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()`.
pull/22550/head
Sebastian Falbesoner 3 years ago
parent 1488f55fa5
commit e3237b1cd0

@ -271,6 +271,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
# Make sure CSV is active # Make sure CSV is active
self.nodes[0].generate(500) self.nodes[0].generate(500)
assert self.nodes[0].getblockchaininfo()['softforks']['csv']['active']
# Create a P2WSH script with CSV # Create a P2WSH script with CSV
script = CScript([1, OP_CHECKSEQUENCEVERIFY, OP_DROP]) script = CScript([1, OP_CHECKSEQUENCEVERIFY, OP_DROP])
@ -304,8 +305,9 @@ class SignRawTransactionsTest(BitcoinTestFramework):
self.nodes[0].walletpassphrase("password", 9999) self.nodes[0].walletpassphrase("password", 9999)
getcontext().prec = 8 getcontext().prec = 8
# Make sure CSV is active # Make sure CLTV is active
self.nodes[0].generate(1500) self.nodes[0].generate(1500)
assert self.nodes[0].getblockchaininfo()['softforks']['bip65']['active']
# Create a P2WSH script with CLTV # Create a P2WSH script with CLTV
script = CScript([1000, OP_CHECKLOCKTIMEVERIFY, OP_DROP]) script = CScript([1000, OP_CHECKLOCKTIMEVERIFY, OP_DROP])

Loading…
Cancel
Save