Struct snarkvm_debug::prelude::store::TransactionStore
pub struct TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,{ /* private fields */ }Expand description
The transaction store.
Implementations§
§impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
pub fn open(
transition_store: TransitionStore<N, <T as TransactionStorage<N>>::TransitionStorage>
) -> Result<TransactionStore<N, T>, Error>
pub fn open( transition_store: TransitionStore<N, <T as TransactionStorage<N>>::TransitionStorage> ) -> Result<TransactionStore<N, T>, Error>
Initializes the transaction store.
pub fn from(storage: T) -> TransactionStore<N, T>
pub fn from(storage: T) -> TransactionStore<N, T>
Initializes a transaction store from storage.
pub fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
pub fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
Stores the given transaction into storage.
pub fn remove(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<(), Error>
pub fn remove( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<(), Error>
Removes the transaction for the given transaction ID.
pub fn deployment_store(
&self
) -> &DeploymentStore<N, <T as TransactionStorage<N>>::DeploymentStorage>
pub fn deployment_store( &self ) -> &DeploymentStore<N, <T as TransactionStorage<N>>::DeploymentStorage>
Returns the deployment store.
pub fn transition_store(
&self
) -> &TransitionStore<N, <T as TransactionStorage<N>>::TransitionStorage>
pub fn transition_store( &self ) -> &TransitionStore<N, <T as TransactionStorage<N>>::TransitionStorage>
Returns the transition store.
pub fn start_atomic(&self)
pub fn start_atomic(&self)
Starts an atomic batch write operation.
pub fn is_atomic_in_progress(&self) -> bool
pub fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
pub fn atomic_checkpoint(&self)
pub fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
pub fn clear_latest_checkpoint(&self)
pub fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
pub fn atomic_rewind(&self)
pub fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
pub fn abort_atomic(&self)
pub fn abort_atomic(&self)
Aborts an atomic batch write operation.
pub fn finish_atomic(&self) -> Result<(), Error>
pub fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
§impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
pub fn get_transaction(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<Transaction<N>>, Error>
pub fn get_transaction( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<Transaction<N>>, Error>
Returns the transaction for the given transaction ID.
pub fn get_deployment(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<Deployment<N>>, Error>
pub fn get_deployment( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<Deployment<N>>, Error>
Returns the deployment for the given transaction ID.
pub fn get_execution(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<Execution<N>>, Error>
pub fn get_execution( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<Execution<N>>, Error>
Returns the execution for the given transaction ID.
pub fn get_edition(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<u16>, Error>
pub fn get_edition( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<u16>, Error>
Returns the edition for the given transaction ID.
pub fn get_program_id(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<ProgramID<N>>, Error>
pub fn get_program_id( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<ProgramID<N>>, Error>
Returns the program ID for the given transaction ID.
pub fn get_program(
&self,
program_id: &ProgramID<N>
) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error>
pub fn get_program( &self, program_id: &ProgramID<N> ) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error>
Returns the program for the given program ID.
pub fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<VerifyingKey<N>>, Error>
pub fn get_verifying_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N> ) -> Result<Option<VerifyingKey<N>>, Error>
Returns the verifying key for the given (program ID, function name).
pub fn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<Certificate<N>>, Error>
pub fn get_certificate( &self, program_id: &ProgramID<N>, function_name: &Identifier<N> ) -> Result<Option<Certificate<N>>, Error>
Returns the certificate for the given (program ID, function name).
§impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
pub fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<Option<<N as Network>::TransactionID>, Error>
pub fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N> ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that contains the given program ID.
pub fn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID
) -> Result<Option<<N as Network>::TransactionID>, Error>
pub fn find_transaction_id_from_transition_id( &self, transition_id: &<N as Network>::TransitionID ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that contains the given transition ID.
§impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
pub fn contains_transaction_id(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<bool, Error>
pub fn contains_transaction_id( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<bool, Error>
Returns true if the given transaction ID exists.
pub fn contains_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<bool, Error>
pub fn contains_program_id( &self, program_id: &ProgramID<N> ) -> Result<bool, Error>
Returns true if the given program ID exists.
§impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
impl<N, T> TransactionStore<N, T>where
N: Network,
T: TransactionStorage<N>,
pub fn transaction_ids(
&self
) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
pub fn transaction_ids( &self ) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
Returns an iterator over the transaction IDs, for all transactions.
pub fn deployment_transaction_ids(
&self
) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
pub fn deployment_transaction_ids( &self ) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
Returns an iterator over the deployment transaction IDs, for all deployments.
pub fn execution_transaction_ids(
&self
) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
pub fn execution_transaction_ids( &self ) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
Returns an iterator over the execution transaction IDs, for all executions.
pub fn program_ids(&self) -> impl Iterator<Item = Cow<'_, ProgramID<N>>>
pub fn program_ids(&self) -> impl Iterator<Item = Cow<'_, ProgramID<N>>>
Returns an iterator over the program IDs, for all deployments.
pub fn programs(
&self
) -> impl Iterator<Item = Cow<'_, ProgramCore<N, Instruction<N>, Command<N>>>>
pub fn programs( &self ) -> impl Iterator<Item = Cow<'_, ProgramCore<N, Instruction<N>, Command<N>>>>
Returns an iterator over the programs, for all deployments.
pub fn verifying_keys(
&self
) -> impl Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, VerifyingKey<N>>)>
pub fn verifying_keys( &self ) -> impl Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, VerifyingKey<N>>)>
Returns an iterator over the ((program ID, function name, edition), verifying key), for all deployments.
pub fn certificates(
&self
) -> impl Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, Certificate<N>>)>
pub fn certificates( &self ) -> impl Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, Certificate<N>>)>
Returns an iterator over the ((program ID, function name, edition), certificate), for all deployments.
Trait Implementations§
§impl<N, T> Clone for TransactionStore<N, T>where
N: Clone + Network,
T: Clone + TransactionStorage<N>,
<T as TransactionStorage<N>>::IDMap: Clone,
impl<N, T> Clone for TransactionStore<N, T>where
N: Clone + Network,
T: Clone + TransactionStorage<N>,
<T as TransactionStorage<N>>::IDMap: Clone,
§fn clone(&self) -> TransactionStore<N, T>
fn clone(&self) -> TransactionStore<N, T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more