feat: NodeTypesWithDB (#10683)

This commit is contained in:
Arsenii Kulikov
2024-09-04 21:56:22 +04:00
committed by GitHub
parent 4fbfedb6e0
commit a1d9ece3be
35 changed files with 319 additions and 212 deletions

View File

@ -1,5 +1,6 @@
use reth_chainspec::ChainSpec;
use reth_evm::ConfigureEvm;
use reth_node_api::FullNodeComponents;
use reth_node_api::{FullNodeComponents, NodeTypes};
use reth_primitives::{
revm_primitives::{BlockEnv, OptimismFields, TxEnv},
Bytes, TxKind, U256,
@ -16,7 +17,7 @@ use crate::{OpEthApi, OpEthApiError};
impl<N> EthCall for OpEthApi<N>
where
Self: Call,
N: FullNodeComponents,
N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
}

View File

@ -16,7 +16,7 @@ use op_alloy_network::AnyNetwork;
use reth_chainspec::ChainSpec;
use reth_evm::ConfigureEvm;
use reth_network_api::NetworkInfo;
use reth_node_api::{BuilderProvider, FullNodeComponents, FullNodeTypes};
use reth_node_api::{BuilderProvider, FullNodeComponents, FullNodeTypes, NodeTypes};
use reth_node_builder::EthApiBuilderCtx;
use reth_provider::{
BlockIdReader, BlockNumReader, BlockReaderIdExt, ChainSpecProvider, HeaderProvider,
@ -101,7 +101,7 @@ where
impl<N> EthApiSpec for OpEthApi<N>
where
Self: Send + Sync,
N: FullNodeComponents,
N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
#[inline]
fn provider(
@ -151,7 +151,7 @@ where
impl<N> LoadFee for OpEthApi<N>
where
Self: LoadBlock,
N: FullNodeComponents,
N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
#[inline]
fn provider(
@ -179,7 +179,7 @@ where
impl<N> LoadState for OpEthApi<N>
where
Self: Send + Sync,
N: FullNodeComponents,
N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
#[inline]
fn provider(&self) -> impl StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec> {
@ -226,7 +226,7 @@ where
}
}
impl<N: FullNodeComponents> AddDevSigners for OpEthApi<N> {
impl<N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>> AddDevSigners for OpEthApi<N> {
fn with_dev_accounts(&self) {
*self.signers().write() = DevSigner::random_signers(20)
}

View File

@ -2,7 +2,7 @@
use reth_chainspec::ChainSpec;
use reth_evm::ConfigureEvm;
use reth_node_api::FullNodeComponents;
use reth_node_api::{FullNodeComponents, NodeTypes};
use reth_primitives::{
revm_primitives::BlockEnv, BlockNumber, Receipt, SealedBlockWithSenders, B256,
};
@ -22,7 +22,7 @@ use crate::OpEthApi;
impl<N> LoadPendingBlock for OpEthApi<N>
where
Self: SpawnBlocking,
N: FullNodeComponents,
N: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
#[inline]
fn provider(