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