Fix spurious test passage.

This commit is contained in:
Kris Nuttycombe 2021-10-28 17:15:32 -06:00
parent 22fa6b22ea
commit dbcdc560de
1 changed files with 6 additions and 6 deletions

View File

@ -1145,28 +1145,28 @@ BOOST_AUTO_TEST_CASE(rpc_z_sendmany_parameters)
// duplicate address // duplicate address
BOOST_CHECK_THROW(CallRPC("z_sendmany " BOOST_CHECK_THROW(CallRPC("z_sendmany "
"tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ " "tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ "
"[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\", \"amount\":50.0}," "[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\",\"amount\":50.0},"
" {\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\", \"amount\":12.0} ]" "{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\",\"amount\":12.0}]"
), runtime_error); ), runtime_error);
// invalid fee amount, cannot be negative // invalid fee amount, cannot be negative
BOOST_CHECK_THROW(CallRPC("z_sendmany " BOOST_CHECK_THROW(CallRPC("z_sendmany "
"tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ " "tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ "
"[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\", \"amount\":50.0}] " "[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\",\"amount\":50.0}] "
"1 -0.00001" "1 -0.00001"
), runtime_error); ), runtime_error);
// invalid fee amount, bigger than MAX_MONEY // invalid fee amount, bigger than MAX_MONEY
BOOST_CHECK_THROW(CallRPC("z_sendmany " BOOST_CHECK_THROW(CallRPC("z_sendmany "
"tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ " "tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ "
"[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\", \"amount\":50.0}] " "[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\",\"amount\":50.0}] "
"1 21000001" "1 21000001"
), runtime_error); ), runtime_error);
// fee amount is bigger than sum of outputs // fee amount is bigger than sum of outputs
BOOST_CHECK_THROW(CallRPC("z_sendmany " BOOST_CHECK_THROW(CallRPC("z_sendmany "
"tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ " "tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ "
"[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\", \"amount\":50.0}] " "[{\"address\":\"tmQP9L3s31cLsghVYf2Jb5MhKj1jRBPoeQn\",\"amount\":50.0}] "
"1 50.00000001" "1 50.00000001"
), runtime_error); ), runtime_error);
@ -1178,7 +1178,7 @@ BOOST_AUTO_TEST_CASE(rpc_z_sendmany_parameters)
KeyIO keyIO(Params()); KeyIO keyIO(Params());
std::string zaddr1 = keyIO.EncodePaymentAddress(pa); std::string zaddr1 = keyIO.EncodePaymentAddress(pa);
BOOST_CHECK_THROW(CallRPC(string("z_sendmany tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ ") BOOST_CHECK_THROW(CallRPC(string("z_sendmany tmRr6yJonqGK23UVhrKuyvTpF8qxQQjKigJ ")
+ "[{\"address\":\"" + zaddr1 + "\", \"amount\":123.456}]"), runtime_error); + "[{\"address\":\"" + zaddr1 + "\",\"amount\":123.456}]"), runtime_error);
// Mutable tx containing contextual information we need to build tx // Mutable tx containing contextual information we need to build tx
UniValue retValue = CallRPC("getblockcount"); UniValue retValue = CallRPC("getblockcount");