mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
chg: POS-2399: implement fundGanacheAccount (#1177)
This commit is contained in:
parent
1ae226bf29
commit
3e999abb67
2 changed files with 21 additions and 0 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -248,6 +248,8 @@ jobs:
|
||||||
|
|
||||||
- name: Run smoke tests
|
- name: Run smoke tests
|
||||||
run: |
|
run: |
|
||||||
|
echo "Funding ganache accounts..."
|
||||||
|
timeout 10m bash bor/integration-tests/fund_ganache_accounts.sh
|
||||||
echo "Deposit 100 matic for each account to bor network"
|
echo "Deposit 100 matic for each account to bor network"
|
||||||
cd matic-cli/devnet/code/contracts
|
cd matic-cli/devnet/code/contracts
|
||||||
npm run truffle exec scripts/deposit.js -- --network development $(jq -r .root.tokens.MaticToken contractAddresses.json) 100000000000000000000
|
npm run truffle exec scripts/deposit.js -- --network development $(jq -r .root.tokens.MaticToken contractAddresses.json) 100000000000000000000
|
||||||
|
|
|
||||||
19
integration-tests/fund_ganache_accounts.sh
Normal file
19
integration-tests/fund_ganache_accounts.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
host='localhost'
|
||||||
|
|
||||||
|
echo "Transferring 1 ETH from ganache account[0] to all others..."
|
||||||
|
|
||||||
|
signersFile="matic-cli/devnet/devnet/signer-dump.json"
|
||||||
|
signersDump=$(jq . $signersFile)
|
||||||
|
signersLength=$(jq '. | length' $signersFile)
|
||||||
|
|
||||||
|
rootChainWeb3="http://${host}:9545"
|
||||||
|
|
||||||
|
for ((i = 1; i < signersLength; i++)); do
|
||||||
|
to_address=$(echo "$signersDump" | jq -r ".[$i].address")
|
||||||
|
from_address=$(echo "$signersDump" | jq -r ".[0].address")
|
||||||
|
txReceipt=$(curl $rootChainWeb3 -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"to":"'"$to_address"'","from":"'"$from_address"'","value":"0xDE0B6B3A7640000"}],"id":1}' -H "Content-Type: application/json")
|
||||||
|
txHash=$(echo "$txReceipt" | jq -r '.result')
|
||||||
|
echo "Funds transferred from $from_address to $to_address with txHash: $txHash"
|
||||||
|
done
|
||||||
Loading…
Reference in a new issue