mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 11:04:26 -08:00
unit test for new memdb bids getter
This commit is contained in:
@@ -2,6 +2,7 @@ package memdb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"cosmos-test/x/cosmostest/types"
|
"cosmos-test/x/cosmostest/types"
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/dgraph-io/badger/v3"
|
"github.com/dgraph-io/badger/v3"
|
||||||
@@ -21,6 +22,18 @@ func TestBasicFlow(t *testing.T) {
|
|||||||
panic(err)
|
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
|
// check highest bid
|
||||||
if bid, err := BidDB.GetHighestBid("0"); err != nil {
|
if bid, err := BidDB.GetHighestBid("0"); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user