@@ -74,7 +74,7 @@ def setup_network(self):
74
74
self .connect_nodes (0 , 2 )
75
75
76
76
def run_test (self ):
77
- self .log .info ('prepare some coins for multiple *rawtransaction commands' )
77
+ self .log .info ("Prepare some coins for multiple *rawtransaction commands" )
78
78
self .nodes [2 ].generate (1 )
79
79
self .sync_all ()
80
80
self .nodes [0 ].generate (COINBASE_MATURITY + 1 )
@@ -86,11 +86,11 @@ def run_test(self):
86
86
self .nodes [0 ].generate (5 )
87
87
self .sync_all ()
88
88
89
- self .log .info (' Test getrawtransaction on genesis block coinbase returns an error' )
89
+ self .log .info (" Test getrawtransaction on genesis block coinbase returns an error" )
90
90
block = self .nodes [0 ].getblock (self .nodes [0 ].getblockhash (0 ))
91
91
assert_raises_rpc_error (- 5 , "The genesis block coinbase is not considered an ordinary transaction" , self .nodes [0 ].getrawtransaction , block ['merkleroot' ])
92
92
93
- self .log .info ('Check parameter types and required parameters of createrawtransaction' )
93
+ self .log .info ("Test createrawtransaction" )
94
94
# Test `createrawtransaction` required parameters
95
95
assert_raises_rpc_error (- 1 , "createrawtransaction" , self .nodes [0 ].createrawtransaction )
96
96
assert_raises_rpc_error (- 1 , "createrawtransaction" , self .nodes [0 ].createrawtransaction , [])
@@ -146,7 +146,7 @@ def run_test(self):
146
146
# Test `createrawtransaction` invalid `replaceable`
147
147
assert_raises_rpc_error (- 3 , "Expected type bool" , self .nodes [0 ].createrawtransaction , [], {}, 0 , 'foo' )
148
148
149
- self . log . info ( 'Check that createrawtransaction accepts an array and object as outputs' )
149
+ # Test that createrawtransaction accepts an array and object as outputs
150
150
# One output
151
151
tx = tx_from_hex (self .nodes [2 ].createrawtransaction (inputs = [{'txid' : TXID , 'vout' : 9 }], outputs = {address : 99 }))
152
152
assert_equal (len (tx .vout ), 1 )
@@ -170,13 +170,10 @@ def run_test(self):
170
170
)
171
171
172
172
for type in ["bech32" , "p2sh-segwit" , "legacy" ]:
173
+ self .log .info (f"Test signrawtransactionwithwallet with missing prevtx info ({ type } )" )
173
174
addr = self .nodes [0 ].getnewaddress ("" , type )
174
175
addrinfo = self .nodes [0 ].getaddressinfo (addr )
175
176
pubkey = addrinfo ["scriptPubKey" ]
176
-
177
- self .log .info ('sendrawtransaction with missing prevtx info (%s)' % (type ))
178
-
179
- # Test `signrawtransactionwithwallet` invalid `prevtxs`
180
177
inputs = [ {'txid' : TXID , 'vout' : 3 , 'sequence' : 1000 }]
181
178
outputs = { self .nodes [0 ].getnewaddress () : 1 }
182
179
rawtx = self .nodes [0 ].createrawtransaction (inputs , outputs )
@@ -224,7 +221,7 @@ def run_test(self):
224
221
# sendrawtransaction with missing input #
225
222
#########################################
226
223
227
- self .log .info (' sendrawtransaction with missing input' )
224
+ self .log .info ("Test sendrawtransaction with missing input" )
228
225
inputs = [{'txid' : TXID , 'vout' : 1 }] # won't exist
229
226
outputs = { self .nodes [0 ].getnewaddress () : 4.998 }
230
227
rawtx = self .nodes [2 ].createrawtransaction (inputs , outputs )
@@ -237,7 +234,7 @@ def run_test(self):
237
234
# getrawtransaction with block hash #
238
235
#####################################
239
236
240
- # make a tx by sending then generate 2 blocks; block1 has the tx in it
237
+ # Make a tx by sending, then generate 2 blocks; block1 has the tx in it
241
238
tx = self .nodes [2 ].sendtoaddress (self .nodes [1 ].getnewaddress (), 1 )
242
239
block1 , block2 = self .nodes [2 ].generate (2 )
243
240
self .sync_all ()
@@ -277,6 +274,7 @@ def run_test(self):
277
274
assert_equal (self .nodes [n ].getbestblockhash (), block2 )
278
275
279
276
if not self .options .descriptors :
277
+ self .log .info ("Test raw multisig transactions (legacy)" )
280
278
# The traditional multisig workflow does not work with descriptor wallets so these are legacy only.
281
279
# The multisig workflow with descriptor wallets uses PSBTs and is tested elsewhere, no need to do them here.
282
280
#########################
@@ -395,7 +393,7 @@ def run_test(self):
395
393
self .sync_all ()
396
394
assert_equal (self .nodes [0 ].getbalance (), bal + Decimal ('50.00000000' )+ Decimal ('2.19000000' )) #block reward + tx
397
395
398
- # decoderawtransaction tests
396
+ self . log . info ( "Test decoderawtransaction" )
399
397
# witness transaction
400
398
encrawtx = "010000000001010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f50500000000000102616100000000"
401
399
decrawtx = self .nodes [0 ].decoderawtransaction (encrawtx , True ) # decode as witness transaction
@@ -413,7 +411,7 @@ def run_test(self):
413
411
assert_equal (decrawtx , decrawtx_wit ) # the witness interpretation should be chosen
414
412
assert_equal (decrawtx ['vin' ][0 ]['coinbase' ], "03c68708046ff8415c622f4254432e434f4d2ffabe6d6de1965d02c68f928e5b244ab1965115a36f56eb997633c7f690124bbf43644e23080000000ca3d3af6d005a65ff0200fd00000000" )
415
413
416
- # Basic signrawtransaction test
414
+ self . log . info ( "Test signrawtransactionwithwallet" )
417
415
addr = self .nodes [1 ].getnewaddress ()
418
416
txid = self .nodes [0 ].sendtoaddress (addr , 10 )
419
417
self .nodes [0 ].generate (1 )
@@ -458,6 +456,8 @@ def run_test(self):
458
456
# TRANSACTION VERSION NUMBER TESTS #
459
457
####################################
460
458
459
+ self .log .info ("Test transaction version numbers" )
460
+
461
461
# Test the minimum transaction version number that fits in a signed 32-bit integer.
462
462
# As transaction version is unsigned, this should convert to its unsigned equivalent.
463
463
tx = CTransaction ()
@@ -473,7 +473,7 @@ def run_test(self):
473
473
decrawtx = self .nodes [0 ].decoderawtransaction (rawtx )
474
474
assert_equal (decrawtx ['version' ], 0x7fffffff )
475
475
476
- self .log .info (' sendrawtransaction/testmempoolaccept with maxfeerate' )
476
+ self .log .info ("Test sendrawtransaction/testmempoolaccept with maxfeerate" )
477
477
478
478
# Test a transaction with a small fee.
479
479
txId = self .nodes [0 ].sendtoaddress (self .nodes [2 ].getnewaddress (), 1.0 )
@@ -523,7 +523,7 @@ def run_test(self):
523
523
assert_equal (testres ['allowed' ], True )
524
524
self .nodes [2 ].sendrawtransaction (hexstring = rawTxSigned ['hex' ], maxfeerate = '0.20000000' )
525
525
526
- self .log .info (' sendrawtransaction/testmempoolaccept with tx that is already in the chain' )
526
+ self .log .info ("Test sendrawtransaction/testmempoolaccept with tx already in the chain" )
527
527
self .nodes [2 ].generate (1 )
528
528
self .sync_blocks ()
529
529
for node in self .nodes :
0 commit comments