From a11211d813162d40d80d842a03b4b1cb6d6953e9 Mon Sep 17 00:00:00 2001 From: rzadp Date: Mon, 3 Jun 2019 15:47:42 +0200 Subject: [PATCH] Common deploy --- e2e-commons/scripts/deployERC20.js | 42 +++++------------------------- oracle-e2e/constants.json | 4 +-- oracle-e2e/run-tests.sh | 2 +- ui-e2e/run-tests.sh | 2 +- 4 files changed, 10 insertions(+), 40 deletions(-) diff --git a/e2e-commons/scripts/deployERC20.js b/e2e-commons/scripts/deployERC20.js index 82ccfe8e..25eeaae4 100644 --- a/e2e-commons/scripts/deployERC20.js +++ b/e2e-commons/scripts/deployERC20.js @@ -4,8 +4,7 @@ const contractsPath = '../../contracts'; require('dotenv').config({ path: path.join(__dirname, contractsPath, '/deploy/.env') }) -const oracle_e2e_user = '0xbb140FbA6242a1c3887A7823F7750a73101383e3' -const ui_e2e_user = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E' +const user = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E' const { deployContract, @@ -33,48 +32,19 @@ async function deployErc20() { foreignNonce++ console.log('[Foreign] POA20 Test: ', poa20foreign.options.address) - const getMintData = (user) => poa20foreign.methods.mint(user, '1000000000000000000').encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - + const mintData = await poa20foreign.methods + .mint(user, '500000000000000000000') + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) await sendRawTxForeign({ - data: getMintData(oracle_e2e_user), + data: mintData, nonce: foreignNonce, to: poa20foreign.options.address, privateKey: deploymentPrivateKey, url: process.env.FOREIGN_RPC_URL }) - - foreignNonce++ - - const receipt = await sendRawTxForeign({ - data: getMintData(ui_e2e_user), - nonce: foreignNonce, - to: poa20foreign.options.address, - privateKey: deploymentPrivateKey, - url: process.env.FOREIGN_RPC_URL - }) - - - - - - - - - - - - console.log('receipt is') - console.log(receipt) - - // while(true) { - // const tx = await web3Foreign.eth.getTransaction(receipt.transactionHash); - // console.log('tx is: ') - // console.log(tx); - // await new Promise(resolve => setTimeout(resolve, 1000)); - // } - } catch (e) { console.log(e) + throw e; } } diff --git a/oracle-e2e/constants.json b/oracle-e2e/constants.json index f0d9d068..b9a6f46b 100644 --- a/oracle-e2e/constants.json +++ b/oracle-e2e/constants.json @@ -4,8 +4,8 @@ "privateKey": "0xcf954e07e6a439faf392eb474e95ddb444c2ca444847f2ad6ecc79e1a585e2b8" }, "user": { - "address": "0xbb140FbA6242a1c3887A7823F7750a73101383e3", - "privateKey": "0x63e48a8ba0b99e0377c6b483af4a072cbca5ffbcfdac77be72e69f4960125800" + "address": "0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E", + "privateKey": "0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d50330b0df9" }, "validator": { "address": "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b", diff --git a/oracle-e2e/run-tests.sh b/oracle-e2e/run-tests.sh index 1b7ff898..dfd8157e 100755 --- a/oracle-e2e/run-tests.sh +++ b/oracle-e2e/run-tests.sh @@ -1,6 +1,6 @@ cd $(dirname $0) -../e2e-commons/up.sh oracle oracle-deploy +../e2e-commons/up.sh oracle deploy docker-compose -f ../e2e-commons/docker-compose.yml run e2e yarn workspace oracle-e2e run start rc=$? diff --git a/ui-e2e/run-tests.sh b/ui-e2e/run-tests.sh index 67ec32fb..1515fcc7 100755 --- a/ui-e2e/run-tests.sh +++ b/ui-e2e/run-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash cd $(dirname $0) -../e2e-commons/up.sh oracle ui ui-deploy +../e2e-commons/up.sh oracle ui deploy node ./scripts/blocks.js & yarn mocha -b ./test.js