paras: fix upgrade restriction signal (#4603)

Closes #3971

Read the linked issue.

Apart from that, this addresses the concern raised in this [comment] by
just adding a test. I couldn't find a clean way to reconcile a block
number delay with a PVF voting TTL, so I just resorted to rely on the
test. Should be fine for now.

[comment]: https://github.com/paritytech/polkadot/pull/4457#discussion_r770517562
This commit is contained in:
Sergei Shulepov
2021-12-31 16:32:40 +01:00
committed by GitHub
parent 72a92eaf9e
commit 5f6a03925a
6 changed files with 116 additions and 19 deletions
+2 -2
View File
@@ -797,7 +797,7 @@ mod tests {
let b = System::block_number();
Scheduler::initializer_finalize();
Paras::initializer_finalize();
Paras::initializer_finalize(b);
if let Some(notification) = new_session(b + 1) {
let mut notification_with_session_index = notification;
@@ -831,7 +831,7 @@ mod tests {
run_to_block(to, &new_session);
Scheduler::initializer_finalize();
Paras::initializer_finalize();
Paras::initializer_finalize(to);
if let Some(notification) = new_session(to + 1) {
Paras::initializer_on_new_session(&notification);