feat: bump alloy (#12391)

This commit is contained in:
Arsenii Kulikov
2024-11-08 04:46:24 +04:00
committed by GitHub
parent eb7bb08b51
commit c7b6a35113
4 changed files with 189 additions and 153 deletions

View File

@ -1,6 +1,6 @@
//! L1 `eth` API types.
use alloy_consensus::{Signed, TxEip4844Variant, TxEnvelope};
use alloy_consensus::{Signed, Transaction as _, TxEip4844Variant, TxEnvelope};
use alloy_network::{Ethereum, Network};
use alloy_rpc_types::{Transaction, TransactionInfo};
use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered};
@ -24,7 +24,7 @@ where
let from = tx.signer();
let TransactionSigned { transaction, signature, hash } = tx.into_signed();
let inner = match transaction {
let inner: TxEnvelope = match transaction {
reth_primitives::Transaction::Legacy(tx) => {
Signed::new_unchecked(tx, signature, hash).into()
}
@ -44,9 +44,24 @@ where
_ => unreachable!(),
};
let TransactionInfo { block_hash, block_number, index: transaction_index, .. } = tx_info;
let TransactionInfo {
block_hash, block_number, index: transaction_index, base_fee, ..
} = tx_info;
Transaction { inner, block_hash, block_number, transaction_index, from }
let effective_gas_price = base_fee
.map(|base_fee| {
inner.effective_tip_per_gas(base_fee as u64).unwrap_or_default() + base_fee
})
.unwrap_or_else(|| inner.max_fee_per_gas());
Transaction {
inner,
block_hash,
block_number,
transaction_index,
from,
effective_gas_price: Some(effective_gas_price),
}
}
fn otterscan_api_truncate_input(tx: &mut Self::Transaction) {