@@ -252,7 +252,7 @@ def test_unnecessary_witness_before_segwit_activation(self):
252
252
tx = CTransaction ()
253
253
tx .vin .append (CTxIn (COutPoint (self .utxo [0 ].sha256 , self .utxo [0 ].n ), b"" ))
254
254
tx .vout .append (CTxOut (self .utxo [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
255
- tx .wit .vtxinwit .append (CTxinWitness ())
255
+ tx .wit .vtxinwit .append (CTxInWitness ())
256
256
tx .wit .vtxinwit [0 ].scriptWitness .stack = [CScript ([CScriptNum (1 )])]
257
257
258
258
# Verify the hash with witness differs from the txid
@@ -362,7 +362,7 @@ def test_witness_commitments(self):
362
362
tx2 = CTransaction ()
363
363
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 0 ), b"" ))
364
364
tx2 .vout .append (CTxOut (tx .vout [0 ].nValue - 1000 , witness_program ))
365
- tx2 .wit .vtxinwit .append (CTxinWitness ())
365
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
366
366
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [witness_program ]
367
367
tx2 .rehash ()
368
368
@@ -489,7 +489,7 @@ def test_witness_block_size(self):
489
489
child_tx .vin .append (CTxIn (COutPoint (parent_tx .sha256 , i ), b"" ))
490
490
child_tx .vout = [CTxOut (value - 100000 , CScript ([OP_TRUE ]))]
491
491
for i in range (NUM_OUTPUTS ):
492
- child_tx .wit .vtxinwit .append (CTxinWitness ())
492
+ child_tx .wit .vtxinwit .append (CTxInWitness ())
493
493
child_tx .wit .vtxinwit [- 1 ].scriptWitness .stack = [b'a' * 195 ]* (2 * NUM_DROPS ) + [witness_program ]
494
494
child_tx .rehash ()
495
495
self .update_witness_block_with_transactions (block , [parent_tx , child_tx ])
@@ -584,7 +584,7 @@ def test_extra_witness_data(self):
584
584
tx .vin .append (CTxIn (COutPoint (self .utxo [0 ].sha256 , self .utxo [0 ].n ), b"" ))
585
585
tx .vout .append (CTxOut (self .utxo [0 ].nValue - 2000 , scriptPubKey ))
586
586
tx .vout .append (CTxOut (1000 , CScript ([OP_TRUE ]))) # non-witness output
587
- tx .wit .vtxinwit .append (CTxinWitness ())
587
+ tx .wit .vtxinwit .append (CTxInWitness ())
588
588
tx .wit .vtxinwit [0 ].scriptWitness .stack = [CScript ([])]
589
589
tx .rehash ()
590
590
self .update_witness_block_with_transactions (block , [tx ])
@@ -607,7 +607,7 @@ def test_extra_witness_data(self):
607
607
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 0 ), b"" )) # witness output
608
608
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 1 ), b"" )) # non-witness
609
609
tx2 .vout .append (CTxOut (tx .vout [0 ].nValue , CScript ([OP_TRUE ])))
610
- tx2 .wit .vtxinwit .extend ([CTxinWitness (), CTxinWitness ()])
610
+ tx2 .wit .vtxinwit .extend ([CTxInWitness (), CTxInWitness ()])
611
611
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [ CScript ([CScriptNum (1 )]), CScript ([CScriptNum (1 )]), witness_program ]
612
612
tx2 .wit .vtxinwit [1 ].scriptWitness .stack = [ CScript ([OP_TRUE ]) ]
613
613
@@ -663,7 +663,7 @@ def test_max_witness_push_length(self):
663
663
tx2 = CTransaction ()
664
664
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 0 ), b"" ))
665
665
tx2 .vout .append (CTxOut (tx .vout [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
666
- tx2 .wit .vtxinwit .append (CTxinWitness ())
666
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
667
667
# First try a 521-byte stack element
668
668
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [ b'a' * (MAX_SCRIPT_ELEMENT_SIZE + 1 ), witness_program ]
669
669
tx2 .rehash ()
@@ -705,7 +705,7 @@ def test_max_witness_program_length(self):
705
705
tx2 = CTransaction ()
706
706
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 0 ), b"" ))
707
707
tx2 .vout .append (CTxOut (tx .vout [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
708
- tx2 .wit .vtxinwit .append (CTxinWitness ())
708
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
709
709
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [b'a' ]* 44 + [long_witness_program ]
710
710
tx2 .rehash ()
711
711
@@ -782,7 +782,7 @@ def serialize_with_witness(self):
782
782
783
783
# First try using a too long vtxinwit
784
784
for i in range (11 ):
785
- tx2 .wit .vtxinwit .append (CTxinWitness ())
785
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
786
786
tx2 .wit .vtxinwit [i ].scriptWitness .stack = [b'a' , witness_program ]
787
787
788
788
block = self .build_next_block ()
@@ -798,7 +798,7 @@ def serialize_with_witness(self):
798
798
self .test_node .test_witness_block (block , accepted = False )
799
799
800
800
# Now make one of the intermediate witnesses be incorrect
801
- tx2 .wit .vtxinwit .append (CTxinWitness ())
801
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
802
802
tx2 .wit .vtxinwit [- 1 ].scriptWitness .stack = [b'a' , witness_program ]
803
803
tx2 .wit .vtxinwit [5 ].scriptWitness .stack = [ witness_program ]
804
804
@@ -825,7 +825,7 @@ def test_witness_tx_relay_before_segwit_activation(self):
825
825
tx = CTransaction ()
826
826
tx .vin .append (CTxIn (COutPoint (self .utxo [0 ].sha256 , self .utxo [0 ].n ), b"" ))
827
827
tx .vout .append (CTxOut (self .utxo [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
828
- tx .wit .vtxinwit .append (CTxinWitness ())
828
+ tx .wit .vtxinwit .append (CTxInWitness ())
829
829
tx .wit .vtxinwit [0 ].scriptWitness .stack = [ b'a' ]
830
830
tx .rehash ()
831
831
@@ -885,7 +885,7 @@ def test_tx_relay_after_segwit_activation(self):
885
885
tx = CTransaction ()
886
886
tx .vin .append (CTxIn (COutPoint (self .utxo [0 ].sha256 , self .utxo [0 ].n ), b"" ))
887
887
tx .vout .append (CTxOut (self .utxo [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
888
- tx .wit .vtxinwit .append (CTxinWitness ())
888
+ tx .wit .vtxinwit .append (CTxInWitness ())
889
889
tx .wit .vtxinwit [0 ].scriptWitness .stack = [ b'a' ]
890
890
tx .rehash ()
891
891
@@ -914,7 +914,7 @@ def test_tx_relay_after_segwit_activation(self):
914
914
tx3 = CTransaction ()
915
915
tx3 .vin .append (CTxIn (COutPoint (tx2 .sha256 , 0 ), b"" ))
916
916
tx3 .vout .append (CTxOut (tx2 .vout [0 ].nValue - 1000 , CScript ([OP_TRUE ])))
917
- tx3 .wit .vtxinwit .append (CTxinWitness ())
917
+ tx3 .wit .vtxinwit .append (CTxInWitness ())
918
918
tx3 .wit .vtxinwit [0 ].scriptWitness .stack = [CScript ([CScriptNum (1 )]), witness_program ]
919
919
tx3 .rehash ()
920
920
@@ -1087,7 +1087,7 @@ def test_segwit_versions(self):
1087
1087
tx2 = CTransaction ()
1088
1088
tx2 .vin = [CTxIn (COutPoint (tx .sha256 , 0 ), b"" )]
1089
1089
tx2 .vout = [CTxOut (tx .vout [0 ].nValue - 1000 , scriptPubKey )]
1090
- tx2 .wit .vtxinwit .append (CTxinWitness ())
1090
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
1091
1091
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [ witness_program ]
1092
1092
tx2 .rehash ()
1093
1093
# Gets accepted to test_node, because standardness of outputs isn't
@@ -1102,7 +1102,7 @@ def test_segwit_versions(self):
1102
1102
total_value = 0
1103
1103
for i in temp_utxo :
1104
1104
tx3 .vin .append (CTxIn (COutPoint (i .sha256 , i .n ), b"" ))
1105
- tx3 .wit .vtxinwit .append (CTxinWitness ())
1105
+ tx3 .wit .vtxinwit .append (CTxInWitness ())
1106
1106
total_value += i .nValue
1107
1107
tx3 .wit .vtxinwit [- 1 ].scriptWitness .stack = [witness_program ]
1108
1108
tx3 .vout .append (CTxOut (total_value - 1000 , CScript ([OP_TRUE ])))
@@ -1140,7 +1140,7 @@ def test_premature_coinbase_witness_spend(self):
1140
1140
spend_tx = CTransaction ()
1141
1141
spend_tx .vin = [CTxIn (COutPoint (block .vtx [0 ].sha256 , 0 ), b"" )]
1142
1142
spend_tx .vout = [CTxOut (block .vtx [0 ].vout [0 ].nValue , witness_program )]
1143
- spend_tx .wit .vtxinwit .append (CTxinWitness ())
1143
+ spend_tx .wit .vtxinwit .append (CTxInWitness ())
1144
1144
spend_tx .wit .vtxinwit [0 ].scriptWitness .stack = [ witness_program ]
1145
1145
spend_tx .rehash ()
1146
1146
@@ -1200,7 +1200,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1200
1200
tx = CTransaction ()
1201
1201
tx .vin .append (CTxIn (COutPoint (prev_utxo .sha256 , prev_utxo .n ), b"" ))
1202
1202
tx .vout .append (CTxOut (prev_utxo .nValue - 1000 , scriptPubKey ))
1203
- tx .wit .vtxinwit .append (CTxinWitness ())
1203
+ tx .wit .vtxinwit .append (CTxInWitness ())
1204
1204
# Too-large input value
1205
1205
sign_P2PK_witness_input (witness_program , tx , 0 , hashtype , prev_utxo .nValue + 1 , key )
1206
1206
self .update_witness_block_with_transactions (block , [tx ])
@@ -1233,7 +1233,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1233
1233
split_value = prev_utxo .nValue // NUM_TESTS
1234
1234
for i in range (NUM_TESTS ):
1235
1235
tx .vout .append (CTxOut (split_value , scriptPubKey ))
1236
- tx .wit .vtxinwit .append (CTxinWitness ())
1236
+ tx .wit .vtxinwit .append (CTxInWitness ())
1237
1237
sign_P2PK_witness_input (witness_program , tx , 0 , SIGHASH_ALL , prev_utxo .nValue , key )
1238
1238
for i in range (NUM_TESTS ):
1239
1239
temp_utxos .append (UTXO (tx .sha256 , i , split_value ))
@@ -1255,7 +1255,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1255
1255
total_value = 0
1256
1256
for i in range (num_inputs ):
1257
1257
tx .vin .append (CTxIn (COutPoint (temp_utxos [i ].sha256 , temp_utxos [i ].n ), b"" ))
1258
- tx .wit .vtxinwit .append (CTxinWitness ())
1258
+ tx .wit .vtxinwit .append (CTxInWitness ())
1259
1259
total_value += temp_utxos [i ].nValue
1260
1260
split_value = total_value // num_outputs
1261
1261
for i in range (num_outputs ):
@@ -1295,7 +1295,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1295
1295
tx = CTransaction ()
1296
1296
tx .vin .append (CTxIn (COutPoint (temp_utxos [0 ].sha256 , temp_utxos [0 ].n ), b"" ))
1297
1297
tx .vout .append (CTxOut (temp_utxos [0 ].nValue , scriptPKH ))
1298
- tx .wit .vtxinwit .append (CTxinWitness ())
1298
+ tx .wit .vtxinwit .append (CTxInWitness ())
1299
1299
sign_P2PK_witness_input (witness_program , tx , 0 , SIGHASH_ALL , temp_utxos [0 ].nValue , key )
1300
1300
tx2 = CTransaction ()
1301
1301
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , 0 ), b"" ))
@@ -1313,7 +1313,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1313
1313
1314
1314
# Move the signature to the witness.
1315
1315
block .vtx .pop ()
1316
- tx2 .wit .vtxinwit .append (CTxinWitness ())
1316
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
1317
1317
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [signature , pubkey ]
1318
1318
tx2 .vin [0 ].scriptSig = b""
1319
1319
tx2 .rehash ()
@@ -1333,7 +1333,7 @@ def sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):
1333
1333
# the signatures as we go.
1334
1334
tx .vin .append (CTxIn (COutPoint (i .sha256 , i .n ), b"" ))
1335
1335
tx .vout .append (CTxOut (i .nValue , CScript ([OP_TRUE ])))
1336
- tx .wit .vtxinwit .append (CTxinWitness ())
1336
+ tx .wit .vtxinwit .append (CTxInWitness ())
1337
1337
sign_P2PK_witness_input (witness_program , tx , index , SIGHASH_SINGLE | SIGHASH_ANYONECANPAY , i .nValue , key )
1338
1338
index += 1
1339
1339
block = self .build_next_block ()
@@ -1393,7 +1393,7 @@ def test_p2sh_witness(self, segwit_activated):
1393
1393
# segwit activates.
1394
1394
spend_tx .vin [0 ].scriptSig = scriptSig
1395
1395
spend_tx .rehash ()
1396
- spend_tx .wit .vtxinwit .append (CTxinWitness ())
1396
+ spend_tx .wit .vtxinwit .append (CTxInWitness ())
1397
1397
spend_tx .wit .vtxinwit [0 ].scriptWitness .stack = [ b'a' , witness_program ]
1398
1398
1399
1399
# Verify mempool acceptance
@@ -1499,7 +1499,7 @@ def test_witness_sigops(self):
1499
1499
total_value = 0
1500
1500
for i in range (outputs - 1 ):
1501
1501
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , i ), b"" ))
1502
- tx2 .wit .vtxinwit .append (CTxinWitness ())
1502
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
1503
1503
tx2 .wit .vtxinwit [- 1 ].scriptWitness .stack = [ witness_program ]
1504
1504
total_value += tx .vout [i ].nValue
1505
1505
tx2 .wit .vtxinwit [- 1 ].scriptWitness .stack = [ witness_program_toomany ]
@@ -1540,7 +1540,7 @@ def test_witness_sigops(self):
1540
1540
block_5 = self .build_next_block ()
1541
1541
tx2 .vout .pop ()
1542
1542
tx2 .vin .append (CTxIn (COutPoint (tx .sha256 , outputs - 1 ), b"" ))
1543
- tx2 .wit .vtxinwit .append (CTxinWitness ())
1543
+ tx2 .wit .vtxinwit .append (CTxInWitness ())
1544
1544
tx2 .wit .vtxinwit [- 1 ].scriptWitness .stack = [ witness_program_justright ]
1545
1545
tx2 .rehash ()
1546
1546
self .update_witness_block_with_transactions (block_5 , [tx2 ])
0 commit comments