|
17 | 17 | use crate::{ParachainInherentData, INHERENT_IDENTIFIER}; |
18 | 18 | use codec::Decode; |
19 | 19 | use cumulus_primitives_core::{ |
20 | | - relay_chain, InboundDownwardMessage, InboundHrmpMessage, ParaId, PersistedValidationData, |
| 20 | + relay_chain, relay_chain::UpgradeGoAhead, InboundDownwardMessage, InboundHrmpMessage, ParaId, |
| 21 | + PersistedValidationData, |
21 | 22 | }; |
22 | 23 | use cumulus_primitives_parachain_inherent::MessageQueueChain; |
| 24 | +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; |
23 | 25 | use sc_client_api::{Backend, StorageProvider}; |
24 | 26 | use sp_crypto_hashing::twox_128; |
25 | 27 | use sp_inherents::{InherentData, InherentDataProvider}; |
26 | 28 | use sp_runtime::traits::Block; |
27 | 29 | use std::collections::BTreeMap; |
28 | 30 |
|
29 | | -use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; |
30 | | - |
31 | 31 | /// Relay chain slot duration, in milliseconds. |
32 | 32 | pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; |
33 | 33 |
|
@@ -68,10 +68,12 @@ pub struct MockValidationDataInherentDataProvider<R = ()> { |
68 | 68 | pub xcm_config: MockXcmConfig, |
69 | 69 | /// Inbound downward XCM messages to be injected into the block. |
70 | 70 | pub raw_downward_messages: Vec<Vec<u8>>, |
71 | | - // Inbound Horizontal messages sorted by channel. |
| 71 | + /// Inbound Horizontal messages sorted by channel. |
72 | 72 | pub raw_horizontal_messages: Vec<(ParaId, Vec<u8>)>, |
73 | | - // Additional key-value pairs that should be injected. |
| 73 | + /// Additional key-value pairs that should be injected. |
74 | 74 | pub additional_key_values: Option<Vec<(Vec<u8>, Vec<u8>)>>, |
| 75 | + /// Whether upgrade go ahead should be set. |
| 76 | + pub upgrade_go_ahead: Option<UpgradeGoAhead>, |
75 | 77 | } |
76 | 78 |
|
77 | 79 | /// Something that can generate randomness. |
@@ -176,6 +178,7 @@ impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider |
176 | 178 | sproof_builder.current_slot = |
177 | 179 | ((relay_parent_number / RELAY_CHAIN_SLOT_DURATION_MILLIS) as u64).into(); |
178 | 180 |
|
| 181 | + sproof_builder.upgrade_go_ahead = self.upgrade_go_ahead; |
179 | 182 | // Process the downward messages and set up the correct head |
180 | 183 | let mut downward_messages = Vec::new(); |
181 | 184 | let mut dmq_mqc = MessageQueueChain::new(self.xcm_config.starting_dmq_mqc_head); |
|
0 commit comments