@@ -51,15 +51,12 @@ def run_test(self):
51
51
print ("Running test BIP68 not consensus before versionbits activation" )
52
52
self .test_bip68_not_consensus ()
53
53
54
- print ("Verifying nVersion=2 transactions aren't standard" )
55
- self .test_version2_relay (before_activation = True )
54
+ print ("Verifying nVersion=2 transactions are standard" )
55
+ self .test_version2_relay ()
56
56
57
57
print ("Activating BIP68 (and 112/113)" )
58
58
self .activateCSV ()
59
59
60
- print ("Verifying nVersion=2 transactions are now standard" )
61
- self .test_version2_relay (before_activation = False )
62
-
63
60
print ("Passed\n " )
64
61
65
62
# Test that BIP68 is not in effect if tx version is 1, or if
@@ -399,30 +396,25 @@ def test_bip68_not_consensus(self):
399
396
self .nodes [0 ].submitblock (ToHex (block ))
400
397
assert_equal (self .nodes [0 ].getbestblockhash (), block .hash )
401
398
402
- def activateCSV (self ):
403
- # activation should happen at block height 432 (3 periods)
404
- min_activation_height = 432
405
- height = self .nodes [0 ].getblockcount ()
406
- assert (height < 432 )
407
- self .nodes [0 ].generate (432 - height )
408
- assert (get_bip9_status (self .nodes [0 ], 'csv' )['status' ] == 'active' )
409
- sync_blocks (self .nodes )
410
-
411
- # Use self.nodes[1] to test standardness relay policy
412
- def test_version2_relay (self , before_activation ):
399
+ # Use self.nodes[1] to test that version 2 transactions are standard even before BIP68 activation.
400
+ def test_version2_relay (self ):
413
401
inputs = [ ]
414
402
outputs = { self .nodes [1 ].getnewaddress () : 1.0 }
415
403
rawtx = self .nodes [1 ].createrawtransaction (inputs , outputs )
416
404
rawtxfund = self .nodes [1 ].fundrawtransaction (rawtx )['hex' ]
417
405
tx = FromHex (CTransaction (), rawtxfund )
418
406
tx .nVersion = 2
419
407
tx_signed = self .nodes [1 ].signrawtransaction (ToHex (tx ))["hex" ]
420
- try :
421
- tx_id = self .nodes [1 ].sendrawtransaction (tx_signed )
422
- assert (before_activation == False )
423
- except :
424
- assert (before_activation )
408
+ tx_id = self .nodes [1 ].sendrawtransaction (tx_signed )
425
409
410
+ def activateCSV (self ):
411
+ # activation should happen at block height 432 (3 periods)
412
+ min_activation_height = 432
413
+ height = self .nodes [0 ].getblockcount ()
414
+ assert (height < 432 )
415
+ self .nodes [0 ].generate (432 - height )
416
+ assert (get_bip9_status (self .nodes [0 ], 'csv' )['status' ] == 'active' )
417
+ sync_blocks (self .nodes )
426
418
427
419
if __name__ == '__main__' :
428
420
BIP68Test ().main ()
0 commit comments