diff options
author | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-03-28 16:58:16 +0100 |
---|---|---|
committer | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-03-28 16:58:16 +0100 |
commit | e47ce42f670fc43859c157766b342509ab5916f9 (patch) | |
tree | e77deb4881e65aa262ce591f1dce3293c1c25910 /test/functional/wallet_fast_rescan.py | |
parent | 4142d19d741d6432ba95f3452f0d949941d89d5c (diff) |
refactor: use address_to_scriptpubkey to retrieve addresses scriptpubkey
This commit updates the code by replacing the RPC call used to
decode an address and retrieve its corresponding scriptpubkey
with the address_to_scriptpubkey function. address_to_scriptpubkey
function can now decode all addresses formats, which makes
it more efficient to use.
Diffstat (limited to 'test/functional/wallet_fast_rescan.py')
-rwxr-xr-x | test/functional/wallet_fast_rescan.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/wallet_fast_rescan.py b/test/functional/wallet_fast_rescan.py index 1ab24f1a96..112aa25e86 100755 --- a/test/functional/wallet_fast_rescan.py +++ b/test/functional/wallet_fast_rescan.py @@ -7,6 +7,7 @@ import os from typing import List +from test_framework.address import address_to_scriptpubkey from test_framework.descriptors import descsum_create from test_framework.test_framework import BitcoinTestFramework from test_framework.test_node import TestNode @@ -58,7 +59,7 @@ class WalletFastRescanTest(BitcoinTestFramework): if 'range' in desc_info: start_range, end_range = desc_info['range'] addr = w.deriveaddresses(desc_info['desc'], [end_range, end_range])[0] - spk = bytes.fromhex(w.getaddressinfo(addr)['scriptPubKey']) + spk = address_to_scriptpubkey(addr) self.log.info(f"-> range [{start_range},{end_range}], last address {addr}") else: spk = bytes.fromhex(fixed_key.p2wpkh_script) |