diff --git a/tests/test_auction_flow.sh b/tests/test_auction_flow.sh index 4cc4a71..a474d6d 100755 --- a/tests/test_auction_flow.sh +++ b/tests/test_auction_flow.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Tests the core auction flow +# Tests the core auction flow (without specifying verified providers) # import utilities HERE=$(cd $(dirname $BASH_SOURCE) && pwd) @@ -67,8 +67,9 @@ before=$(get_balance $BOB uusdc) # Was experiencing issues with bob's balance not updating, probably # because we weren't waiting long enough -log_info "Waiting 12s until auction expires..." -sleep 12 +wait=12 +log_info "Waiting $wait s until auction expires..." +sleep $wait colineard tx colinearcore new-bid $(get_last_auction_index) 50 \ -y --from alice \ @@ -76,6 +77,10 @@ colineard tx colinearcore new-bid $(get_last_auction_index) 50 \ colineard q colinearcore show-auction $(get_last_auction_index) \ | jq -rM ".auction.best.amount" \ - | assert_eq 90 "Remaining vested amount from finalized top bid" + | assert_eq 90 "Finalized top bid amount" + +colineard q colinearcore show-auction $(get_last_auction_index) \ + | jq -rM ".auction.remaining" \ + | assert_eq 90 "Remaining vested amount" get_balance $BOB uusdc | expect_change 110 $before "Change in Bob's balance" diff --git a/tests/test_auction_flow_verified.sh b/tests/test_auction_flow_verified.sh new file mode 100755 index 0000000..f07c269 --- /dev/null +++ b/tests/test_auction_flow_verified.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Tests the core auction flow with the added factor of specifying which +# providers are verified. + +# import utilities +HERE=$(cd $(dirname $BASH_SOURCE) && pwd) +source $HERE/testutil.sh + +get_last_auction_index + +get_block_time diff --git a/tests/test_locking_funds.sh b/tests/test_locking_funds.sh index 5148100..7a09ade 100755 --- a/tests/test_locking_funds.sh +++ b/tests/test_locking_funds.sh @@ -28,7 +28,7 @@ colineard tx colinearcore unlock-funds 150000000 -y --from alice \ colineard q colinearcore locked-funds $ALICE \ | jq -rM ".amount" \ - | expect_change -150000000 $before "New locked balance reflects unlock" + | expect_change -150000000 $before "New locked balance (reflecting unlock)" before=$(colineard q colinearcore locked-funds $ALICE \ | jq -rM ".amount") @@ -38,4 +38,4 @@ colineard tx colinearcore unlock-all-funds -y --from alice \ colineard q colinearcore locked-funds $ALICE \ | jq -rM ".amount" \ - | expect_change -450000000 $before "New locked balance reflects unlock" + | expect_change -450000000 $before "New locked balance (reflecting unlock)" diff --git a/tests/testutil.sh b/tests/testutil.sh index 2c039a5..e22d90b 100644 --- a/tests/testutil.sh +++ b/tests/testutil.sh @@ -56,11 +56,8 @@ function get_balance { # Get current block time from chain. function get_block_time { - return \ - $( - curl -s http://0.0.0.0:1317/cosmos/base/tendermint/v1beta1/blocks/latest \ - | jq -M ".blocks.header.height | tonumber" - ) + curl -s http://0.0.0.0:1317/cosmos/base/tendermint/v1beta1/blocks/latest \ + | jq -M ".block.header.height | tonumber" } function get_code {