fuel_core_gas_price_service/v0/
metadata.rsuse fuel_gas_price_algorithm::v0::AlgorithmUpdaterV0;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq)]
pub struct V0Metadata {
pub new_exec_price: u64,
pub min_exec_gas_price: u64,
pub exec_gas_price_change_percent: u64,
pub l2_block_height: u32,
pub l2_block_fullness_threshold_percent: u64,
}
impl From<V0Metadata> for AlgorithmUpdaterV0 {
fn from(metadata: V0Metadata) -> Self {
Self {
new_exec_price: metadata.new_exec_price,
min_exec_gas_price: metadata.min_exec_gas_price,
exec_gas_price_change_percent: metadata.exec_gas_price_change_percent,
l2_block_height: metadata.l2_block_height,
l2_block_fullness_threshold_percent: metadata
.l2_block_fullness_threshold_percent,
}
}
}
impl From<AlgorithmUpdaterV0> for V0Metadata {
fn from(updater: AlgorithmUpdaterV0) -> Self {
Self {
new_exec_price: updater.new_exec_price,
min_exec_gas_price: updater.min_exec_gas_price,
exec_gas_price_change_percent: updater.exec_gas_price_change_percent,
l2_block_height: updater.l2_block_height,
l2_block_fullness_threshold_percent: updater
.l2_block_fullness_threshold_percent,
}
}
}