From 34af8dcfcd006294f43c7d1f3f5963eee7d0ef71 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 25 Sep 2023 17:11:29 -0500 Subject: [PATCH] keyfork-derive-util: add test requiring ed25519 hardened derivation --- keyfork-derive-util/src/tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/keyfork-derive-util/src/tests.rs b/keyfork-derive-util/src/tests.rs index 059131b..0200794 100644 --- a/keyfork-derive-util/src/tests.rs +++ b/keyfork-derive-util/src/tests.rs @@ -102,6 +102,17 @@ fn ed25519() { } } +#[cfg(feature = "ed25519")] +#[test] +#[should_panic] +fn panics_with_unhardened_derivation() { + use ed25519_dalek::SigningKey; + + let seed = hex!("000102030405060708090a0b0c0d0e0f"); + let xkey = ExtendedPrivateKey::::new(seed).unwrap(); + xkey.derive_path(&DerivationPath::from_str("m/0").unwrap()).unwrap(); +} + #[cfg(feature = "ed25519")] #[test] #[should_panic]