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

Method verify

final-spv/src/spv.rs:30–38  ·  view source on GitHub ↗
(&self, mmr_guest: MMRGuest)

Source from the content-addressed store, hash-verified

28 }
29
30 pub fn verify(&self, mmr_guest: MMRGuest) -> bool {
31 let txid: [u8; 32] = self.transaction.txid();
32 println!("txid: {:?}", txid);
33 let block_merkle_root = self.block_inclusion_proof.get_root(txid);
34 println!("block_merkle_root: {:?}", block_merkle_root);
35 assert_eq!(block_merkle_root, self.block_header.merkle_root);
36 let block_hash = self.block_header.compute_block_hash();
37 mmr_guest.verify_proof(block_hash, &self.mmr_inclusion_proof)
38 }
39}
40
41#[cfg(test)]

Callers 2

verify_schnorr_signatureFunction · 0.45
final_circuitFunction · 0.45

Calls 4

txidMethod · 0.80
get_rootMethod · 0.80
compute_block_hashMethod · 0.80
verify_proofMethod · 0.45

Tested by

no test coverage detected