mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 19:11:04 +00:00
refactor View to include finalized_number (#2128)
* refactor View to include finalized_number * guide: update the NetworkBridge on BlockFinalized * av-store: fix the tests * actually fix tests * grumbles * ignore macro doctest * use Hash::repeat_bytes more consistently * broadcast empty leaves updates as well * fix issuing view updates on empty leaves updates
This commit is contained in:
@@ -1415,13 +1415,10 @@ where
|
||||
self.on_head_deactivated(deactivated)
|
||||
}
|
||||
|
||||
// Most of the time we have a leave already closed when it is finalized, so we check here if there are actually
|
||||
// any updates before sending it to the subsystems.
|
||||
if !update.is_empty() {
|
||||
self.broadcast_signal(OverseerSignal::ActiveLeaves(update)).await?;
|
||||
}
|
||||
|
||||
self.broadcast_signal(OverseerSignal::BlockFinalized(block.hash)).await?;
|
||||
self.broadcast_signal(OverseerSignal::BlockFinalized(block.hash, block.number)).await?;
|
||||
// broadcast `ActiveLeavesUpdate` even if empty to issue view updates
|
||||
self.broadcast_signal(OverseerSignal::ActiveLeaves(update)).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -2061,7 +2058,7 @@ mod tests {
|
||||
deactivated: [first_block_hash, second_block_hash].as_ref().into(),
|
||||
..Default::default()
|
||||
}),
|
||||
OverseerSignal::BlockFinalized(third_block_hash),
|
||||
OverseerSignal::BlockFinalized(third_block_hash, 3),
|
||||
];
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user