Skip to content
Snippets Groups Projects
Commit 1e550b3d authored by André Silva's avatar André Silva Committed by asynchronous rob
Browse files

grandpa: fix slow gossip test (#4440)

parent 1fc3060f
Branches
No related merge requests found
......@@ -274,16 +274,25 @@ fn good_commit_leads_to_relay() {
let sender_id = id.clone();
let send_message = tester.filter_network_events(move |event| match event {
Event::EventStream(sender) => {
// Add the sending peer and send the commit
let _ = sender.unbounded_send(NetworkEvent::NotificationStreamOpened {
remote: sender_id.clone(),
engine_id: GRANDPA_ENGINE_ID,
roles: Roles::FULL,
});
let _ = sender.unbounded_send(NetworkEvent::NotificationsReceived {
remote: sender_id.clone(),
messages: vec![(GRANDPA_ENGINE_ID, commit_to_send.clone().into())],
});
// Add a random peer which will be the recipient of this message
let _ = sender.unbounded_send(NetworkEvent::NotificationStreamOpened {
remote: sc_network::PeerId::random(),
engine_id: GRANDPA_ENGINE_ID,
roles: Roles::FULL,
});
true
}
_ => false,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment