Skip to content

Commit

Permalink
[feat] Made Enr generic with Enr<CombinedKey> as default
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 27, 2024
1 parent ab4ce9a commit a67cfa5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/discv5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub enum Event {

/// The main Discv5 Service struct. This provides the user-level API for performing queries and
/// interacting with the underlying service.
pub struct Discv5<P = DefaultProtocolId>
pub struct Discv5<P = DefaultProtocolId, K : EnrKey>
where
P: ProtocolIdentity,
{
Expand All @@ -96,17 +96,17 @@ where
/// The local ENR of the server.
local_enr: Arc<RwLock<Enr>>,
/// The key associated with the local ENR, required for updating the local ENR.
enr_key: Arc<RwLock<CombinedKey>>,
enr_key: Arc<RwLock<K>>,
// Type of socket we are using
ip_mode: IpMode,
/// Phantom for the protocol id.
_phantom: PhantomData<P>,
}

impl<P: ProtocolIdentity> Discv5<P> {
impl<P: ProtocolIdentity, K:EnrKey> Discv5<P,K> {
pub fn new(
local_enr: Enr,
enr_key: CombinedKey,
enr_key: K,
mut config: Config,
) -> Result<Self, &'static str> {
// ensure the keypair matches the one that signed the enr.
Expand Down

0 comments on commit a67cfa5

Please sign in to comment.