@ethereumjs/mpt / WalkController
Defined in: packages/mpt/src/util/walkController.ts:11
WalkController is an interface to control how the trie is being traversed.
readonly
onNode:FoundNodeFunction
Defined in: packages/mpt/src/util/walkController.ts:12
readonly
taskExecutor:PrioritizedTaskExecutor
Defined in: packages/mpt/src/util/walkController.ts:13
readonly
trie:MerklePatriciaTrie
Defined in: packages/mpt/src/util/walkController.ts:14
allChildren(
node
,key
):void
Defined in: packages/mpt/src/util/walkController.ts:69
Run all children of a node. Priority of these nodes are the key length of the children.
Node to get all children of and call onNode on.
Nibbles
= []
The current key
which would yield the node
when trying to get this node with a get
operation.
void
onlyBranchIndex(
node
,key
,childIndex
,priority?
):void
Defined in: packages/mpt/src/util/walkController.ts:120
Push a branch of a certain BranchMPTNode to the event queue.
The node to select a branch on. Should be a BranchMPTNode.
Nibbles
= []
The current key which leads to the corresponding node.
number
The child index to add to the event queue.
number
Optional priority of the event, defaults to the total key length.
void
pushNodeToQueue(
nodeRef
,key
,priority?
):void
Defined in: packages/mpt/src/util/walkController.ts:97
Push a node to the queue. If the queue has places left for tasks, the node is executed immediately, otherwise it is queued.
Uint8Array
Push a node reference to the event queue. This reference is a 32-byte keccak hash of the value corresponding to the key
.
Nibbles
= []
The current key.
number
Optional priority, defaults to key length
void
static
newWalk(onNode
,trie
,root
,poolSize?
):Promise
<void
>
Defined in: packages/mpt/src/util/walkController.ts:39
Async function to create and start a new walk over a trie.
The `FoundNodeFunction to call if a node is found.
The trie to walk on.
Uint8Array
The root key to walk on.
number
Task execution pool size to prevent OOM errors. Defaults to 500.
Promise
<void
>