Overhaul crypto (Schnorr/Ristretto, HDKD, BIP39) (#1795)

* Rijig to Ristretto

* Rebuild wasm

* adds compatibility test with the wasm module

* Add Ed25519-BIP39 support

* Bump subkey version

* Update CLI output

* New keys.

* Standard phrase/password/path keys.

* Subkey uses S-URI for secrets

* Move everything to use new HDKD crypto.

* Test fixes

* Ignore old test vector.

* fix the ^^ old test vector.

* Fix tests

* Test fixes

* Cleanups

* Fix broken key conversion logic in grandpa

CC @rphmeier

* Remove legacy Keyring usage

* Traitify `Pair`

* Replace Ed25519AuthorityId with ed25519::Public

* Expunge Ed25519AuthorityId type!

* Replace Sr25519AuthorityId with sr25519::Public

* Remove dodgy crypto type-punning conversions

* Fix some tests

* Avoid trait

* Deduplicate DeriveJunction string decode

* Remove cruft code

* Fix test

* Minor removals

* Build fix

* Subkey supports sign and verify

* Inspect works for public key URIs

* Remove more crypto type-punning

* Fix typo

* Fix tests
This commit is contained in:
Gav Wood
2019-03-13 14:08:31 +01:00
committed by GitHub
parent 17f093da13
commit d7fcf5dc9d
83 changed files with 2636 additions and 1687 deletions
+3 -8
View File
@@ -536,12 +536,7 @@ mod tests {
use super::*;
use parity_codec::Encode;
use consensus_common::BlockOrigin;
use substrate_test_client::{
self,
TestClient,
keyring::Keyring,
runtime::{Extrinsic, Transfer},
};
use substrate_test_client::{self, TestClient, AccountKeyring, runtime::{Extrinsic, Transfer}};
#[test]
fn should_remove_transactions_from_the_pool() {
@@ -551,10 +546,10 @@ mod tests {
let transfer = Transfer {
amount: 5,
nonce: 0,
from: Keyring::Alice.to_raw_public().into(),
from: AccountKeyring::Alice.into(),
to: Default::default(),
};
let signature = Keyring::from_raw_public(transfer.from.to_fixed_bytes()).unwrap().sign(&transfer.encode()).into();
let signature = AccountKeyring::from_public(&transfer.from).unwrap().sign(&transfer.encode()).into();
Extrinsic::Transfer(transfer, signature)
};
// store the transaction in the pool