Skip to content

Commit

Permalink
refactor github test action scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kwtalley committed Jun 27, 2024
1 parent 283c844 commit 4157db7
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 115 deletions.
27 changes: 9 additions & 18 deletions scripts/gh-action-test/attrs_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm store $WASM \
--instantiate-anyof-addresses "$node0" \
Expand All @@ -29,9 +28,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm instantiate 1 '{"name": "attrs-itv2.sc.pb"}' \
--admin="$node0" \
Expand All @@ -42,9 +40,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# Query for the contract address so we can execute it
export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 -t -o json | jq -r ".contracts[0]")
Expand All @@ -58,9 +55,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 -t -o json | jq
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" query wasm contract-state smart \
"$contract" '{"get_label_name":{}}' -t -o json
Expand All @@ -74,9 +70,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 -t -o json | jq
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# delay to ensure correct order for text1 and text2 below

Expand All @@ -89,9 +84,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 -t -o json | jq
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export text1=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels[0].text")
export text2=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels[1].text")
Expand Down Expand Up @@ -121,9 +115,8 @@ fi
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export text1=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels[0].text")
export text2=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels[1].text")
Expand Down Expand Up @@ -153,9 +146,8 @@ fi
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export label_count=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels | length")
export text1=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels[0].text")
Expand All @@ -179,9 +171,8 @@ fi
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export label_count=$("$PROV_CMD" query wasm contract-state smart "$contract" '{"get_labels":{}}' --testnet --output json | jq -r ".data.labels | length")

Expand Down
36 changes: 12 additions & 24 deletions scripts/gh-action-test/marker_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm store $WASM \
--instantiate-anyof-addresses "$node0" \
Expand All @@ -29,9 +28,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm instantiate 1 '{"name":"marker-itv2.sc.pb"}' \
--admin "$node0" \
Expand All @@ -42,9 +40,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# Query for the contract address so we can execute it
export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --output json | jq -r ".contracts[0]")
Expand All @@ -58,9 +55,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -71,9 +67,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" q marker list --testnet
#"$PROV_CMD" q wasm contract-state smart "$contract" '{"get_by_denom":{"denom":"faustiancoin"}}' --testnet -o json
Expand All @@ -87,9 +82,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -100,9 +94,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -113,9 +106,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -126,9 +118,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -139,9 +130,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# verify that the amount was withdrawn into the node0 address
export faustiancoin=$("$PROV_CMD" q bank balances "$node0" --testnet --output json | jq -r ".balances[0].amount")
Expand All @@ -160,9 +150,8 @@ fi
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm execute \
"$contract" \
Expand All @@ -173,9 +162,8 @@ fi
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" q wasm contract-state smart "$contract" '{"get_by_denom":{"denom":"faustiancoin"}}' --testnet -o json

Expand Down
15 changes: 5 additions & 10 deletions scripts/gh-action-test/msgfees_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ echo "Sending coins to different keys"
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode=block \
--yes \
--testnet \
--output json
--output json | "$PROV_CMD" q wait-tx

echo "Binding name"
# Setup name and new COIN for the smart contract
Expand All @@ -44,10 +43,9 @@ echo "Binding name"
--chain-id="testing" \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet \
--output json
--output json | "$PROV_CMD" q wait-tx

echo "Storing wasm"
# Run the contract
Expand All @@ -59,9 +57,8 @@ echo "Storing wasm"
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode=block \
--yes \
-t
-t | "$PROV_CMD" q wait-tx

echo "Instantiating contract"
"$PROV_CMD" tx wasm instantiate 1 '{"fee_amount":{"amount":"10000","denom":"nhash"},"fee_recipient":"'"$feebucket"'"}' \
Expand All @@ -73,9 +70,8 @@ echo "Instantiating contract"
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# Query for the contract address so we can execute it
export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 -t -o json | jq -r ".contracts[0]")
Expand All @@ -91,10 +87,9 @@ echo "Executing contract"
--gas auto \
--gas-prices="1906nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet \
--output json
--output json | "$PROV_CMD" q wait-tx

# Verify that the funds were sent to the correct accounts for the receiver and the feebucket
export receiver_query=$("$PROV_CMD" query bank balances "$receiver" --testnet --output json )
Expand Down
15 changes: 5 additions & 10 deletions scripts/gh-action-test/name_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm store $WASM \
--instantiate-anyof-addresses "$node0" \
Expand All @@ -31,9 +30,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

"$PROV_CMD" tx wasm instantiate 1 '{"name": "name-itv2.sc.pb"}' \
--admin "$node0" \
Expand All @@ -44,9 +42,8 @@ export node0=$("$PROV_CMD" keys show -a validator --keyring-backend test --testn
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

# Query for the contract address so we can execute it
export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --output json | jq -r ".contracts[0]")
Expand All @@ -60,9 +57,8 @@ export contract=$("$PROV_CMD" query wasm list-contract-by-code 1 --testnet --out
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export address=$("$PROV_CMD" query name resolve "nm.name-itv2.sc.pb" --testnet --output json | jq -r ".address")

Expand Down Expand Up @@ -96,9 +92,8 @@ echo "$lookup"
--gas=auto \
--gas-prices="1905nhash" \
--gas-adjustment=1.5 \
--broadcast-mode block \
--yes \
--testnet
--testnet | "$PROV_CMD" q wait-tx

export query=$("$PROV_CMD" query name resolve "nm.name-itv2.sc.pb" --testnet --output json --log_level="panic" --log_format="json" )

Expand Down
Loading

0 comments on commit 4157db7

Please sign in to comment.