Skip to content

Commit c27343a

Browse files
committed
fix some stuff
1 parent 1e6cc1f commit c27343a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

tests/testdata

trie/committer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (c *committer) store(path []byte, n node) node {
157157
// length of leaves should be exactly same.
158158
if c.collectLeaf {
159159
if sn, ok := n.(*shortNode); ok {
160-
if val, ok := sn.Val.(valueNode); ok {
160+
if val, ok := sn.Val.(*valueNode); ok {
161161
c.nodes.AddLeaf(nhash, val.resolve())
162162
}
163163
}

trie/node.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ func (n nodeFlag) copy() nodeFlag {
107107
func (n *fullNode) cache() (hashNode, bool) { return n.flags.hash, n.flags.dirty }
108108
func (n *shortNode) cache() (hashNode, bool) { return n.flags.hash, n.flags.dirty }
109109
func (n hashNode) cache() (hashNode, bool) { return nil, true }
110-
func (n valueNode) cache() (hashNode, bool) { return nil, true }
110+
func (n *valueNode) cache() (hashNode, bool) { return nil, true }
111111

112112
// Pretty printing.
113113
func (n *fullNode) String() string { return n.fstring("") }
114114
func (n *shortNode) String() string { return n.fstring("") }
115115
func (n hashNode) String() string { return n.fstring("") }
116-
func (n valueNode) String() string { return n.fstring("") }
116+
func (n *valueNode) String() string { return n.fstring("") }
117117

118118
func (n *fullNode) fstring(ind string) string {
119119
resp := fmt.Sprintf("[\n%s ", ind)
@@ -133,7 +133,7 @@ func (n *shortNode) fstring(ind string) string {
133133
func (n hashNode) fstring(ind string) string {
134134
return fmt.Sprintf("<%x> ", []byte(n))
135135
}
136-
func (n valueNode) fstring(ind string) string {
136+
func (n *valueNode) fstring(ind string) string {
137137
return fmt.Sprintf("%x ", n.resolve())
138138
}
139139

trie/node_enc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ func (n hashNode) encode(w rlp.EncoderBuffer) {
101101
w.WriteBytes(n)
102102
}
103103

104-
func (n valueNode) encode(w rlp.EncoderBuffer) {
104+
func (n *valueNode) encode(w rlp.EncoderBuffer) {
105105
w.WriteBytes(n.resolve())
106106
}

trie/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ func (s *Sync) children(req *nodeRequest, object node) ([]*nodeRequest, error) {
612612
for _, child := range children {
613613
// Notify any external watcher of a new key/value node
614614
if req.callback != nil {
615-
if node, ok := (child.node).(valueNode); ok {
615+
if node, ok := (child.node).(*valueNode); ok {
616616
var paths [][]byte
617617
if len(child.path) == 2*common.HashLength {
618618
paths = append(paths, hexToKeybytes(child.path))

0 commit comments

Comments
 (0)