diff options
author | Jon Atack <jon@atack.com> | 2020-11-12 11:16:48 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2020-11-12 11:44:15 +0100 |
commit | 05e82d86b09d914ebce05dbc92a7299cb026847b (patch) | |
tree | 8b195c88b03678af4cad58226faaf6bcec00d1fc /test/functional/rpc_fundrawtransaction.py | |
parent | 9a670b4f07a6140de809d73cbd7f3e614eb6ea74 (diff) | |
download | bitcoin-05e82d86b09d914ebce05dbc92a7299cb026847b.tar.xz |
wallet: override minfee checks (fOverrideFeeRate) for fee_rate
in RPCs fundrawtransaction and walletcreatefundedpsbt only.
This provides the existing feeRate (BTC/kvB) behavior in these two RPCs to the
new fee_rate (sat/vB) param also.
See these two GitHub review discussions for more info:
https://github.com/bitcoin/bitcoin/pull/10706/#discussion_r126560525
https://github.com/bitcoin/bitcoin/pull/20305#discussion_r520032533
Diffstat (limited to 'test/functional/rpc_fundrawtransaction.py')
-rwxr-xr-x | test/functional/rpc_fundrawtransaction.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index d515b4a7d3..f987867e61 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -752,7 +752,7 @@ class RawTransactionsTest(BitcoinTestFramework): node.fundrawtransaction, rawtx, {"estimate_mode": mode, "conf_target": n, "add_inputs": True}) self.log.info("Test invalid fee rate settings") - assert_raises_rpc_error(-4, "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)", + assert_raises_rpc_error(-8, "Invalid fee_rate 0.000 sat/vB (must be greater than 0)", node.fundrawtransaction, rawtx, {"fee_rate": 0, "add_inputs": True}) assert_raises_rpc_error(-8, "Invalid feeRate 0.00000000 BTC/kvB (must be greater than 0)", node.fundrawtransaction, rawtx, {"feeRate": 0, "add_inputs": True}) @@ -766,12 +766,9 @@ class RawTransactionsTest(BitcoinTestFramework): assert_raises_rpc_error(-3, "Invalid amount", node.fundrawtransaction, rawtx, {"fee_rate": "", "add_inputs": True}) - # Test setting explicit fee rate just below the minimum. - self.log.info("- raises RPC error 'fee rate too low' if fee_rate of 0.99999999 sat/vB is passed") - msg = "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)" - assert_raises_rpc_error(-4, msg, node.fundrawtransaction, rawtx, {"fee_rate": 0.99999999, "add_inputs": True}) - # This feeRate test only passes if `coinControl.fOverrideFeeRate = true` in wallet/rpcwallet.cpp::FundTransaction is removed. - # assert_raises_rpc_error(-4, msg, node.fundrawtransaction, rawtx, {"feeRate": 0.00000999, "add_inputs": True}) + self.log.info("Test min fee rate checks are bypassed with fundrawtxn, e.g. a fee_rate under 1 sat/vB is allowed") + node.fundrawtransaction(rawtx, {"fee_rate": 0.99999999, "add_inputs": True}) + node.fundrawtransaction(rawtx, {"feeRate": 0.00000999, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and fee_rate are passed") assert_raises_rpc_error(-8, "Cannot specify both fee_rate (sat/vB) and feeRate (BTC/kvB)", |