mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-04 21:54:26 -08:00
change denoms to CLR/USDC from token/stake
This commit is contained in:
@@ -8,59 +8,59 @@ colineard tx colinear new-auction asdf asdf 200 token $(now + 3500) \
|
||||
-y --from bob \
|
||||
| expect_fail "Can't create auction below min lease period"
|
||||
|
||||
colineard tx colinear new-auction asdf asdf 200 token $(now + 8200000) \
|
||||
colineard tx colinearcore new-auction asdf asdf 200 usdc $(now + 8200000) \
|
||||
-y --from bob \
|
||||
| expect_fail "Can't create auction above max lease period"
|
||||
|
||||
before=$(get_balance $BOB token)
|
||||
before=$(get_balance $BOB usdc)
|
||||
|
||||
colineard tx colinear new-auction asdf asdf 200 token $(now + 3700) \
|
||||
colineard tx colinearcore new-auction asdf asdf 200 usdc $(now + 3700) \
|
||||
-y --from bob \
|
||||
| expect_success "New auction is created"
|
||||
|
||||
get_balance $BOB token | expect_change -200 $before "Change in Bob's balance"
|
||||
get_balance $BOB usdc | expect_change -200 $before "Change in Bob's balance"
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 100 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 100 \
|
||||
-y --from alice \
|
||||
| expect_success "New bid is correctly created"
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 90 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 90 \
|
||||
-y --from alice \
|
||||
| expect_success "Can bid below price ceiling"
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 100 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 100 \
|
||||
-y --from alice \
|
||||
| expect_fail "Can't create duplicate bids"
|
||||
|
||||
colineard tx colinear new-bid $(get_next_auction_index) 100 \
|
||||
colineard tx colinearcore new-bid $(get_next_auction_index) 100 \
|
||||
-y --from alice \
|
||||
| expect_fail "Can't create bids for nonexistent auctions"
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 600 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 600 \
|
||||
-y --from alice \
|
||||
| expect_fail "Can't bid over price ceiling"
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 0 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 0 \
|
||||
-y --from alice \
|
||||
| expect_fail "Can't bid 0 tokens"
|
||||
| expect_fail "Can't bid 0 usdcs"
|
||||
|
||||
colineard q colinear auction-bids $(get_last_auction_index) \
|
||||
colineard q colinearcore auction-bids $(get_last_auction_index) \
|
||||
| jq -M ".bids | length" \
|
||||
| assert_eq 2 "Number of auction bids"
|
||||
|
||||
before=$(get_balance $BOB token)
|
||||
before=$(get_balance $BOB usdc)
|
||||
|
||||
# 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
|
||||
|
||||
colineard tx colinear new-bid $(get_last_auction_index) 50 \
|
||||
colineard tx colinearcore new-bid $(get_last_auction_index) 50 \
|
||||
-y --from alice \
|
||||
| expect_fail "Can't add bids after auction expiry"
|
||||
|
||||
colineard q colinear show-auction $(get_last_auction_index) \
|
||||
colineard q colinearcore show-auction $(get_last_auction_index) \
|
||||
| jq -rM ".auction.best.amount" \
|
||||
| assert_eq 90 "Remaining vested amount from finalized top bid"
|
||||
|
||||
get_balance $BOB token | expect_change 110 $before "Change in Bob's balance"
|
||||
get_balance $BOB usdc | expect_change 110 $before "Change in Bob's balance"
|
||||
|
||||
@@ -69,12 +69,12 @@ function get_key {
|
||||
}
|
||||
|
||||
function get_last_auction_index {
|
||||
res=$(colineard q colinear show-next-auction | jq -M ".NextAuction.auctionId | tonumber")
|
||||
res=$(colineard q colinearcore show-next-auction | jq -M ".NextAuction.auctionId | tonumber")
|
||||
echo "$res-1" | bc
|
||||
}
|
||||
|
||||
function get_next_auction_index {
|
||||
colineard q colinear show-next-auction | jq -M ".NextAuction.auctionId | tonumber"
|
||||
colineard q colinearcore show-next-auction | jq -M ".NextAuction.auctionId | tonumber"
|
||||
}
|
||||
|
||||
function now {
|
||||
|
||||
Reference in New Issue
Block a user