Merge pull request #1714 from CosmWasm/local_scripts
Fix local test scripts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user