replace &Bytes with &[u8] in optimism functions (#5896)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-02-09 18:24:55 +01:00
committed by GitHub
parent 3ae2611c9c
commit cede8b7dd6
3 changed files with 7 additions and 10 deletions

View File

@ -170,7 +170,7 @@ pub trait RethL1BlockInfo {
&self,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
input: &[u8],
is_deposit: bool,
) -> Result<U256, BlockExecutionError>;
@ -184,7 +184,7 @@ pub trait RethL1BlockInfo {
&self,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
input: &[u8],
) -> Result<U256, BlockExecutionError>;
}
@ -193,7 +193,7 @@ impl RethL1BlockInfo for L1BlockInfo {
&self,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
input: &[u8],
is_deposit: bool,
) -> Result<U256, BlockExecutionError> {
if is_deposit {
@ -218,7 +218,7 @@ impl RethL1BlockInfo for L1BlockInfo {
&self,
chain_spec: &ChainSpec,
timestamp: u64,
input: &Bytes,
input: &[u8],
) -> Result<U256, BlockExecutionError> {
let spec_id = if chain_spec.is_fork_active_at_timestamp(Hardfork::Regolith, timestamp) {
SpecId::REGOLITH

View File

@ -1112,11 +1112,8 @@ where
) -> EthResult<OptimismTxMeta> {
let Some(l1_block_info) = l1_block_info else { return Ok(OptimismTxMeta::default()) };
let envelope_buf: Bytes = {
let mut envelope_buf = bytes::BytesMut::new();
tx.encode_enveloped(&mut envelope_buf);
envelope_buf.freeze().into()
};
let (l1_fee, l1_data_gas) = if tx.is_deposit() {
let inner_l1_fee = l1_block_info

View File

@ -342,7 +342,7 @@ where
info.l1_tx_data_fee(
&self.chain_spec,
block.timestamp,
&encoded.freeze().into(),
&encoded,
transaction.is_deposit(),
)
}) {