wallet, rpc:remove settxfee and paytxfee

This commit is contained in:
Pol Espinasa
2025-03-25 19:24:43 +01:00
parent 4ae00e9a71
commit 331a5279d2
26 changed files with 118 additions and 255 deletions

View File

@@ -15,12 +15,13 @@ from test_framework.blocktools import (
TIME_GENESIS_BLOCK,
)
from decimal import Decimal
class CreateTxWalletTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-deprecatedrpc=settxfee"]]
self.extra_args = [[]]
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
@@ -54,7 +55,7 @@ class CreateTxWalletTest(BitcoinTestFramework):
outputs = {self.nodes[0].getnewaddress(address_type='bech32'): 0.000025 for _ in range(400)}
raw_tx = self.nodes[0].createrawtransaction(inputs=[], outputs=outputs)
for fee_setting in ['-minrelaytxfee=0.01', '-mintxfee=0.01', '-paytxfee=0.01']:
for fee_setting in ['-minrelaytxfee=0.01', '-mintxfee=0.01']:
self.log.info('Check maxtxfee in combination with {}'.format(fee_setting))
self.restart_node(0, extra_args=[fee_setting])
assert_raises_rpc_error(
@@ -68,20 +69,21 @@ class CreateTxWalletTest(BitcoinTestFramework):
lambda: self.nodes[0].fundrawtransaction(hexstring=raw_tx),
)
self.log.info('Check maxtxfee in combination with settxfee')
self.restart_node(0, expected_stderr='Warning: -paytxfee is deprecated and will be fully removed in v31.0.')
self.nodes[0].settxfee(0.01)
# Hit maxtxfee with explicit fee rate
self.log.info('Check maxtxfee in combination with explicit fee_rate=1000 sat/vB')
fee_rate_sats_per_vb = Decimal('0.01') * Decimal(1e8) / 1000 # Convert 0.01 BTC/kvB to sat/vB
assert_raises_rpc_error(
-6,
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
lambda: self.nodes[0].sendmany(dummy="", amounts=outputs),
lambda: self.nodes[0].sendmany(dummy="", amounts=outputs, fee_rate=fee_rate_sats_per_vb),
)
assert_raises_rpc_error(
-4,
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
lambda: self.nodes[0].fundrawtransaction(hexstring=raw_tx),
lambda: self.nodes[0].fundrawtransaction(hexstring=raw_tx, options={'fee_rate': fee_rate_sats_per_vb}),
)
self.nodes[0].settxfee(0)
def test_create_too_long_mempool_chain(self):
self.log.info('Check too-long mempool chain error')