derivekey: add test TestDeriveKeyXprv

This test checks that "chantools derivekey --rootkey xpriv..." works.
This commit is contained in:
Boris Nagaev 2025-01-09 15:41:25 -03:00
parent b352ed9838
commit d93e39098b
No known key found for this signature in database

View file

@ -82,3 +82,23 @@ func TestDeriveKeySeedBip39(t *testing.T) {
h.assertLogContains(keyContentBIP39)
}
func TestDeriveKeyXprv(t *testing.T) {
h := newHarness(t)
// Derive a specific key from xprv.
derive := &deriveKeyCommand{
Path: testPath,
rootKey: &rootKey{
RootKey: "xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nR" +
"k4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejM" +
"RNNU3TGtRBeJgk33yuGBxrMPHi",
},
}
err := derive.Execute(nil, nil)
require.NoError(t, err)
h.assertLogContains("cQcdieZy2d1TAdCsa5MjmHJs2gdHcD7x22nDbhJyVTUa3Ax" +
"5KB3w")
}