pub struct NoteStore { /* private fields */ }Expand description
Stores discovered notes indexed by siloed nullifier (unique key).
Phase 2 enhanced version with:
- Scope-based access control
- Nullification with block number tracking
- Status filtering (Active/Nullified/Both)
- Rollback support for chain reorgs
- Batch note addition
Implementations§
Source§impl NoteStore
impl NoteStore
pub fn new(kv: Arc<dyn KvStore>) -> NoteStore
Sourcepub async fn add_notes(
&self,
notes: &[StoredNote],
scope: &AztecAddress,
) -> Result<(), Error>
pub async fn add_notes( &self, notes: &[StoredNote], scope: &AztecAddress, ) -> Result<(), Error>
Add multiple notes at once.
Sourcepub async fn add_note(&self, note: &StoredNote) -> Result<(), Error>
pub async fn add_note(&self, note: &StoredNote) -> Result<(), Error>
Add a single discovered note (backward compatible).
Sourcepub async fn get_notes(
&self,
filter: &NoteFilter,
) -> Result<Vec<StoredNote>, Error>
pub async fn get_notes( &self, filter: &NoteFilter, ) -> Result<Vec<StoredNote>, Error>
Get notes matching a filter.
Sourcepub async fn get_notes_by_slot(
&self,
contract: &AztecAddress,
storage_slot: &Fr,
) -> Result<Vec<StoredNote>, Error>
pub async fn get_notes_by_slot( &self, contract: &AztecAddress, storage_slot: &Fr, ) -> Result<Vec<StoredNote>, Error>
Get notes for a contract and storage slot (backward compatible).
Sourcepub async fn apply_nullifiers(
&self,
nullifiers: &[(Fr, u64)],
) -> Result<(), Error>
pub async fn apply_nullifiers( &self, nullifiers: &[(Fr, u64)], ) -> Result<(), Error>
Apply nullifiers: mark notes as nullified with block number tracking.
Sourcepub async fn nullify_note(
&self,
contract: &AztecAddress,
storage_slot: &Fr,
note_hash: &Fr,
) -> Result<(), Error>
pub async fn nullify_note( &self, contract: &AztecAddress, storage_slot: &Fr, note_hash: &Fr, ) -> Result<(), Error>
Mark a note as nullified (backward compatible).
Auto Trait Implementations§
impl Freeze for NoteStore
impl !RefUnwindSafe for NoteStore
impl Send for NoteStore
impl Sync for NoteStore
impl Unpin for NoteStore
impl !UnwindSafe for NoteStore
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