fuel_core_producer/block_producer/
gas_price.rs

1use fuel_core_types::blockchain::header::ConsensusParametersVersion;
2use std::sync::Arc;
3
4/// Interface for retrieving the gas price for a block
5pub trait GasPriceProvider {
6    /// The gas price for all transactions in the block.
7    fn production_gas_price(&self) -> anyhow::Result<u64>;
8
9    fn dry_run_gas_price(&self) -> anyhow::Result<u64>;
10}
11
12/// Interface for retrieving the consensus parameters.
13#[cfg_attr(feature = "test-helpers", mockall::automock)]
14pub trait ConsensusParametersProvider {
15    /// Retrieve the consensus parameters for the `version`.
16    fn consensus_params_at_version(
17        &self,
18        version: &ConsensusParametersVersion,
19    ) -> anyhow::Result<Arc<fuel_core_types::fuel_tx::ConsensusParameters>>;
20}