From b7deedf2a9f4e774a6cbad8627f2545e27d46c77 Mon Sep 17 00:00:00 2001 From: Greg Sanders Date: Mon, 8 Jul 2024 14:25:59 -0400 Subject: [PATCH] test: add P2A coverage for decodescript --- test/functional/rpc_decodescript.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/functional/rpc_decodescript.py b/test/functional/rpc_decodescript.py index f37e61ab509ea0..8f6b1426c20ba7 100755 --- a/test/functional/rpc_decodescript.py +++ b/test/functional/rpc_decodescript.py @@ -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".