pub struct EventService<'a, N>where
N: AztecNode,{ /* private fields */ }Expand description
Service for validating and storing private events.
Matches the TS EventService — validates that events exist in the
transaction’s nullifier set (via siloed event commitment) and stores
them in the PrivateEventStore with proper metadata.
Implementations§
Source§impl<'a, N> EventService<'a, N>where
N: AztecNode,
impl<'a, N> EventService<'a, N>where
N: AztecNode,
pub fn new( node: &'a N, private_event_store: &'a PrivateEventStore, anchor_block_store: &'a AnchorBlockStore, ) -> EventService<'a, N>
Sourcepub async fn validate_and_store_event(
&self,
contract_address: &AztecAddress,
selector: &EventSelector,
randomness: Fr,
content: Vec<Fr>,
event_commitment: Fr,
tx_hash: TxHash,
scope: &AztecAddress,
) -> Result<(), Error>
pub async fn validate_and_store_event( &self, contract_address: &AztecAddress, selector: &EventSelector, randomness: Fr, content: Vec<Fr>, event_commitment: Fr, tx_hash: TxHash, scope: &AztecAddress, ) -> Result<(), Error>
Validate and store a private event.
Validates:
- The tx effect exists and is at or before the anchor block
- The siloed event commitment is present as a nullifier in the tx
Then stores the event in the PrivateEventStore with full metadata (block hash, tx index in block, event index in tx).
Sourcepub async fn get_private_events(
&self,
event_selector: &EventSelector,
filter: &PrivateEventQueryFilter,
) -> Result<Vec<StoredPrivateEvent>, Error>
pub async fn get_private_events( &self, event_selector: &EventSelector, filter: &PrivateEventQueryFilter, ) -> Result<Vec<StoredPrivateEvent>, Error>
Get private events for a contract and event selector.
Auto Trait Implementations§
impl<'a, N> Freeze for EventService<'a, N>
impl<'a, N> !RefUnwindSafe for EventService<'a, N>
impl<'a, N> Send for EventService<'a, N>
impl<'a, N> Sync for EventService<'a, N>
impl<'a, N> Unpin for EventService<'a, N>
impl<'a, N> !UnwindSafe for EventService<'a, N>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 more