@@ -343,7 +343,7 @@ def run_test(self):
343
343
bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
344
344
bip113signed2 = sign_transaction (self .nodes [0 ], bip113tx_v2 )
345
345
for bip113tx in [bip113signed1 , bip113signed2 ]:
346
- self .send_blocks ([self .create_test_block ([bip113tx ])], success = False )
346
+ self .send_blocks ([self .create_test_block ([bip113tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
347
347
# BIP 113 tests should now pass if the locktime is < MTP
348
348
bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 - 1 # < MTP of prior block
349
349
bip113signed1 = sign_transaction (self .nodes [0 ], bip113tx_v1 )
@@ -375,11 +375,11 @@ def run_test(self):
375
375
# All txs without flag fail as we are at delta height = 8 < 10 and delta time = 8 * 600 < 10 * 512
376
376
bip68timetxs = [tx ['tx' ] for tx in bip68txs_v2 if not tx ['sdf' ] and tx ['stf' ]]
377
377
for tx in bip68timetxs :
378
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
378
+ self .send_blocks ([self .create_test_block ([tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
379
379
380
380
bip68heighttxs = [tx ['tx' ] for tx in bip68txs_v2 if not tx ['sdf' ] and not tx ['stf' ]]
381
381
for tx in bip68heighttxs :
382
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
382
+ self .send_blocks ([self .create_test_block ([tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
383
383
384
384
# Advance one block to 438
385
385
test_blocks = self .generate_blocks (1 )
@@ -390,7 +390,7 @@ def run_test(self):
390
390
self .send_blocks ([self .create_test_block (bip68success_txs )])
391
391
self .nodes [0 ].invalidateblock (self .nodes [0 ].getbestblockhash ())
392
392
for tx in bip68heighttxs :
393
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
393
+ self .send_blocks ([self .create_test_block ([tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
394
394
395
395
# Advance one block to 439
396
396
test_blocks = self .generate_blocks (1 )
@@ -405,7 +405,8 @@ def run_test(self):
405
405
self .log .info ("Test version 1 txs" )
406
406
407
407
# -1 OP_CSV tx and (empty stack) OP_CSV tx should fail
408
- self .send_blocks ([self .create_test_block ([bip112tx_special_v1 ])], success = False )
408
+ self .send_blocks ([self .create_test_block ([bip112tx_special_v1 ])], success = False ,
409
+ reject_reason = 'non-mandatory-script-verify-flag (Negative locktime)' )
409
410
self .send_blocks ([self .create_test_block ([bip112tx_emptystack_v1 ])], success = False ,
410
411
reject_reason = 'non-mandatory-script-verify-flag (Operation not valid with the current stack size)' )
411
412
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in argument to OP_CSV, version 1 txs should still pass
@@ -418,15 +419,17 @@ def run_test(self):
418
419
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is unset in argument to OP_CSV, version 1 txs should now fail
419
420
fail_txs = all_rlt_txs (bip112txs_vary_nSequence_v1 )
420
421
fail_txs += all_rlt_txs (bip112txs_vary_nSequence_9_v1 )
421
- fail_txs += [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_9_v1 if not tx ['sdf' ]]
422
+ fail_txs += [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_v1 if not tx ['sdf' ]]
422
423
fail_txs += [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_9_v1 if not tx ['sdf' ]]
423
424
for tx in fail_txs :
424
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
425
+ self .send_blocks ([self .create_test_block ([tx ])], success = False ,
426
+ reject_reason = 'non-mandatory-script-verify-flag (Locktime requirement not satisfied)' )
425
427
426
428
self .log .info ("Test version 2 txs" )
427
429
428
430
# -1 OP_CSV tx and (empty stack) OP_CSV tx should fail
429
- self .send_blocks ([self .create_test_block ([bip112tx_special_v2 ])], success = False )
431
+ self .send_blocks ([self .create_test_block ([bip112tx_special_v2 ])], success = False ,
432
+ reject_reason = 'non-mandatory-script-verify-flag (Negative locktime)' )
430
433
self .send_blocks ([self .create_test_block ([bip112tx_emptystack_v2 ])], success = False ,
431
434
reject_reason = 'non-mandatory-script-verify-flag (Operation not valid with the current stack size)' )
432
435
@@ -443,18 +446,21 @@ def run_test(self):
443
446
fail_txs = all_rlt_txs (bip112txs_vary_nSequence_9_v2 )
444
447
fail_txs += [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_9_v2 if not tx ['sdf' ]]
445
448
for tx in fail_txs :
446
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
449
+ self .send_blocks ([self .create_test_block ([tx ])], success = False ,
450
+ reject_reason = 'non-mandatory-script-verify-flag (Locktime requirement not satisfied)' )
447
451
448
452
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in nSequence, tx should fail
449
453
fail_txs = [tx ['tx' ] for tx in bip112txs_vary_nSequence_v2 if tx ['sdf' ]]
450
454
for tx in fail_txs :
451
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
455
+ self .send_blocks ([self .create_test_block ([tx ])], success = False ,
456
+ reject_reason = 'non-mandatory-script-verify-flag (Locktime requirement not satisfied)' )
452
457
453
458
# If sequencelock types mismatch, tx should fail
454
459
fail_txs = [tx ['tx' ] for tx in bip112txs_vary_nSequence_v2 if not tx ['sdf' ] and tx ['stf' ]]
455
460
fail_txs += [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_v2 if not tx ['sdf' ] and tx ['stf' ]]
456
461
for tx in fail_txs :
457
- self .send_blocks ([self .create_test_block ([tx ])], success = False )
462
+ self .send_blocks ([self .create_test_block ([tx ])], success = False ,
463
+ reject_reason = 'non-mandatory-script-verify-flag (Locktime requirement not satisfied)' )
458
464
459
465
# Remaining txs should pass, just test masking works properly
460
466
success_txs = [tx ['tx' ] for tx in bip112txs_vary_nSequence_v2 if not tx ['sdf' ] and not tx ['stf' ]]
0 commit comments