pub struct CardanoBlocksProofs {
pub certificate_hash: String,
pub certified_blocks: Option<MkSetProofMessagePart<CardanoBlockMessagePart>>,
pub non_certified_blocks: Vec<String>,
pub latest_block_number: BlockNumber,
pub security_parameter: BlockNumberOffset,
}unstable only.Expand description
A cryptographic proof for a set of Cardano blocks
Fields§
§certificate_hash: StringHash of the certificate that validates this proof Merkle root
certified_blocks: Option<MkSetProofMessagePart<CardanoBlockMessagePart>>Blocks that have been certified
non_certified_blocks: Vec<String>Hashes of the blocks that could not be certified
latest_block_number: BlockNumberLatest block number that has been certified by the associated Mithril certificate
security_parameter: BlockNumberOffsetSecurity parameter that has been certified by the associated Mithril certificate
Implementations§
Source§impl CardanoBlocksProofsMessage
impl CardanoBlocksProofsMessage
Sourcepub fn blocks_hashes(&self) -> Vec<String>
pub fn blocks_hashes(&self) -> Vec<String>
Hashes of the Cardano blocks that have been certified
Source§impl CardanoBlocksProofsMessage
impl CardanoBlocksProofsMessage
Sourcepub fn new(
certificate_hash: &str,
certified_blocks: Option<MkSetProofMessagePart<CardanoBlockMessagePart>>,
non_certified_blocks: Vec<String>,
latest_block_number: BlockNumber,
security_parameter: BlockNumberOffset,
) -> CardanoBlocksProofsMessage
pub fn new( certificate_hash: &str, certified_blocks: Option<MkSetProofMessagePart<CardanoBlockMessagePart>>, non_certified_blocks: Vec<String>, latest_block_number: BlockNumber, security_parameter: BlockNumberOffset, ) -> CardanoBlocksProofsMessage
Create a new ProofsV2CardanoBlocksMessage
Sourcepub fn verify(&self) -> Result<VerifiedCardanoBlocks, VerifyProofsV2Error>
pub fn verify(&self) -> Result<VerifiedCardanoBlocks, VerifyProofsV2Error>
Verify that all the certified blocks proofs are valid
The following checks will be executed:
1 - Check that each Merkle proof is valid
2 - Check that all proofs share the same Merkle root
3 - Assert that there’s at least one certified block
If every check is okay, the hex encoded Merkle root of the proof will be returned.
Trait Implementations§
Source§impl Clone for CardanoBlocksProofsMessage
impl Clone for CardanoBlocksProofsMessage
Source§fn clone(&self) -> CardanoBlocksProofsMessage
fn clone(&self) -> CardanoBlocksProofsMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CardanoBlocksProofsMessage
impl Debug for CardanoBlocksProofsMessage
Source§impl<'de> Deserialize<'de> for CardanoBlocksProofsMessage
impl<'de> Deserialize<'de> for CardanoBlocksProofsMessage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CardanoBlocksProofsMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CardanoBlocksProofsMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Dummy for CardanoBlocksProofsMessage
impl Dummy for CardanoBlocksProofsMessage
Source§fn dummy() -> CardanoBlocksProofsMessage
fn dummy() -> CardanoBlocksProofsMessage
Return a dummy CardanoBlocksProofsMessage (test-only).
Source§impl Serialize for CardanoBlocksProofsMessage
impl Serialize for CardanoBlocksProofsMessage
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,
impl StructuralPartialEq for CardanoBlocksProofsMessage
Auto Trait Implementations§
impl Freeze for CardanoBlocksProofsMessage
impl RefUnwindSafe for CardanoBlocksProofsMessage
impl Send for CardanoBlocksProofsMessage
impl Sync for CardanoBlocksProofsMessage
impl Unpin for CardanoBlocksProofsMessage
impl UnsafeUnpin for CardanoBlocksProofsMessage
impl UnwindSafe for CardanoBlocksProofsMessage
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more