Skip to content

Commit

Permalink
kad/tests: Expect to not find record in the memory store
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv committed Jul 31, 2024
1 parent 985ecf9 commit 2d1a4b4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/protocol/libp2p/kademlia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,8 @@ mod tests {
let action = QueryAction::GetRecordQueryDone { query_id, records };
assert!(kademlia.on_query_action(action).await.is_ok());

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

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

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

0 comments on commit 2d1a4b4

Please sign in to comment.