コンテンツにスキップ

Merkle⚓︎

BranchNode ⚓︎

Bases: TreeNode

BranchNode

Branch node in a compact patricia tree.

calculate_hash() ⚓︎

BranchNode.calculate_hash

Calculates node hash.

LeafNode ⚓︎

Bases: TreeNode

LeafNode

Leaf node in a compact patricia tree.

calculate_hash() ⚓︎

LeafNode.calculate_hash

Calculates node hash.

MerkleHashBuilder ⚓︎

MerkleHashBuilder

Builder for creating a merkle hash.

__init__() ⚓︎

MerkleHashBuilder.__init__

Creates a merkle hash builder.

final() ⚓︎

MerkleHashBuilder.final

Calculates the merkle hash.

update(component_hash) ⚓︎

MerkleHashBuilder.update

Adds a hash to the merkle hash.

PatriciaMerkleProofResult ⚓︎

Bases: Enum

PatriciaMerkleProofResult

Possible results of a patricia merkle proof.

TreeNode ⚓︎

TreeNode

Node in a compact patricia tree.

hex_path property ⚓︎

TreeNode.hex_path

Gets hex representation of path.

prove_merkle(leaf_hash, merkle_path, root_hash) ⚓︎

Merkle.prove_merkle

Proves a merkle hash. Merkle hash chain path is ordered from leaf to root, where each element is MerklePart.

prove_patricia_merkle(encoded_key, value_to_test, merkle_path, state_hash, subcache_merkle_roots) ⚓︎

Merkle.prove_patricia_merkle

Proves a patricia merkle hash. Merkle node path is ordered from root to leaf, where each element is either BranchNode or LeafNode.