fuel_core_producer::ports

Trait BlockProducerDatabase

Source
pub trait BlockProducerDatabase: Send + Sync {
    // Required methods
    fn latest_height(&self) -> Option<BlockHeight>;
    fn get_block(
        &self,
        height: &BlockHeight,
    ) -> StorageResult<Cow<'_, CompressedBlock>>;
    fn block_header_merkle_root(
        &self,
        height: &BlockHeight,
    ) -> StorageResult<Bytes32>;
    fn latest_consensus_parameters_version(
        &self,
    ) -> StorageResult<ConsensusParametersVersion>;
    fn latest_state_transition_bytecode_version(
        &self,
    ) -> StorageResult<StateTransitionBytecodeVersion>;
}

Required Methods§

Source

fn latest_height(&self) -> Option<BlockHeight>

Returns the latest block height.

Source

fn get_block( &self, height: &BlockHeight, ) -> StorageResult<Cow<'_, CompressedBlock>>

Gets the committed block at the height.

Source

fn block_header_merkle_root( &self, height: &BlockHeight, ) -> StorageResult<Bytes32>

Gets the block header BMT MMR root at height.

Source

fn latest_consensus_parameters_version( &self, ) -> StorageResult<ConsensusParametersVersion>

Returns the latest consensus parameters version.

Source

fn latest_state_transition_bytecode_version( &self, ) -> StorageResult<StateTransitionBytecodeVersion>

Returns the latest state transition bytecode version.

Implementors§