pub struct StateProof {
pub header: StateProofHeader,
pub body: StateProofBody,
}Expand description
Complete state proof structure
Fields§
§header: StateProofHeader§body: StateProofBodyImplementations§
Source§impl StateProof
impl StateProof
Sourcepub fn new(header: StateProofHeader, body: StateProofBody) -> Self
pub fn new(header: StateProofHeader, body: StateProofBody) -> Self
Create a new state proof
Sourcepub fn zero_creation(slot: u64) -> Self
pub fn zero_creation(slot: u64) -> Self
Create a zeroed creation state proof
Sourcepub fn existing(
slot: u64,
path_bitset: TnHash,
sibling_hashes: Vec<TnHash>,
) -> Self
pub fn existing( slot: u64, path_bitset: TnHash, sibling_hashes: Vec<TnHash>, ) -> Self
Create an existing state proof
Sourcepub fn updating(
slot: u64,
path_bitset: TnHash,
existing_leaf_hash: TnHash,
sibling_hashes: Vec<TnHash>,
) -> Self
pub fn updating( slot: u64, path_bitset: TnHash, existing_leaf_hash: TnHash, sibling_hashes: Vec<TnHash>, ) -> Self
Create an updating state proof
Sourcepub fn creation(
slot: u64,
path_bitset: TnHash,
existing_leaf_pubkey: TnPubkey,
existing_leaf_hash: TnHash,
sibling_hashes: Vec<TnHash>,
) -> Self
pub fn creation( slot: u64, path_bitset: TnHash, existing_leaf_pubkey: TnPubkey, existing_leaf_hash: TnHash, sibling_hashes: Vec<TnHash>, ) -> Self
Create a creation state proof
Sourcepub fn footprint_from_counts(
proof_type: StateProofType,
sibling_hash_count: usize,
) -> usize
pub fn footprint_from_counts( proof_type: StateProofType, sibling_hash_count: usize, ) -> usize
Calculate footprint from proof type and sibling hash count
Sourcepub fn footprint_from_header(header: &StateProofHeader) -> usize
pub fn footprint_from_header(header: &StateProofHeader) -> usize
Calculate footprint from path bitset (count set bits for sibling hashes)
Sourcepub fn proof_type(&self) -> StateProofType
pub fn proof_type(&self) -> StateProofType
Get the proof type
Sourcepub fn path_bitset(&self) -> &TnHash
pub fn path_bitset(&self) -> &TnHash
Get the path bitset
Trait Implementations§
Source§impl Clone for StateProof
impl Clone for StateProof
Source§fn clone(&self) -> StateProof
fn clone(&self) -> StateProof
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 moreAuto Trait Implementations§
impl Freeze for StateProof
impl RefUnwindSafe for StateProof
impl Send for StateProof
impl Sync for StateProof
impl Unpin for StateProof
impl UnwindSafe for StateProof
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