Skip to content

Commit

Permalink
test: update for Bytes::from_static for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Oct 22, 2024
1 parent b85f20b commit 44c94ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocols/kad/src/behaviour/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ fn get_record() {
.map(|(_addr, swarm)| swarm)
.collect::<Vec<_>>();

let record = Record::new(random_multihash(), Bytes::from(vec![4, 5, 6]));
let record = Record::new(random_multihash(), Bytes::from_static(&[4, 5, 6]));

swarms[2].behaviour_mut().store.put(record.clone()).unwrap();
let qid = swarms[0].behaviour_mut().get_record(record.key.clone());
Expand Down Expand Up @@ -875,7 +875,7 @@ fn get_record_many() {
.collect::<Vec<_>>();
let num_results = 10;

let record = Record::new(random_multihash(), Bytes::from(vec![4, 5, 6]));
let record = Record::new(random_multihash(), Bytes::from_static(&[4, 5, 6]));

for swarm in swarms.iter_mut().take(num_nodes) {
swarm.behaviour_mut().store.put(record.clone()).unwrap();
Expand Down

0 comments on commit 44c94ae

Please sign in to comment.