From 10c51a4e4174010717869e9393d7bc33b2281e75 Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Wed, 6 Mar 2024 10:30:38 +0700 Subject: [PATCH] test: assert creator migrated --- scripts/test-upgrade.sh | 9 +++++---- scripts/upgrade/v_6_4_6/post-script.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/test-upgrade.sh b/scripts/test-upgrade.sh index 33eaa0456..52eda51b1 100755 --- a/scripts/test-upgrade.sh +++ b/scripts/test-upgrade.sh @@ -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 , diff --git a/scripts/upgrade/v_6_4_6/post-script.sh b/scripts/upgrade/v_6_4_6/post-script.sh index 8d5294532..8e34033b2 100644 --- a/scripts/upgrade/v_6_4_6/post-script.sh +++ b/scripts/upgrade/v_6_4_6/post-script.sh @@ -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"