diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-11-08 18:43:39 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-11-08 18:43:39 +0100 |
commit | 887d85e43d136dbfc2428f873ced3de50076bbd0 (patch) | |
tree | 5dd156a5a40932c1219d96f5562531a5fc128430 | |
parent | 50422b770a40f5fa964201d1e99fd6b5dc1653ca (diff) | |
download | bitcoin-887d85e43d136dbfc2428f873ced3de50076bbd0.tar.xz |
test: add missing bech32m / BIP86 test-cases to wallet_descriptor.py
-rwxr-xr-x | test/functional/wallet_descriptor.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/functional/wallet_descriptor.py b/test/functional/wallet_descriptor.py index 5dc23ba245..e7cfa56c46 100755 --- a/test/functional/wallet_descriptor.py +++ b/test/functional/wallet_descriptor.py @@ -62,6 +62,11 @@ class WalletDescriptorTest(BitcoinTestFramework): assert addr_info['desc'].startswith('wpkh(') assert_equal(addr_info['hdkeypath'], 'm/84\'/1\'/0\'/0/0') + addr = self.nodes[0].getnewaddress("", "bech32m") + addr_info = self.nodes[0].getaddressinfo(addr) + assert addr_info['desc'].startswith('tr(') + assert_equal(addr_info['hdkeypath'], 'm/86\'/1\'/0\'/0/0') + # Check that getrawchangeaddress works addr = self.nodes[0].getrawchangeaddress("legacy") addr_info = self.nodes[0].getaddressinfo(addr) @@ -78,6 +83,11 @@ class WalletDescriptorTest(BitcoinTestFramework): assert addr_info['desc'].startswith('wpkh(') assert_equal(addr_info['hdkeypath'], 'm/84\'/1\'/0\'/1/0') + addr = self.nodes[0].getrawchangeaddress("bech32m") + addr_info = self.nodes[0].getaddressinfo(addr) + assert addr_info['desc'].startswith('tr(') + assert_equal(addr_info['hdkeypath'], 'm/86\'/1\'/0\'/1/0') + # Make a wallet to receive coins at self.nodes[0].createwallet(wallet_name="desc2", descriptors=True) recv_wrpc = self.nodes[0].get_wallet_rpc("desc2") @@ -161,9 +171,11 @@ class WalletDescriptorTest(BitcoinTestFramework): addr_types = [('legacy', False, 'pkh(', '44\'/1\'/0\'', -13), ('p2sh-segwit', False, 'sh(wpkh(', '49\'/1\'/0\'', -14), ('bech32', False, 'wpkh(', '84\'/1\'/0\'', -13), + ('bech32m', False, 'tr(', '86\'/1\'/0\'', -13), ('legacy', True, 'pkh(', '44\'/1\'/0\'', -13), ('p2sh-segwit', True, 'sh(wpkh(', '49\'/1\'/0\'', -14), - ('bech32', True, 'wpkh(', '84\'/1\'/0\'', -13)] + ('bech32', True, 'wpkh(', '84\'/1\'/0\'', -13), + ('bech32m', True, 'tr(', '86\'/1\'/0\'', -13)] for addr_type, internal, desc_prefix, deriv_path, int_idx in addr_types: int_str = 'internal' if internal else 'external' |