update/fix tests & start on verified test

master
michael 2022-09-14 00:01:24 +00:00
parent c08c827b4e
commit 62b51c88b0
4 changed files with 25 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Tests the core auction flow # Tests the core auction flow (without specifying verified providers)
# import utilities # import utilities
HERE=$(cd $(dirname $BASH_SOURCE) && pwd) 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 # Was experiencing issues with bob's balance not updating, probably
# because we weren't waiting long enough # because we weren't waiting long enough
log_info "Waiting 12s until auction expires..." wait=12
sleep 12 log_info "Waiting $wait s until auction expires..."
sleep $wait
colineard tx colinearcore new-bid $(get_last_auction_index) 50 \ colineard tx colinearcore new-bid $(get_last_auction_index) 50 \
-y --from alice \ -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) \ colineard q colinearcore show-auction $(get_last_auction_index) \
| jq -rM ".auction.best.amount" \ | 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" get_balance $BOB uusdc | expect_change 110 $before "Change in Bob's balance"

View File

@ -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

View File

@ -28,7 +28,7 @@ colineard tx colinearcore unlock-funds 150000000 -y --from alice \
colineard q colinearcore locked-funds $ALICE \ colineard q colinearcore locked-funds $ALICE \
| jq -rM ".amount" \ | 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 \ before=$(colineard q colinearcore locked-funds $ALICE \
| jq -rM ".amount") | jq -rM ".amount")
@ -38,4 +38,4 @@ colineard tx colinearcore unlock-all-funds -y --from alice \
colineard q colinearcore locked-funds $ALICE \ colineard q colinearcore locked-funds $ALICE \
| jq -rM ".amount" \ | jq -rM ".amount" \
| expect_change -450000000 $before "New locked balance reflects unlock" | expect_change -450000000 $before "New locked balance (reflecting unlock)"

View File

@ -56,11 +56,8 @@ function get_balance {
# Get current block time from chain. # Get current block time from chain.
function get_block_time { function get_block_time {
return \
$(
curl -s http://0.0.0.0:1317/cosmos/base/tendermint/v1beta1/blocks/latest \ curl -s http://0.0.0.0:1317/cosmos/base/tendermint/v1beta1/blocks/latest \
| jq -M ".blocks.header.height | tonumber" | jq -M ".block.header.height | tonumber"
)
} }
function get_code { function get_code {