snarkvm_ledger_store

Trait FeeStorage

Source
pub trait FeeStorage<N: Network>:
    Clone
    + Send
    + Sync {
    type FeeMap: for<'a> Map<'a, N::TransactionID, (N::TransitionID, N::StateRoot, Option<Proof<N>>)>;
    type ReverseFeeMap: for<'a> Map<'a, N::TransitionID, N::TransactionID>;
    type TransitionStorage: TransitionStorage<N>;

Show 16 methods // Required methods fn open( transition_store: TransitionStore<N, Self::TransitionStorage>, ) -> Result<Self>; fn fee_map(&self) -> &Self::FeeMap; fn reverse_fee_map(&self) -> &Self::ReverseFeeMap; fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>; // Provided methods fn storage_mode(&self) -> &StorageMode { ... } 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_id: N::TransactionID, fee: &Fee<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 get_fee( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Fee<N>>> { ... }
}
Expand description

A trait for fee storage.

Required Associated Types§

Source

type FeeMap: for<'a> Map<'a, N::TransactionID, (N::TransitionID, N::StateRoot, Option<Proof<N>>)>

The mapping of transaction ID to (fee transition ID, global state root, proof).

Source

type ReverseFeeMap: for<'a> Map<'a, N::TransitionID, N::TransactionID>

The mapping of fee transition ID to transaction ID.

Source

type TransitionStorage: TransitionStorage<N>

The transition storage.

Required Methods§

Source

fn open( transition_store: TransitionStore<N, Self::TransitionStorage>, ) -> Result<Self>

Initializes the fee storage.

Source

fn fee_map(&self) -> &Self::FeeMap

Returns the fee map.

Source

fn reverse_fee_map(&self) -> &Self::ReverseFeeMap

Returns the reverse fee map.

Source

fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>

Returns the transition storage.

Provided Methods§

Source

fn storage_mode(&self) -> &StorageMode

Returns the storage mode.

Source

fn start_atomic(&self)

Starts an atomic batch write operation.

Source

fn is_atomic_in_progress(&self) -> bool

Checks if an atomic batch is in progress.

Source

fn atomic_checkpoint(&self)

Checkpoints the atomic batch.

Source

fn clear_latest_checkpoint(&self)

Clears the latest atomic batch checkpoint.

Source

fn atomic_rewind(&self)

Rewinds the atomic batch to the previous checkpoint.

Source

fn abort_atomic(&self)

Aborts an atomic batch write operation.

Source

fn finish_atomic(&self) -> Result<()>

Finishes an atomic batch write operation.

Source

fn insert(&self, transaction_id: N::TransactionID, fee: &Fee<N>) -> Result<()>

Stores the given (transaction ID, fee) pair into storage.

Source

fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>

Removes the fee for the given transaction ID.

Source

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.

Source

fn get_fee(&self, transaction_id: &N::TransactionID) -> Result<Option<Fee<N>>>

Returns the fee for the given transaction ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§