Skip to content

Commit

Permalink
fix 0,0 pruning strategy error
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSripal committed Jan 22, 2020
1 parent 07ffaa9 commit f603c45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package iavl

import (
"fmt"
"io"
"sync"

Expand Down Expand Up @@ -38,12 +39,14 @@ type Store struct {
func LoadStore(db dbm.DB, id types.CommitID, pruning types.PruningOptions, lazyLoading bool) (types.CommitKVStore, error) {
var iavlOpts *iavl.Options
iavlOpts = iavl.PruningOptions(pruning.KeepEvery(), pruning.KeepRecent())
fmt.Printf("iavlOpts: %v\n", iavlOpts)

This comment has been minimized.

Copy link
@tnachen

tnachen Jan 22, 2020

Contributor

Remove these?

tree, err := iavl.NewMutableTreeWithOpts(
db,
dbm.NewMemDB(),
defaultIAVLCacheSize,
iavlOpts,
)
fmt.Printf("IAVL ERR: %v\n", err)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion store/rootmulti/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ func TestVerifyMultiStoreQueryProof(t *testing.T) {
iavlStoreKey := types.NewKVStoreKey("iavlStoreKey")

store.MountStoreWithDB(iavlStoreKey, types.StoreTypeIAVL, nil)
store.LoadVersion(0)
serr := store.LoadVersion(0)
require.Nil(t, serr)

iavlStore := store.GetCommitStore(iavlStoreKey).(*iavl.Store)
iavlStore.Set([]byte("MYKEY"), []byte("MYVALUE"))
Expand Down
1 change: 1 addition & 0 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var _ types.Queryable = (*Store)(nil)
func NewStore(db dbm.DB) *Store {
return &Store{
db: db,
pruningOpts: types.PruneNothing,
storesParams: make(map[types.StoreKey]storeParams),
stores: make(map[types.StoreKey]types.CommitKVStore),
keysByName: make(map[string]types.StoreKey),
Expand Down

0 comments on commit f603c45

Please sign in to comment.