Skip to content

Commit

Permalink
test: assert creator migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Mar 6, 2024
1 parent 71ef264 commit 10c51a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/test-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@ sleep 1

# run new node
echo -e "\n\n=> =>continue running nodes after upgrade"

# run new node
if [[ "$OSTYPE" == "darwin"* ]]; then
CONTINUE="true" screen -L -dmS picad bash scripts/localnode.sh _build/new/picad $DENOM
CONTINUE="true" screen -L -dmS picad bash scripts/localnode.sh _build/new/picad $DENOM
else
CONTINUE="true" screen -L -dmS picad bash scripts/localnode.sh _build/new/picad $DENOM
CONTINUE="true" screen -L -dmS picad bash scripts/localnode.sh _build/new/picad $DENOM
fi



sleep 5
# execute additional after scripts
if [ ! -z "$ADDITIONAL_AFTER_SCRIPTS" ]; then
# slice ADDITIONAL_SCRIPTS by ,
Expand Down
10 changes: 10 additions & 0 deletions scripts/upgrade/v_6_4_6/post-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ COUNTER_CONTRACT_DIR=$(pwd)/scripts/upgrade/contracts/counter.wasm
## Get contract by $CODE_ID
echo -e "\n Fetching the new contract address (it got changed after the upgrade)"
CODE_ID=1 ## TODO: hardfix for now to get the contract, and overide the contract address

## Fetch code info
CREATOR=$($BINARY query wasm code-info $CODE_ID -o json | jq -r '.creator')
if [ "$CREATOR" == "$WALLET_1" ]; then
echo "Assertion passed: Code creator ($CREATOR) is equal to Wallet 1 ($WALLET_1)"
else
echo "Assertion failed: Code creator ($CREATOR) is not equal to Wallet 1 ($WALLET_1)"
exit 1
fi

CONTRACT_ADDRESS=$($BINARY query wasm list-contract-by-code $CODE_ID -o json | jq -r '.contracts[0]')
echo "Query contract address: $CONTRACT_ADDRESS"

Expand Down

0 comments on commit 10c51a4

Please sign in to comment.