feat: expose Op node network_config helper (#11506)

This commit is contained in:
Matthias Seitz
2024-10-05 20:12:28 +02:00
committed by GitHub
parent 51db6564d6
commit 41455dfcdd
2 changed files with 36 additions and 13 deletions

View File

@ -106,6 +106,14 @@ impl<C> NetworkConfig<C> {
NetworkConfig::builder(secret_key).build(client)
}
/// Apply a function to the config.
pub fn apply<F>(self, f: F) -> Self
where
F: FnOnce(Self) -> Self,
{
f(self)
}
/// Sets the config to use for the discovery v4 protocol.
pub fn set_discovery_v4(mut self, discovery_config: Discv4Config) -> Self {
self.discovery_v4_config = Some(discovery_config);