diff options
author | Jon Atack <jon@atack.com> | 2020-12-03 10:55:15 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2021-05-09 12:49:47 +0200 |
commit | c5fd4344f7fcc257062a610c8ff26ffcc9b53953 (patch) | |
tree | 1c764d5f3df844da1dcc162102213ce7feb9d532 /test/functional/wallet_bumpfee.py | |
parent | ea6f76b66ecc52360719053489e0ec9f9a673eab (diff) | |
download | bitcoin-c5fd4344f7fcc257062a610c8ff26ffcc9b53953.tar.xz |
test: explicit fee rates with invalid amounts
Diffstat (limited to 'test/functional/wallet_bumpfee.py')
-rwxr-xr-x | test/functional/wallet_bumpfee.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py index d2005140a4..895db7d472 100755 --- a/test/functional/wallet_bumpfee.py +++ b/test/functional/wallet_bumpfee.py @@ -116,11 +116,14 @@ class BumpFeeTest(BitcoinTestFramework): msg = "Insufficient total fee 0.00" for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]: assert_raises_rpc_error(-8, msg, rbf_node.bumpfee, rbfid, {"fee_rate": zero_value}) + msg = "Invalid amount" + # Test fee_rate values that don't pass fixed-point parsing checks. + for invalid_value in ["", 0.000000001, 1e-09, 1.111111111, 1111111111111111, "31.999999999999999999999"]: + assert_raises_rpc_error(-3, msg, rbf_node.bumpfee, rbfid, {"fee_rate": invalid_value}) # Test fee_rate out of range (negative number). assert_raises_rpc_error(-3, "Amount out of range", rbf_node.bumpfee, rbfid, {"fee_rate": -1}) for value in [{"foo": "bar"}, True]: assert_raises_rpc_error(-3, "Amount is not a number or string", rbf_node.bumpfee, rbfid, {"fee_rate": value}) - assert_raises_rpc_error(-3, "Invalid amount", rbf_node.bumpfee, rbfid, {"fee_rate": ""}) self.log.info("Test explicit fee rate raises RPC error if both fee_rate and conf_target are passed") assert_raises_rpc_error(-8, "Cannot specify both conf_target and fee_rate. Please provide either a confirmation " |