aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-04-27 11:00:20 +0200
committerJon Atack <jon@atack.com>2021-05-09 12:49:58 +0200
commit8ce3ef57a3e9ad13c0aaa4648e8584241d53592d (patch)
tree52fb177ee9c1b89fecf8e5771a4fc4a6ddfef66f /src
parentb5033275979a2a495b02b25f70cadbdcc8b6eb6a (diff)
test: ParseFixedPoint with 3 decimals for sat/vB fee rates
Diffstat (limited to 'src')
-rw-r--r--src/test/util_tests.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index 04b908829b..534d28e5de 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -1759,6 +1759,15 @@ BOOST_AUTO_TEST_CASE(test_ParseFixedPoint)
BOOST_CHECK(!ParseFixedPoint("1.1e", 8, &amount));
BOOST_CHECK(!ParseFixedPoint("1.1e-", 8, &amount));
BOOST_CHECK(!ParseFixedPoint("1.", 8, &amount));
+
+ // Test with 3 decimal places for fee rates in sat/vB.
+ BOOST_CHECK(ParseFixedPoint("0.001", 3, &amount));
+ BOOST_CHECK_EQUAL(amount, CAmount{1});
+ BOOST_CHECK(!ParseFixedPoint("0.0009", 3, &amount));
+ BOOST_CHECK(!ParseFixedPoint("31.00100001", 3, &amount));
+ BOOST_CHECK(!ParseFixedPoint("31.0011", 3, &amount));
+ BOOST_CHECK(!ParseFixedPoint("31.99999999", 3, &amount));
+ BOOST_CHECK(!ParseFixedPoint("31.999999999999999999999", 3, &amount));
}
static void TestOtherThread(fs::path dirname, std::string lockname, bool *result)