Skip to content

Commit

Permalink
test: add P2A coverage for decodescript
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Jul 22, 2024
1 parent 83b1313 commit 98edb44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/functional/rpc_decodescript.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ def decodescript_script_pub_key(self):
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".
Expand Down

0 comments on commit 98edb44

Please sign in to comment.