20 #include <ripple/protocol/jss.h>
35 args[jss::source_account] = source.
human();
36 args[jss::destination_account] = dest.
human();
38 args[jss::ledger_index] = ledger;
47 BEAST_EXPECT (results[jss::deposit_authorized] ==
authorized);
48 BEAST_EXPECT (results[jss::status] == jss::success);
60 env.
fund(
XRP(1000), alice, becky, carol);
66 becky, becky,
"validated").toStyledString()),
true);
71 alice, becky,
"validated").toStyledString()),
true);
84 becky, becky,
"validated").toStyledString()),
true);
89 becky, alice,
"current").toStyledString()),
true);
92 env (deposit::auth (becky, alice));
123 auto verifyErr = [
this] (
124 Json::Value const& result,
char const* error,
char const* errorMsg)
126 BEAST_EXPECT (result[jss::result][jss::status] == jss::error);
127 BEAST_EXPECT (result[jss::result][jss::error] == error);
128 BEAST_EXPECT (result[jss::result][jss::error_message] == errorMsg);
137 "json",
"deposit_authorized", args.toStyledString())};
138 verifyErr (result,
"invalidParams",
139 "Missing field 'source_account'.");
144 args[jss::source_account] = 7.3;
146 "json",
"deposit_authorized", args.toStyledString())};
147 verifyErr (result,
"invalidParams",
148 "Invalid field 'source_account', not a string.");
153 args[jss::source_account] =
"rG1QQv2nh2gr7RCZ!P8YYcBUKCCN633jCn";
155 "json",
"deposit_authorized", args.toStyledString())};
156 verifyErr (result,
"actMalformed",
"Account malformed.");
163 "json",
"deposit_authorized", args.toStyledString())};
164 verifyErr (result,
"invalidParams",
165 "Missing field 'destination_account'.");
170 args[jss::destination_account] = 7.3;
172 "json",
"deposit_authorized", args.toStyledString())};
173 verifyErr (result,
"invalidParams",
174 "Invalid field 'destination_account', not a string.");
179 args[jss::destination_account] =
180 "rP6P9ypfAmc!pw8SZHNwM4nvZHFXDraQas";
182 "json",
"deposit_authorized", args.toStyledString())};
183 verifyErr (result,
"actMalformed",
"Account malformed.");
189 "json",
"deposit_authorized", args.toStyledString())};
190 verifyErr (result,
"invalidParams",
"ledgerIndexMalformed");
195 args[jss::ledger_index] = 17;
197 "json",
"deposit_authorized", args.toStyledString())};
198 verifyErr (result,
"lgrNotFound",
"ledgerNotFound");
204 "json",
"deposit_authorized", args.toStyledString())};
205 verifyErr (result,
"srcActNotFound",
206 "Source account not found.");
214 "json",
"deposit_authorized", args.toStyledString())};
215 verifyErr (result,
"dstActNotFound",
216 "Destination account not found.");
224 "json",
"deposit_authorized", args.toStyledString())};