From 7d8ffac18612fe9a5faea3f8fb41442f9e7a3c1d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 6 Jun 2015 09:41:12 +0200 Subject: Changes necessary now that zero values accepted in AmountFromValue - Add an accept test for zero amounts, and a reject test for negative amounts - Remove ugly hack in `settxfee` that is no longer necessary - Do explicit zero checks in wallet RPC functions - Don't add a check for zero amounts in `createrawtransaction` - this could be seen as a feature --- src/test/rpc_tests.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test/rpc_tests.cpp') diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 0b33ddb086..08f988fdbf 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -131,6 +131,9 @@ static UniValue ValueFromString(const std::string &str) BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values) { + BOOST_CHECK_THROW(AmountFromValue(ValueFromString("-0.00000001")), UniValue); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0")), 0LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000")), 0LL); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000001")), 1LL); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.17622195")), 17622195LL); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.5")), 50000000LL); -- cgit v1.2.3