From 7bb1412d15393024733a7910766eb1a5a7e75b94 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 16 Mar 2019 14:46:47 +0100 Subject: [PATCH] Fixes for new Schnorrkel API (#2015) * Fixes for new Schnorrkel API * Include specific commit hash for schnorrkel --- substrate/Cargo.lock | 2 +- substrate/core/primitives/Cargo.toml | 2 +- substrate/core/primitives/src/sr25519.rs | 4 +--- substrate/subkey/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 08829f4ae2..f521384442 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -2768,7 +2768,7 @@ dependencies = [ [[package]] name = "schnorrkel" version = "0.0.0" -source = "git+https://github.com/w3f/schnorrkel#0a0de4294b475ef6abdeebb50067f213ca79b3c7" +source = "git+https://github.com/w3f/schnorrkel#d3289df76b8ae6dfb68e733204c5c009df5343a9" dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/core/primitives/Cargo.toml b/substrate/core/primitives/Cargo.toml index 4c176ef404..31a0790b58 100644 --- a/substrate/core/primitives/Cargo.toml +++ b/substrate/core/primitives/Cargo.toml @@ -22,7 +22,7 @@ untrusted = { version = "0.6", optional = true } hex-literal = { version = "0.1", optional = true } base58 = { version = "0.1", optional = true } blake2-rfc = { version = "0.2.18", optional = true } -schnorrkel = { git = "https://github.com/w3f/schnorrkel", optional = true } +schnorrkel = { git = "https://github.com/w3f/schnorrkel", optional = true, commit = "d3289df76b8ae6dfb68e733204c5c009df5343a9" } rand = { version = "0.6", optional = true } sha2 = { version = "0.8", optional = true } substrate-bip39 = { git = "https://github.com/paritytech/substrate-bip39", optional = true } diff --git a/substrate/core/primitives/src/sr25519.rs b/substrate/core/primitives/src/sr25519.rs index c9c9ee9ecc..f6e135ebef 100644 --- a/substrate/core/primitives/src/sr25519.rs +++ b/substrate/core/primitives/src/sr25519.rs @@ -21,8 +21,6 @@ //! for this to work. // end::description[] -#[cfg(feature = "std")] -use blake2_rfc; #[cfg(feature = "std")] use rand::rngs::OsRng; #[cfg(feature = "std")] @@ -366,7 +364,7 @@ impl AsRef for Pair { /// Derive a single hard junction. #[cfg(feature = "std")] fn derive_hard_junction(secret: &SecretKey, cc: &[u8; CHAIN_CODE_LENGTH]) -> SecretKey { - secret.hard_derive_mini_secret_key(signing_context(b"SchnorrRistrettoHDKD").bytes(&cc[..])).expand() + secret.hard_derive_mini_secret_key(Some(ChainCode(cc.clone())), b"").0.expand() } #[cfg(feature = "std")] diff --git a/substrate/subkey/Cargo.toml b/substrate/subkey/Cargo.toml index d6f8cdd88c..3a581e504a 100644 --- a/substrate/subkey/Cargo.toml +++ b/substrate/subkey/Cargo.toml @@ -11,7 +11,7 @@ clap = { version = "~2.32", features = ["yaml"] } tiny-bip39 = "0.6.0" rustc-hex = "2.0" substrate-bip39 = { git = "https://github.com/paritytech/substrate-bip39" } -schnorrkel = { git = "https://github.com/w3f/schnorrkel" } +schnorrkel = { git = "https://github.com/w3f/schnorrkel", commit = "d3289df76b8ae6dfb68e733204c5c009df5343a9" } hex = "0.3" [features]