mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 13:24:26 -08:00
unit test for new memdb bids getter
This commit is contained in:
@@ -2,6 +2,7 @@ package memdb
|
||||
|
||||
import (
|
||||
"cosmos-test/x/cosmostest/types"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/dgraph-io/badger/v3"
|
||||
@@ -21,6 +22,18 @@ func TestBasicFlow(t *testing.T) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// get all bids out
|
||||
if bids, err := BidDB.GetBids("0"); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
if bids == nil {
|
||||
panic("GetBids(0) should should not return nil")
|
||||
}
|
||||
if len(bids) != 2 {
|
||||
panic(fmt.Sprintf("Length of GetBids(0) should be 2, instead got %d", len(bids)))
|
||||
}
|
||||
}
|
||||
|
||||
// check highest bid
|
||||
if bid, err := BidDB.GetHighestBid("0"); err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user