parachain-system: Send same event & digest as a standalone chain (#2064)

This ensures that upgrading a parachain code sends the same event &
digest as when using `set_code` on a standalone chain.

Close: https://github.com/paritytech/polkadot-sdk/issues/2049
This commit is contained in:
Bastian Köcher
2023-10-30 17:37:10 +01:00
committed by GitHub
parent 40ff09b8fb
commit 2d9426f1cc
3 changed files with 13 additions and 13 deletions
+10 -2
View File
@@ -869,7 +869,7 @@ fn hrmp_outbound_respects_used_bandwidth() {
}
#[test]
fn events() {
fn runtime_upgrade_events() {
BlockTests::new()
.with_relay_sproof_builder(|_, block_number, builder| {
if block_number > 123 {
@@ -894,12 +894,20 @@ fn events() {
|| {},
|| {
let events = System::events();
assert_eq!(events[0].event, RuntimeEvent::System(frame_system::Event::CodeUpdated));
assert_eq!(
events[0].event,
events[1].event,
RuntimeEvent::ParachainSystem(crate::Event::ValidationFunctionApplied {
relay_chain_block_num: 1234
})
);
assert!(System::digest()
.logs()
.iter()
.any(|d| *d == sp_runtime::generic::DigestItem::RuntimeEnvironmentUpdated));
},
);
}