From af9e09d0724ad5e5edb51d79da7fe4414d7f9aea Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Wed, 17 Apr 2024 16:27:33 -0500 Subject: [PATCH] test: make an offer with a bad invitation before upgrade Note: 1IST is too much; gov1 doesn't have that much --- .../proposals/a:upgrade-15/prepare.sh | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/a3p-integration/proposals/a:upgrade-15/prepare.sh b/a3p-integration/proposals/a:upgrade-15/prepare.sh index 9c72d81215c..febb39d835f 100755 --- a/a3p-integration/proposals/a:upgrade-15/prepare.sh +++ b/a3p-integration/proposals/a:upgrade-15/prepare.sh @@ -1,9 +1,29 @@ #!/bin/bash # Exit when any command fails -set -e +set -uxeo pipefail # Place here any actions that should happen before the upgrade is proposed. The # actions are executed in the previous chain software, and the effects are # persisted so they can be used in the steps after the upgrade is complete, # such as in the "use" or "test" steps, or further proposal layers. + +printISTBalance() { + addr=$(agd keys show -a "$1" --keyring-backend=test) + agd query bank balances "$addr" -o json \ + | jq -c '.balances[] | select(.denom=="uist")' + +} + +echo TEST: Offer with bad invitation +printISTBalance gov1 + +badInvitationOffer=$(mktemp) +cat > "$badInvitationOffer" << 'EOF' +{"body":"#{\"method\":\"executeOffer\",\"offer\":{\"id\":\"bad-invitation-15\",\"invitationSpec\":{\"callPipe\":[[\"badMethodName\"]],\"instancePath\":[\"reserve\"],\"source\":\"agoricContract\"},\"proposal\":{\"give\":{\"Collateral\":{\"brand\":\"$0.Alleged: IST brand\",\"value\":\"+15000\"}}}}}","slots":["board0257"]} +EOF + +PATH=/usr/src/agoric-sdk/node_modules/.bin:$PATH +agops perf satisfaction --keyring-backend=test send --executeOffer "$badInvitationOffer" --from gov1 || true + +printISTBalance gov1