diff --git a/cmd/chantools/derivekey_test.go b/cmd/chantools/derivekey_test.go index e99a926..47ee731 100644 --- a/cmd/chantools/derivekey_test.go +++ b/cmd/chantools/derivekey_test.go @@ -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") +}