Last active
October 25, 2019 18:39
-
-
Save b-m-f/f9a17b248806de5219dca1878a09f4cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests { | |
// Note this useful idiom: importing names from outer (for mod tests) scope. | |
use super::*; | |
use enr::{Enr, EnrBuilder}; | |
use libp2p_core::identity; | |
#[test] | |
fn test_updating_connection_on_ping() { | |
let keypair = identity::Keypair::generate_secp256k1(); | |
let ip: IpAddr = "127.0.0.1".parse().unwrap(); | |
let enr = EnrBuilder::new("v4") | |
.ip(ip.clone().into()) | |
.udp(500) | |
.build(&keypair) | |
.unwrap(); | |
let discv5: Discv5<String> = Discv5::new(enr, keypair.clone(), ip.into()).unwrap(); | |
println!("{:?}", discv5.kbuckets); | |
assert_eq!(true, false); | |
// set a node to be disconnected | |
// call handle_RPC with a PONG and ensure that the corrent Node in the DHT is updated | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment