mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user