gpu-compute-chain/tests/test_auction_flow.sh

37 lines
1.1 KiB
Bash
Raw Normal View History

2022-09-02 13:48:12 -07:00
#!/bin/bash
# import utilities
HERE=$(cd $(dirname $BASH_SOURCE) && pwd)
source $HERE/testutil.sh
cosmos-testd tx cosmostest new-auction asdf asdf 500 token 1662155879 \
-y --from bob \
| expect_success "New auction is created"
cosmos-testd tx cosmostest new-bid $(get_last_auction_index) 100 \
-y --from alice \
| expect_success "New bid is correctly created"
cosmos-testd tx cosmostest new-bid $(get_last_auction_index) 100 \
-y --from alice \
| expect_fail "Can't create duplicate bids"
cosmos-testd tx cosmostest new-bid $(get_next_auction_index) 100 \
2022-09-03 00:41:54 -07:00
-y --from alice \
| expect_fail "Can't create bids for nonexistent auctions"
2022-09-02 13:48:12 -07:00
cosmos-testd tx cosmostest new-bid $(get_last_auction_index) 600 \
-y --from alice \
| expect_fail "Can't bid over price ceiling"
2022-09-02 13:48:12 -07:00
cosmos-testd tx cosmostest new-bid $(get_last_auction_index) 0 \
-y --from alice \
| expect_fail "Can't bid 0 tokens"
log_info "Waiting until auction expires..."
sleep 10
cosmos-testd tx cosmostest new-bid $(get_last_auction_index) 100 \
-y --from alice \
| expect_fail "Can't add bids after auction expiry"