Skip to content

Commit

Permalink
work with additional key values
Browse files Browse the repository at this point in the history
  • Loading branch information
girazoki committed Nov 27, 2023
1 parent d95f54c commit c3d18c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cumulus/primitives/parachain-inherent/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub struct MockValidationDataInherentDataProvider<R = ()> {
pub raw_downward_messages: Vec<Vec<u8>>,
// Inbound Horizontal messages sorted by channel
pub raw_horizontal_messages: Vec<(ParaId, Vec<u8>)>,
// Additional keys to be injected
pub additional_key_values: Option<Vec<(Vec<u8>, Vec<u8>)>>
}

pub trait GenerateRandomness<I> {
Expand Down Expand Up @@ -210,6 +212,10 @@ impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider
sproof_builder.randomness =
self.relay_randomness_config.generate_randomness(self.current_para_block.into());

if let Some(key_values) = &self.additional_key_values {
sproof_builder.additional_key_values = key_values.clone()
}

let (relay_parent_storage_root, proof) = sproof_builder.into_state_root_and_proof();

inherent_data.put_data(
Expand Down

0 comments on commit c3d18c8

Please sign in to comment.