aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-18 00:41:28 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-18 01:07:26 +0100
commit83f6c0f9ef3a1962be02db479ddf87cb22b8c14b (patch)
tree9e75a04f3cc1cff41ae04e5ae71c7d44dd16bed0
parent099c6957de4246669b1dddba10561e802f5e8a01 (diff)
downloadbitcoin-83f6c0f9ef3a1962be02db479ddf87cb22b8c14b.tar.xz
test: add decodescript RPC test for P2TR output type
-rwxr-xr-xtest/functional/rpc_decodescript.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/rpc_decodescript.py b/test/functional/rpc_decodescript.py
index 865febd463..8c0f48129a 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 <x-only pubkey>
+ 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".