From 22a7fad75f98cad8b1f43ea837cf2d436cbcc25c Mon Sep 17 00:00:00 2001 From: Amar Singh <asinghchrony@protonmail.com> Date: Thu, 10 Mar 2022 14:00:57 -0500 Subject: [PATCH] Add babe randomness to well known keys (#5030) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add babe randomness storage keys to well known keys * Update primitives/src/v1/mod.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> --- polkadot/primitives/src/v2/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/polkadot/primitives/src/v2/mod.rs b/polkadot/primitives/src/v2/mod.rs index 9495978ba5e..36a9ad35ac1 100644 --- a/polkadot/primitives/src/v2/mod.rs +++ b/polkadot/primitives/src/v2/mod.rs @@ -176,6 +176,24 @@ pub mod well_known_keys { // <Hrmp as Store>::HrmpEgressChannelsIndex::prefix_hash(); // + /// The current relay chain block randomness + /// + /// The storage item should be accessed as a `schnorrkel::Randomness` encoded value. + pub const CURRENT_BLOCK_RANDOMNESS: &[u8] = + &hex!["1cb6f36e027abb2091cfb5110ab5087fd077dfdb8adb10f78f10a5df8742c545"]; + + /// The randomness for one epoch ago + /// + /// The storage item should be accessed as a `schnorrkel::Randomness` encoded value. + pub const ONE_EPOCH_AGO_RANDOMNESS: &[u8] = + &hex!["1cb6f36e027abb2091cfb5110ab5087f7ce678799d3eff024253b90e84927cc6"]; + + /// The randomness for two epochs ago + /// + /// The storage item should be accessed as a `schnorrkel::Randomness` encoded value. + pub const TWO_EPOCHS_AGO_RANDOMNESS: &[u8] = + &hex!["1cb6f36e027abb2091cfb5110ab5087f7a414cb008e0e61e46722aa60abdd672"]; + /// The current slot number. /// /// The storage entry should be accessed as a `Slot` encoded value. -- GitLab