-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: make an offer with a bad invitation before upgrade
Note: 1IST is too much; gov1 doesn't have that much
- Loading branch information
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |