mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-09 07:17:56 -05:00
chore: add config_mut helpers (#19436)
This commit is contained in:
@@ -331,6 +331,11 @@ impl<DB, ChainSpec> WithLaunchContext<NodeBuilder<DB, ChainSpec>> {
|
||||
pub const fn config(&self) -> &NodeConfig<ChainSpec> {
|
||||
self.builder.config()
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the node builder's config.
|
||||
pub const fn config_mut(&mut self) -> &mut NodeConfig<ChainSpec> {
|
||||
self.builder.config_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl<DB, ChainSpec> WithLaunchContext<NodeBuilder<DB, ChainSpec>>
|
||||
@@ -452,6 +457,11 @@ where
|
||||
&self.builder.config
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the node builder's config.
|
||||
pub const fn config_mut(&mut self) -> &mut NodeConfig<<T::Types as NodeTypes>::ChainSpec> {
|
||||
&mut self.builder.config
|
||||
}
|
||||
|
||||
/// Returns a reference to node's database.
|
||||
pub const fn db(&self) -> &T::DB {
|
||||
&self.builder.adapter.database
|
||||
@@ -729,6 +739,11 @@ impl<Node: FullNodeTypes> BuilderContext<Node> {
|
||||
&self.config_container.config
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the config of the node.
|
||||
pub const fn config_mut(&mut self) -> &mut NodeConfig<<Node::Types as NodeTypes>::ChainSpec> {
|
||||
&mut self.config_container.config
|
||||
}
|
||||
|
||||
/// Returns the loaded reh.toml config.
|
||||
pub const fn reth_config(&self) -> &reth_config::Config {
|
||||
&self.config_container.toml_config
|
||||
|
||||
Reference in New Issue
Block a user