Moved constant user from oracle-e2e to e2e-common

This commit is contained in:
rzadp 2019-06-04 10:51:34 +02:00
parent 7e937bdefa
commit 13d49de5c6
8 changed files with 24 additions and 15 deletions

@ -9,6 +9,11 @@ Common scripts and configuration for the end-to-end tests.
``` ```
Spins up parity networks, redis, rabbit, e2e container needed for end-to-end tests. Spins up parity networks, redis, rabbit, e2e container needed for end-to-end tests.
```
./down.sh
```
Shuts down and cleans up containers, networks, services, running scripts.
### Components ### Components
| Component | Description | | Component | Description |

@ -0,0 +1,6 @@
{
"user": {
"address": "0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E",
"privateKey": "0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d50330b0df9"
}
}

@ -3,15 +3,14 @@ const { generateNewBlock } = require('../utils')
const homeWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8541')) const homeWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8541'))
const foreignWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8542')) const foreignWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8542'))
const account = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E' const {user} = require('../constants.json');
const privateKey = '0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d50330b0df9' homeWeb3.eth.accounts.wallet.add(user.privateKey)
homeWeb3.eth.accounts.wallet.add(privateKey) foreignWeb3.eth.accounts.wallet.add(user.privateKey)
foreignWeb3.eth.accounts.wallet.add(privateKey)
function main() { function main() {
setTimeout(async () => { setTimeout(async () => {
generateNewBlock(homeWeb3, account) generateNewBlock(homeWeb3, user.account)
generateNewBlock(foreignWeb3, account) generateNewBlock(foreignWeb3, user.account)
main() main()
}, 5000) }, 5000)
} }

@ -1,10 +1,10 @@
/* eslint import/no-unresolved: 0 node/no-missing-require: 0 */ /* eslint import/no-unresolved: 0 node/no-missing-require: 0 */
const path = require('path') const path = require('path')
const {user} = require('../constants.json')
const contractsPath = '../../contracts'; const contractsPath = '../../contracts';
require('dotenv').config({ require('dotenv').config({
path: path.join(__dirname, contractsPath, '/deploy/.env') path: path.join(__dirname, contractsPath, '/deploy/.env')
}) })
const user = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E'
const { const {
deployContract, deployContract,
@ -33,7 +33,7 @@ async function deployErc20() {
console.log('[Foreign] POA20 Test: ', poa20foreign.options.address) console.log('[Foreign] POA20 Test: ', poa20foreign.options.address)
const mintData = await poa20foreign.methods const mintData = await poa20foreign.methods
.mint(user, '500000000000000000000') .mint(user.address, '500000000000000000000')
.encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS })
await sendRawTxForeign({ await sendRawTxForeign({
data: mintData, data: mintData,

@ -3,10 +3,6 @@
"address": "0xcca2fb44C8C36E51f743269d6F484Fd027B9F9Aa", "address": "0xcca2fb44C8C36E51f743269d6F484Fd027B9F9Aa",
"privateKey": "0xcf954e07e6a439faf392eb474e95ddb444c2ca444847f2ad6ecc79e1a585e2b8" "privateKey": "0xcf954e07e6a439faf392eb474e95ddb444c2ca444847f2ad6ecc79e1a585e2b8"
}, },
"user": {
"address": "0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E",
"privateKey": "0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d50330b0df9"
},
"validator": { "validator": {
"address": "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b", "address": "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b",
"privateKey": "0x8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9" "privateKey": "0x8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"

@ -2,7 +2,8 @@ const path = require('path')
const Web3 = require('web3') const Web3 = require('web3')
const assert = require('assert') const assert = require('assert')
const promiseRetry = require('promise-retry') const promiseRetry = require('promise-retry')
const { user, contractsPath } = require('../constants.json') const { user } = require('../../e2e-commons/constants.json')
const { contractsPath } = require('../constants.json')
const { generateNewBlock } = require('../../e2e-commons/utils') const { generateNewBlock } = require('../../e2e-commons/utils')
const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts') const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts')

@ -2,7 +2,8 @@ const path = require('path')
const Web3 = require('web3') const Web3 = require('web3')
const assert = require('assert') const assert = require('assert')
const promiseRetry = require('promise-retry') const promiseRetry = require('promise-retry')
const { user, contractsPath } = require('../constants.json') const { user } = require('../../e2e-commons/constants.json')
const { contractsPath } = require('../constants.json')
const { generateNewBlock } = require('../../e2e-commons/utils') const { generateNewBlock } = require('../../e2e-commons/utils')
const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts') const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts')

@ -2,7 +2,8 @@ const path = require('path')
const Web3 = require('web3') const Web3 = require('web3')
const assert = require('assert') const assert = require('assert')
const promiseRetry = require('promise-retry') const promiseRetry = require('promise-retry')
const { user, validator, temp, contractsPath } = require('../constants.json') const { user } = require('../../e2e-commons/constants.json')
const { validator, temp, contractsPath } = require('../constants.json')
const { generateNewBlock } = require('../../e2e-commons/utils') const { generateNewBlock } = require('../../e2e-commons/utils')
const abisDir = path.join(__dirname, '..', contractsPath, '/build/contracts') const abisDir = path.join(__dirname, '..', contractsPath, '/build/contracts')