mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 06:14:25 -08:00
better test
This commit is contained in:
@@ -10,22 +10,21 @@ func TestBasicFlow(t *testing.T) {
|
|||||||
BidDB.Mount()
|
BidDB.Mount()
|
||||||
|
|
||||||
// add a bid
|
// add a bid
|
||||||
testBid := &types.Bid{
|
if err := BidDB.AddBid("0", &types.Bid{Owner: "cosmos123", Amount: "100"}); err != nil {
|
||||||
Owner: "cosmos123",
|
|
||||||
Amount: "100",
|
|
||||||
}
|
|
||||||
if err := BidDB.AddBid("0", testBid); err != nil {
|
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// // add a duplicate bid (won't check amount)
|
// add a higher bid (won't check amount, though)
|
||||||
// if err := BidDB.AddBid("0", testBid); err != nil {
|
|
||||||
// panic(err)
|
if err := BidDB.AddBid("0", &types.Bid{Owner: "cosmos456", Amount: "200"}); err != nil {
|
||||||
// }
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
if bid, err := BidDB.GetHighestBid("0"); err != nil {
|
if bid, err := BidDB.GetHighestBid("0"); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
} else {
|
} else {
|
||||||
panic(bid)
|
if bid.Owner != "cosmos456" || bid.Amount != "200" {
|
||||||
|
panic("Highest auction item not selected")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user