diff options
author | Jon Atack <jon@atack.com> | 2020-11-10 12:29:01 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2020-11-12 11:43:17 +0100 |
commit | 449b730579566459e350703611629e63e54657ed (patch) | |
tree | 0cd98fd3d8cb44d52df4221677fa387e9ecc2dd7 /test/functional/wallet_send.py | |
parent | 6da3afbaee5809ebf6d88efaa3958c505c2d71c7 (diff) | |
download | bitcoin-449b730579566459e350703611629e63e54657ed.tar.xz |
wallet: provide valid values if invalid estimate mode passed
Co-authored-by: Murch <murch@murch.one>
Diffstat (limited to 'test/functional/wallet_send.py')
-rwxr-xr-x | test/functional/wallet_send.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py index 0896dea98a..5da71c85f9 100755 --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -289,16 +289,13 @@ class WalletSendTest(BitcoinTestFramework): for target, mode in product([-1, 0, 1009], ["economical", "conservative"]): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=target, estimate_mode=mode, expect_error=(-8, "Invalid conf_target, must be between 1 and 1008")) # max value of 1008 per src/policy/fees.h + msg = 'Invalid estimate_mode parameter, must be one of: "unset", "economical", "conservative"' for target, mode in product([-1, 0], ["btc/kb", "sat/b"]): - self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=target, estimate_mode=mode, - expect_error=(-8, "Invalid estimate_mode parameter")) - + self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=target, estimate_mode=mode, expect_error=(-8, msg)) for mode in ["", "foo", Decimal("3.141592")]: - self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode=mode, - expect_error=(-8, "Invalid estimate_mode parameter")) - self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_conf_target=0.1, arg_estimate_mode=mode, - expect_error=(-8, "Invalid estimate_mode parameter")) - assert_raises_rpc_error(-8, "Invalid estimate_mode parameter", w0.send, {w1.getnewaddress(): 1}, 0.1, mode) + self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode=mode, expect_error=(-8, msg)) + self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_conf_target=0.1, arg_estimate_mode=mode, expect_error=(-8, msg)) + assert_raises_rpc_error(-8, msg, w0.send, {w1.getnewaddress(): 1}, 0.1, mode) for mode in ["economical", "conservative", "btc/kb", "sat/b"]: self.log.debug("{}".format(mode)) |