Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Apr 24, 2023
1 parent 45e63f4 commit 292622d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func New(
interfaceRegistry := encodingConfig.InterfaceRegistry

if cast.ToBool(appOpts.Get(FlagMemIAVL)) {
// cms must be overriden before the other options, because they may use the cms,
// cms must be overridden before the other options, because they may use the cms,
// FIXME we are assuming the cms won't be overridden by the other options, but we can't be sure.
cms := rootmulti.NewStore(filepath.Join(homePath, "data", "memiavl.db"), logger)
baseAppOptions = append([]func(*baseapp.BaseApp){setCMS(cms)}, baseAppOptions...)
Expand Down
6 changes: 5 additions & 1 deletion memiavl/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func BenchmarkRandomGet(b *testing.B) {
b.Run("iavl-lru", func(b *testing.B) {
cache := iavlcache.New(amount)
for _, item := range items {
cache.Add(iavlCacheNode{item.key, item.value})
cache.Add(NewIavlCacheNode(item.key, item.value))
}
v := cache.Get(targetItem.key).(iavlCacheNode).value
require.Equal(b, targetValue, v)
Expand Down Expand Up @@ -223,6 +223,10 @@ type iavlCacheNode struct {
value []byte
}

func NewIavlCacheNode(key, value []byte) iavlCacheNode {
return iavlCacheNode{key, value}
}

func (n iavlCacheNode) GetKey() []byte {
return n.key
}
1 change: 1 addition & 0 deletions memiavl/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func TestDBSnapshotRestore(t *testing.T) {
require.NoError(t, err)

db2, err := Load(restoreDir, Options{})
require.NoError(t, err)
require.Equal(t, db.LastCommitInfo(), db2.LastCommitInfo())
require.Equal(t, db.Hash(), db2.Hash())

Expand Down

0 comments on commit 292622d

Please sign in to comment.