File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
test/functional/test_framework Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1414)
1515from test_framework .address import (
1616 base58_to_byte ,
17+ bech32_to_bytes ,
1718 create_deterministic_address_bcrt1_p2tr_op_true ,
1819 key_to_p2pkh ,
1920 key_to_p2sh_p2wpkh ,
4950 key_to_p2sh_p2wpkh_script ,
5051 key_to_p2wpkh_script ,
5152 keyhash_to_p2pkh_script ,
53+ program_to_witness_script ,
5254 scripthash_to_p2sh_script ,
5355)
5456from test_framework .util import (
@@ -414,6 +416,9 @@ def getnewdestination(address_type='bech32m'):
414416
415417def address_to_scriptpubkey (address ):
416418 """Converts a given address to the corresponding output script (scriptPubKey)."""
419+ version , payload = bech32_to_bytes (address )
420+ if version is not None :
421+ return program_to_witness_script (version , payload ) # testnet segwit scriptpubkey
417422 payload , version = base58_to_byte (address )
418423 if version == 111 : # testnet pubkey hash
419424 return keyhash_to_p2pkh_script (payload )
You can’t perform that action at this time.
0 commit comments