use fuel_core_types::{
blockchain::header::ConsensusParametersVersion,
fuel_types::BlockHeight,
};
use std::sync::Arc;
pub struct GasPriceParams {
block_height: BlockHeight,
}
impl GasPriceParams {
pub fn new(block_height: BlockHeight) -> Self {
Self { block_height }
}
pub fn block_height(&self) -> BlockHeight {
self.block_height
}
}
impl From<BlockHeight> for GasPriceParams {
fn from(block_height: BlockHeight) -> Self {
Self { block_height }
}
}
pub trait GasPriceProvider {
fn gas_price(&self, params: GasPriceParams) -> Option<u64>;
}
#[cfg_attr(feature = "test-helpers", mockall::automock)]
pub trait ConsensusParametersProvider {
fn consensus_params_at_version(
&self,
version: &ConsensusParametersVersion,
) -> anyhow::Result<Arc<fuel_core_types::fuel_tx::ConsensusParameters>>;
}