We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8ce968 commit 01aa683Copy full SHA for 01aa683
tests/test_from_xpublic_key.py
@@ -4,6 +4,7 @@
4
import os
5
6
from hdwallet import HDWallet
7
+from hdwallet.utils import generate_entropy
8
9
# Test Values
10
base_path: str = os.path.dirname(__file__)
@@ -81,3 +82,11 @@ def test_from_xpublic_key():
81
82
del dumps["xpublic_key_hex"]
83
84
assert hdwallet.dumps() == dumps
85
+
86
+def test_derivation_from_xpublic_key():
87
+ hdwallet: HDWallet = HDWallet().from_entropy(generate_entropy())
88
+ wallet1: HDWallet = hdwallet.from_path("m/1'/2'/3'")
89
+ xpub: str = wallet1.xpublic_key()
90
+ wallet2: HDWallet = HDWallet().from_xpublic_key(xpub)
91
+ assert wallet1.xpublic_key() == wallet2.xpublic_key()
92
+ assert wallet1.from_path("m/1/2/3").xpublic_key() == wallet2.from_path("m/1/2/3").xpublic_key()
0 commit comments