Suggestions for Capella execution_layer (#3983)

* Restrict Engine::request to FnOnce

* Use `Into::into`

* Impl IntoIterator for VariableList

* Use Instant rather than SystemTime
This commit is contained in:
Paul Hauner
2023-02-17 11:58:33 +11:00
committed by GitHub
parent 461bda6e85
commit 4aa8a2ab12
5 changed files with 17 additions and 25 deletions

View File

@@ -1348,16 +1348,11 @@ impl<T: EthSpec> ExecutionLayer<T> {
.set_latest_forkchoice_state(forkchoice_state)
.await;
let payload_attributes_ref = &payload_attributes;
let result = self
.engine()
.request(|engine| async move {
engine
.notify_forkchoice_updated(
forkchoice_state,
payload_attributes_ref.clone(),
self.log(),
)
.notify_forkchoice_updated(forkchoice_state, payload_attributes, self.log())
.await
})
.await;
@@ -1723,7 +1718,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
capella_block
.withdrawals
.into_iter()
.map(|w| w.into())
.map(Into::into)
.collect(),
)
.map_err(ApiError::DeserializeWithdrawals)?;
@@ -1750,7 +1745,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
eip4844_block
.withdrawals
.into_iter()
.map(|w| w.into())
.map(Into::into)
.collect(),
)
.map_err(ApiError::DeserializeWithdrawals)?;