Skip to content

Commit

Permalink
add 1 to send amount
Browse files Browse the repository at this point in the history
  • Loading branch information
dasanchez committed Apr 17, 2024
1 parent 42c0d2c commit 82c9c99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/gaia-v16/test_rate_limits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ function test_transfer {
# supply=$($CHAIN_BINARY q bank total --home $HOME_1 -o json | jq -r '.supply[0].amount')
supply=$($CHAIN_BINARY q ratelimit rate-limit $channel_id --home $HOME_1 -o json | jq -r '.[0].flow.channel_value')
fraction=$(echo "$rate_limit" | bc)
amount=$(echo "($supply * $fraction)/1 " | bc )
amount=$(echo "($supply * $fraction)/1 + 1" | bc )
echo "uatom supply: $supply"
echo "Sending $amount..."
result=$(test_transfer $amount)
if [[ "$result" == "1" ]]; then
echo "PASS: Rate limit was detected."
else
echo "FAIL: Rate limit was not detected."
sleep 10
sleep 30
$CHAIN_BINARY q bank balances $WALLET_1 --node http://localhost:$rpc_port
exit 1
fi
Expand All @@ -42,7 +42,7 @@ result=$(test_transfer $amount)
echo "test transfer result: $result"
if [[ "$result" == "0" ]]; then
echo "PASS: Transaction below rate limit was accepted."
sleep 10
sleep 30
$CHAIN_BINARY q bank balances $WALLET_1 --node http://localhost:$rpc_port
else
echo "FAIL: Transaction below rate limit was not accepted."
Expand All @@ -68,7 +68,7 @@ if [[ "$result" == "1" ]]; then
echo "PASS: Rate limit was detected."
else
echo "FAIL: Rate limit was not detected."
sleep 10
sleep 30
$CHAIN_BINARY q bank balances $WALLET_1 --node http://localhost:$rpc_port
exit 1
fi

0 comments on commit 82c9c99

Please sign in to comment.