Struct simperby_core::merkle_tree::OneshotMerkleTree
source · pub struct OneshotMerkleTree { /* private fields */ }Expand description
A Merkle tree that is created once but never modified.
This is useful for per-block data such as transaction lists.
Implementations§
source§impl OneshotMerkleTree
impl OneshotMerkleTree
pub const EMPTY_HASH: Hash256 = _
sourcepub fn create_merkle_proof(&self, key: Hash256) -> Option<MerkleProof>
pub fn create_merkle_proof(&self, key: Hash256) -> Option<MerkleProof>
Creates a Merkle proof for a given data in the tree.
Returns None if the data is not in the tree.
Given a tree [[1, 2, 3], [4, 5], [6]], Merkle proof for 2 is [1, 5] and Merkle proof for 3 is [OnlyChild, 4].
For LeftChild and RightChild, pair hash of the sibling node is given.
For OnlyChild, only the instruction is given.
Auto Trait Implementations§
impl RefUnwindSafe for OneshotMerkleTree
impl Send for OneshotMerkleTree
impl Sync for OneshotMerkleTree
impl Unpin for OneshotMerkleTree
impl UnwindSafe for OneshotMerkleTree
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