ethereumjs-monorepo

@ethereumjs/mpt


@ethereumjs/mpt / updateMPTFromMerkleProof

Function: updateMPTFromMerkleProof()

updateMPTFromMerkleProof(trie, proof, shouldVerifyRoot?): Promise<Uint8Array<ArrayBufferLike> | undefined>

Defined in: proof/proof.ts:55

Populate a trie from an EIP-1186 proof by batch-putting all proof nodes.

Parameters

trie

MerklePatriciaTrie

Trie to update (typically empty or sparse)

proof

Proof

Serialized nodes from root to leaf

shouldVerifyRoot?

boolean = false

When true, require the first proof node’s hash to match trie.root()

Returns

Promise<Uint8Array<ArrayBufferLike> | undefined>

Root hash derived from the first proof node