pub trait Store: Send + Sync {
Show 47 methods
// Required methods
fn get_current_timestamp(&self) -> Option<u64>;
fn get_transactions<'life0, 'async_trait>(
&'life0 self,
filter: TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
tx_update: TransactionStoreUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_input_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_output_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<OutputNoteRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_input_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
notes: &'life1 [InputNoteRecord],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_note_script<'life0, 'async_trait>(
&'life0 self,
script_root: Word,
) -> Pin<Box<dyn Future<Output = Result<NoteScript, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_note_scripts<'life0, 'life1, 'async_trait>(
&'life0 self,
note_scripts: &'life1 [NoteScript],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_block_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 BTreeSet<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_tracked_block_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_partial_blockchain_nodes<'life0, 'async_trait>(
&'life0 self,
filter: PartialBlockchainFilter,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<InOrderIndex, Word>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_partial_blockchain_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [(InOrderIndex, Word)],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_partial_blockchain_peaks_by_block_num<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<MmrPeaks, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
block_header: &'life1 BlockHeader,
partial_blockchain_peaks: MmrPeaks,
has_client_notes: bool,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn prune_irrelevant_blocks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_header<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_header_by_commitment<'life0, 'async_trait>(
&'life0 self,
account_commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountHeader>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
initial_address: Address,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn upsert_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
code: AccountCode,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<AccountId, AccountCode>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_addresses_by_account_id<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_account<'life0, 'life1, 'async_trait>(
&'life0 self,
new_account_state: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn insert_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_setting_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_note_tags<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<NoteTagRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_sync_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_state_sync<'life0, 'async_trait>(
&'life0 self,
state_sync_update: StateSyncUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_vault<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AssetVault, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account_storage<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
filter: AccountStorageFilter,
) -> Pin<Box<dyn Future<Output = Result<AccountStorage, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_minimal_partial_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn get_unspent_input_note_nullifiers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Nullifier>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_block_header_by_num<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_unique_note_tags<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeSet<NoteTag>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NoteTransportCursor, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn update_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
cursor: NoteTransportCursor,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_current_partial_mmr<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PartialMmr, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_account_asset<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
vault_key: AssetVaultKey,
) -> Pin<Box<dyn Future<Output = Result<Option<(Asset, AssetWitness)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_account_map_item<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
slot_name: StorageSlotName,
key: Word,
) -> Pin<Box<dyn Future<Output = Result<(Word, StorageMapWitness), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
The Store trait exposes all methods that the client store needs in order to track the
current state.
All update functions are implied to be atomic. That is, if multiple entities are meant to be updated as part of any single function and an error is returned during its execution, any changes that might have happened up to that point need to be rolled back and discarded.
Because the Store’s ownership is shared between the executor and the client, interior
mutability is expected to be implemented, which is why all methods receive &self and
not &mut self.
Required Methods§
Sourcefn get_current_timestamp(&self) -> Option<u64>
fn get_current_timestamp(&self) -> Option<u64>
Returns the current timestamp tracked by the store, measured in non-leap seconds since
Unix epoch. If the store implementation is incapable of tracking time, it should return
None.
This method is used to add time metadata to notes’ states. This information doesn’t have a functional impact on the client’s operation, it’s shown to the user for informational purposes.
Sourcefn get_transactions<'life0, 'async_trait>(
&'life0 self,
filter: TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transactions<'life0, 'async_trait>(
&'life0 self,
filter: TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves stored transactions, filtered by TransactionFilter.
Sourcefn apply_transaction<'life0, 'async_trait>(
&'life0 self,
tx_update: TransactionStoreUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
tx_update: TransactionStoreUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Applies a transaction, atomically updating the current state based on the
TransactionStoreUpdate.
An update involves:
- Updating the stored account which is being modified by the transaction.
- Storing new input/output notes and payback note details as a result of the transaction execution.
- Updating the input notes that are being processed by the transaction.
- Inserting the new tracked tags into the store.
- Inserting the transaction into the store to track.
Sourcefn get_input_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_input_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the input notes from the store.
Sourcefn get_output_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<OutputNoteRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_output_notes<'life0, 'async_trait>(
&'life0 self,
filter: NoteFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<OutputNoteRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the output notes from the store.
Sourcefn upsert_input_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
notes: &'life1 [InputNoteRecord],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_input_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
notes: &'life1 [InputNoteRecord],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inserts the provided input notes into the database. If a note with the same ID already exists, it will be replaced.
Sourcefn get_note_script<'life0, 'async_trait>(
&'life0 self,
script_root: Word,
) -> Pin<Box<dyn Future<Output = Result<NoteScript, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_script<'life0, 'async_trait>(
&'life0 self,
script_root: Word,
) -> Pin<Box<dyn Future<Output = Result<NoteScript, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the note script associated with the given root.
Sourcefn upsert_note_scripts<'life0, 'life1, 'async_trait>(
&'life0 self,
note_scripts: &'life1 [NoteScript],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_note_scripts<'life0, 'life1, 'async_trait>(
&'life0 self,
note_scripts: &'life1 [NoteScript],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inserts the provided note scripts into the database. If a script with the same root already exists, it will be replaced.
Sourcefn get_block_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 BTreeSet<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_block_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 BTreeSet<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a vector of BlockHeaders filtered by the provided block numbers.
The returned vector may not contain some or all of the requested block headers. It’s up to the callee to check whether all requested block headers were found.
For each block header an additional boolean value is returned representing whether the block contains notes relevant to the client.
Sourcefn get_tracked_block_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tracked_block_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a list of BlockHeader that include relevant notes to the client.
Sourcefn get_partial_blockchain_nodes<'life0, 'async_trait>(
&'life0 self,
filter: PartialBlockchainFilter,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<InOrderIndex, Word>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_partial_blockchain_nodes<'life0, 'async_trait>(
&'life0 self,
filter: PartialBlockchainFilter,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<InOrderIndex, Word>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves all MMR authentication nodes based on PartialBlockchainFilter.
Sourcefn insert_partial_blockchain_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [(InOrderIndex, Word)],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_partial_blockchain_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
nodes: &'life1 [(InOrderIndex, Word)],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inserts blockchain MMR authentication nodes.
In the case where the InOrderIndex already exists on the table, the insertion is
ignored.
Sourcefn get_partial_blockchain_peaks_by_block_num<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<MmrPeaks, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_partial_blockchain_peaks_by_block_num<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<MmrPeaks, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns peaks information from the blockchain by a specific block number.
If there is no partial blockchain info stored for the provided block returns an empty
MmrPeaks.
Sourcefn insert_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
block_header: &'life1 BlockHeader,
partial_blockchain_peaks: MmrPeaks,
has_client_notes: bool,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
block_header: &'life1 BlockHeader,
partial_blockchain_peaks: MmrPeaks,
has_client_notes: bool,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inserts a block header into the store, alongside peaks information at the block’s height.
has_client_notes describes whether the block has relevant notes to the client; this means
the client might want to authenticate merkle paths based on this value.
If the block header exists and has_client_notes is true then the has_client_notes
column is updated to true to signify that the block now contains a relevant note.
Sourcefn prune_irrelevant_blocks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune_irrelevant_blocks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes block headers that do not contain any client notes and aren’t the genesis or last block.
Sourcefn get_account_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the account IDs of all accounts stored in the database.
Sourcefn get_account_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a list of AccountHeader of all accounts stored in the database along with their
statuses.
Said accounts’ state is the state after the last performed sync.
Sourcefn get_account_header<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_header<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<(AccountHeader, AccountStatus)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves an AccountHeader object for the specified AccountId along with its status.
Returns None if the account is not found.
Said account’s state is the state according to the last sync performed.
Sourcefn get_account_header_by_commitment<'life0, 'async_trait>(
&'life0 self,
account_commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountHeader>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_header_by_commitment<'life0, 'async_trait>(
&'life0 self,
account_commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountHeader>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns an AccountHeader corresponding to the stored account state that matches the
given commitment. If no account state matches the provided commitment, None is returned.
Sourcefn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a full AccountRecord object, this contains the account’s latest state along
with its status. Returns None if the account is not found.
Sourcefn insert_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
initial_address: Address,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
initial_address: Address,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn upsert_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
code: AccountCode,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
code: AccountCode,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Upserts the account code for a foreign account. This value will be used as a cache of known
script roots and added to the GetForeignAccountCode request.
Sourcefn get_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<AccountId, AccountCode>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_foreign_account_code<'life0, 'async_trait>(
&'life0 self,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<AccountId, AccountCode>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the cached account code for various foreign accounts.
Sourcefn get_addresses_by_account_id<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_addresses_by_account_id<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves all Address objects that correspond to the provided account ID.
Sourcefn update_account<'life0, 'life1, 'async_trait>(
&'life0 self,
new_account_state: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_account<'life0, 'life1, 'async_trait>(
&'life0 self,
new_account_state: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn insert_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn remove_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_address<'life0, 'async_trait>(
&'life0 self,
address: Address,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds a value to the settings table.
Sourcefn get_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a value from the settings table.
Sourcefn remove_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_setting<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes a value from the settings table.
Sourcefn list_setting_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_setting_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns all the keys from the settings table.
Returns the note tag records that the client is interested in.
Sourcefn add_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds a note tag to the list of tags that the client is interested in.
If the tag was already being tracked, returns false since no new tags were actually added. Otherwise true.
Sourcefn remove_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_note_tag<'life0, 'async_trait>(
&'life0 self,
tag: NoteTagRecord,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes a note tag from the list of tags that the client is interested in.
If the tag wasn’t present in the store returns false since no tag was actually removed. Otherwise returns true.
Sourcefn get_sync_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_sync_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the block number of the last state sync block.
Sourcefn apply_state_sync<'life0, 'async_trait>(
&'life0 self,
state_sync_update: StateSyncUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_state_sync<'life0, 'async_trait>(
&'life0 self,
state_sync_update: StateSyncUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Applies the state sync update to the store. An update involves:
- Inserting the new block header to the store alongside new MMR peaks information.
- Updating the corresponding tracked input/output notes.
- Removing note tags that are no longer relevant.
- Updating transactions in the store, marking as
committedordiscarded.- In turn, validating private account’s state transitions. If a private account’s
commitment locally does not match the
StateSyncUpdateinformation, the account may be locked.
- In turn, validating private account’s state transitions. If a private account’s
commitment locally does not match the
- Storing new MMR authentication nodes.
- Updating the tracked public accounts.
Sourcefn get_account_vault<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AssetVault, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_vault<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AssetVault, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the asset vault for a specific account.
Sourcefn get_account_storage<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
filter: AccountStorageFilter,
) -> Pin<Box<dyn Future<Output = Result<AccountStorage, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_storage<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
filter: AccountStorageFilter,
) -> Pin<Box<dyn Future<Output = Result<AccountStorage, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the storage for a specific account.
Can take an optional map root to retrieve only part of the storage, If it does, it will either return an account storage with a single slot (the one requested), or an error if not found.
Sourcefn get_minimal_partial_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_minimal_partial_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves an AccountRecord object, this contains the account’s latest partial
state along with its status. Returns None if the partial account is not found.
Provided Methods§
Sourcefn get_unspent_input_note_nullifiers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Nullifier>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_unspent_input_note_nullifiers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Nullifier>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the nullifiers of all unspent input notes.
The default implementation of this method uses Store::get_input_notes.
Sourcefn get_block_header_by_num<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_header_by_num<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHeader, BlockRelevance)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a BlockHeader corresponding to the provided block number and a boolean value
that represents whether the block contains notes relevant to the client. Returns None if
the block is not found.
The default implementation of this method uses Store::get_block_headers.
Returns the unique note tags (without source) that the client is interested in.
Sourcefn get_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NoteTransportCursor, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NoteTransportCursor, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the note transport cursor.
This is used to reduce the number of fetched notes from the note transport network.
Sourcefn update_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
cursor: NoteTransportCursor,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_note_transport_cursor<'life0, 'async_trait>(
&'life0 self,
cursor: NoteTransportCursor,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates the note transport cursor.
This is used to track the last cursor position when fetching notes from the note transport network.
Sourcefn get_current_partial_mmr<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PartialMmr, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_partial_mmr<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PartialMmr, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Builds the current view of the chain’s PartialMmr. Because we want to add all new
authentication nodes that could come from applying the MMR updates, we need to track all
known leaves thus far.
The default implementation is based on Store::get_partial_blockchain_nodes,
Store::get_partial_blockchain_peaks_by_block_num and Store::get_block_header_by_num
Sourcefn get_account_asset<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
vault_key: AssetVaultKey,
) -> Pin<Box<dyn Future<Output = Result<Option<(Asset, AssetWitness)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_asset<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
vault_key: AssetVaultKey,
) -> Pin<Box<dyn Future<Output = Result<Option<(Asset, AssetWitness)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a specific asset (by vault key) from the account’s vault along with its Merkle witness.
The default implementation of this method uses Store::get_account_vault.
Sourcefn get_account_map_item<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
slot_name: StorageSlotName,
key: Word,
) -> Pin<Box<dyn Future<Output = Result<(Word, StorageMapWitness), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_map_item<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
slot_name: StorageSlotName,
key: Word,
) -> Pin<Box<dyn Future<Output = Result<(Word, StorageMapWitness), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a specific item from the account’s storage map along with its Merkle proof.
The default implementation of this method uses Store::get_account_storage.