Skip to content

Commit 2d1a4b4

Browse files
committed
kad/tests: Expect to not find record in the memory store
Signed-off-by: Alexandru Vasile <[email protected]>
1 parent 985ecf9 commit 2d1a4b4

File tree

1 file changed

+4
-6
lines changed
  • src/protocol/libp2p/kademlia

1 file changed

+4
-6
lines changed

src/protocol/libp2p/kademlia/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,8 @@ mod tests {
951951
let action = QueryAction::GetRecordQueryDone { query_id, records };
952952
assert!(kademlia.on_query_action(action).await.is_ok());
953953

954-
// Check the local storage was updated.
955-
let record = kademlia.store.get(&key).unwrap();
956-
assert_eq!(record.value, vec![0x1]);
954+
// Check the local storage should not get updated updated.
955+
assert!(kademlia.store.get(&key).is_none());
957956
}
958957

959958
#[tokio::test]
@@ -992,8 +991,7 @@ mod tests {
992991
let action = QueryAction::GetRecordQueryDone { query_id, records };
993992
assert!(kademlia.on_query_action(action).await.is_ok());
994993

995-
// Check the local storage was updated.
996-
let record = kademlia.store.get(&key).unwrap();
997-
assert_eq!(record.value, vec![0x2]);
994+
// Check the local storage should not get updated updated.
995+
assert!(kademlia.store.get(&key).is_none());
998996
}
999997
}

0 commit comments

Comments
 (0)