From 4dbe5bbf3a9ff96c96e3db068730cc7af0a34a0f Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 9 Apr 2024 09:45:57 +1000 Subject: [PATCH] test: Use 'm/' prefix in derivation path string In the integration test of the new PSBT signing API the derivation path strings do not have a leading 'm/'. The PR that introduced the new API must have overlapped with the one that removed the prefix from the `bip32` modules `DerivationPath` string parsing because when we reverted that change these paths were not included. --- bitcoin/tests/psbt-sign-taproot.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bitcoin/tests/psbt-sign-taproot.rs b/bitcoin/tests/psbt-sign-taproot.rs index a8da4084e..4cf7616b7 100644 --- a/bitcoin/tests/psbt-sign-taproot.rs +++ b/bitcoin/tests/psbt-sign-taproot.rs @@ -31,12 +31,13 @@ fn psbt_sign_taproot() { _secp: &Secp256k1, ) -> Result, Self::Error> { match key_request { - KeyRequest::Bip32((mfp, _)) => + KeyRequest::Bip32((mfp, _)) => { if mfp == self.mfp { Ok(Some(self.sk)) } else { Err(SignError::KeyNotFound) - }, + } + } _ => Err(SignError::KeyNotFound), } } @@ -45,9 +46,9 @@ fn psbt_sign_taproot() { let secp = &Secp256k1::new(); let sk_path = [ - ("dff1c8c2c016a572914b4c5adb8791d62b4768ae9d0a61be8ab94cf5038d7d90", "86'/1'/0'/0/0"), - ("1ede31b0e7e47c2afc65ffd158b1b1b9d3b752bba8fd117dc8b9e944a390e8d9", "86'/1'/0'/0/1"), - ("1fb777f1a6fb9b76724551f8bc8ad91b77f33b8c456d65d746035391d724922a", "86'/1'/0'/0/2"), + ("dff1c8c2c016a572914b4c5adb8791d62b4768ae9d0a61be8ab94cf5038d7d90", "m/86'/1'/0'/0/0"), + ("1ede31b0e7e47c2afc65ffd158b1b1b9d3b752bba8fd117dc8b9e944a390e8d9", "m/86'/1'/0'/0/1"), + ("1fb777f1a6fb9b76724551f8bc8ad91b77f33b8c456d65d746035391d724922a", "m/86'/1'/0'/0/2"), ]; let mfp = "73c5da0a"; @@ -225,7 +226,7 @@ fn create_psbt_for_taproot_key_path_spend( let mut psbt = Psbt::from_unsigned_tx(transaction).unwrap(); let mfp = "73c5da0a"; - let internal_key_path = "86'/1'/0'/0/2"; + let internal_key_path = "m/86'/1'/0'/0/2"; let mut origins = BTreeMap::new(); origins.insert(