Report which key exactly was not found. (#1171)

This commit is contained in:
Fedor Sakharov
2019-06-07 17:50:06 +03:00
committed by GitHub
parent 60228f7dcb
commit 58015d1fb4
2 changed files with 8 additions and 3 deletions

View File

@ -252,7 +252,8 @@ fn get_value_not_found() {
loop {
match swarm.poll().unwrap() {
Async::Ready(Some(KademliaOut::GetValueResult(result))) => {
if let GetValueResult::NotFound { closest_peers} = result {
if let GetValueResult::NotFound { key, closest_peers } = result {
assert_eq!(key, target_key);
assert_eq!(closest_peers.len(), 2);
assert!(closest_peers.contains(&swarm_ids[1]));
assert!(closest_peers.contains(&swarm_ids[2]));