-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
#!/bin/bash | ||
|
||
ACK_FEE=456 | ||
balance_before=$($CHAIN_BINARY q bank balances $WALLET_RELAYER --home $HOME_1 -o json | jq -r --arg DENOM "$DENOM" '.balances[] | select(.denom == $DENOM).amount') | ||
|
||
|
||
$RELAYER --json create channel --order unordered --a-chain $CHAIN_ID --a-port transfer --b-port transfer --a-connection connection-0 --channel-version "{\"fee_version\":\"ics29-1\",\"app_version\":\"ics20-1\"}" | ||
|
||
txhash=$($CHAIN_BINARY tx ibc-transfer transfer transfer channel-0 $WALLET_1 1$DENOM --gas $GAS --gas-prices $GAS_PRICE$DENOM --gas-adjustment $GAS_ADJUSTMENT --from $WALLET_1 --output json -y --home $HOME_1 | jq -r '.txhash') | ||
sleep $COMMIT_TIMEOUT | ||
sequence=$($CHAIN_BINARY q tx $txhash --home $HOME_1 -o json | jq -r '.events[] | select(.type == "send_packet").attributes[] | select(.key == "packet_sequence").value') | ||
$CHAIN_BINARY tx ibc-fee pay-packet-fee transfer channel-0 $sequence --recv-fee 123uatom --ack-fee 456uatom --timeout-fee 789uatom --from $WALLET_1 --gas $GAS --gas-prices $GAS_PRICE$DENOM --gas-adjustment $GAS_ADJUSTMENT --home $HOME_1 -y | ||
$CHAIN_BINARY tx ibc-fee pay-packet-fee transfer channel-0 $sequence --recv-fee 123$DENOM --ack-fee ${ACK_FEE}$DENOM --timeout-fee 789$DENOM --from $WALLET_1 --gas $GAS --gas-prices $GAS_PRICE$DENOM --gas-adjustment $GAS_ADJUSTMENT --home $HOME_1 -y | ||
|
||
sleep 30 | ||
balance_after=$($CHAIN_BINARY q bank balances $WALLET_RELAYER --home $HOME_1 -o json | jq -r --arg DENOM "$DENOM" '.balances[] | select(.denom == $DENOM).amount') | ||
|
||
difference=$(echo "$balance_after - $balance_before" | bc) | ||
echo "Difference: ${difference}$DENOM" | ||
echo "Difference: ${difference}$DENOM" | ||
|
||
if [ $difference == $ACK_FEE ]; then | ||
echo "PASS: Relayer balance increased by the ACK FEE." | ||
else | ||
echo "FAIL: Relayer balance did not increase by the ACK FEE." | ||
exit 1 | ||
fi |