mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 10:42:23 +02:00
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.
This commit is contained in:
@ -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"]]
|
||||
|
Reference in New Issue
Block a user