This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disable force transfer & add cw bindings tests
- Loading branch information
1 parent
074638d
commit 4342df9
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
CHAIN_ID=${CHAIN_ID:-testing} | ||
USER=${USER:-tupt} | ||
NODE_HOME=${NODE_HOME:-"$PWD/.oraid"} | ||
WASM_PATH=${WASM_PATH:-"$PWD/scripts/wasm_file/tokenfactory.wasm"} | ||
ARGS="--from $USER --chain-id testing -y --keyring-backend test --fees 200orai --gas auto --gas-adjustment 1.5 -b block --home $NODE_HOME" | ||
user_address=$(oraid keys show $USER --keyring-backend test --home $NODE_HOME -a) | ||
|
||
# deploy cw-bindings contract | ||
store_ret=$(oraid tx wasm store $WASM_PATH $ARGS --output json) | ||
code_id=$(echo $store_ret | jq -r '.logs[0].events[1].attributes[] | select(.key | contains("code_id")).value') | ||
oraid tx wasm instantiate $code_id '{}' --label 'tokenfactory cw bindings testing' --admin $user_address $ARGS | ||
contract_address=$(oraid query wasm list-contract-by-code $code_id --output json | jq -r '.contracts[0]') | ||
echo $contract_address | ||
|
||
subdenom="usdc" | ||
CREATE_DENOM_MSG='{"create_denom":{"subdenom":"'"$subdenom"'"}}' | ||
QUERY_DENOM_MSG='{"get_denom":{"creator_address":"'"$user_address"'","subdenom":"'"$subdenom"'"}}' | ||
|
||
echo "create denom msg: $CREATE_DENOM_MSG" | ||
echo "query denom msg: $QUERY_DENOM_MSG" | ||
|
||
# send to the contract some funds to create denom | ||
oraid tx send $user_address $contract_address 100000000orai $ARGS | ||
|
||
# create denom | ||
oraid tx wasm execute $contract_address $CREATE_DENOM_MSG $ARGS --output json | jq '.gas_used | tonumber' | ||
|
||
# query created denom | ||
created_denom=$(oraid query wasm contract-state smart $contract_address $QUERY_DENOM_MSG --output json | jq '.data.denom' | tr -d '"') | ||
|
||
if ! [[ $created_denom =~ "factory/$user_address/$subdenom" ]] ; then | ||
echo "The created denom does not match with our expected denom"; exit 1 | ||
fi | ||
|
||
echo "Tokenfactory cw binding tests passed!" |
Binary file not shown.