Crypto fixes/improvements (#2008)

* Crypto fixes:

- Use schnorrkel's HDKD derive
- Assume all key URIs beginning with `/` are prefixed with public
  root phrase.

* Remove commented code.

* Update README

* Update core/primitives/src/ed25519.rs

Co-Authored-By: gavofyork <github@gavwood.com>
This commit is contained in:
Gav Wood
2019-03-15 13:53:09 +01:00
committed by GitHub
parent ae1351cb79
commit 03d52fdbeb
10 changed files with 70 additions and 38 deletions
+2 -3
View File
@@ -3,7 +3,6 @@ use node_template_runtime::{
AccountId, GenesisConfig, ConsensusConfig, TimestampConfig, BalancesConfig,
SudoConfig, IndicesConfig, FeesConfig,
};
use substrate_cli::DEV_PHRASE;
use substrate_service;
use ed25519::Public as AuthorityId;
@@ -26,13 +25,13 @@ pub enum Alternative {
}
fn authority_key(s: &str) -> AuthorityId {
ed25519::Pair::from_string(&format!("{}//{}", DEV_PHRASE, s), None)
ed25519::Pair::from_string(&format!("//{}", s), None)
.expect("static values are valid; qed")
.public()
}
fn account_key(s: &str) -> AccountId {
ed25519::Pair::from_string(&format!("{}//{}", DEV_PHRASE, s), None)
ed25519::Pair::from_string(&format!("//{}", s), None)
.expect("static values are valid; qed")
.public()
}