Add extra assert to coordinator

This commit is contained in:
Luke Parker
2023-10-09 23:38:39 -04:00
parent b8abc1e3cc
commit 30d0bad175

View File

@@ -536,7 +536,9 @@ async fn handle_processor_messages<D: Db, Pro: Processors, P: P2p>(
loop { loop {
match new_tributary.try_recv() { match new_tributary.try_recv() {
Ok(tributary) => { Ok(tributary) => {
tributaries.insert(tributary.spec.set().session, tributary); let set = tributary.spec.set();
assert_eq!(set.network, network);
tributaries.insert(set.session, tributary);
} }
Err(mpsc::error::TryRecvError::Empty) => {} Err(mpsc::error::TryRecvError::Empty) => {}
Err(mpsc::error::TryRecvError::Disconnected) => { Err(mpsc::error::TryRecvError::Disconnected) => {
@@ -577,7 +579,7 @@ async fn handle_processor_messages<D: Db, Pro: Processors, P: P2p>(
} }
}, },
ProcessorMessage::Coordinator(inner_msg) => match inner_msg { ProcessorMessage::Coordinator(inner_msg) => match inner_msg {
// This is a special case as it's relevant to *all* Tributaries // This is a special case as it's relevant to *all* Tributaries for this network
// It doesn't return a Tributary to become `relevant_tributary` though // It doesn't return a Tributary to become `relevant_tributary` though
coordinator::ProcessorMessage::SubstrateBlockAck { network, block, plans } => { coordinator::ProcessorMessage::SubstrateBlockAck { network, block, plans } => {
assert_eq!( assert_eq!(