From 83f6c0f9ef3a1962be02db479ddf87cb22b8c14b Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Thu, 18 Nov 2021 00:41:28 +0100 Subject: [PATCH] test: add decodescript RPC test for P2TR output type --- test/functional/rpc_decodescript.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/rpc_decodescript.py b/test/functional/rpc_decodescript.py index 865febd4631..8c0f48129a1 100755 --- a/test/functional/rpc_decodescript.py +++ b/test/functional/rpc_decodescript.py @@ -176,6 +176,14 @@ class DecodeScriptTest(BitcoinTestFramework): # a nested segwit script should not be returned in the results. assert 'segwit' not in rpc_result + self.log.info("- P2TR") + # 1 + xonly_public_key = '01'*32 # first ever P2TR output on mainnet + rpc_result = self.nodes[0].decodescript('5120' + xonly_public_key) + assert_equal('witness_v1_taproot', rpc_result['type']) + assert_equal('1 ' + xonly_public_key, rpc_result['asm']) + assert 'segwit' not in rpc_result + def decoderawtransaction_asm_sighashtype(self): """Test decoding scripts via RPC command "decoderawtransaction".