pub struct CompiledMerkleProof(pub Vec<u8>);
Expand description
An structure optimized for verify merkle proof
Tuple Fields§
§0: Vec<u8>
Implementations§
Source§impl CompiledMerkleProof
impl CompiledMerkleProof
Sourcepub fn extract_proof<H: Hasher + Default>(
&self,
all_leaves: Vec<(H256, H256, bool)>,
) -> Result<CompiledMerkleProof>
pub fn extract_proof<H: Hasher + Default>( &self, all_leaves: Vec<(H256, H256, bool)>, ) -> Result<CompiledMerkleProof>
Extract sub compiled proof for certain sub leaves from current compiled proof.
The argument must include all leaves. The 3rd item of every tuple indicate if the sub key is selected.
pub fn compute_root<H: Hasher + Default>( &self, leaves: Vec<(H256, H256)>, ) -> Result<H256>
pub fn verify<H: Hasher + Default>( &self, root: &H256, leaves: Vec<(H256, H256)>, ) -> Result<bool>
Trait Implementations§
Source§impl Clone for CompiledMerkleProof
impl Clone for CompiledMerkleProof
Source§fn clone(&self) -> CompiledMerkleProof
fn clone(&self) -> CompiledMerkleProof
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CompiledMerkleProof
impl Debug for CompiledMerkleProof
Auto Trait Implementations§
impl Freeze for CompiledMerkleProof
impl RefUnwindSafe for CompiledMerkleProof
impl Send for CompiledMerkleProof
impl Sync for CompiledMerkleProof
impl Unpin for CompiledMerkleProof
impl UnwindSafe for CompiledMerkleProof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more