Skip to content

Commit

Permalink
updates for latest tmlibs
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman committed Feb 13, 2018
1 parent 1ec59f7 commit 39de8f0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion benchmarks/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func BenchmarkRandomBytes(b *testing.B) {
}

type benchmark struct {
dbType string
dbType db.DBBackendType
initSize, blockSize int
keyLen, dataLen int
}
Expand Down
14 changes: 7 additions & 7 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package: github.com/tendermint/iavl
import:
- package: github.com/tendermint/go-wire
version: develop
version: master
- package: github.com/tendermint/tmlibs
version: sdk2
version: develop
- package: golang.org/x/crypto
subpackages:
- ripemd160
Expand Down
4 changes: 2 additions & 2 deletions nodedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (ndb *nodeDB) GetNode(hash []byte) *Node {
// Doesn't exist, load.
buf := ndb.db.Get(ndb.nodeKey(hash))
if buf == nil {
panic(fmt.Sprintf("Value missing for key %x", hash))
panic(fmt.Sprintf("Value missing for hash %x corresponding to nodeKey %s", hash, ndb.nodeKey(hash)))
}

node, err := MakeNode(buf)
Expand Down Expand Up @@ -301,7 +301,7 @@ func (ndb *nodeDB) traverse(fn func(key, value []byte)) {

// Traverse all keys with a certain prefix.
func (ndb *nodeDB) traversePrefix(prefix []byte, fn func(k, v []byte)) {
itr := ndb.db.Iterator(nil, nil)
itr := dbm.IteratePrefix(ndb.db, prefix)
defer itr.Close()

for ; itr.Valid(); itr.Next() {
Expand Down
4 changes: 2 additions & 2 deletions testutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func N(l, r interface{}) *Node {

// Setup a deep node
func T(n *Node) *Tree {
d := db.NewDB("test", db.MemDBBackendStr, "")
d := db.NewDB("test", db.MemDBBackend, "")
t := NewTree(d, 0)

n.hashWithCount()
Expand Down Expand Up @@ -147,7 +147,7 @@ func testProof(t *testing.T, proof *KeyExistsProof, keyBytes, valueBytes, rootHa
}

func BenchmarkImmutableAvlTreeMemDB(b *testing.B) {
db := db.NewDB("test", db.MemDBBackendStr, "")
db := db.NewDB("test", db.MemDBBackend, "")
benchmarkImmutableAvlTreeWithDB(b, db)
}

Expand Down
1 change: 1 addition & 0 deletions versioned_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (tree *VersionedTree) LoadVersion(targetVersion int64) error {
// Load all roots from the database.
latestVersion := int64(0)
for version, root := range roots {
fmt.Printf("ROOTS %d %x\n", version, root)

// Construct a tree manually.
t := &Tree{}
Expand Down

0 comments on commit 39de8f0

Please sign in to comment.