File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
public/content/developers/docs/data-structures-and-encoding/patricia-merkle-trie Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,10 @@ Examples:
137
137
Here is the extended code for getting a node in the Merkle Patricia trie:
138
138
139
139
```
140
- def get_helper(node ,path):
141
- if path == []: return node
142
- if node = '': return ''
143
- curnode = rlp.decode(node if len(node ) < 32 else db.get(node ))
140
+ def get_helper(node_hash ,path):
141
+ if path == []: return node_hash
142
+ if node_hash = = '': return ''
143
+ curnode = rlp.decode(node_hash if len(node_hash ) < 32 else db.get(node_hash ))
144
144
if len(curnode) == 2:
145
145
(k2, v2) = curnode
146
146
k2 = compact_decode(k2)
@@ -151,13 +151,13 @@ Here is the extended code for getting a node in the Merkle Patricia trie:
151
151
elif len(curnode) == 17:
152
152
return get_helper(curnode[path[0]],path[1:])
153
153
154
- def get(node ,path):
154
+ def get(node_hash ,path):
155
155
path2 = []
156
156
for i in range(len(path)):
157
157
path2.push(int(ord(path[i]) / 16))
158
158
path2.push(ord(path[i]) % 16)
159
159
path2.push(16)
160
- return get_helper(node ,path2)
160
+ return get_helper(node_hash ,path2)
161
161
```
162
162
163
163
### Example Trie {#example-trie}
You can’t perform that action at this time.
0 commit comments