@@ -128,7 +128,7 @@ def test_segwit_bumpfee_succeeds(rbf_node, dest_address):
128
128
def test_nonrbf_bumpfee_fails (peer_node , dest_address ):
129
129
# cannot replace a non RBF transaction (from node which did not enable RBF)
130
130
not_rbfid = create_fund_sign_send (peer_node , {dest_address : 0.00090000 })
131
- assert_raises_message ( JSONRPCException , "not BIP 125 replaceable" , peer_node .bumpfee , not_rbfid )
131
+ assert_raises_jsonrpc ( - 4 , "not BIP 125 replaceable" , peer_node .bumpfee , not_rbfid )
132
132
133
133
134
134
def test_notmine_bumpfee_fails (rbf_node , peer_node , dest_address ):
@@ -148,7 +148,7 @@ def test_notmine_bumpfee_fails(rbf_node, peer_node, dest_address):
148
148
signedtx = rbf_node .signrawtransaction (rawtx )
149
149
signedtx = peer_node .signrawtransaction (signedtx ["hex" ])
150
150
rbfid = rbf_node .sendrawtransaction (signedtx ["hex" ])
151
- assert_raises_message ( JSONRPCException , "Transaction contains inputs that don't belong to this wallet" ,
151
+ assert_raises_jsonrpc ( - 4 , "Transaction contains inputs that don't belong to this wallet" ,
152
152
rbf_node .bumpfee , rbfid )
153
153
154
154
@@ -159,7 +159,7 @@ def test_bumpfee_with_descendant_fails(rbf_node, rbf_node_address, dest_address)
159
159
tx = rbf_node .createrawtransaction ([{"txid" : parent_id , "vout" : 0 }], {dest_address : 0.00020000 })
160
160
tx = rbf_node .signrawtransaction (tx )
161
161
txid = rbf_node .sendrawtransaction (tx ["hex" ])
162
- assert_raises_message ( JSONRPCException , "Transaction has descendants in the wallet" , rbf_node .bumpfee , parent_id )
162
+ assert_raises_jsonrpc ( - 8 , "Transaction has descendants in the wallet" , rbf_node .bumpfee , parent_id )
163
163
164
164
165
165
def test_small_output_fails (rbf_node , dest_address ):
@@ -174,7 +174,7 @@ def test_small_output_fails(rbf_node, dest_address):
174
174
Decimal ("0.00100000" ),
175
175
{dest_address : 0.00080000 ,
176
176
get_change_address (rbf_node ): Decimal ("0.00010000" )})
177
- assert_raises_message ( JSONRPCException , "Change output is too small" , rbf_node .bumpfee , rbfid , {"totalFee" : 20001 })
177
+ assert_raises_jsonrpc ( - 4 , "Change output is too small" , rbf_node .bumpfee , rbfid , {"totalFee" : 20001 })
178
178
179
179
180
180
def test_dust_to_fee (rbf_node , dest_address ):
@@ -209,15 +209,15 @@ def test_rebumping(rbf_node, dest_address):
209
209
rbf_node .settxfee (Decimal ("0.00001000" ))
210
210
rbfid = create_fund_sign_send (rbf_node , {dest_address : 0.00090000 })
211
211
bumped = rbf_node .bumpfee (rbfid , {"totalFee" : 1000 })
212
- assert_raises_message ( JSONRPCException , "already bumped" , rbf_node .bumpfee , rbfid , {"totalFee" : 2000 })
212
+ assert_raises_jsonrpc ( - 4 , "already bumped" , rbf_node .bumpfee , rbfid , {"totalFee" : 2000 })
213
213
rbf_node .bumpfee (bumped ["txid" ], {"totalFee" : 2000 })
214
214
215
215
216
216
def test_rebumping_not_replaceable (rbf_node , dest_address ):
217
217
# check that re-bumping a non-replaceable bump tx fails
218
218
rbfid = create_fund_sign_send (rbf_node , {dest_address : 0.00090000 })
219
219
bumped = rbf_node .bumpfee (rbfid , {"totalFee" : 10000 , "replaceable" : False })
220
- assert_raises_message ( JSONRPCException , "Transaction is not BIP 125 replaceable" , rbf_node .bumpfee , bumped ["txid" ],
220
+ assert_raises_jsonrpc ( - 4 , "Transaction is not BIP 125 replaceable" , rbf_node .bumpfee , bumped ["txid" ],
221
221
{"totalFee" : 20000 })
222
222
223
223
@@ -268,7 +268,7 @@ def test_bumpfee_metadata(rbf_node, dest_address):
268
268
def test_locked_wallet_fails (rbf_node , dest_address ):
269
269
rbfid = create_fund_sign_send (rbf_node , {dest_address : 0.00090000 })
270
270
rbf_node .walletlock ()
271
- assert_raises_message ( JSONRPCException , "Please enter the wallet passphrase with walletpassphrase first." ,
271
+ assert_raises_jsonrpc ( - 13 , "Please enter the wallet passphrase with walletpassphrase first." ,
272
272
rbf_node .bumpfee , rbfid )
273
273
274
274
@@ -315,9 +315,7 @@ def submit_block_with_tx(node, tx):
315
315
block .rehash ()
316
316
block .hashMerkleRoot = block .calc_merkle_root ()
317
317
block .solve ()
318
- error = node .submitblock (bytes_to_hex_str (block .serialize (True )))
319
- if error is not None :
320
- raise Exception (error )
318
+ node .submitblock (bytes_to_hex_str (block .serialize (True )))
321
319
return block
322
320
323
321
0 commit comments