mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Split off System random functions into a new Randomness module (#3699)
* split off system randomness functions into a new module * bump spec and impl version * Move randomness to bottom of construct_runtime calls, move initialization into on_initialize * Update srml/randomness/Cargo.toml Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update srml/randomness/src/lib.rs Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update srml/randomness/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update srml/randomness/Cargo.toml Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Improve system example * Update Cargo.lock * Fix randomness example * Get rid of the stored index * Add tests * Add a random test * Improve docs * Fix executive test :^) * Add a utility function to tests * Update srml/randomness/Cargo.toml Co-Authored-By: Gavin Wood <github@gavwood.com> * Update srml/randomness/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update srml/randomness/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Change interpretation of block numbers * rename crate * refactor randomess module usage * change random material len to a const * Update srml/randomness-collective-flip/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update srml/randomness-collective-flip/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Robert Habermeier
parent
520009973f
commit
968a30685f
@@ -40,6 +40,7 @@ im-online = { package = "srml-im-online", path = "../../srml/im-online", default
|
||||
indices = { package = "srml-indices", path = "../../srml/indices", default-features = false }
|
||||
membership = { package = "srml-membership", path = "../../srml/membership", default-features = false }
|
||||
offences = { package = "srml-offences", path = "../../srml/offences", default-features = false }
|
||||
randomness-collective-flip = { package = "srml-randomness-collective-flip", path = "../../srml/randomness-collective-flip", default-features = false }
|
||||
session = { package = "srml-session", path = "../../srml/session", default-features = false, features = ["historical"] }
|
||||
staking = { package = "srml-staking", path = "../../srml/staking", default-features = false }
|
||||
srml-staking-reward-curve = { path = "../../srml/staking/reward-curve"}
|
||||
@@ -78,6 +79,7 @@ std = [
|
||||
"offchain-primitives/std",
|
||||
"offences/std",
|
||||
"primitives/std",
|
||||
"randomness-collective-flip/std",
|
||||
"rstd/std",
|
||||
"rustc-hex",
|
||||
"safe-mix/std",
|
||||
|
||||
@@ -84,8 +84,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
// and set impl_version to equal spec_version. If only runtime
|
||||
// implementation changes and behavior does not, then leave spec_version as
|
||||
// is and increment impl_version.
|
||||
spec_version: 172,
|
||||
impl_version: 172,
|
||||
spec_version: 173,
|
||||
impl_version: 173,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
@@ -518,6 +518,7 @@ construct_runtime!(
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config<T>},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -589,7 +590,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
|
||||
fn random_seed() -> <Block as BlockT>::Hash {
|
||||
System::random_seed()
|
||||
RandomnessCollectiveFlip::random_seed()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user