Subkey supports 24-word phrases (#2827)

* Revamp crypto API and make seeds work better in subkey

* Final tweaks

* Update tests

* line spacing

* Avoid escapes in hex constants

* Fix build

* Another fix

* More fixes

* Minor nits
This commit is contained in:
Gavin Wood
2019-06-13 11:06:30 +02:00
committed by GitHub
parent 68f4d11df3
commit f4afdd2f0b
11 changed files with 204 additions and 211 deletions
+2 -2
View File
@@ -170,13 +170,13 @@ impl RuntimeAdapter for FactoryState<Number> {
/// Generates a random `AccountId` from `seed`.
fn gen_random_account_id(seed: &Self::Number) -> Self::AccountId {
let pair: sr25519::Pair = sr25519::Pair::from_seed(gen_seed_bytes(*seed));
let pair: sr25519::Pair = sr25519::Pair::from_seed(&gen_seed_bytes(*seed));
pair.public().into()
}
/// Generates a random `Secret` from `seed`.
fn gen_random_account_secret(seed: &Self::Number) -> Self::Secret {
let pair: sr25519::Pair = sr25519::Pair::from_seed(gen_seed_bytes(*seed));
let pair: sr25519::Pair = sr25519::Pair::from_seed(&gen_seed_bytes(*seed));
pair
}