Skip to content

Commit

Permalink
Add extra assert to coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Oct 10, 2023
1 parent b8abc1e commit 30d0bad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions coordinator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,9 @@ async fn handle_processor_messages<D: Db, Pro: Processors, P: P2p>(
loop {
match new_tributary.try_recv() {
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::Disconnected) => {
Expand Down Expand Up @@ -577,7 +579,7 @@ async fn handle_processor_messages<D: Db, Pro: Processors, P: P2p>(
}
},
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
coordinator::ProcessorMessage::SubstrateBlockAck { network, block, plans } => {
assert_eq!(
Expand Down

0 comments on commit 30d0bad

Please sign in to comment.