Skip to content

Commit

Permalink
test: cover iavl disable fast node
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Oct 19, 2022
1 parent daf3ab5 commit 91a591f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ func TestGetBlockRentionHeight(t *testing.T) {
commitHeight: 499000,
expected: 0,
},
"iavl disable fast node": {
bapp: NewBaseApp(
name, logger, db, nil,
SetIAVLDisableFastNode(true),
),
maxAgeBlocks: 0,
commitHeight: 499000,
expected: 0,
},
}

for name, tc := range testCases {
Expand Down
11 changes: 11 additions & 0 deletions store/rootmulti/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,3 +887,14 @@ func hashStores(stores map[types.StoreKey]types.CommitKVStore) []byte {
}
return sdkmaps.HashFromMap(m)
}

func TestSetIAVLDIsableFastNode(t *testing.T) {
db := dbm.NewMemDB()
multi := newMultiStoreWithMounts(db, types.PruneNothing)

multi.SetIAVLDisableFastNode(true)
require.Equal(t, multi.iavlDisableFastNode, true)

multi.SetIAVLDisableFastNode(false)
require.Equal(t, multi.iavlDisableFastNode, false)
}

0 comments on commit 91a591f

Please sign in to comment.