From 7beccb29becf439df7bf4c033a94c019ad25bead Mon Sep 17 00:00:00 2001 From: gary rong Date: Wed, 9 May 2018 20:24:25 +0800 Subject: all: get rid of error when creating memory database (#16716) * all: get rid of error when create mdb * core: clean up variables definition * all: inline mdb definition --- trie/proof_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'trie/proof_test.go') diff --git a/trie/proof_test.go b/trie/proof_test.go index fff313d7f..a3537787c 100644 --- a/trie/proof_test.go +++ b/trie/proof_test.go @@ -36,7 +36,7 @@ func TestProof(t *testing.T) { trie, vals := randomTrie(500) root := trie.Hash() for _, kv := range vals { - proofs, _ := ethdb.NewMemDatabase() + proofs := ethdb.NewMemDatabase() if trie.Prove(kv.k, 0, proofs) != nil { t.Fatalf("missing key %x while constructing proof", kv.k) } @@ -53,7 +53,7 @@ func TestProof(t *testing.T) { func TestOneElementProof(t *testing.T) { trie := new(Trie) updateString(trie, "k", "v") - proofs, _ := ethdb.NewMemDatabase() + proofs := ethdb.NewMemDatabase() trie.Prove([]byte("k"), 0, proofs) if len(proofs.Keys()) != 1 { t.Error("proof should have one element") @@ -71,7 +71,7 @@ func TestVerifyBadProof(t *testing.T) { trie, vals := randomTrie(800) root := trie.Hash() for _, kv := range vals { - proofs, _ := ethdb.NewMemDatabase() + proofs := ethdb.NewMemDatabase() trie.Prove(kv.k, 0, proofs) if len(proofs.Keys()) == 0 { t.Fatal("zero length proof") @@ -109,7 +109,7 @@ func BenchmarkProve(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { kv := vals[keys[i%len(keys)]] - proofs, _ := ethdb.NewMemDatabase() + proofs := ethdb.NewMemDatabase() if trie.Prove(kv.k, 0, proofs); len(proofs.Keys()) == 0 { b.Fatalf("zero length proof for %x", kv.k) } @@ -123,7 +123,7 @@ func BenchmarkVerifyProof(b *testing.B) { var proofs []*ethdb.MemDatabase for k := range vals { keys = append(keys, k) - proof, _ := ethdb.NewMemDatabase() + proof := ethdb.NewMemDatabase() trie.Prove([]byte(k), 0, proof) proofs = append(proofs, proof) } -- cgit