mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Simplify consensus message sending (#1166)
* Create gossip_consensus_message helper on service, simplify consensus_gossip access
This commit is contained in:
committed by
GitHub
parent
59af4de4fd
commit
dbe31230c3
@@ -229,10 +229,7 @@ impl<V: 'static + Verifier<Block>, D> Peer<V, D> {
|
||||
/// Push a message into the gossip network and relay to peers.
|
||||
/// `TestNet::sync_step` needs to be called to ensure it's propagated.
|
||||
pub fn gossip_message(&self, topic: Hash, data: Vec<u8>) {
|
||||
let gossip = self.sync.consensus_gossip();
|
||||
self.sync.with_spec(&mut TestIo::new(&self.queue, None), move |_s, context|{
|
||||
gossip.write().multicast(context, topic, data);
|
||||
});
|
||||
self.sync.gossip_consensus_message(&mut TestIo::new(&self.queue, None), topic, data);
|
||||
}
|
||||
|
||||
/// Add blocks to the peer -- edit the block before adding
|
||||
|
||||
Reference in New Issue
Block a user