diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-01-11 02:08:01 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-01-11 15:28:28 +0100 |
commit | 2f7978682245ada40e7f72c6f28bf2379fdc8ce2 (patch) | |
tree | 910b34219d84d8974bf59c23f13d8a04161cd08f /test/functional/feature_cltv.py | |
parent | c561f2f06ed25f08f7776ac41aeb2999ebe79550 (diff) | |
download | bitcoin-2f7978682245ada40e7f72c6f28bf2379fdc8ce2.tar.xz |
test: refactor: add constant for sequence number `SEQUENCE_FINAL`
Diffstat (limited to 'test/functional/feature_cltv.py')
-rwxr-xr-x | test/functional/feature_cltv.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index eb90b2c598..a6bb8cab76 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -13,6 +13,7 @@ from test_framework.blocktools import ( ) from test_framework.messages import ( CTransaction, + SEQUENCE_FINAL, msg_block, ) from test_framework.p2p import P2PInterface @@ -53,7 +54,7 @@ def cltv_invalidate(tx, failure_reason): # 3) the lock-time type (height vs. timestamp) of the top stack item and the # nLockTime field are not the same # 4) the top stack item is greater than the transaction's nLockTime field - # 5) the nSequence field of the txin is 0xffffffff + # 5) the nSequence field of the txin is 0xffffffff (SEQUENCE_FINAL) assert failure_reason in range(5) scheme = [ # | Script to prepend to scriptSig | nSequence | nLockTime | @@ -62,7 +63,7 @@ def cltv_invalidate(tx, failure_reason): [[OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP], None, None], [[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 1296688602], # timestamp of genesis block [[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 50], - [[CScriptNum(50), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0xffffffff, 50], + [[CScriptNum(50), OP_CHECKLOCKTIMEVERIFY, OP_DROP], SEQUENCE_FINAL, 50], ][failure_reason] cltv_modify_tx(tx, prepend_scriptsig=scheme[0], nsequence=scheme[1], nlocktime=scheme[2]) |