pub struct BaseFeeParams {
pub max_change_denominator: u128,
pub elasticity_multiplier: u128,
}
Expand description
BaseFeeParams contains the config parameters that control block base fee computation
Fields§
§max_change_denominator: u128
The base_fee_max_change_denominator from EIP-1559
elasticity_multiplier: u128
The elasticity multiplier from EIP-1559
Implementations§
Source§impl BaseFeeParams
impl BaseFeeParams
Sourcepub const fn new(
max_change_denominator: u128,
elasticity_multiplier: u128,
) -> Self
pub const fn new( max_change_denominator: u128, elasticity_multiplier: u128, ) -> Self
Create a new BaseFeeParams
Sourcepub const fn optimism_canyon() -> Self
pub const fn optimism_canyon() -> Self
Get the base fee parameters for Optimism Mainnet (post Canyon)
Sourcepub const fn optimism_sepolia() -> Self
pub const fn optimism_sepolia() -> Self
Get the base fee parameters for Optimism Sepolia
Sourcepub const fn optimism_sepolia_canyon() -> Self
pub const fn optimism_sepolia_canyon() -> Self
Get the base fee parameters for Optimism Sepolia (post Canyon)
Sourcepub const fn base_sepolia() -> Self
pub const fn base_sepolia() -> Self
Get the base fee parameters for Base Sepolia
Sourcepub const fn base_sepolia_canyon() -> Self
pub const fn base_sepolia_canyon() -> Self
Get the base fee parameters for Base Sepolia (post Canyon)
Sourcepub fn next_block_base_fee(
self,
gas_used: u64,
gas_limit: u64,
base_fee: u64,
) -> u64
pub fn next_block_base_fee( self, gas_used: u64, gas_limit: u64, base_fee: u64, ) -> u64
Calculate the base fee for the next block based on the EIP-1559 specification.
See also calc_next_block_base_fee
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
impl<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§impl Clone for BaseFeeParams
impl Clone for BaseFeeParams
Source§fn clone(&self) -> BaseFeeParams
fn clone(&self) -> BaseFeeParams
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BaseFeeParams
impl Debug for BaseFeeParams
Source§impl<'de> Deserialize<'de> for BaseFeeParams
impl<'de> Deserialize<'de> for BaseFeeParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BaseFeeParams
impl PartialEq for BaseFeeParams
Source§impl Serialize for BaseFeeParams
impl Serialize for BaseFeeParams
impl Copy for BaseFeeParams
impl Eq for BaseFeeParams
impl StructuralPartialEq for BaseFeeParams
Auto Trait Implementations§
impl Freeze for BaseFeeParams
impl RefUnwindSafe for BaseFeeParams
impl Send for BaseFeeParams
impl Sync for BaseFeeParams
impl Unpin for BaseFeeParams
impl UnwindSafe for BaseFeeParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more