Skip to content

Commit

Permalink
update usages of EnumerateKeysForPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina committed Dec 23, 2024
1 parent 2dc941f commit 1ab5b35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions routes/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,12 +1363,12 @@ func TestAPI(t *testing.T) {
{
prefix := lib.DbTxindexTxIDKey(&lib.BlockHash{})[0]
txnsInTransactionIndex, _ := lib.EnumerateKeysForPrefix(
apiServer.TXIndex.TXIndexChain.DB(), []byte{prefix}, true)
apiServer.TXIndex.TXIndexChain.DB(), []byte{prefix}, true, false)
require.Equal(1+len(apiServer.Params.SeedTxns)+len(apiServer.Params.SeedBalances), len(txnsInTransactionIndex))
}
{
keysInPublicKeyTable, _ := lib.EnumerateKeysForPrefix(
apiServer.TXIndex.TXIndexChain.DB(), lib.DbTxindexPublicKeyPrefix([]byte{}), true)
apiServer.TXIndex.TXIndexChain.DB(), lib.DbTxindexPublicKeyPrefix([]byte{}), true, false)
// There should be two keys since one is the miner public key and
// the other is a dummy public key corresponding to the input of
// a block reward txn. Plus one for the seed balance, which creates
Expand Down Expand Up @@ -1449,12 +1449,12 @@ func TestAPI(t *testing.T) {
{
prefix := lib.DbTxindexTxIDKey(&lib.BlockHash{})[0]
txnsInTransactionIndex, _ := lib.EnumerateKeysForPrefix(
apiServer.TXIndex.TXIndexChain.DB(), []byte{prefix}, true)
apiServer.TXIndex.TXIndexChain.DB(), []byte{prefix}, true, false)
require.Equal(5+len(apiServer.Params.SeedTxns)+len(apiServer.Params.SeedBalances), len(txnsInTransactionIndex))
}
{
keysInPublicKeyTable, _ := lib.EnumerateKeysForPrefix(
apiServer.TXIndex.TXIndexChain.DB(), lib.DbTxindexPublicKeyPrefix([]byte{}), true)
apiServer.TXIndex.TXIndexChain.DB(), lib.DbTxindexPublicKeyPrefix([]byte{}), true, false)
// Three pairs for the block rewards and two pairs for the transactions
// we created.
require.Equal(10+
Expand Down

0 comments on commit 1ab5b35

Please sign in to comment.