From e47ce42f670fc43859c157766b342509ab5916f9 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Tue, 28 Mar 2023 16:58:16 +0100 Subject: 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. --- test/functional/feature_nulldummy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/feature_nulldummy.py') diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py index d7558c830e..c95657dbbb 100755 --- a/test/functional/feature_nulldummy.py +++ b/test/functional/feature_nulldummy.py @@ -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'] -- cgit v1.2.3