mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Generalize the Consensus Infrastructure (#883)
* Split out Consensus * Supply ImportQueue through network-service - simplify ImportQueue.import_blocks - remove Deadlock on import_block - Adding Verifier-Trait - Implement import_queue provisioning in service; allow cli to import * Allow to actually customize import queue * Consensus Gossip: Cache Message hash per Topic
This commit is contained in:
committed by
GitHub
parent
a24e61cb29
commit
ac4bcf879f
@@ -625,22 +625,12 @@ mod tests {
|
||||
type In = Box<Stream<Item=Vec<u8>,Error=()>>;
|
||||
|
||||
fn messages_for(&self, round: u64) -> Self::In {
|
||||
use network::consensus_gossip::ConsensusMessage;
|
||||
|
||||
let messages = self.inner.lock().peer(self.peer_id)
|
||||
.with_spec(|spec, _| spec.gossip.messages_for(round_to_topic(round)));
|
||||
|
||||
let messages = messages
|
||||
.map_err(
|
||||
move |_| panic!("Messages for round {} dropped too early", round)
|
||||
)
|
||||
.map(|msg| match msg {
|
||||
ConsensusMessage::ChainSpecific(raw, _) => {
|
||||
let message = GossipMessage::decode(&mut &raw[..]).unwrap();
|
||||
message.data
|
||||
}
|
||||
_ => panic!("Only chain-specific messages come under this stream"),
|
||||
});
|
||||
let messages = messages.map_err(
|
||||
move |_| panic!("Messages for round {} dropped too early", round)
|
||||
);
|
||||
|
||||
Box::new(messages)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user