Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Allow arbitrary key-values in RelayStateSproofBuilder (#2407)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk committed Mar 31, 2023
1 parent 9106fa8 commit e5035c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/relay-sproof-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub struct RelayStateSproofBuilder {
pub current_slot: relay_chain::Slot,
pub current_epoch: u64,
pub randomness: relay_chain::Hash,
pub additional_key_values: Vec<(Vec<u8>, Vec<u8>)>,
}

impl Default for RelayStateSproofBuilder {
Expand All @@ -71,6 +72,7 @@ impl Default for RelayStateSproofBuilder {
current_slot: 0.into(),
current_epoch: 0u64,
randomness: relay_chain::Hash::default(),
additional_key_values: vec![],
}
}
}
Expand Down Expand Up @@ -163,6 +165,10 @@ impl RelayStateSproofBuilder {
self.randomness.encode(),
);
insert(relay_chain::well_known_keys::CURRENT_SLOT.to_vec(), self.current_slot.encode());

for (key, value) in self.additional_key_values {
insert(key, value);
}
}

let root = backend.root().clone();
Expand Down

0 comments on commit e5035c8

Please sign in to comment.