pub struct EventWithProof<T> {
pub transaction_version: u64,
pub event_index: u64,
pub event: ContractEvent,
pub proof: EventProof<T>,
}Fields§
§transaction_version: u64§event_index: u64§event: ContractEvent§proof: EventProof<T>Implementations§
Source§impl<T: TransactionInfoTrait> EventWithProof<T>
impl<T: TransactionInfoTrait> EventWithProof<T>
Sourcepub fn new(
transaction_version: Version,
event_index: u64,
event: ContractEvent,
proof: EventProof<T>,
) -> Self
pub fn new( transaction_version: Version, event_index: u64, event: ContractEvent, proof: EventProof<T>, ) -> Self
Constructor.
Sourcepub fn verify(
&self,
ledger_info: &LedgerInfo,
event_key: &EventKey,
sequence_number: u64,
transaction_version: Version,
event_index: u64,
) -> Result<()>
pub fn verify( &self, ledger_info: &LedgerInfo, event_key: &EventKey, sequence_number: u64, transaction_version: Version, event_index: u64, ) -> Result<()>
Verifies the event with the proof, both carried by self.
Two things are ensured if no error is raised:
- This event exists in the ledger represented by
ledger_info. - And this event has the same
event_key,sequence_number,transaction_version, andevent_indexas indicated in the parameter list. If any of these parameter is unknown to the call site and is supposed to be informed by this struct, get it from the struct itself, such as:event_with_proof.event.access_path(),event_with_proof.event_index(), etc.
Trait Implementations§
Source§impl<T: Clone> Clone for EventWithProof<T>
impl<T: Clone> Clone for EventWithProof<T>
Source§fn clone(&self) -> EventWithProof<T>
fn clone(&self) -> EventWithProof<T>
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<T: Debug> Debug for EventWithProof<T>
impl<T: Debug> Debug for EventWithProof<T>
Source§impl<'de, T> Deserialize<'de> for EventWithProof<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for EventWithProof<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: TransactionInfoTrait> Display for EventWithProof<T>
impl<T: TransactionInfoTrait> Display for EventWithProof<T>
impl<T: Eq> Eq for EventWithProof<T>
Source§impl<T: PartialEq> PartialEq for EventWithProof<T>
impl<T: PartialEq> PartialEq for EventWithProof<T>
Source§impl<T> Serialize for EventWithProof<T>where
T: Serialize,
impl<T> Serialize for EventWithProof<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for EventWithProof<T>
Auto Trait Implementations§
impl<T> Freeze for EventWithProof<T>where
T: Freeze,
impl<T> RefUnwindSafe for EventWithProof<T>where
T: RefUnwindSafe,
impl<T> Send for EventWithProof<T>where
T: Send,
impl<T> Sync for EventWithProof<T>where
T: Sync,
impl<T> Unpin for EventWithProof<T>where
T: Unpin,
impl<T> UnsafeUnpin for EventWithProof<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EventWithProof<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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>
Converts
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>
Converts
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TestOnlyHash for T
impl<T> TestOnlyHash for T
Source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.