-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aaronmgdr/invite-page' of github.com:celo-org/celo-mono…
…repo into aaronmgdr/invite-page * 'aaronmgdr/invite-page' of github.com:celo-org/celo-monorepo: (63 commits) Fix compile error during local clean build (#1506) Update to RN 61 and AndroidX (#1343) Set usage of shuffled round robin in the genesis block (#1464) Add spanish backup key for backup key flow (#1500) Fix sync tests by pulling genesis block to determine epoch length (#1504) [Wallet] fix missing full name error alert (#1496) [Wallet + Verification Pool] Add details about generating an app-signature (#1482) Deploy celo's image of ethstats (#1421) Storing previous randomness values (#1197) [Wallet] Fix wei invite bug (#1489) Point all packages to latest ganache-cli master (#1488) Point end-to-end tests back to master (#1469) [Wallet] Migrate app view functions to contractkit (#1381) [Wallet] Add script to translate locale strings (#1485) [Wallet] Update wallet celo client version and add missing translations for backup flow (#1483) [Wallet] Hotfix local currency (#1481) [Wallet] Remove QR debouncing to improve responsiveness (#1480) [Wallet] Upgrade app version to v1.5.1 (#1463) Update governance end-to-end tests to work with changed precompile (#1476) Fixes key_placer.sh when encrypting files (#1465) ...
- Loading branch information
Showing
497 changed files
with
23,019 additions
and
17,956 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# This test starts a standalone Geth node and runs transactions on it. | ||
|
||
# For testing a particular branch of Geth repo (usually, on Circle CI) | ||
# Usage: ci_test_attestations.sh checkout <branch_of_geth_repo_to_test> | ||
# For testing the local Geth dir (usually, for manual testing) | ||
# Usage: ci_test_attestations.sh local <location_of_local_geth_dir> | ||
|
||
if [ "${1}" == "checkout" ]; then | ||
# Test master by default. | ||
BRANCH_TO_TEST=${2:-"master"} | ||
echo "Checking out geth at branch ${BRANCH_TO_TEST}..." | ||
../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/attestations_tests.ts --branch ${BRANCH_TO_TEST} | ||
elif [ "${1}" == "local" ]; then | ||
export GETH_DIR="${2}" | ||
echo "Testing using local geth dir ${GETH_DIR}..." | ||
../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/attestations_tests.ts --localgeth ${GETH_DIR} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { ContractKit, newKit } from '@celo/contractkit' | ||
import { AttestationsWrapper } from '@celo/contractkit/lib/wrappers/Attestations' | ||
import { assert } from 'chai' | ||
import { getContext, GethTestConfig, sleep } from './utils' | ||
|
||
const validatorAddress = '0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95' | ||
const phoneNumber = '+15555555555' | ||
|
||
describe('governance tests', () => { | ||
const gethConfig: GethTestConfig = { | ||
migrate: true, | ||
instances: [ | ||
{ name: 'validator0', validating: true, syncmode: 'full', port: 30303, rpcport: 8545 }, | ||
{ name: 'validator1', validating: true, syncmode: 'full', port: 30305, rpcport: 8547 }, | ||
{ name: 'validator2', validating: true, syncmode: 'full', port: 30307, rpcport: 8549 }, | ||
{ name: 'validator3', validating: true, syncmode: 'full', port: 30309, rpcport: 8551 }, | ||
{ name: 'validator4', validating: true, syncmode: 'full', port: 30311, rpcport: 8553 }, | ||
], | ||
} | ||
|
||
const context: any = getContext(gethConfig) | ||
let contractKit: ContractKit | ||
let Attestations: AttestationsWrapper | ||
|
||
before(async function(this: any) { | ||
this.timeout(0) | ||
await context.hooks.before() | ||
}) | ||
|
||
after(context.hooks.after) | ||
|
||
const restart = async () => { | ||
await context.hooks.restart() | ||
contractKit = newKit('http://localhost:8545') | ||
contractKit.defaultAccount = validatorAddress | ||
|
||
// TODO(mcortesi): magic sleep. without it unlockAccount sometimes fails | ||
await sleep(2) | ||
// Assuming empty password | ||
await contractKit.web3.eth.personal.unlockAccount(validatorAddress, '', 1000000) | ||
Attestations = await contractKit.contracts.getAttestations() | ||
} | ||
|
||
describe('Attestations', () => { | ||
before(async function() { | ||
this.timeout(0) | ||
await restart() | ||
}) | ||
|
||
it('requests an attestation', async function(this: any) { | ||
this.timeout(10000) | ||
const approve = await Attestations.approveAttestationFee(2) | ||
await approve.sendAndWaitForReceipt() | ||
const request = await Attestations.request(phoneNumber, 2) | ||
await request.sendAndWaitForReceipt() | ||
|
||
const stats = await Attestations.getAttestationStat(phoneNumber, validatorAddress) | ||
assert.equal(stats.total, 2) | ||
const actionable = await Attestations.getActionableAttestations(phoneNumber, validatorAddress) | ||
assert.lengthOf(actionable, 2) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.