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§
sourcefn latest_block_root(&self) -> StorageResult<Option<MerkleRoot>>
fn latest_block_root(&self) -> StorageResult<Option<MerkleRoot>>
Returns the latest block root.
sourcefn store_new_block(
&mut self,
chain_id: &ChainId,
block: &SealedBlock,
) -> StorageResult<bool>
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
.
sourcefn commit(self) -> StorageResult<()>
fn commit(self) -> StorageResult<()>
Commits the changes to the underlying storage.