pub struct ConsistencyProof {
pub old_size: u64,
pub new_size: u64,
pub old_root: MerkleHash,
pub new_root: MerkleHash,
pub hashes: Vec<MerkleHash>,
}Expand description
Merkle consistency proof between two tree sizes.
Proves that the tree at old_size is a prefix of the tree at new_size.
Args:
old_size— Earlier tree size.new_size— Later tree size.old_root— Root atold_size.new_root— Root atnew_size.hashes— Consistency proof hashes.
Usage:
ⓘ
let proof = ConsistencyProof { old_size: 8, new_size: 16, .. };
proof.verify()?;Fields§
§old_size: u64§new_size: u64§old_root: MerkleHash§new_root: MerkleHash§hashes: Vec<MerkleHash>Implementations§
Source§impl ConsistencyProof
impl ConsistencyProof
Sourcepub fn verify(&self) -> Result<(), TransparencyError>
pub fn verify(&self) -> Result<(), TransparencyError>
Verify that the old tree is a prefix of the new tree.
Trait Implementations§
Source§impl Clone for ConsistencyProof
impl Clone for ConsistencyProof
Source§fn clone(&self) -> ConsistencyProof
fn clone(&self) -> ConsistencyProof
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConsistencyProof
impl Debug for ConsistencyProof
Source§impl<'de> Deserialize<'de> for ConsistencyProof
impl<'de> Deserialize<'de> for ConsistencyProof
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConsistencyProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConsistencyProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConsistencyProof
impl PartialEq for ConsistencyProof
Source§impl Serialize for ConsistencyProof
impl Serialize for ConsistencyProof
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ConsistencyProof
Auto Trait Implementations§
impl Freeze for ConsistencyProof
impl RefUnwindSafe for ConsistencyProof
impl Send for ConsistencyProof
impl Sync for ConsistencyProof
impl Unpin for ConsistencyProof
impl UnsafeUnpin for ConsistencyProof
impl UnwindSafe for ConsistencyProof
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