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/rpc_createmultisig.py | |
parent | 4142d19d741d6432ba95f3452f0d949941d89d5c (diff) | |
download | bitcoin-e47ce42f670fc43859c157766b342509ab5916f9.tar.xz |
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/rpc_createmultisig.py')
-rwxr-xr-x | test/functional/rpc_createmultisig.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/rpc_createmultisig.py b/test/functional/rpc_createmultisig.py index 7d03ed2951..bec499107f 100755 --- a/test/functional/rpc_createmultisig.py +++ b/test/functional/rpc_createmultisig.py @@ -8,6 +8,7 @@ import itertools import json import os +from test_framework.address import address_to_scriptpubkey from test_framework.blocktools import COINBASE_MATURITY from test_framework.authproxy import JSONRPCException from test_framework.descriptors import descsum_create, drop_origins @@ -193,7 +194,7 @@ class RpcCreateMultiSigTest(BitcoinTestFramework): assert mredeemw == mredeem wmulti.unloadwallet() - spk = bytes.fromhex(node0.validateaddress(madd)["scriptPubKey"]) + spk = address_to_scriptpubkey(madd) txid, _ = self.wallet.send_to(from_node=self.nodes[0], scriptPubKey=spk, amount=1300) tx = node0.getrawtransaction(txid, True) vout = [v["n"] for v in tx["vout"] if madd == v["scriptPubKey"]["address"]] |