diff options
author | Jon Atack <jon@atack.com> | 2020-12-04 12:51:34 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2021-05-09 12:49:56 +0200 |
commit | b5033275979a2a495b02b25f70cadbdcc8b6eb6a (patch) | |
tree | a49ad225b9ac20750a5fa48767eb8d078c735091 /test/functional/wallet_basic.py | |
parent | c5fd4344f7fcc257062a610c8ff26ffcc9b53953 (diff) | |
download | bitcoin-b5033275979a2a495b02b25f70cadbdcc8b6eb6a.tar.xz |
test: type error and out of range fee rates where missing
Diffstat (limited to 'test/functional/wallet_basic.py')
-rwxr-xr-x | test/functional/wallet_basic.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index 96e86ff9f9..f46c79b609 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -15,6 +15,7 @@ from test_framework.util import ( ) from test_framework.wallet_util import test_address +NOT_A_NUMBER_OR_STRING = "Amount is not a number or string" OUT_OF_RANGE = "Amount out of range" @@ -277,6 +278,9 @@ class WalletTest(BitcoinTestFramework): assert_raises_rpc_error(-3, msg, self.nodes[2].sendmany, amounts={address: 1.0}, fee_rate=invalid_value) # Test fee_rate out of range (negative number). assert_raises_rpc_error(-3, OUT_OF_RANGE, self.nodes[2].sendmany, amounts={address: 10}, fee_rate=-1) + # Test type error. + for invalid_value in [True, {"foo": "bar"}]: + assert_raises_rpc_error(-3, NOT_A_NUMBER_OR_STRING, self.nodes[2].sendmany, amounts={address: 10}, fee_rate=invalid_value) self.log.info("Test sendmany raises if an invalid conf_target or estimate_mode is passed") for target, mode in product([-1, 0, 1009], ["economical", "conservative"]): @@ -467,6 +471,9 @@ class WalletTest(BitcoinTestFramework): assert_raises_rpc_error(-3, msg, self.nodes[2].sendtoaddress, address=address, amount=1.0, fee_rate=invalid_value) # Test fee_rate out of range (negative number). assert_raises_rpc_error(-3, OUT_OF_RANGE, self.nodes[2].sendtoaddress, address=address, amount=1.0, fee_rate=-1) + # Test type error. + for invalid_value in [True, {"foo": "bar"}]: + assert_raises_rpc_error(-3, NOT_A_NUMBER_OR_STRING, self.nodes[2].sendtoaddress, address=address, amount=1.0, fee_rate=invalid_value) self.log.info("Test sendtoaddress raises if an invalid conf_target or estimate_mode is passed") for target, mode in product([-1, 0, 1009], ["economical", "conservative"]): |