feat(api,rpc): improve engine API abstraction (#6871)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Federico Gimenez
2024-03-05 17:05:17 +01:00
committed by GitHub
parent b24f9de141
commit 96fcdfbac8
19 changed files with 312 additions and 137 deletions

View File

@ -15,8 +15,8 @@ use futures_util::FutureExt;
use reth_interfaces::RethResult;
use reth_node_api::{BuiltPayload, PayloadBuilderAttributes};
use reth_payload_builder::{
database::CachedReads, error::PayloadBuilderError, EthBuiltPayload, KeepPayloadJobAlive,
PayloadId, PayloadJob, PayloadJobGenerator,
database::CachedReads, error::PayloadBuilderError, KeepPayloadJobAlive, PayloadId, PayloadJob,
PayloadJobGenerator,
};
use reth_primitives::{
bytes::BytesMut,
@ -890,7 +890,7 @@ where
///
/// This compares the total fees of the blocks, higher is better.
#[inline(always)]
pub fn is_better_payload(best_payload: Option<&EthBuiltPayload>, new_fees: U256) -> bool {
pub fn is_better_payload(best_payload: Option<impl BuiltPayload>, new_fees: U256) -> bool {
if let Some(best_payload) = best_payload {
new_fees > best_payload.fees()
} else {