mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(payload): Ethereum Payload Builder Zero Type (#5313)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -115,11 +115,11 @@ pub trait RethNodeCommandConfig: fmt::Debug {
|
||||
// The default payload builder is implemented on the unit type.
|
||||
#[cfg(not(feature = "optimism"))]
|
||||
#[allow(clippy::let_unit_value)]
|
||||
let payload_builder = ();
|
||||
let payload_builder = reth_basic_payload_builder::EthereumPayloadBuilder::default();
|
||||
|
||||
// Optimism's payload builder is implemented on the OptimismPayloadBuilder type.
|
||||
#[cfg(feature = "optimism")]
|
||||
let payload_builder = reth_basic_payload_builder::OptimismPayloadBuilder;
|
||||
let payload_builder = reth_basic_payload_builder::OptimismPayloadBuilder::default();
|
||||
|
||||
let payload_generator = BasicPayloadJobGenerator::with_builder(
|
||||
components.provider(),
|
||||
|
||||
@ -62,9 +62,14 @@ mod optimism;
|
||||
#[cfg(feature = "optimism")]
|
||||
pub use optimism::OptimismPayloadBuilder;
|
||||
|
||||
/// Ethereum payload builder
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[non_exhaustive]
|
||||
pub struct EthereumPayloadBuilder;
|
||||
|
||||
/// The [`PayloadJobGenerator`] that creates [`BasicPayloadJob`]s.
|
||||
#[derive(Debug)]
|
||||
pub struct BasicPayloadJobGenerator<Client, Pool, Tasks, Builder = ()> {
|
||||
pub struct BasicPayloadJobGenerator<Client, Pool, Tasks, Builder = EthereumPayloadBuilder> {
|
||||
/// The client that can interact with the chain.
|
||||
client: Client,
|
||||
/// txpool
|
||||
@ -94,7 +99,14 @@ impl<Client, Pool, Tasks> BasicPayloadJobGenerator<Client, Pool, Tasks> {
|
||||
config: BasicPayloadJobGeneratorConfig,
|
||||
chain_spec: Arc<ChainSpec>,
|
||||
) -> Self {
|
||||
BasicPayloadJobGenerator::with_builder(client, pool, executor, config, chain_spec, ())
|
||||
BasicPayloadJobGenerator::with_builder(
|
||||
client,
|
||||
pool,
|
||||
executor,
|
||||
config,
|
||||
chain_spec,
|
||||
EthereumPayloadBuilder,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -716,7 +728,7 @@ pub trait PayloadBuilder<Pool, Client>: Send + Sync + Clone {
|
||||
}
|
||||
|
||||
// Default implementation of [PayloadBuilder] for unit type
|
||||
impl<Pool, Client> PayloadBuilder<Pool, Client> for ()
|
||||
impl<Pool, Client> PayloadBuilder<Pool, Client> for EthereumPayloadBuilder
|
||||
where
|
||||
Client: StateProviderFactory,
|
||||
Pool: TransactionPool,
|
||||
|
||||
@ -287,7 +287,8 @@ where
|
||||
}
|
||||
|
||||
/// Optimism's payload builder
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[non_exhaustive]
|
||||
pub struct OptimismPayloadBuilder;
|
||||
|
||||
/// Implementation of the [PayloadBuilder] trait for [OptimismPayloadBuilder].
|
||||
|
||||
Reference in New Issue
Block a user