From 237c22f234ea888c7004da2e2fe52eeb20de7720 Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Sat, 31 Aug 2024 00:06:47 +0800 Subject: [PATCH] feat: use alloy_network::Network::BlockResponse instead of reth_rpc_types::Block in RPC (#10613) --- crates/rpc/rpc-eth-api/src/types.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc-eth-api/src/types.rs b/crates/rpc/rpc-eth-api/src/types.rs index 3f0d526b01..55f1373007 100644 --- a/crates/rpc/rpc-eth-api/src/types.rs +++ b/crates/rpc/rpc-eth-api/src/types.rs @@ -20,7 +20,10 @@ pub trait EthApiTypes: Send + Sync + Clone { + Sync; /// Blockchain primitive types, specific to network, e.g. block and transaction. // todo: remove restriction `reth_rpc_types::Transaction` - type NetworkTypes: Network>; + type NetworkTypes: Network< + TransactionResponse = WithOtherFields, + HeaderResponse = reth_rpc_types::Header, + >; } impl EthApiTypes for () { @@ -32,4 +35,4 @@ impl EthApiTypes for () { pub type RpcTransaction = ::TransactionResponse; /// Adapter for network specific block type. -pub type RpcBlock = Block>; +pub type RpcBlock = Block, ::HeaderResponse>;