mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-12 19:07:14 +00:00
fix(gossipsub): fix check for fanout peer inclusion in test_join
The check for fanout peer inclusion in `test_join` does not check anything since `new_peers` is always empty.
12b785e94e/protocols/gossipsub/src/behaviour/tests.rs (L611)
I assume the intention was to fill the `new_peers` with the fanout peers. In this MR I do just that.
Pull-Request: #3628.
This commit is contained in:
parent
f64187049d
commit
64cd225dca
@ -580,7 +580,7 @@ fn test_join() {
|
|||||||
// add 3 random peers to the fanout[topic1]
|
// add 3 random peers to the fanout[topic1]
|
||||||
gs.fanout
|
gs.fanout
|
||||||
.insert(topic_hashes[1].clone(), Default::default());
|
.insert(topic_hashes[1].clone(), Default::default());
|
||||||
let new_peers: Vec<PeerId> = vec![];
|
let mut new_peers: Vec<PeerId> = vec![];
|
||||||
for _ in 0..3 {
|
for _ in 0..3 {
|
||||||
let random_peer = PeerId::random();
|
let random_peer = PeerId::random();
|
||||||
// inform the behaviour of a new peer
|
// inform the behaviour of a new peer
|
||||||
@ -598,6 +598,7 @@ fn test_join() {
|
|||||||
// add the new peer to the fanout
|
// add the new peer to the fanout
|
||||||
let fanout_peers = gs.fanout.get_mut(&topic_hashes[1]).unwrap();
|
let fanout_peers = gs.fanout.get_mut(&topic_hashes[1]).unwrap();
|
||||||
fanout_peers.insert(random_peer);
|
fanout_peers.insert(random_peer);
|
||||||
|
new_peers.push(random_peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// subscribe to topic1
|
// subscribe to topic1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user