pub fn generate_seal_proof(
seal_tree: &SealMerkleTree,
payment_root: [u8; 32],
) -> Option<SealProof>
Expand description
Generate a seal proof for a payment root.
This is a convenience function that generates a seal proof for a payment root from a seal merkle tree.
§Parameters
seal_tree
: Seal merkle treepayment_root
: Payment root to generate proof for
§Returns
Some(SealProof)
if payment root is foundNone
if payment root is not in the tree
§Example
use miracle_api::sdk::{create_seal_merkle_tree_from_roots, generate_seal_proof};
let payment_roots = vec![[1u8; 32], [2u8; 32]];
let seal_tree = create_seal_merkle_tree_from_roots(payment_roots);
let seal_proof = generate_seal_proof(&seal_tree, [1u8; 32]);
assert!(seal_proof.is_some());