Skip to content

Commit

Permalink
feat: make load_network_config and lookup_head generic over DB (#5692)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
Rjected and mattsse authored Dec 5, 2023
1 parent 926766d commit 227e1b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
/// Fetches the head block from the database.
///
/// If the database is empty, returns the genesis block.
fn lookup_head(&self, db: Arc<DatabaseEnv>) -> RethResult<Head> {
fn lookup_head<DB: Database>(&self, db: DB) -> RethResult<Head> {
let factory = ProviderFactory::new(db, self.chain.clone());
let provider = factory.provider()?;

Expand Down Expand Up @@ -826,15 +826,15 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
}
}

fn load_network_config(
fn load_network_config<DB: Database>(
&self,
config: &Config,
db: Arc<DatabaseEnv>,
db: DB,
executor: TaskExecutor,
head: Head,
secret_key: SecretKey,
default_peers_path: PathBuf,
) -> NetworkConfig<ProviderFactory<Arc<DatabaseEnv>>> {
) -> NetworkConfig<ProviderFactory<DB>> {
let cfg_builder = self
.network
.network_config(config, self.chain.clone(), secret_key, default_peers_path)
Expand Down

0 comments on commit 227e1b7

Please sign in to comment.