Skip to content

Commit

Permalink
Add constructor for NodeContact (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML authored Feb 12, 2025
1 parent e2ac53b commit 60e24b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/node_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ pub struct NonContactable {
}

impl NodeContact {
pub fn new(public_key: CombinedPublicKey, socket_addr: SocketAddr, enr: Option<Enr>) -> Self {
NodeContact {
public_key,
socket_addr,
enr,
}
}

pub fn node_id(&self) -> NodeId {
self.public_key.clone().into()
}
Expand Down

0 comments on commit 60e24b9

Please sign in to comment.