pub trait TransactionStorage<N: Network>: Clone + Send + Sync {
type IDMap: for<'a> Map<'a, N::TransactionID, TransactionType>;
type DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>;
type ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>;
type FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>;
type TransitionStorage: TransitionStorage<N>;
Show 19 methods
// Required methods
fn open(
transition_store: TransitionStore<N, Self::TransitionStorage>
) -> Result<Self>;
fn id_map(&self) -> &Self::IDMap;
fn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>;
fn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>;
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>;
// Provided methods
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage> { ... }
fn dev(&self) -> Option<u16> { ... }
fn start_atomic(&self) { ... }
fn is_atomic_in_progress(&self) -> bool { ... }
fn atomic_checkpoint(&self) { ... }
fn clear_latest_checkpoint(&self) { ... }
fn atomic_rewind(&self) { ... }
fn abort_atomic(&self) { ... }
fn finish_atomic(&self) -> Result<()> { ... }
fn insert(&self, transaction: &Transaction<N>) -> Result<()> { ... }
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()> { ... }
fn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID
) -> Result<Option<N::TransactionID>> { ... }
fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<Option<N::TransactionID>> { ... }
fn get_transaction(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Transaction<N>>> { ... }
}
Expand description
A trait for transaction storage.
Required Associated Types§
sourcetype IDMap: for<'a> Map<'a, N::TransactionID, TransactionType>
type IDMap: for<'a> Map<'a, N::TransactionID, TransactionType>
The mapping of transaction ID
to transaction type
.
sourcetype DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>
type DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>
The deployment storage.
sourcetype ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>
type ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>
The execution storage.
sourcetype FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>
type FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>
The fee storage.
sourcetype TransitionStorage: TransitionStorage<N>
type TransitionStorage: TransitionStorage<N>
The transition storage.
Required Methods§
sourcefn open(
transition_store: TransitionStore<N, Self::TransitionStorage>
) -> Result<Self>
fn open( transition_store: TransitionStore<N, Self::TransitionStorage> ) -> Result<Self>
Initializes the transaction storage.
sourcefn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>
fn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>
Returns the deployment store.
sourcefn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>
fn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>
Returns the execution store.
sourcefn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
Returns the fee store.
Provided Methods§
sourcefn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
Returns the transition store.
sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcefn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
sourcefn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
sourcefn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcefn finish_atomic(&self) -> Result<()>
fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
sourcefn insert(&self, transaction: &Transaction<N>) -> Result<()>
fn insert(&self, transaction: &Transaction<N>) -> Result<()>
Stores the given transaction
into storage.
sourcefn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
Removes the transaction for the given transaction ID
.
sourcefn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID
) -> Result<Option<N::TransactionID>>
fn find_transaction_id_from_transition_id( &self, transition_id: &N::TransitionID ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given transition ID
.
sourcefn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<Option<N::TransactionID>>
fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N> ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given program ID
.
sourcefn get_transaction(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Transaction<N>>>
fn get_transaction( &self, transaction_id: &N::TransactionID ) -> Result<Option<Transaction<N>>>
Returns the transaction for the given transaction ID
.