aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_send.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-04 11:28:47 +0100
committerJon Atack <jon@atack.com>2021-05-06 09:06:27 +0200
commitea6f76b66ecc52360719053489e0ec9f9a673eab (patch)
tree4dfb3f0ec253a4818bc661699a38d1ed3a4b2549 /test/functional/wallet_send.py
parent9c05da4a5c57d7fd0fc53817ad6f0a07c0f08b5b (diff)
downloadbitcoin-ea6f76b66ecc52360719053489e0ec9f9a673eab.tar.xz
test: improve zero-value explicit fee rate coverage
Diffstat (limited to 'test/functional/wallet_send.py')
-rwxr-xr-xtest/functional/wallet_send.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py
index 53553dcd80..ac64f44f1f 100755
--- a/test/functional/wallet_send.py
+++ b/test/functional/wallet_send.py
@@ -349,16 +349,17 @@ class WalletSendTest(BitcoinTestFramework):
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=v, estimate_mode=mode,
expect_error=(-3, "Expected type number for conf_target, got {}".format(k)))
- # Test setting explicit fee rate just below the minimum and at zero.
+ # Test setting explicit fee rate just below the minimum of 1 sat/vB.
self.log.info("Explicit fee rate raises RPC error 'fee rate too low' if fee_rate of 0.99999999 is passed")
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=0.99999999,
expect_error=(-4, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)"))
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=0.99999999,
expect_error=(-4, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)"))
- self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=0,
- expect_error=(-4, "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)"))
- self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=0,
- expect_error=(-4, "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)"))
+ # Test fee_rate with zero values.
+ msg = "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)"
+ for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]:
+ self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=zero_value, expect_error=(-4, msg))
+ self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=zero_value, expect_error=(-4, msg))
# TODO: Return hex if fee rate is below -maxmempool
# res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode="sat/b", add_to_wallet=False)