@@ -90,7 +90,6 @@ def set_test_params(self):
90
90
self .setup_clean_chain = True
91
91
self .extra_args = [[
92
92
93
- '-acceptnonstdtxn=1' ,
94
93
'-par=1' , # Use only one script thread to get the exact reject reason for testing
95
94
]]
96
95
self .supports_cli = False
@@ -103,12 +102,14 @@ def create_self_transfer_from_utxo(self, input_tx):
103
102
def create_bip112special (self , input , txversion ):
104
103
tx = self .create_self_transfer_from_utxo (input )
105
104
tx .nVersion = txversion
105
+ self .miniwallet .sign_tx (tx )
106
106
tx .vin [0 ].scriptSig = CScript ([- 1 , OP_CHECKSEQUENCEVERIFY , OP_DROP ] + list (CScript (tx .vin [0 ].scriptSig )))
107
107
return tx
108
108
109
109
def create_bip112emptystack (self , input , txversion ):
110
110
tx = self .create_self_transfer_from_utxo (input )
111
111
tx .nVersion = txversion
112
+ self .miniwallet .sign_tx (tx )
112
113
tx .vin [0 ].scriptSig = CScript ([OP_CHECKSEQUENCEVERIFY ] + list (CScript (tx .vin [0 ].scriptSig )))
113
114
return tx
114
115
@@ -126,6 +127,7 @@ def create_bip68txs(self, bip68inputs, txversion, locktime_delta=0):
126
127
tx = self .create_self_transfer_from_utxo (bip68inputs [i ])
127
128
tx .nVersion = txversion
128
129
tx .vin [0 ].nSequence = locktime + locktime_delta
130
+ self .miniwallet .sign_tx (tx )
129
131
tx .rehash ()
130
132
txs .append ({'tx' : tx , 'sdf' : sdf , 'stf' : stf })
131
133
@@ -143,6 +145,7 @@ def create_bip112txs(self, bip112inputs, varyOP_CSV, txversion, locktime_delta=0
143
145
else : # vary nSequence instead, OP_CSV is fixed
144
146
tx .vin [0 ].nSequence = locktime + locktime_delta
145
147
tx .nVersion = txversion
148
+ self .miniwallet .sign_tx (tx )
146
149
if (varyOP_CSV ):
147
150
tx .vin [0 ].scriptSig = CScript ([locktime , OP_CHECKSEQUENCEVERIFY , OP_DROP ] + list (CScript (tx .vin [0 ].scriptSig )))
148
151
else :
@@ -178,7 +181,7 @@ def send_blocks(self, blocks, success=True, reject_reason=None):
178
181
179
182
def run_test (self ):
180
183
self .helper_peer = self .nodes [0 ].add_p2p_connection (P2PDataStore ())
181
- self .miniwallet = MiniWallet (self .nodes [0 ], raw_script = True )
184
+ self .miniwallet = MiniWallet (self .nodes [0 ], use_p2pk = True )
182
185
183
186
self .log .info ("Generate blocks in the past for coinbase outputs." )
184
187
long_past_time = int (time .time ()) - 600 * 1000 # enough to build up to 1000 blocks 10 minutes apart without worrying about getting into the future
@@ -285,7 +288,7 @@ def run_test(self):
285
288
success_txs = []
286
289
# BIP113 tx, -1 CSV tx and empty stack CSV tx should succeed
287
290
bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
288
- bip113tx_v1 . rehash ( )
291
+ self . miniwallet . sign_tx ( bip113tx_v1 )
289
292
success_txs .append (bip113tx_v1 )
290
293
success_txs .append (bip112tx_special_v1 )
291
294
success_txs .append (bip112tx_emptystack_v1 )
@@ -305,7 +308,7 @@ def run_test(self):
305
308
success_txs = []
306
309
# BIP113 tx, -1 CSV tx and empty stack CSV tx should succeed
307
310
bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
308
- bip113tx_v2 . rehash ( )
311
+ self . miniwallet . sign_tx ( bip113tx_v2 )
309
312
success_txs .append (bip113tx_v2 )
310
313
success_txs .append (bip112tx_special_v2 )
311
314
success_txs .append (bip112tx_emptystack_v2 )
@@ -331,16 +334,20 @@ def run_test(self):
331
334
self .log .info ("BIP 113 tests" )
332
335
# BIP 113 tests should now fail regardless of version number if nLockTime isn't satisfied by new rules
333
336
bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
337
+ self .miniwallet .sign_tx (bip113tx_v1 )
334
338
bip113tx_v1 .rehash ()
335
339
bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
340
+ self .miniwallet .sign_tx (bip113tx_v2 )
336
341
bip113tx_v2 .rehash ()
337
342
for bip113tx in [bip113tx_v1 , bip113tx_v2 ]:
338
343
self .send_blocks ([self .create_test_block ([bip113tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
339
344
340
345
# BIP 113 tests should now pass if the locktime is < MTP
341
346
bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 - 1 # < MTP of prior block
347
+ self .miniwallet .sign_tx (bip113tx_v1 )
342
348
bip113tx_v1 .rehash ()
343
349
bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 - 1 # < MTP of prior block
350
+ self .miniwallet .sign_tx (bip113tx_v2 )
344
351
bip113tx_v2 .rehash ()
345
352
for bip113tx in [bip113tx_v1 , bip113tx_v2 ]:
346
353
self .send_blocks ([self .create_test_block ([bip113tx ])])
@@ -465,6 +472,7 @@ def run_test(self):
465
472
time_txs = []
466
473
for tx in [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_v2 if not tx ['sdf' ] and tx ['stf' ]]:
467
474
tx .vin [0 ].nSequence = BASE_RELATIVE_LOCKTIME | SEQ_TYPE_FLAG
475
+ self .miniwallet .sign_tx (tx )
468
476
tx .rehash ()
469
477
time_txs .append (tx )
470
478
0 commit comments