mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +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:
@@ -14,6 +14,7 @@ Generate COINBASE_MATURITY (CB) more blocks to ensure the coinbases are mature.
|
||||
"""
|
||||
import time
|
||||
|
||||
from test_framework.address import address_to_scriptpubkey
|
||||
from test_framework.blocktools import (
|
||||
COINBASE_MATURITY,
|
||||
NORMAL_GBT_REQUEST_PARAMS,
|
||||
@@ -77,7 +78,7 @@ class NULLDUMMYTest(BitcoinTestFramework):
|
||||
cms = self.nodes[0].createmultisig(1, [self.pubkey])
|
||||
wms = self.nodes[0].createmultisig(1, [self.pubkey], 'p2sh-segwit')
|
||||
self.ms_address = cms["address"]
|
||||
ms_unlock_details = {"scriptPubKey": self.nodes[0].validateaddress(self.ms_address)["scriptPubKey"],
|
||||
ms_unlock_details = {"scriptPubKey": address_to_scriptpubkey(self.ms_address).hex(),
|
||||
"redeemScript": cms["redeemScript"]}
|
||||
self.wit_ms_address = wms['address']
|
||||
|
||||
|
Reference in New Issue
Block a user