Skip to content

Commit

Permalink
test: make an offer with a bad invitation before upgrade
Browse files Browse the repository at this point in the history
Note: 1IST is too much; gov1 doesn't have that much
  • Loading branch information
dckc authored and gibson042 committed Apr 19, 2024
1 parent ba3e3c4 commit af9e09d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion a3p-integration/proposals/a:upgrade-15/prepare.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit af9e09d

Please sign in to comment.