tokenbridge/e2e-commons/scripts/blocks.js
Przemyslaw Rzad 2be0e9f363
Fix flaky UI-E2E (#178)
* Change user

* jobs

* Revert "Change user"

5fa7084f06e743f2981035d254a5ca287c41b02b

* Trying to use block generator address

* jobs

* Fixed

* 5 jobs

* 10 jobs

* all jobs

* finish

* Removed jobs

* Add funds for block generator in block genesis
2019-08-05 14:13:16 +02:00

27 lines
834 B
JavaScript

const Web3 = require('web3')
const { generateNewBlock } = require('../utils')
const homeWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8541'))
const foreignWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8542'))
const {user, blockGenerator} = require('../constants.json');
homeWeb3.eth.accounts.wallet.add(user.privateKey)
foreignWeb3.eth.accounts.wallet.add(user.privateKey)
homeWeb3.eth.accounts.wallet.add(blockGenerator.privateKey)
foreignWeb3.eth.accounts.wallet.add(blockGenerator.privateKey)
function main() {
setTimeout(async () => {
generateNewBlock(homeWeb3, blockGenerator.address)
generateNewBlock(foreignWeb3, blockGenerator.address)
main()
}, 1000)
}
main()
process.on('SIGTERM', function () {
console.log('Finishing sending blocks...')
process.exit(0);
});