diff --git a/store/iavl/store.go b/store/iavl/store.go index 77f611380535..3721400e2023 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -142,10 +142,7 @@ func (st *Store) Commit() types.CommitID { // LastCommitID implements Committer. func (st *Store) LastCommitID() types.CommitID { - hash, err := st.tree.Hash() - if err != nil { - panic(err) - } + hash := st.tree.Hash() return types.CommitID{ Version: st.tree.Version(), @@ -246,19 +243,13 @@ func (st *Store) LazyLoadVersionForOverwriting(targetVersion int64) (int64, erro // Implements types.KVStore. func (st *Store) Iterator(start, end []byte) types.Iterator { - iterator, err := st.tree.Iterator(start, end, true) - if err != nil { - panic(err) - } + iterator := st.tree.Iterator(start, end, true) return iterator } // Implements types.KVStore. func (st *Store) ReverseIterator(start, end []byte) types.Iterator { - iterator, err := st.tree.Iterator(start, end, false) - if err != nil { - panic(err) - } + iterator := st.tree.Iterator(start, end, false) return iterator } diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index f73c86197c07..ae83b863e485 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/store/cachekv" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" "github.com/stretchr/testify/require" @@ -34,8 +34,7 @@ func randBytes(numBytes int) []byte { // make a tree with data from above and save it func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) { - tree, err := iavl.NewMutableTree(db, cacheSize, false) - require.NoError(t, err) + tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) for k, v := range treeData { tree.Set([]byte(k), []byte(v)) @@ -280,10 +279,8 @@ func TestIAVLIterator(t *testing.T) { } func TestIAVLReverseIterator(t *testing.T) { - db := dbm.NewMemDB() - tree, err := iavl.NewMutableTree(db, cacheSize, false) - require.NoError(t, err) + tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -314,9 +311,7 @@ func TestIAVLReverseIterator(t *testing.T) { } func TestIAVLPrefixIterator(t *testing.T) { - db := dbm.NewMemDB() - tree, err := iavl.NewMutableTree(db, cacheSize, false) - require.NoError(t, err) + tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) diff --git a/store/prefix/store_test.go b/store/prefix/store_test.go index d7b655968814..c5c43f372c63 100644 --- a/store/prefix/store_test.go +++ b/store/prefix/store_test.go @@ -4,9 +4,10 @@ import ( "crypto/rand" "testing" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/store/cachekv" - dbm "github.com/cometbft/cometbft-db" + dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" tiavl "github.com/cosmos/iavl" @@ -89,9 +90,7 @@ func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) { } func TestIAVLStorePrefix(t *testing.T) { - db := dbm.NewMemDB() - tree, err := tiavl.NewMutableTree(db, cacheSize, false) - require.NoError(t, err) + tree := tiavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) iavlStore := iavl.UnsafeNewStore(tree) testPrefixStore(t, iavlStore, []byte("test"))