diff --git a/e2e_test/js-tests/send_tx.mjs b/e2e_test/js-tests/send_tx.mjs index 73a3b537d9..50e4741843 100755 --- a/e2e_test/js-tests/send_tx.mjs +++ b/e2e_test/js-tests/send_tx.mjs @@ -72,7 +72,7 @@ async function replaceTx(tx) { }); const receipt = await publicClient.waitForTransactionReceipt({ hash: hash, - confirmations: 2, + confirmations: 1, }); return receipt; } @@ -89,6 +89,7 @@ async function main() { }); var hash; + try { hash = await walletClient.sendRawTransaction({ serializedTransaction: await walletClient.signTransaction(request), @@ -105,8 +106,11 @@ async function main() { } var success = true; + // wait 1 second to give the node time to potentially process the tx + // in instamine mode. If the tx is invalidated, the block will not progress + await sleep(1000); // give the node some time to process the transaction - await waitBlocks(5); + // await waitBlocks(1); var receipt = await getTransactionReceipt(hash); if (!receipt) { receipt = await replaceTx(request); diff --git a/e2e_test/run_all_tests.sh b/e2e_test/run_all_tests.sh index 6d4529c445..1573bc8f01 100755 --- a/e2e_test/run_all_tests.sh +++ b/e2e_test/run_all_tests.sh @@ -10,7 +10,7 @@ TEST_GLOB=$1 cd "$SCRIPT_DIR/.." || exit 1 make geth trap 'kill %%' EXIT # kill bg job at exit -build/bin/geth --dev --dev.period 1 --http --http.api eth,web3,net &>"$SCRIPT_DIR/geth.log" & +build/bin/geth --dev --http --http.api eth,web3,net &>"$SCRIPT_DIR/geth.log" & # Wait for geth to be ready for _ in {1..10}; do @@ -27,7 +27,8 @@ cd "$SCRIPT_DIR" || exit 1 # There's a problem with geth return errors on the first transaction sent. # See https://github.com/ethereum/web3.py/issues/3212 # To work around this, send a transaction before running tests -cast send --json --private-key $ACC_PRIVKEY $TOKEN_ADDR 'transfer(address to, uint256 value) returns (bool)' 0x000000000000000000000000000000000000dEaD 100 +cast send --async --json --private-key "$ACC_PRIVKEY" "$TOKEN_ADDR" 'transfer(address to, uint256 value) returns (bool)' 0x000000000000000000000000000000000000dEaD 100 +sleep 5 failures=0 tests=0