mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: bump alloy (#12930)
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
This commit is contained in:
@ -58,6 +58,7 @@ impl TryFrom<AnyRpcBlock> for Block {
|
||||
excess_blob_gas,
|
||||
parent_beacon_block_root,
|
||||
requests_hash,
|
||||
target_blobs_per_block,
|
||||
} = block.header.inner;
|
||||
|
||||
Ok(Self {
|
||||
@ -84,6 +85,7 @@ impl TryFrom<AnyRpcBlock> for Block {
|
||||
excess_blob_gas,
|
||||
parent_beacon_block_root,
|
||||
requests_hash,
|
||||
target_blobs_per_block,
|
||||
},
|
||||
body: BlockBody {
|
||||
transactions,
|
||||
|
||||
@ -73,6 +73,8 @@ impl Receipt {
|
||||
}
|
||||
|
||||
impl TxReceipt for Receipt {
|
||||
type Log = Log;
|
||||
|
||||
fn status_or_post_state(&self) -> Eip658Value {
|
||||
self.success.into()
|
||||
}
|
||||
|
||||
@ -3,8 +3,8 @@ use crate::{
|
||||
BlockWithSenders, SealedBlock,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
use alloy_eips::{eip2718::Encodable2718, BlockNumHash};
|
||||
use reth_primitives_traits::{Block, BlockBody, BlockHeader, SealedHeader, SignedTransaction};
|
||||
use alloy_eips::eip2718::Encodable2718;
|
||||
use reth_primitives_traits::{Block, BlockBody, SealedHeader, SignedTransaction};
|
||||
use revm_primitives::{Address, B256};
|
||||
|
||||
/// Extension trait for [`reth_primitives_traits::Block`] implementations
|
||||
@ -121,17 +121,3 @@ pub trait BlockBodyTxExt: BlockBody {
|
||||
}
|
||||
|
||||
impl<T: BlockBody> BlockBodyTxExt for T {}
|
||||
|
||||
/// Extension trait for [`BlockHeader`] adding useful helper methods.
|
||||
pub trait HeaderExt: BlockHeader {
|
||||
/// TODO: remove once <https://github.com/alloy-rs/alloy/pull/1687> is released
|
||||
///
|
||||
/// Returns the parent block's number and hash
|
||||
///
|
||||
/// Note: for the genesis block the parent number is 0 and the parent hash is the zero hash.
|
||||
fn parent_num_hash(&self) -> BlockNumHash {
|
||||
BlockNumHash::new(self.number().saturating_sub(1), self.parent_hash())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: BlockHeader> HeaderExt for T {}
|
||||
|
||||
@ -308,7 +308,7 @@ impl Transaction {
|
||||
set_code_tx.eip2718_encode(signature, out);
|
||||
}
|
||||
#[cfg(feature = "optimism")]
|
||||
Self::Deposit(deposit_tx) => deposit_tx.eip2718_encode(out),
|
||||
Self::Deposit(deposit_tx) => deposit_tx.encode_2718(out),
|
||||
}
|
||||
}
|
||||
|
||||
@ -675,6 +675,18 @@ impl alloy_consensus::Transaction for Transaction {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_create(&self) -> bool {
|
||||
match self {
|
||||
Self::Legacy(tx) => tx.is_create(),
|
||||
Self::Eip2930(tx) => tx.is_create(),
|
||||
Self::Eip1559(tx) => tx.is_create(),
|
||||
Self::Eip4844(tx) => tx.is_create(),
|
||||
Self::Eip7702(tx) => tx.is_create(),
|
||||
#[cfg(feature = "optimism")]
|
||||
Self::Deposit(tx) => tx.is_create(),
|
||||
}
|
||||
}
|
||||
|
||||
fn value(&self) -> U256 {
|
||||
match self {
|
||||
Self::Legacy(tx) => tx.value(),
|
||||
@ -1392,6 +1404,10 @@ impl alloy_consensus::Transaction for TransactionSigned {
|
||||
self.deref().kind()
|
||||
}
|
||||
|
||||
fn is_create(&self) -> bool {
|
||||
self.deref().is_create()
|
||||
}
|
||||
|
||||
fn value(&self) -> U256 {
|
||||
self.deref().value()
|
||||
}
|
||||
|
||||
@ -525,6 +525,16 @@ impl alloy_consensus::Transaction for PooledTransactionsElement {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_create(&self) -> bool {
|
||||
match self {
|
||||
Self::Legacy(tx) => tx.tx().is_create(),
|
||||
Self::Eip2930(tx) => tx.tx().is_create(),
|
||||
Self::Eip1559(tx) => tx.tx().is_create(),
|
||||
Self::Eip7702(tx) => tx.tx().is_create(),
|
||||
Self::BlobTransaction(tx) => tx.tx().is_create(),
|
||||
}
|
||||
}
|
||||
|
||||
fn value(&self) -> U256 {
|
||||
match self {
|
||||
Self::Legacy(tx) => tx.tx().value(),
|
||||
|
||||
Reference in New Issue
Block a user