File tree 1 file changed +5
-0
lines changed
test/functional/test_framework
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 14
14
)
15
15
from test_framework .address import (
16
16
base58_to_byte ,
17
+ bech32_to_bytes ,
17
18
create_deterministic_address_bcrt1_p2tr_op_true ,
18
19
key_to_p2pkh ,
19
20
key_to_p2sh_p2wpkh ,
49
50
key_to_p2sh_p2wpkh_script ,
50
51
key_to_p2wpkh_script ,
51
52
keyhash_to_p2pkh_script ,
53
+ program_to_witness_script ,
52
54
scripthash_to_p2sh_script ,
53
55
)
54
56
from test_framework .util import (
@@ -414,6 +416,9 @@ def getnewdestination(address_type='bech32m'):
414
416
415
417
def address_to_scriptpubkey (address ):
416
418
"""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
417
422
payload , version = base58_to_byte (address )
418
423
if version == 111 : # testnet pubkey hash
419
424
return keyhash_to_p2pkh_script (payload )
You can’t perform that action at this time.
0 commit comments