pub trait DbWriter: Send + Sync {
    // Required methods
    fn save_transactions(
        &self,
        txns_to_commit: &[TransactionToCommit],
        first_version: Version,
        ledger_info_with_sigs: Option<&LedgerInfoWithSignatures>,
        pos_state: Option<PosState>,
        committed_blocks: Vec<CommittedBlock>,
        ledger_infos_with_voted_block: Vec<(HashValue, LedgerInfoWithSignatures)>
    ) -> Result<()>;
    fn save_reward_event(
        &self,
        epoch: u64,
        event: &RewardDistributionEventV2
    ) -> Result<()>;
    fn delete_pos_state_by_block(&self, block_id: &HashValue) -> Result<()>;
}
Expand description

Trait that is implemented by a DB that supports certain public (to client) write APIs expected of a Diem DB. This adds write APIs to DbReader.

Required Methods§

source

fn save_transactions( &self, txns_to_commit: &[TransactionToCommit], first_version: Version, ledger_info_with_sigs: Option<&LedgerInfoWithSignatures>, pos_state: Option<PosState>, committed_blocks: Vec<CommittedBlock>, ledger_infos_with_voted_block: Vec<(HashValue, LedgerInfoWithSignatures)> ) -> Result<()>

Persist transactions. Called by the executor module when either syncing nodes or committing blocks during normal operation. See DiemDB::save_transactions.

source

fn save_reward_event( &self, epoch: u64, event: &RewardDistributionEventV2 ) -> Result<()>

source

fn delete_pos_state_by_block(&self, block_id: &HashValue) -> Result<()>

Implementors§