MCPcopy Create free account
hub / github.com/ElementsProject/elements / test_settxfee

Function test_settxfee

test/functional/wallet_bumpfee.py:349–370  ·  view source on GitHub ↗
(self, rbf_node, dest_address)

Source from the content-addressed store, hash-verified

347
348
349def test_settxfee(self, rbf_node, dest_address):
350 self.log.info('Test settxfee')
351 assert_raises_rpc_error(-8, "txfee cannot be less than min relay tx fee", rbf_node.settxfee, Decimal('0.000005'))
352 assert_raises_rpc_error(-8, "txfee cannot be less than wallet min fee", rbf_node.settxfee, Decimal('0.000015'))
353 # check that bumpfee reacts correctly to the use of settxfee (paytxfee)
354 rbfid = spend_one_input(rbf_node, dest_address)
355 requested_feerate = Decimal("0.00025000")
356 rbf_node.settxfee(requested_feerate)
357 bumped_tx = rbf_node.bumpfee(rbfid)
358 actual_feerate = bumped_tx["fee"] * 1000 / rbf_node.getrawtransaction(bumped_tx["txid"], True)["vsize"]
359 # Assert that the difference between the requested feerate and the actual
360 # feerate of the bumped transaction is small.
361 assert_greater_than(Decimal("0.00001000"), abs(requested_feerate - actual_feerate))
362 rbf_node.settxfee(Decimal("0.00000000")) # unset paytxfee
363
364 # check that settxfee respects -maxtxfee
365 self.restart_node(1, ['-maxtxfee=0.000025'] + self.extra_args[1])
366 assert_raises_rpc_error(-8, "txfee cannot be more than wallet max tx fee", rbf_node.settxfee, Decimal('0.00003'))
367 self.restart_node(1, self.extra_args[1])
368 rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
369 self.connect_nodes(1, 0)
370 self.clear_mempool()
371
372
373def test_maxtxfee_fails(self, rbf_node, dest_address):

Callers 1

run_testMethod · 0.70

Calls 7

assert_raises_rpc_errorFunction · 0.90
assert_greater_thanFunction · 0.90
infoMethod · 0.80
connect_nodesMethod · 0.80
clear_mempoolMethod · 0.80
spend_one_inputFunction · 0.70
restart_nodeMethod · 0.45

Tested by

no test coverage detected