aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_signer.py
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2023-04-04 18:33:08 +0200
committerSjors Provoost <sjors@sprovoost.nl>2023-04-04 18:33:08 +0200
commitbd13dc2f46ea10302a928fcf0f53b7aed77ad260 (patch)
treeb7c0773b762bd3374bbc0e675e6f8b54b1e779d8 /test/functional/wallet_signer.py
parentfe1b3256888bd0e70d0c9655f565e139ec87b606 (diff)
downloadbitcoin-bd13dc2f46ea10302a928fcf0f53b7aed77ad260.tar.xz
Switch hardened derivation marker to h in descriptors
This makes it easier to handle descriptor strings manually. E.g. an RPC call that takes an array of descriptors can now use '["desc": ".../0h/..."]'. Both markers can still be parsed. The default for new descriptors is changed to h. In normalized form h is also used. For private keys the chosen marker is preserved in a round trip. The hdkeypath field in getaddressinfo is also impacted by this change.
Diffstat (limited to 'test/functional/wallet_signer.py')
-rwxr-xr-xtest/functional/wallet_signer.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/wallet_signer.py b/test/functional/wallet_signer.py
index 8d25044e43..6aaec65b86 100755
--- a/test/functional/wallet_signer.py
+++ b/test/functional/wallet_signer.py
@@ -109,28 +109,28 @@ class WalletSignerTest(BitcoinTestFramework):
address_info = hww.getaddressinfo(address1)
assert_equal(address_info['solvable'], True)
assert_equal(address_info['ismine'], True)
- assert_equal(address_info['hdkeypath'], "m/84'/1'/0'/0/0")
+ assert_equal(address_info['hdkeypath'], "m/84h/1h/0h/0/0")
address2 = hww.getnewaddress(address_type="p2sh-segwit")
assert_equal(address2, "2N2gQKzjUe47gM8p1JZxaAkTcoHPXV6YyVp")
address_info = hww.getaddressinfo(address2)
assert_equal(address_info['solvable'], True)
assert_equal(address_info['ismine'], True)
- assert_equal(address_info['hdkeypath'], "m/49'/1'/0'/0/0")
+ assert_equal(address_info['hdkeypath'], "m/49h/1h/0h/0/0")
address3 = hww.getnewaddress(address_type="legacy")
assert_equal(address3, "n1LKejAadN6hg2FrBXoU1KrwX4uK16mco9")
address_info = hww.getaddressinfo(address3)
assert_equal(address_info['solvable'], True)
assert_equal(address_info['ismine'], True)
- assert_equal(address_info['hdkeypath'], "m/44'/1'/0'/0/0")
+ assert_equal(address_info['hdkeypath'], "m/44h/1h/0h/0/0")
address4 = hww.getnewaddress(address_type="bech32m")
assert_equal(address4, "bcrt1phw4cgpt6cd30kz9k4wkpwm872cdvhss29jga2xpmftelhqll62ms4e9sqj")
address_info = hww.getaddressinfo(address4)
assert_equal(address_info['solvable'], True)
assert_equal(address_info['ismine'], True)
- assert_equal(address_info['hdkeypath'], "m/86'/1'/0'/0/0")
+ assert_equal(address_info['hdkeypath'], "m/86h/1h/0h/0/0")
self.log.info('Test walletdisplayaddress')
result = hww.walletdisplayaddress(address1)
@@ -153,14 +153,14 @@ class WalletSignerTest(BitcoinTestFramework):
assert mock_wallet.getwalletinfo()['private_keys_enabled']
result = mock_wallet.importdescriptors([{
- "desc": "tr([00000001/86'/1'/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0/*)#0jtt2jc9",
+ "desc": "tr([00000001/86h/1h/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0/*)#7ew68cn8",
"timestamp": 0,
"range": [0,1],
"internal": False,
"active": True
},
{
- "desc": "tr([00000001/86'/1'/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/*)#7xw2h8ga",
+ "desc": "tr([00000001/86h/1h/0']tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/*)#0dtm6drl",
"timestamp": 0,
"range": [0, 0],
"internal": True,
@@ -182,7 +182,7 @@ class WalletSignerTest(BitcoinTestFramework):
# hww4 = self.nodes[1].get_wallet_rpc("hww4")
#
# descriptors = [{
- # "desc": "wpkh([00000001/84'/1'/0']tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/0/*)#x30uthjs",
+ # "desc": "wpkh([00000001/84h/1h/0']tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/0/*)#x30uthjs",
# "timestamp": "now",
# "range": [0, 1],
# "internal": False,
@@ -190,7 +190,7 @@ class WalletSignerTest(BitcoinTestFramework):
# "active": True
# },
# {
- # "desc": "wpkh([00000001/84'/1'/0']tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/*)#h92akzzg",
+ # "desc": "wpkh([00000001/84h/1h/0']tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/*)#h92akzzg",
# "timestamp": "now",
# "range": [0, 0],
# "internal": True,