Enable Offchain Equalise (#5683)

* Master.into()

* Remove debug stuff

* Better license

* Migrate away from SimpleDispatchInfo

* Fix test

* Revert "Migrate away from SimpleDispatchInfo"

This reverts commit dbdd27fa19948f16bd17defdc01d3dd32986df11.

* Move to offchain randomness

* Fix tests

* Fix tests more
This commit is contained in:
Kian Paimani
2020-04-27 18:51:46 +02:00
committed by GitHub
parent 33d00692d8
commit ee54eff488
20 changed files with 635 additions and 373 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ wasmi = { version = "0.6.2", optional = true }
hash-db = { version = "0.15.2", default-features = false }
hash256-std-hasher = { version = "0.15.2", default-features = false }
base58 = { version = "0.1.0", optional = true }
rand = { version = "0.7.2", optional = true }
rand = { version = "0.7.3", optional = true, features = ["small_rng"] }
substrate-bip39 = { version = "0.4.1", optional = true }
tiny-bip39 = { version = "0.7", optional = true }
regex = { version = "1.3.1", optional = true }
@@ -165,7 +165,12 @@ impl offchain::Externalities for TestOffchainExt {
}
fn random_seed(&mut self) -> [u8; 32] {
unimplemented!("not needed in tests so far")
use rand::{SeedableRng, RngCore};
use rand::rngs::SmallRng;
let mut seed = [0u8; 32];
let mut small_rng = SmallRng::from_entropy();
small_rng.fill_bytes(&mut seed);
seed
}
fn local_storage_set(&mut self, kind: StorageKind, key: &[u8], value: &[u8]) {