Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work with additional key values #1757

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 key-value pairs that should 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