Skip to content

Commit

Permalink
more replacement of calls to iavl
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Nov 14, 2023
1 parent 1696d17 commit 5c8d5fc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions store/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"fmt"
"testing"

dbm "github.com/cometbft/cometbft-db"
"cosmossdk.io/log"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/iavl"
"github.com/stretchr/testify/require"

Expand All @@ -15,11 +16,10 @@ import (
)

func TestGetOrSetStoreCache(t *testing.T) {
db := dbm.NewMemDB()
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)

sKey := types.NewKVStoreKey("test")
tree := iavl.NewMutableTree(db, 100, false)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := iavlstore.UnsafeNewStore(tree)
store2 := mngr.GetStoreCache(sKey, store)

Expand All @@ -28,11 +28,10 @@ func TestGetOrSetStoreCache(t *testing.T) {
}

func TestUnwrap(t *testing.T) {
db := dbm.NewMemDB()
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)

sKey := types.NewKVStoreKey("test")
tree := iavl.NewMutableTree(db, 100, false)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := iavlstore.UnsafeNewStore(tree)
_ = mngr.GetStoreCache(sKey, store)

Expand All @@ -41,11 +40,10 @@ func TestUnwrap(t *testing.T) {
}

func TestStoreCache(t *testing.T) {
db := dbm.NewMemDB()
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)

sKey := types.NewKVStoreKey("test")
tree := iavl.NewMutableTree(db, 100, false)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := iavlstore.UnsafeNewStore(tree)
kvStore := mngr.GetStoreCache(sKey, store)

Expand All @@ -67,11 +65,10 @@ func TestStoreCache(t *testing.T) {
}

func TestReset(t *testing.T) {
db := dbm.NewMemDB()
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)

sKey := types.NewKVStoreKey("test")
tree := iavl.NewMutableTree(db, 100, false)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := iavlstore.UnsafeNewStore(tree)
store2 := mngr.GetStoreCache(sKey, store)

Expand All @@ -87,11 +84,10 @@ func TestReset(t *testing.T) {
}

func TestCacheWrap(t *testing.T) {
db := dbm.NewMemDB()
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)

sKey := types.NewKVStoreKey("test")
tree := iavl.NewMutableTree(db, 100, false)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := iavlstore.UnsafeNewStore(tree)

cacheWrapper := mngr.GetStoreCache(sKey, store).CacheWrap()
Expand Down

0 comments on commit 5c8d5fc

Please sign in to comment.