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 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_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 dev(&self) -> Option<u16>

Returns the optional development ID.

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<N: Network> FeeStorage<N> for FeeMemory<N>

§

type FeeMap = MemoryMap<<N as Network>::TransactionID, (<N as Network>::TransitionID, <N as Network>::StateRoot, Option<Proof<N>>)>

§

type ReverseFeeMap = MemoryMap<<N as Network>::TransitionID, <N as Network>::TransactionID>

§

type TransitionStorage = TransitionMemory<N>