feat: EthApi traits abstraction (#13170)

This commit is contained in:
Arsenii Kulikov
2024-12-06 16:30:50 +04:00
committed by GitHub
parent ab87f22cab
commit cf2a6a1ee8
53 changed files with 851 additions and 511 deletions

View File

@ -97,7 +97,9 @@ where
where
Engine::ExecutionPayloadEnvelopeV3: From<Engine::BuiltPayload> + PayloadEnvelopeExt,
Engine::ExecutionPayloadEnvelopeV4: From<Engine::BuiltPayload> + PayloadEnvelopeExt,
AddOns::EthApi: EthApiSpec + EthTransactions + TraceExt,
AddOns::EthApi: EthApiSpec<Provider: BlockReader<Block = reth_primitives::Block>>
+ EthTransactions
+ TraceExt,
{
let mut chain = Vec::with_capacity(length as usize);
for i in 0..length {

View File

@ -4,6 +4,7 @@ use alloy_primitives::{Bytes, B256};
use reth_chainspec::EthereumHardforks;
use reth_node_api::{FullNodeComponents, NodePrimitives};
use reth_node_builder::{rpc::RpcRegistry, NodeTypes};
use reth_provider::BlockReader;
use reth_rpc_api::DebugApiServer;
use reth_rpc_eth_api::{
helpers::{EthApiSpec, EthTransactions, TraceExt},
@ -26,7 +27,9 @@ where
>,
>,
>,
EthApi: EthApiSpec + EthTransactions + TraceExt,
EthApi: EthApiSpec<Provider: BlockReader<Block = reth_primitives::Block>>
+ EthTransactions
+ TraceExt,
{
/// Injects a raw transaction into the node tx pool via RPC server
pub async fn inject_tx(&self, raw_tx: Bytes) -> Result<B256, EthApi::Error> {