Skip to content
Prev Previous commit
Next Next commit
Extend the test
  • Loading branch information
bkchr committed Apr 2, 2024
commit c27b265e49feb622636c6387281176b08469c124
7 changes: 6 additions & 1 deletion polkadot/runtime/parachains/src/paras/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,12 @@ fn upgrade_strategy_apply_at_expected_block_works() {
submit_super_majority_pvf_votes(&new_code, EXPECTED_SESSION, true);
assert!(FutureCodeUpgradesAt::<Test>::get().iter().any(|(id, _)| *id == para_id));

run_to_block(expected_at + 1, None);
// Going to the expected block triggers the upgrade directly.
run_to_block(expected_at, None);

// Reporting a head doesn't change anything.
Paras::note_new_head(para_id, Default::default(), expected_at - 1);

assert_eq!(Paras::past_code_meta(&para_id).most_recent_change(), Some(expected_at));
assert_eq!(PastCodeHash::<Test>::get(&(para_id, expected_at)), Some(original_code.hash()));
assert!(FutureCodeUpgrades::<Test>::get(&para_id).is_none());
Expand Down