From b77e52a40e1487a736dc17871f0c48a00a5ba8ad Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 30 Nov 2023 15:04:55 -0600 Subject: [PATCH] fix: wait for block inclusion when submitting tx --- proposals/16:upgrade-8/use.sh | 2 +- upgrade-test-scripts/env_setup.sh | 8 ++++---- upgrade-test-scripts/lib/agd-lib.js | 2 +- upgrade-test-scripts/lib/cliHelper.js | 2 +- upgrade-test-scripts/start_ag0.sh | 2 +- upgrade-test-scripts/start_to_to.sh | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/proposals/16:upgrade-8/use.sh b/proposals/16:upgrade-8/use.sh index d555960b..94a0d99d 100644 --- a/proposals/16:upgrade-8/use.sh +++ b/proposals/16:upgrade-8/use.sh @@ -22,7 +22,7 @@ waitForBlock 2 waitForBlock 3 # fund provision pool stakeamount="20000000${USDC_DENOM}" -agd tx bank send "validator" "agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346" "$stakeamount" -y --keyring-backend=test --chain-id="$CHAINID" +agd tx bank send "validator" "agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346" "$stakeamount" -y --keyring-backend=test --chain-id="$CHAINID" -bblock waitForBlock 3 govaccounts=("$GOV1ADDR" "$GOV2ADDR" "$GOV3ADDR") diff --git a/upgrade-test-scripts/env_setup.sh b/upgrade-test-scripts/env_setup.sh index f7c38147..ccb0667a 100755 --- a/upgrade-test-scripts/env_setup.sh +++ b/upgrade-test-scripts/env_setup.sh @@ -80,10 +80,10 @@ provisionSmartWallet() { addr="$1" amount="$2" echo "funding $addr" - agd tx bank send "validator" "$addr" "$amount" -y --keyring-backend=test --chain-id="$CHAINID" + agd tx -bblock bank send "validator" "$addr" "$amount" -y --keyring-backend=test --chain-id="$CHAINID" waitForBlock echo "provisioning $addr" - agd tx swingset provision-one my-wallet "$addr" SMART_WALLET --keyring-backend=test --yes --chain-id="$CHAINID" --from="$addr" + agd tx -bblock swingset provision-one my-wallet "$addr" SMART_WALLET --keyring-backend=test --yes --chain-id="$CHAINID" --from="$addr" echo "Waiting for wallet $addr to reach vstorage" waitForBlock 5 echo "Reading $addr from vstorage" @@ -164,9 +164,9 @@ voteLatestProposalAndWait() { waitForBlock proposal=$($binary q gov proposals -o json | jq -r '.proposals[-1].proposal_id') waitForBlock - $binary tx gov deposit $proposal 50000000ubld --from=validator --chain-id="$CHAINID" --yes --keyring-backend test + $binary tx -bblock gov deposit $proposal 50000000ubld --from=validator --chain-id="$CHAINID" --yes --keyring-backend test waitForBlock - $binary tx gov vote $proposal yes --from=validator --chain-id="$CHAINID" --yes --keyring-backend test + $binary tx -bblock gov vote $proposal yes --from=validator --chain-id="$CHAINID" --yes --keyring-backend test waitForBlock while true; do diff --git a/upgrade-test-scripts/lib/agd-lib.js b/upgrade-test-scripts/lib/agd-lib.js index 8d2220e4..007efa4e 100644 --- a/upgrade-test-scripts/lib/agd-lib.js +++ b/upgrade-test-scripts/lib/agd-lib.js @@ -85,8 +85,8 @@ export const makeAgd = ({ execFileSync }) => { ...keyringArgs, ...[`--from`, from], 'tx', - ...txArgs, ...['--broadcast-mode', 'block'], + ...txArgs, ...yesArg, ...outJson, ]; diff --git a/upgrade-test-scripts/lib/cliHelper.js b/upgrade-test-scripts/lib/cliHelper.js index cb3c3adf..66fa6dd1 100644 --- a/upgrade-test-scripts/lib/cliHelper.js +++ b/upgrade-test-scripts/lib/cliHelper.js @@ -17,7 +17,7 @@ export const agd = { return JSON.parse(data); }, tx: async (...params) => { - const newParams = ['tx', ...params, '-o json']; + const newParams = ['tx', '-bblock', ...params, '-o json']; const data = await executeCommand(BINARY, newParams, { shell: true }); return JSON.parse(data); }, diff --git a/upgrade-test-scripts/start_ag0.sh b/upgrade-test-scripts/start_ag0.sh index 169d032e..c321d43a 100755 --- a/upgrade-test-scripts/start_ag0.sh +++ b/upgrade-test-scripts/start_ag0.sh @@ -71,7 +71,7 @@ else echo "Upgrade info is not valid JSON: $info" exit $status fi -agd tx gov submit-proposal software-upgrade "$UPGRADE_TO" \ +agd tx -bblock gov submit-proposal software-upgrade "$UPGRADE_TO" \ --upgrade-height="$height" --upgrade-info="$info" \ --title="Upgrade to ${UPGRADE_TO}" --description="upgrades" \ --from=validator --chain-id="$CHAINID" \ diff --git a/upgrade-test-scripts/start_to_to.sh b/upgrade-test-scripts/start_to_to.sh index 9fc8b580..b6afe2a9 100755 --- a/upgrade-test-scripts/start_to_to.sh +++ b/upgrade-test-scripts/start_to_to.sh @@ -25,7 +25,7 @@ else echo "Upgrade info is not valid JSON: $info" exit $status fi -agd tx gov submit-proposal software-upgrade "$UPGRADE_TO" \ +agd tx -bblock gov submit-proposal software-upgrade "$UPGRADE_TO" \ --upgrade-height="$height" --upgrade-info="$info" \ --title="Upgrade to ${UPGRADE_TO}" --description="upgrades" \ --from=validator --chain-id="$CHAINID" \