Trait RethL1BlockInfo
pub trait RethL1BlockInfo {
// Required methods
fn l1_tx_data_fee(
&mut self,
chain_spec: impl OpHardforks,
timestamp: u64,
input: &[u8],
is_deposit: bool,
) -> Result<Uint<256, 4>, BlockExecutionError>;
fn l1_data_gas(
&self,
chain_spec: impl OpHardforks,
timestamp: u64,
input: &[u8],
) -> Result<Uint<256, 4>, BlockExecutionError>;
}
Available on crate features
node-api
and node
only.Expand description
An extension trait for L1BlockInfo
that allows us to calculate the L1 cost of a transaction
based off of the chain spec’s activated hardfork.
Required Methods§
fn l1_tx_data_fee(
&mut self,
chain_spec: impl OpHardforks,
timestamp: u64,
input: &[u8],
is_deposit: bool,
) -> Result<Uint<256, 4>, BlockExecutionError>
fn l1_tx_data_fee( &mut self, chain_spec: impl OpHardforks, timestamp: u64, input: &[u8], is_deposit: bool, ) -> Result<Uint<256, 4>, BlockExecutionError>
Forwards an L1 transaction calculation to revm and returns the gas cost.
§Takes
chain_spec
: The chain spec for the node.timestamp
: The timestamp of the current block.input
: The calldata of the transaction.is_deposit
: Whether or not the transaction is a deposit.
fn l1_data_gas(
&self,
chain_spec: impl OpHardforks,
timestamp: u64,
input: &[u8],
) -> Result<Uint<256, 4>, BlockExecutionError>
fn l1_data_gas( &self, chain_spec: impl OpHardforks, timestamp: u64, input: &[u8], ) -> Result<Uint<256, 4>, BlockExecutionError>
Computes the data gas cost for an L2 transaction.
§Takes
chain_spec
: The chain spec for the node.timestamp
: The timestamp of the current block.input
: The calldata of the transaction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.