MCPcopy Create free account
hub / github.com/BitVM/BitVM / root

Method root

final-spv/src/merkle_tree.rs:81–83  ·  view source on GitHub ↗

Returns the Merkle root

(&self)

Source from the content-addressed store, hash-verified

79
80 // Returns the Merkle root
81 pub fn root(&self) -> [u8; 32] {
82 self.nodes[self.nodes.len() - 1][0]
83 }
84
85 /// Constructs a "mid-state" Merkle tree, designed for generating secure SPV (Simplified Payment Verification) proofs.
86 /// This structure, when used with the corresponding `calculate_root_with_merkle_proof` (or `BlockInclusionProof::get_root`) method,

Callers 2

test_merkle_tree_0Function · 0.80
test_merkle_tree_1Function · 0.80

Calls 1

lenMethod · 0.80

Tested by 2

test_merkle_tree_0Function · 0.64
test_merkle_tree_1Function · 0.64