From e3237b1cd07a5099fbb0108218194eb653b6a9f3 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sun, 25 Jul 2021 23:42:27 +0200 Subject: [PATCH] test: check that CSV/CLTV are active in rpc_signrawtransaction Without this check, the tests would also pass if the CSV and CLTV activation heights are not reached yet (e.g. if the .generate() calls before are removed), as the operations OP_CSV and OP_CLTV simply behave as NOPs. Also fixes a comment in the sub-test `test_signing_with_cltv()`. --- test/functional/rpc_signrawtransaction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py index f3627d1e37..71933fe1ba 100755 --- a/test/functional/rpc_signrawtransaction.py +++ b/test/functional/rpc_signrawtransaction.py @@ -271,6 +271,7 @@ class SignRawTransactionsTest(BitcoinTestFramework): # Make sure CSV is active self.nodes[0].generate(500) + assert self.nodes[0].getblockchaininfo()['softforks']['csv']['active'] # Create a P2WSH script with CSV script = CScript([1, OP_CHECKSEQUENCEVERIFY, OP_DROP]) @@ -304,8 +305,9 @@ class SignRawTransactionsTest(BitcoinTestFramework): self.nodes[0].walletpassphrase("password", 9999) getcontext().prec = 8 - # Make sure CSV is active + # Make sure CLTV is active self.nodes[0].generate(1500) + assert self.nodes[0].getblockchaininfo()['softforks']['bip65']['active'] # Create a P2WSH script with CLTV script = CScript([1000, OP_CHECKLOCKTIMEVERIFY, OP_DROP])