Trait fuel_core_importer::ports::DatabaseTransaction

source ·
pub trait DatabaseTransaction {
    // Required methods
    fn latest_block_root(&self) -> StorageResult<Option<MerkleRoot>>;
    fn store_new_block(
        &mut self,
        chain_id: &ChainId,
        block: &SealedBlock,
    ) -> StorageResult<bool>;
    fn commit(self) -> StorageResult<()>;
}
Expand description

The port of the storage transaction required by the importer.

Required Methods§

source

fn latest_block_root(&self) -> StorageResult<Option<MerkleRoot>>

Returns the latest block root.

source

fn store_new_block( &mut self, chain_id: &ChainId, block: &SealedBlock, ) -> StorageResult<bool>

Inserts the SealedBlock.

The method returns true if the block is a new, otherwise false.

source

fn commit(self) -> StorageResult<()>

Commits the changes to the underlying storage.

Implementations on Foreign Types§

source§

impl<S> DatabaseTransaction for StorageTransaction<S>
where S: KeyValueInspect<Column = Column> + Modifiable,

Implementors§