Common mine blocks
This commit is contained in:
parent
a11211d813
commit
8480b4d499
33
e2e-commons/scripts/blocks.js
Normal file
33
e2e-commons/scripts/blocks.js
Normal file
@ -0,0 +1,33 @@
|
||||
const Web3 = require('web3')
|
||||
|
||||
const homeWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8541'))
|
||||
const foreignWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8542'))
|
||||
const account = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E'
|
||||
const privateKey = '0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d50330b0df9'
|
||||
homeWeb3.eth.accounts.wallet.add(privateKey)
|
||||
foreignWeb3.eth.accounts.wallet.add(privateKey)
|
||||
|
||||
function generateNewBlock(web3, address) {
|
||||
return web3.eth.sendTransaction({
|
||||
from: address,
|
||||
to: '0x0000000000000000000000000000000000000000',
|
||||
gasPrice: '1',
|
||||
gas: '21000',
|
||||
value: '1'
|
||||
})
|
||||
}
|
||||
|
||||
function main() {
|
||||
setTimeout(async () => {
|
||||
generateNewBlock(homeWeb3, account)
|
||||
generateNewBlock(foreignWeb3, account)
|
||||
main()
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
process.on('SIGTERM', function () {
|
||||
console.log('Finishing sending blocks...')
|
||||
process.exit(0);
|
||||
});
|
@ -30,17 +30,13 @@ while [ "$1" != "" ]; do
|
||||
docker-compose run -d -p 3002:3000 ui-erc20-native yarn workspace ui run start
|
||||
fi
|
||||
|
||||
if [ "$1" == "oracle-deploy" ]; then
|
||||
docker-compose run e2e yarn workspace oracle-e2e run deploy
|
||||
fi
|
||||
|
||||
if [ "$1" == "ui-deploy" ]; then
|
||||
docker-compose run e2e yarn workspace ui-e2e run deploy
|
||||
fi
|
||||
|
||||
if [ "$1" == "deploy" ]; then
|
||||
docker-compose run e2e e2e-commons/scripts/deploy.sh
|
||||
fi
|
||||
|
||||
if [ "$1" == "blocks" ]; then
|
||||
node ./scripts/blocks.js &
|
||||
fi
|
||||
|
||||
shift # Shift all the parameters down by one
|
||||
done
|
||||
|
@ -1,9 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
cd $(dirname $0)
|
||||
|
||||
../e2e-commons/up.sh oracle ui deploy
|
||||
../e2e-commons/up.sh oracle ui deploy blocks
|
||||
|
||||
node ./scripts/blocks.js &
|
||||
yarn mocha -b ./test.js
|
||||
rc=$?
|
||||
if [ $CI ]; then exit $rc; fi
|
||||
|
Loading…
Reference in New Issue
Block a user