20 #include <ripple/protocol/jss.h>
37 args[jss::source_account] = source.
human();
38 args[jss::destination_account] = dest.
human();
40 args[jss::ledger_index] = ledger;
50 BEAST_EXPECT(results[jss::deposit_authorized] ==
authorized);
51 BEAST_EXPECT(results[jss::status] == jss::success);
64 env.
fund(
XRP(1000), alice, becky, carol);
107 "deposit_authorized",
112 env(deposit::auth(becky, alice));
119 "deposit_authorized",
127 "deposit_authorized",
138 "deposit_authorized",
146 "deposit_authorized",
160 auto verifyErr = [
this](
163 char const* errorMsg) {
164 BEAST_EXPECT(result[jss::result][jss::status] == jss::error);
165 BEAST_EXPECT(result[jss::result][jss::error] == error);
166 BEAST_EXPECT(result[jss::result][jss::error_message] == errorMsg);
175 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
177 result,
"invalidParams",
"Missing field 'source_account'.");
182 args[jss::source_account] = 7.3;
184 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
188 "Invalid field 'source_account', not a string.");
193 args[jss::source_account] =
"rG1QQv2nh2gr7RCZ!P8YYcBUKCCN633jCn";
195 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
196 verifyErr(result,
"actMalformed",
"Account malformed.");
203 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
207 "Missing field 'destination_account'.");
212 args[jss::destination_account] = 7.3;
214 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
218 "Invalid field 'destination_account', not a string.");
223 args[jss::destination_account] =
224 "rP6P9ypfAmc!pw8SZHNwM4nvZHFXDraQas";
226 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
227 verifyErr(result,
"actMalformed",
"Account malformed.");
233 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
234 verifyErr(result,
"invalidParams",
"ledgerIndexMalformed");
240 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
241 verifyErr(result,
"lgrNotFound",
"ledgerNotFound");
246 args[jss::ledger_index] = 17;
248 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
249 verifyErr(result,
"lgrNotFound",
"ledgerNotFound");
255 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
256 verifyErr(result,
"srcActNotFound",
"Source account not found.");
264 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};
266 result,
"dstActNotFound",
"Destination account not found.");
274 env.
rpc(
"json",
"deposit_authorized", args.toStyledString())};