mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-14 00:45:01 -05:00
refactor(examples): Replace redundant type definitions with a CustomTransaction alias in the custom_node example (#16367)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
use crate::primitives::{CustomHeader, CustomTransactionEnvelope, ExtendedOpTxEnvelope};
|
||||
use crate::primitives::{CustomHeader, CustomTransaction};
|
||||
|
||||
/// The Block type of this node
|
||||
pub type Block =
|
||||
alloy_consensus::Block<ExtendedOpTxEnvelope<CustomTransactionEnvelope>, CustomHeader>;
|
||||
pub type Block = alloy_consensus::Block<CustomTransaction, CustomHeader>;
|
||||
|
||||
/// The body type of this node
|
||||
pub type BlockBody =
|
||||
alloy_consensus::BlockBody<ExtendedOpTxEnvelope<CustomTransactionEnvelope>, CustomHeader>;
|
||||
pub type BlockBody = alloy_consensus::BlockBody<CustomTransaction, CustomHeader>;
|
||||
|
||||
@@ -22,6 +22,6 @@ impl NodePrimitives for CustomNodePrimitives {
|
||||
type Block = Block;
|
||||
type BlockHeader = CustomHeader;
|
||||
type BlockBody = BlockBody;
|
||||
type SignedTx = ExtendedOpTxEnvelope<CustomTransactionEnvelope>;
|
||||
type SignedTx = CustomTransaction;
|
||||
type Receipt = OpReceipt;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ use reth_op::primitives::{Extended, SignedTransaction};
|
||||
use revm_primitives::{Address, Bytes};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// An [`OpTxEnvelope`] that is [`Extended`] by one more variant of [`CustomTransactionEnvelope`].
|
||||
pub type CustomTransaction = ExtendedOpTxEnvelope<CustomTransactionEnvelope>;
|
||||
|
||||
/// A [`SignedTransaction`] implementation that combines the [`OpTxEnvelope`] and another
|
||||
/// transaction type.
|
||||
pub type ExtendedOpTxEnvelope<T> = Extended<OpTxEnvelope, T>;
|
||||
|
||||
Reference in New Issue
Block a user