mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
test: add P2A coverage for decodescript
This commit is contained in:
parent
1349e9ec15
commit
71c9b02a04
1 changed files with 10 additions and 0 deletions
|
@ -187,6 +187,16 @@ class DecodeScriptTest(BitcoinTestFramework):
|
|||
assert_equal('1 ' + xonly_public_key, rpc_result['asm'])
|
||||
assert 'segwit' not in rpc_result
|
||||
|
||||
self.log.info("- P2A (anchor)")
|
||||
# 1 <4e73>
|
||||
witprog_hex = '4e73'
|
||||
rpc_result = self.nodes[0].decodescript('5102' + witprog_hex)
|
||||
assert_equal('anchor', rpc_result['type'])
|
||||
# in the disassembly, the witness program is shown as single decimal due to its small size
|
||||
witprog_as_decimal = int.from_bytes(bytes.fromhex(witprog_hex), 'little')
|
||||
assert_equal(f'1 {witprog_as_decimal}', rpc_result['asm'])
|
||||
assert_equal('bcrt1pfeesnyr2tx', rpc_result['address'])
|
||||
|
||||
def decoderawtransaction_asm_sighashtype(self):
|
||||
"""Test decoding scripts via RPC command "decoderawtransaction".
|
||||
|
||||
|
|
Loading…
Reference in a new issue