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

Method append

header-chain/src/mmr_native.rs:21–24  ·  view source on GitHub ↗

Appends a new leaf to the MMR.

(&mut self, leaf: [u8; 32])

Source from the content-addressed store, hash-verified

19
20 /// Appends a new leaf to the MMR.
21 pub fn append(&mut self, leaf: [u8; 32]) {
22 self.nodes[0].push(leaf);
23 self.recalculate_peaks();
24 }
25
26 /// Recalculates peaks based on the current leaves.
27 fn recalculate_peaks(&mut self) {

Callers 3

test_mmr_native_fail_1Function · 0.45
test_mmr_nativeFunction · 0.45
test_mmr_crosscheckFunction · 0.45

Calls 2

recalculate_peaksMethod · 0.80
pushMethod · 0.45

Tested by 3

test_mmr_native_fail_1Function · 0.36
test_mmr_nativeFunction · 0.36
test_mmr_crosscheckFunction · 0.36