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:
Ashley
2019-10-09 04:31:39 +13:00
committed by Robert Habermeier
parent 520009973f
commit 968a30685f
12 changed files with 352 additions and 81 deletions
+17
View File
@@ -2478,6 +2478,7 @@ dependencies = [
"srml-indices 2.0.0",
"srml-membership 2.0.0",
"srml-offences 1.0.0",
"srml-randomness-collective-flip 2.0.0",
"srml-session 2.0.0",
"srml-staking 2.0.0",
"srml-staking-reward-curve 2.0.0",
@@ -2544,6 +2545,7 @@ dependencies = [
"srml-executive 2.0.0",
"srml-grandpa 2.0.0",
"srml-indices 2.0.0",
"srml-randomness-collective-flip 2.0.0",
"srml-sudo 2.0.0",
"srml-support 2.0.0",
"srml-system 2.0.0",
@@ -4011,6 +4013,7 @@ dependencies = [
"sr-sandbox 2.0.0",
"sr-std 2.0.0",
"srml-balances 2.0.0",
"srml-randomness-collective-flip 2.0.0",
"srml-support 2.0.0",
"srml-system 2.0.0",
"srml-timestamp 2.0.0",
@@ -4224,6 +4227,20 @@ dependencies = [
"substrate-primitives 2.0.0",
]
[[package]]
name = "srml-randomness-collective-flip"
version = "2.0.0"
dependencies = [
"parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-io 2.0.0",
"sr-primitives 2.0.0",
"sr-std 2.0.0",
"srml-support 2.0.0",
"srml-system 2.0.0",
"substrate-primitives 2.0.0",
]
[[package]]
name = "srml-scored-pool"
version = "1.0.0"