Skip to content

Commit 8ce3ef5

Browse files
committed
test: ParseFixedPoint with 3 decimals for sat/vB fee rates
1 parent b503327 commit 8ce3ef5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/util_tests.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,15 @@ BOOST_AUTO_TEST_CASE(test_ParseFixedPoint)
17591759
BOOST_CHECK(!ParseFixedPoint("1.1e", 8, &amount));
17601760
BOOST_CHECK(!ParseFixedPoint("1.1e-", 8, &amount));
17611761
BOOST_CHECK(!ParseFixedPoint("1.", 8, &amount));
1762+
1763+
// Test with 3 decimal places for fee rates in sat/vB.
1764+
BOOST_CHECK(ParseFixedPoint("0.001", 3, &amount));
1765+
BOOST_CHECK_EQUAL(amount, CAmount{1});
1766+
BOOST_CHECK(!ParseFixedPoint("0.0009", 3, &amount));
1767+
BOOST_CHECK(!ParseFixedPoint("31.00100001", 3, &amount));
1768+
BOOST_CHECK(!ParseFixedPoint("31.0011", 3, &amount));
1769+
BOOST_CHECK(!ParseFixedPoint("31.99999999", 3, &amount));
1770+
BOOST_CHECK(!ParseFixedPoint("31.999999999999999999999", 3, &amount));
17621771
}
17631772

17641773
static void TestOtherThread(fs::path dirname, std::string lockname, bool *result)

0 commit comments

Comments
 (0)