From 5c8d5fcb9b1995ce2f49880d6dab0360d0ae9c72 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 14 Nov 2023 22:33:38 +0700 Subject: [PATCH] more replacement of calls to iavl --- store/cache/cache_test.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/store/cache/cache_test.go b/store/cache/cache_test.go index b011decd2e2d..927b646b61be 100644 --- a/store/cache/cache_test.go +++ b/store/cache/cache_test.go @@ -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" @@ -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) @@ -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) @@ -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) @@ -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) @@ -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()