feat(storage): replace Tree generic with Arc<dyn TreeViewer> (#7810)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Kyrylo Riabov
2024-04-23 22:10:45 +03:00
committed by GitHub
parent a8a434d2c4
commit c659e28aa0
9 changed files with 102 additions and 113 deletions

View File

@ -43,13 +43,7 @@ type DatabaseEnv = TempDatabase<DE>;
type TestBeaconConsensusEngine<Client> = BeaconConsensusEngine<
Arc<DatabaseEnv>,
BlockchainProvider<
Arc<DatabaseEnv>,
ShareableBlockchainTree<
Arc<DatabaseEnv>,
EitherExecutorFactory<TestExecutorFactory, EvmProcessorFactory<EthEvmConfig>>,
>,
>,
BlockchainProvider<Arc<DatabaseEnv>>,
Arc<EitherDownloader<Client, NoopFullBlockClient>>,
EthEngineTypes,
>;
@ -423,9 +417,9 @@ where
// Setup blockchain tree
let externals = TreeExternals::new(provider_factory.clone(), consensus, executor_factory);
let config = BlockchainTreeConfig::new(1, 2, 3, 2);
let tree = ShareableBlockchainTree::new(
let tree = Arc::new(ShareableBlockchainTree::new(
BlockchainTree::new(externals, config, None).expect("failed to create tree"),
);
));
let latest = self.base_config.chain_spec.genesis_header().seal_slow();
let blockchain_provider =
BlockchainProvider::with_latest(provider_factory.clone(), tree, latest);