Skip to content

Commit

Permalink
attempt to fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Feb 17, 2022
1 parent 141d98d commit 543206b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
4 changes: 3 additions & 1 deletion benchmarks/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"

"github.com/cosmos/iavl"
"github.com/stretchr/testify/require"

_ "crypto/sha256"

Expand Down Expand Up @@ -45,7 +46,8 @@ func benchHasher(b *testing.B, hash hash.Hash, size int) {
for i := 0; i < b.N; i++ {
hash.Reset()
// grab a slice of size bytes from random string
hash.Write(inputs[i : i+size])
_, err := hash.Write(inputs[i : i+size])
require.NoError(b, err)
hash.Sum(nil)
}
}
24 changes: 0 additions & 24 deletions cmd/iaviewer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,6 @@ func OpenDB(dir string) (dbm.DB, error) {
return db, nil
}

// nolint: deadcode
func PrintDBStats(db dbm.DB) {
count := 0
prefix := map[string]int{}
itr, err := db.Iterator(nil, nil)
if err != nil {
panic(err)
}

defer itr.Close()
for ; itr.Valid(); itr.Next() {
key := string(itr.Key()[:1])
prefix[key]++
count++
}
if err := itr.Error(); err != nil {
panic(err)
}
fmt.Printf("DB contains %d entries\n", count)
for k, v := range prefix {
fmt.Printf(" %s: %d\n", k, v)
}
}

// ReadTree loads an iavl tree from the directory
// If version is 0, load latest, otherwise, load named version
// The prefix represents which iavl tree you want to read. The iaviwer will always set a prefix.
Expand Down

0 comments on commit 543206b

Please sign in to comment.