mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-12 10:57:13 +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]
|
||||
gs.fanout
|
||||
.insert(topic_hashes[1].clone(), Default::default());
|
||||
let new_peers: Vec<PeerId> = vec![];
|
||||
let mut new_peers: Vec<PeerId> = vec![];
|
||||
for _ in 0..3 {
|
||||
let random_peer = PeerId::random();
|
||||
// inform the behaviour of a new peer
|
||||
@ -598,6 +598,7 @@ fn test_join() {
|
||||
// add the new peer to the fanout
|
||||
let fanout_peers = gs.fanout.get_mut(&topic_hashes[1]).unwrap();
|
||||
fanout_peers.insert(random_peer);
|
||||
new_peers.push(random_peer);
|
||||
}
|
||||
|
||||
// subscribe to topic1
|
||||
|
Loading…
x
Reference in New Issue
Block a user