Skip to content

Commit

Permalink
fix: wait for block inclusion when submitting tx
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 5, 2023
1 parent 1270a38 commit b77e52a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion proposals/16:upgrade-8/use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions upgrade-test-scripts/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion upgrade-test-scripts/lib/agd-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export const makeAgd = ({ execFileSync }) => {
...keyringArgs,
...[`--from`, from],
'tx',
...txArgs,
...['--broadcast-mode', 'block'],
...txArgs,
...yesArg,
...outJson,
];
Expand Down
2 changes: 1 addition & 1 deletion upgrade-test-scripts/lib/cliHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
2 changes: 1 addition & 1 deletion upgrade-test-scripts/start_ag0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion upgrade-test-scripts/start_to_to.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit b77e52a

Please sign in to comment.