mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: change build_empty_payload to require &self (#8646)
This commit is contained in:
@ -103,6 +103,7 @@ where
|
||||
}
|
||||
|
||||
fn build_empty_payload(
|
||||
&self,
|
||||
client: &Client,
|
||||
config: PayloadConfig<Self::Attributes>,
|
||||
) -> Result<OptimismBuiltPayload, PayloadBuilderError> {
|
||||
|
||||
@ -460,7 +460,7 @@ where
|
||||
// away and the first full block should have been built by the time CL is requesting the
|
||||
// payload.
|
||||
self.metrics.inc_requested_empty_payload();
|
||||
Builder::build_empty_payload(&self.client, self.config.clone())
|
||||
self.builder.build_empty_payload(&self.client, self.config.clone())
|
||||
}
|
||||
|
||||
fn payload_attributes(&self) -> Result<Self::PayloadAttributes, PayloadBuilderError> {
|
||||
@ -501,8 +501,9 @@ where
|
||||
let (tx, rx) = oneshot::channel();
|
||||
let client = self.client.clone();
|
||||
let config = self.config.clone();
|
||||
let builder = self.builder.clone();
|
||||
self.executor.spawn_blocking(Box::pin(async move {
|
||||
let res = Builder::build_empty_payload(&client, config);
|
||||
let res = builder.build_empty_payload(&client, config);
|
||||
let _ = tx.send(res);
|
||||
}));
|
||||
|
||||
@ -784,6 +785,7 @@ pub trait PayloadBuilder<Pool, Client>: Send + Sync + Clone {
|
||||
|
||||
/// Builds an empty payload without any transaction.
|
||||
fn build_empty_payload(
|
||||
&self,
|
||||
client: &Client,
|
||||
config: PayloadConfig<Self::Attributes>,
|
||||
) -> Result<Self::BuiltPayload, PayloadBuilderError>;
|
||||
|
||||
@ -77,6 +77,7 @@ where
|
||||
}
|
||||
|
||||
fn build_empty_payload(
|
||||
&self,
|
||||
client: &Client,
|
||||
config: PayloadConfig<Self::Attributes>,
|
||||
) -> Result<EthBuiltPayload, PayloadBuilderError> {
|
||||
|
||||
@ -302,6 +302,7 @@ where
|
||||
}
|
||||
|
||||
fn build_empty_payload(
|
||||
&self,
|
||||
client: &Client,
|
||||
config: PayloadConfig<Self::Attributes>,
|
||||
) -> Result<Self::BuiltPayload, PayloadBuilderError> {
|
||||
@ -313,9 +314,8 @@ where
|
||||
attributes,
|
||||
chain_spec,
|
||||
} = config;
|
||||
<reth_ethereum_payload_builder::EthereumPayloadBuilder as PayloadBuilder<Pool,Client>> ::build_empty_payload(client,
|
||||
PayloadConfig { initialized_block_env, initialized_cfg, parent_block, extra_data, attributes: attributes.0, chain_spec }
|
||||
)
|
||||
<reth_ethereum_payload_builder::EthereumPayloadBuilder as PayloadBuilder<Pool, Client>>::build_empty_payload(&reth_ethereum_payload_builder::EthereumPayloadBuilder::default(),client,
|
||||
PayloadConfig { initialized_block_env, initialized_cfg, parent_block, extra_data, attributes: attributes.0, chain_spec })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ where
|
||||
client: self.client.clone(),
|
||||
_pool: self.pool.clone(),
|
||||
_executor: self.executor.clone(),
|
||||
_builder: self.builder.clone(),
|
||||
builder: self.builder.clone(),
|
||||
config,
|
||||
})
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ where
|
||||
/// The type responsible for building payloads.
|
||||
///
|
||||
/// See [PayloadBuilder]
|
||||
pub(crate) _builder: Builder,
|
||||
pub(crate) builder: Builder,
|
||||
}
|
||||
|
||||
impl<Client, Pool, Tasks, Builder> PayloadJob for EmptyBlockPayloadJob<Client, Pool, Tasks, Builder>
|
||||
@ -44,7 +44,7 @@ where
|
||||
type BuiltPayload = Builder::BuiltPayload;
|
||||
|
||||
fn best_payload(&self) -> Result<Self::BuiltPayload, PayloadBuilderError> {
|
||||
let payload = Builder::build_empty_payload(&self.client, self.config.clone())?;
|
||||
let payload = self.builder.build_empty_payload(&self.client, self.config.clone())?;
|
||||
Ok(payload)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user