diff --git a/crates/node-builder/src/builder.rs b/crates/node-builder/src/builder.rs index f7865a08f4..ae90d7928d 100644 --- a/crates/node-builder/src/builder.rs +++ b/crates/node-builder/src/builder.rs @@ -523,14 +523,7 @@ where let blockchain_db = BlockchainProvider::new(provider_factory.clone(), blockchain_tree.clone())?; - let ctx = BuilderContext { - head, - provider: blockchain_db, - executor, - data_dir, - config, - reth_config, - }; + let ctx = BuilderContext::new(head, blockchain_db, executor, data_dir, config, reth_config); debug!(target: "reth::cli", "creating components"); let NodeComponents { transaction_pool, network, payload_builder } = @@ -1083,6 +1076,18 @@ pub struct BuilderContext { } impl BuilderContext { + /// Create a new instance of [BuilderContext] + pub fn new( + head: Head, + provider: Node::Provider, + executor: TaskExecutor, + data_dir: ChainPath, + config: NodeConfig, + reth_config: reth_config::Config, + ) -> Self { + Self { head, provider, executor, data_dir, config, reth_config } + } + /// Returns the configured provider to interact with the blockchain. pub fn provider(&self) -> &Node::Provider { &self.provider