From c5f58813fbc5ea849669e3ac00a654d6b9baa3d0 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Mon, 13 Nov 2023 17:00:13 +0100 Subject: [PATCH] Fix local test scripts --- contrib/local/01-accounts.sh | 2 +- contrib/local/02-contracts.sh | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/local/01-accounts.sh b/contrib/local/01-accounts.sh index 4aecc65b73..59478dc1ad 100755 --- a/contrib/local/01-accounts.sh +++ b/contrib/local/01-accounts.sh @@ -2,7 +2,7 @@ set -o errexit -o nounset -o pipefail BASE_ACCOUNT=$(wasmd keys show validator -a --keyring-backend=test) -wasmd q account "$BASE_ACCOUNT" -o json | jq +wasmd q auth account "$BASE_ACCOUNT" -o json | jq echo "## Add new account" wasmd keys add fred --keyring-backend=test diff --git a/contrib/local/02-contracts.sh b/contrib/local/02-contracts.sh index d3ea4bff2c..5e886fc29c 100755 --- a/contrib/local/02-contracts.sh +++ b/contrib/local/02-contracts.sh @@ -9,15 +9,15 @@ RESP=$(wasmd tx wasm store "$DIR/../../x/wasm/keeper/testdata/hackatom.wasm" \ --from validator --gas 1500000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json --keyring-backend=test) sleep 6 RESP=$(wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json) -CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[]| select(.type=="store_code").attributes[]| select(.key=="code_id").value') -CODE_HASH=$(echo "$RESP" | jq -r '.logs[0].events[]| select(.type=="store_code").attributes[]| select(.key=="code_checksum").value') +CODE_ID=$(echo "$RESP" | jq -r '.events[]| select(.type=="store_code").attributes[]| select(.key=="code_id").value') +CODE_HASH=$(echo "$RESP" | jq -r '.events[]| select(.type=="store_code").attributes[]| select(.key=="code_checksum").value') echo "* Code id: $CODE_ID" echo "* Code checksum: $CODE_HASH" echo "* Download code" -TMPDIR=$(mktemp -t wasmdXXXXXX) -wasmd q wasm code "$CODE_ID" "$TMPDIR" -rm -f "$TMPDIR" +TMPDIR=$(mktemp -d -t wasmdXXXXXX) +wasmd q wasm code "$CODE_ID" "$TMPDIR/delme.wasm" +rm -f "$TMPDIR/delme.wasm" echo "-----------------------" echo "## List code" wasmd query wasm list-code --node=http://localhost:26657 -o json | jq @@ -81,10 +81,11 @@ echo "-----------------------" echo "## Migrate contract" echo "### Upload new code" RESP=$(wasmd tx wasm store "$DIR/../../x/wasm/keeper/testdata/burner.wasm" \ - --from validator --gas 1000000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json --keyring-backend=test) + --from validator --gas 1100000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json --keyring-backend=test) sleep 6 RESP=$(wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json) -BURNER_CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[]| select(.type=="store_code").attributes[]| select(.key=="code_id").value') +BURNER_CODE_ID=$(echo "$RESP" | jq -r '.events[]| select(.type=="store_code").attributes[]| select(.key=="code_id").value') + echo "### Migrate to code id: $BURNER_CODE_ID" DEST_ACCOUNT=$(wasmd keys show fred -a --keyring-backend=test)