mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Merge stable futures
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use clap::ArgMatches;
|
||||
use eth2_libp2p::{
|
||||
discovery::{build_enr, CombinedKey, Keypair, ENR_FILENAME},
|
||||
discovery::{build_enr, CombinedKey, CombinedKeyExt, Keypair, ENR_FILENAME},
|
||||
NetworkConfig, NETWORK_KEY_FILENAME,
|
||||
};
|
||||
use std::convert::TryInto;
|
||||
@@ -30,10 +30,7 @@ pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
|
||||
config.enr_tcp_port = Some(tcp_port);
|
||||
|
||||
let local_keypair = Keypair::generate_secp256k1();
|
||||
let enr_key: CombinedKey = local_keypair
|
||||
.clone()
|
||||
.try_into()
|
||||
.map_err(|e| format!("Unable to convert keypair: {:?}", e))?;
|
||||
let enr_key = CombinedKey::from_libp2p(&local_keypair)?;
|
||||
let enr = build_enr::<T>(&enr_key, &config, EnrForkId::default())
|
||||
.map_err(|e| format!("Unable to create ENR: {:?}", e))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user