Commit 8222696c authored by vipwzw's avatar vipwzw Committed by 33cn

update new proto

parent c07239ab
...@@ -176,7 +176,7 @@ func (h *hasher) store(n node, db *Database, force bool) (node, error) { ...@@ -176,7 +176,7 @@ func (h *hasher) store(n node, db *Database, force bool) (node, error) {
//这个不用非常精确,只要保持确定性就可以了 //这个不用非常精确,只要保持确定性就可以了
size := n.size() size := n.size()
if size < 64 && !force { if size < 64 && !force {
return n, nil // Nodes smaller than 32 bytes are stored inside their parent return n, nil // Nodes smaller than 64 bytes are stored inside their parent
} }
nn := n.create() nn := n.create()
data, err := proto.Marshal(nn) data, err := proto.Marshal(nn)
......
This diff is collapsed.
...@@ -37,6 +37,7 @@ import ( ...@@ -37,6 +37,7 @@ import (
"github.com/33cn/chain33/common" "github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db" dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/log"
comTy "github.com/33cn/chain33/types" comTy "github.com/33cn/chain33/types"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
...@@ -54,6 +55,7 @@ var ( ...@@ -54,6 +55,7 @@ var (
func init() { func init() {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
log.SetLogLevel("err")
spew.Config.Indent = " " spew.Config.Indent = " "
spew.Config.DisableMethods = false spew.Config.DisableMethods = false
} }
......
...@@ -29,10 +29,12 @@ import ( ...@@ -29,10 +29,12 @@ import (
"github.com/33cn/chain33/common" "github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db" dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/log"
) )
func init() { func init() {
mrand.Seed(time.Now().UnixNano()) mrand.Seed(time.Now().UnixNano())
log.SetLogLevel("err")
} }
// makeProvers creates Merkle trie provers based on different implementations to // makeProvers creates Merkle trie provers based on different implementations to
......
...@@ -735,7 +735,6 @@ func get10000(t assert.TestingT, root common.Hash, db dbm.DB, keys map[string]st ...@@ -735,7 +735,6 @@ func get10000(t assert.TestingT, root common.Hash, db dbm.DB, keys map[string]st
database := NewDatabase(db) database := NewDatabase(db)
t1, _ := New(root, database) t1, _ := New(root, database)
for k, v := range keys { for k, v := range keys {
fmt.Println(k, v)
value, err := t1.TryGet([]byte(k)) value, err := t1.TryGet([]byte(k))
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, string(value), v) assert.Equal(t, string(value), v)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment