rippled
Loading...
Searching...
No Matches
RPCCall_test.cpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2018 Ripple Labs Inc.
5 Permission to use, copy, modify, and/or distribute this software for any
6 purpose with or without fee is hereby granted, provided that the above
7 copyright notice and this permission notice appear in all copies.
8 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16//==============================================================================
17
18#include <test/jtx.h>
19#include <test/jtx/utility.h>
20#include <xrpld/net/RPCCall.h>
21#include <xrpld/rpc/detail/RPCHelpers.h>
22#include <xrpl/beast/unit_test.h>
23#include <xrpl/json/json_reader.h>
24#include <xrpl/protocol/ErrorCodes.h>
25
26#include <boost/algorithm/string.hpp>
27
28#include <functional>
29#include <initializer_list>
30#include <vector>
31
32namespace ripple {
33namespace test {
34
36{
37 char const* const description;
38 int const line;
39 // List of passed arguments.
41
42 // If it throws, what does it throw?
45
46 // Expected JSON response.
48
50 char const* description_,
51 int line_,
53 Exception throwsWhat_,
54 char const* exp_)
55 : description(description_)
56 , line(line_)
57 , args(args_)
58 , throwsWhat(throwsWhat_)
59 , exp(1, exp_)
60 {
61 }
62
64 char const* description_,
65 int line_,
67 Exception throwsWhat_,
69 : description(description_)
70 , line(line_)
71 , args(args_)
72 , throwsWhat(throwsWhat_)
73 , exp(exp_)
74 {
75 }
76
77 RPCCallTestData() = delete;
81 operator=(RPCCallTestData const&) = delete;
84};
85
87 // account_channels
88 // ------------------------------------------------------------
89 {"account_channels: minimal.",
90 __LINE__,
91 {"account_channels", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
93 R"({
94 "method" : "account_channels",
95 "params" : [
96 {
97 "api_version" : %API_VER%,
98 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
99 }
100 ]
101 })"},
102 {"account_channels: account and ledger hash.",
103 __LINE__,
104 {"account_channels",
105 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
106 "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"},
108 R"({
109 "method" : "account_channels",
110 "params" : [
111 {
112 "api_version" : %API_VER%,
113 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
114 "destination_account" : "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"
115 }
116 ]
117 })"},
118 {"account_channels: account and ledger index.",
119 __LINE__,
120 {"account_channels",
121 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
122 "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"},
124 R"({
125 "method" : "account_channels",
126 "params" : [
127 {
128 "api_version" : %API_VER%,
129 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
130 "destination_account" : "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"
131 }
132 ]
133 })"},
134 {"account_channels: two accounts.",
135 __LINE__,
136 {"account_channels",
137 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
138 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
140 R"({
141 "method" : "account_channels",
142 "params" : [
143 {
144 "api_version" : %API_VER%,
145 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
146 "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
147 }
148 ]
149 })"},
150 {"account_channels: two accounts and ledger hash.",
151 __LINE__,
152 {"account_channels",
153 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
154 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
155 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
157 R"({
158 "method" : "account_channels",
159 "params" : [
160 {
161 "api_version" : %API_VER%,
162 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
163 "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
164 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
165 }
166 ]
167 })"},
168 {"account_channels: two accounts and ledger index.",
169 __LINE__,
170 {"account_channels",
171 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
172 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
173 "90210"},
175 R"({
176 "method" : "account_channels",
177 "params" : [
178 {
179 "api_version" : %API_VER%,
180 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
181 "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
182 "ledger_index" : 90210
183 }
184 ]
185 })"},
186 {"account_channels: too few arguments.",
187 __LINE__,
188 {
189 "account_channels",
190 },
192 R"({
193 "method" : "account_channels",
194 "params" : [
195 {
196 "error" : "badSyntax",
197 "error_code" : 1,
198 "error_message" : "Syntax error."
199 }
200 ]
201 })"},
202 {"account_channels: too many arguments.",
203 __LINE__,
204 {"account_channels",
205 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
206 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
207 "current",
208 "extra"},
210 R"({
211 "method" : "account_channels",
212 "params" : [
213 {
214 "error" : "badSyntax",
215 "error_code" : 1,
216 "error_message" : "Syntax error."
217 }
218 ]
219 })"},
220 {"account_channels: invalid accountID.",
221 __LINE__,
222 {
223 "account_channels",
224 "", // Note: very few values are detected as bad!
225 },
227 R"({
228 "method" : "account_channels",
229 "params" : [
230 {
231 "error" : "actMalformed",
232 "error_code" : 35,
233 "error_message" : "Account malformed."
234 }
235 ]
236 })"},
237
238 // account_currencies
239 // ----------------------------------------------------------
240 {"account_currencies: minimal 1.",
241 __LINE__,
242 {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
244 R"({
245 "method" : "account_currencies",
246 "params" : [
247 {
248 "api_version" : %API_VER%,
249 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
250 }
251 ]
252 })"},
253 {"account_currencies: minimal 2.",
254 __LINE__,
255 {"account_currencies", "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"},
257 R"({
258 "method" : "account_currencies",
259 "params" : [
260 {
261 "api_version" : %API_VER%,
262 "account" : "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"
263 }
264 ]
265 })"},
266 {"account_currencies: ledger index.",
267 __LINE__,
268 {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "42"},
270 R"({
271 "method" : "account_currencies",
272 "params" : [
273 {
274 "api_version" : %API_VER%,
275 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
276 "ledger_index" : 42
277 }
278 ]
279 })"},
280 {"account_currencies: validated ledger.",
281 __LINE__,
282 {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
284 R"({
285 "method" : "account_currencies",
286 "params" : [
287 {
288 "api_version" : %API_VER%,
289 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
290 "ledger_index" : "validated"
291 }
292 ]
293 })"},
294 {"account_currencies: current ledger.",
295 __LINE__,
296 {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "current"},
298 R"({
299 "method" : "account_currencies",
300 "params" : [
301 {
302 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
303 "api_version" : %API_VER%,
304 "ledger_index" : "current"
305 }
306 ]
307 })"},
308 {"account_currencies: too few arguments.",
309 __LINE__,
310 {
311 "account_currencies",
312 },
314 R"({
315 "method" : "account_currencies",
316 "params" : [
317 {
318 "error" : "badSyntax",
319 "error_code" : 1,
320 "error_message" : "Syntax error."
321 }
322 ]
323 })"},
324 {"account_currencies: too many arguments.",
325 __LINE__,
326 {"account_currencies",
327 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
328 "current",
329 "spare1",
330 "spare2"},
332 R"({
333 "method" : "account_currencies",
334 "params" : [
335 {
336 "error" : "badSyntax",
337 "error_code" : 1,
338 "error_message" : "Syntax error."
339 }
340 ]
341 })"},
342 {"account_currencies: invalid second argument.",
343 __LINE__,
344 {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "yup"},
346 R"({
347 "method" : "account_currencies",
348 "params" : [
349 {
350 "api_version" : %API_VER%,
351 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
352 "ledger_index" : 0
353 }
354 ]
355 })"},
356 {
357 "account_currencies: invalid accountID.",
358 __LINE__,
359 {
360 "account_currencies",
361 "", // Note: very few values are detected as bad!
362 },
364 R"({
365 "method" : "account_currencies",
366 "params" : [
367 {
368 "error" : "actMalformed",
369 "error_code" : 35,
370 "error_message" : "Account malformed."
371 }
372 ]
373 })",
374 },
375
376 // account_info
377 // ----------------------------------------------------------------
378 {"account_info: minimal.",
379 __LINE__,
380 {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
382 R"({
383 "method" : "account_info",
384 "params" : [
385 {
386 "api_version" : %API_VER%,
387 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
388 }
389 ]
390 })"},
391 {"account_info: with numeric ledger index.",
392 __LINE__,
393 {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
395 R"({
396 "method" : "account_info",
397 "params" : [
398 {
399 "api_version" : %API_VER%,
400 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
401 "ledger_index" : 77777
402 }
403 ]
404 })"},
405 {"account_info: with text ledger index.",
406 __LINE__,
407 {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
409 R"({
410 "method" : "account_info",
411 "params" : [
412 {
413 "api_version" : %API_VER%,
414 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
415 "ledger_index" : "closed"
416 }
417 ]
418 })"},
419 {"account_info: with ledger hash.",
420 __LINE__,
421 {"account_info",
422 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
423 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
425 R"({
426 "method" : "account_info",
427 "params" : [
428 {
429 "api_version" : %API_VER%,
430 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
431 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
432 }
433 ]
434 })"},
435 {"account_info: with ledger index.",
436 __LINE__,
437 {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
439 R"({
440 "method" : "account_info",
441 "params" : [
442 {
443 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
444 "api_version" : %API_VER%,
445 "ledger_index" : "validated"
446 }
447 ]
448 })"},
449 {"account_info: too few arguments.",
450 __LINE__,
451 {
452 "account_info",
453 },
455 R"({
456 "method" : "account_info",
457 "params" : [
458 {
459 "error" : "badSyntax",
460 "error_code" : 1,
461 "error_message" : "Syntax error."
462 }
463 ]
464 })"},
465 {"account_info: too many arguments.",
466 __LINE__,
467 {"account_info",
468 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
469 "current",
470 "extra1",
471 "extra2"},
473 R"({
474 "method" : "account_info",
475 "params" : [
476 {
477 "error" : "badSyntax",
478 "error_code" : 1,
479 "error_message" : "Syntax error."
480 }
481 ]
482 })"},
483 {
484 "account_info: invalid accountID.",
485 __LINE__,
486 {
487 "account_info",
488 "", // Note: very few values are detected as bad!
489 },
491 R"({
492 "method" : "account_info",
493 "params" : [
494 {
495 "error" : "actMalformed",
496 "error_code" : 35,
497 "error_message" : "Account malformed."
498 }
499 ]
500 })",
501 },
502
503 // account_lines
504 // ---------------------------------------------------------------
505 {"account_lines: minimal.",
506 __LINE__,
507 {"account_lines", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
509 R"({
510 "method" : "account_lines",
511 "params" : [
512 {
513 "api_version" : %API_VER%,
514 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
515 }
516 ]
517 })"},
518 {"account_lines: peer.",
519 __LINE__,
520 {"account_lines",
521 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
522 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
524 R"({
525 "method" : "account_lines",
526 "params" : [
527 {
528 "api_version" : %API_VER%,
529 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
530 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
531 }
532 ]
533 })"},
534 {"account_lines: peer and numeric ledger index.",
535 __LINE__,
536 {"account_lines",
537 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
538 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
539 "888888888"},
541 R"({
542 "method" : "account_lines",
543 "params" : [
544 {
545 "api_version" : %API_VER%,
546 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
547 "ledger_index" : 888888888,
548 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
549 }
550 ]
551 })"},
552 {"account_lines: peer and text ledger index.",
553 __LINE__,
554 {"account_lines",
555 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
556 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
557 "closed"},
559 R"({
560 "method" : "account_lines",
561 "params" : [
562 {
563 "api_version" : %API_VER%,
564 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
565 "ledger_index" : "closed",
566 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
567 }
568 ]
569 })"},
570 {"account_lines: peer and ledger hash.",
571 __LINE__,
572 {"account_lines",
573 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
574 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
575 "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000"},
577 R"({
578 "method" : "account_lines",
579 "params" : [
580 {
581 "api_version" : %API_VER%,
582 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
583 "ledger_hash" : "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000",
584 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
585 }
586 ]
587 })"},
588 {"account_lines: too few arguments.",
589 __LINE__,
590 {
591 "account_lines",
592 },
594 R"({
595 "method" : "account_lines",
596 "params" : [
597 {
598 "error" : "badSyntax",
599 "error_code" : 1,
600 "error_message" : "Syntax error."
601 }
602 ]
603 })"},
604 {// Note: I believe this _ought_ to be detected as too many arguments.
605 "account_lines: four arguments.",
606 __LINE__,
607 {"account_lines",
608 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
609 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
610 "12345678",
611 "current"},
613 R"({
614 "method" : "account_lines",
615 "params" : [
616 {
617 "api_version" : %API_VER%,
618 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
619 "ledger_index" : 12345678,
620 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
621 }
622 ]
623 })"},
624 {// Note: I believe this _ought_ to be detected as too many arguments.
625 "account_lines: five arguments.",
626 __LINE__,
627 {"account_lines",
628 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
629 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
630 "12345678",
631 "current",
632 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
634 R"({
635 "method" : "account_lines",
636 "params" : [
637 {
638 "api_version" : %API_VER%,
639 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
640 "ledger_index" : 12345678,
641 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
642 }
643 ]
644 })"},
645 {"account_lines: too many arguments.",
646 __LINE__,
647 {"account_lines",
648 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
649 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
650 "12345678",
651 "current",
652 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
653 "validated"},
655 R"({
656 "method" : "account_lines",
657 "params" : [
658 {
659 "error" : "badSyntax",
660 "error_code" : 1,
661 "error_message" : "Syntax error."
662 }
663 ]
664 })"},
665 {
666 "account_lines: first invalid accountID.",
667 __LINE__,
668 {
669 "account_lines",
670 "", // Note: very few values are detected as bad!
671 },
673 R"({
674 "method" : "account_lines",
675 "params" : [
676 {
677 "error" : "actMalformed",
678 "error_code" : 35,
679 "error_message" : "Account malformed."
680 }
681 ]
682 })",
683 },
684 {
685 "account_lines: second invalid accountID.",
686 __LINE__,
687 {
688 "account_lines",
689 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
690 "" // Note: very few values are detected as bad!
691 },
693 R"({
694 "method" : "account_lines",
695 "params" : [
696 {
697 "api_version" : %API_VER%,
698 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
699 }
700 ]
701 })",
702 },
703 {
704 "account_lines: invalid ledger selector.",
705 __LINE__,
706 {"account_lines",
707 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
708 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
709 "not_a_ledger"},
711 R"({
712 "method" : "account_lines",
713 "params" : [
714 {
715 "api_version" : %API_VER%,
716 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
717 "ledger_index" : 0,
718 "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
719 }
720 ]
721 })",
722 },
723
724 // account_objects
725 // -------------------------------------------------------------
726 {"account_objects: minimal.",
727 __LINE__,
728 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
730 R"({
731 "method" : "account_objects",
732 "params" : [
733 {
734 "api_version" : %API_VER%,
735 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
736 }
737 ]
738 })"},
739 {"account_objects: with numeric ledger index.",
740 __LINE__,
741 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
743 R"({
744 "method" : "account_objects",
745 "params" : [
746 {
747 "api_version" : %API_VER%,
748 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
749 "ledger_index" : 77777
750 }
751 ]
752 })"},
753 {"account_objects: with text ledger index.",
754 __LINE__,
755 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
757 R"({
758 "method" : "account_objects",
759 "params" : [
760 {
761 "api_version" : %API_VER%,
762 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
763 "ledger_index" : "closed"
764 }
765 ]
766 })"},
767 {"account_objects: with ledger hash.",
768 __LINE__,
769 {"account_objects",
770 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
771 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
773 R"({
774 "method" : "account_objects",
775 "params" : [
776 {
777 "api_version" : %API_VER%,
778 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
779 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
780 }
781 ]
782 })"},
783 {"account_objects: with ledger index.",
784 __LINE__,
785 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
787 R"({
788 "method" : "account_objects",
789 "params" : [
790 {
791 "api_version" : %API_VER%,
792 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
793 "ledger_index" : "validated"
794 }
795 ]
796 })"},
797 {"account_objects: too few arguments.",
798 __LINE__,
799 {
800 "account_objects",
801 },
803 R"({
804 "method" : "account_objects",
805 "params" : [
806 {
807 "error" : "badSyntax",
808 "error_code" : 1,
809 "error_message" : "Syntax error."
810 }
811 ]
812 })"},
813 {// Note: I believe this _ought_ to be detected as too many arguments.
814 "account_objects: four arguments.",
815 __LINE__,
816 {
817 "account_objects",
818 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
819 "current",
820 "extra1",
821 "extra2",
822 },
824 R"({
825 "method" : "account_objects",
826 "params" : [
827 {
828 "api_version" : %API_VER%,
829 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
830 }
831 ]
832 })"},
833 {// Note: I believe this _ought_ to be detected as too many arguments.
834 "account_objects: five arguments.",
835 __LINE__,
836 {
837 "account_objects",
838 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
839 "current",
840 "extra1",
841 "extra2",
842 "extra3",
843 },
845 R"({
846 "method" : "account_objects",
847 "params" : [
848 {
849 "api_version" : %API_VER%,
850 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
851 }
852 ]
853 })"},
854 {"account_objects: too many arguments.",
855 __LINE__,
856 {
857 "account_objects",
858 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
859 "current",
860 "extra1",
861 "extra2",
862 "extra3",
863 "extra4",
864 },
866 R"({
867 "method" : "account_objects",
868 "params" : [
869 {
870 "error" : "badSyntax",
871 "error_code" : 1,
872 "error_message" : "Syntax error."
873 }
874 ]
875 })"},
876 {
877 "account_objects: invalid accountID.",
878 __LINE__,
879 {
880 "account_objects",
881 "", // Note: very few values are detected as bad!
882 },
884 R"({
885 "method" : "account_objects",
886 "params" : [
887 {
888 "error" : "actMalformed",
889 "error_code" : 35,
890 "error_message" : "Account malformed."
891 }
892 ]
893 })",
894 },
895 {
896 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
897 // cannot currently occur because jvParseLedger() always returns true.
898 "account_objects: invalid ledger selection 1.",
899 __LINE__,
900 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
902 R"({
903 "method" : "account_objects",
904 "params" : [
905 {
906 "api_version" : %API_VER%,
907 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
908 "ledger_index" : 0
909 }
910 ]
911 })",
912 },
913 {
914 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
915 // cannot currently occur because jvParseLedger() always returns true.
916 "account_objects: invalid ledger selection 2.",
917 __LINE__,
918 {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
920 R"({
921 "method" : "account_objects",
922 "params" : [
923 {
924 "api_version" : %API_VER%,
925 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
926 "ledger_index" : 0
927 }
928 ]
929 })",
930 },
931
932 // account_offers
933 // --------------------------------------------------------------
934 {"account_offers: minimal.",
935 __LINE__,
936 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
938 R"({
939 "method" : "account_offers",
940 "params" : [
941 {
942 "api_version" : %API_VER%,
943 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
944 }
945 ]
946 })"},
947 {"account_offers: with numeric ledger index.",
948 __LINE__,
949 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
951 R"({
952 "method" : "account_offers",
953 "params" : [
954 {
955 "api_version" : %API_VER%,
956 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
957 "ledger_index" : 987654321
958 }
959 ]
960 })"},
961 {"account_offers: with text ledger index.",
962 __LINE__,
963 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
965 R"({
966 "method" : "account_offers",
967 "params" : [
968 {
969 "api_version" : %API_VER%,
970 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
971 "ledger_index" : "validated"
972 }
973 ]
974 })"},
975 {"account_offers: with ledger hash.",
976 __LINE__,
977 {"account_offers",
978 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
979 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
981 R"({
982 "method" : "account_offers",
983 "params" : [
984 {
985 "api_version" : %API_VER%,
986 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
987 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
988 }
989 ]
990 })"},
991 {"account_offers: with ledger index.",
992 __LINE__,
993 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
995 R"({
996 "method" : "account_offers",
997 "params" : [
998 {
999 "api_version" : %API_VER%,
1000 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1001 "ledger_index" : "validated"
1002 }
1003 ]
1004 })"},
1005 {"account_offers: too few arguments.",
1006 __LINE__,
1007 {
1008 "account_offers",
1009 },
1011 R"({
1012 "method" : "account_offers",
1013 "params" : [
1014 {
1015 "error" : "badSyntax",
1016 "error_code" : 1,
1017 "error_message" : "Syntax error."
1018 }
1019 ]
1020 })"},
1021 {// Note: I believe this _ought_ to be detected as too many arguments.
1022 "account_offers: four arguments.",
1023 __LINE__,
1024 {"account_offers",
1025 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1026 "current",
1027 "extra"},
1029 R"({
1030 "method" : "account_offers",
1031 "params" : [
1032 {
1033 "api_version" : %API_VER%,
1034 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1035 }
1036 ]
1037 })"},
1038 {"account_offers: too many arguments.",
1039 __LINE__,
1040 {
1041 "account_offers",
1042 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1043 "current",
1044 "extra1",
1045 "extra2",
1046 "extra3",
1047 },
1049 R"({
1050 "method" : "account_offers",
1051 "params" : [
1052 {
1053 "error" : "badSyntax",
1054 "error_code" : 1,
1055 "error_message" : "Syntax error."
1056 }
1057 ]
1058 })"},
1059 {
1060 "account_offers: invalid accountID.",
1061 __LINE__,
1062 {
1063 "account_offers",
1064 "", // Note: very few values are detected as bad!
1065 },
1067 R"({
1068 "method" : "account_offers",
1069 "params" : [
1070 {
1071 "error" : "actMalformed",
1072 "error_code" : 35,
1073 "error_message" : "Account malformed."
1074 }
1075 ]
1076 })",
1077 },
1078 {
1079 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
1080 // cannot currently occur because jvParseLedger() always returns true.
1081 "account_offers: invalid ledger selection 1.",
1082 __LINE__,
1083 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
1085 R"({
1086 "method" : "account_offers",
1087 "params" : [
1088 {
1089 "api_version" : %API_VER%,
1090 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1091 "ledger_index" : 0
1092 }
1093 ]
1094 })",
1095 },
1096 {
1097 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
1098 // cannot currently occur because jvParseLedger() always returns true.
1099 "account_offers: invalid ledger selection 2.",
1100 __LINE__,
1101 {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
1103 R"({
1104 "method" : "account_offers",
1105 "params" : [
1106 {
1107 "api_version" : %API_VER%,
1108 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1109 "ledger_index" : 0
1110 }
1111 ]
1112 })",
1113 },
1114
1115 // account_tx
1116 // ------------------------------------------------------------------
1117 {"account_tx: minimal.",
1118 __LINE__,
1119 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
1121 R"({
1122 "method" : "account_tx",
1123 "params" : [
1124 {
1125 "api_version" : %API_VER%,
1126 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1127 }
1128 ]
1129 })"},
1130 {"account_tx: ledger_index .",
1131 __LINE__,
1132 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "444"},
1134 R"({
1135 "method" : "account_tx",
1136 "params" : [
1137 {
1138 "api_version" : %API_VER%,
1139 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1140 "ledger_index" : 444
1141 }
1142 ]
1143 })"},
1144 {"account_tx: ledger_index plus trailing params.",
1145 __LINE__,
1146 {"account_tx",
1147 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1148 "707",
1149 "descending",
1150 "binary",
1151 "count"},
1153 R"({
1154 "method" : "account_tx",
1155 "params" : [
1156 {
1157 "api_version" : %API_VER%,
1158 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1159 "count" : true,
1160 "binary" : true,
1161 "descending" : true,
1162 "ledger_index" : 707
1163 }
1164 ]
1165 })"},
1166 {"account_tx: ledger_index_min and _max.",
1167 __LINE__,
1168 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "-1"},
1170 R"({
1171 "method" : "account_tx",
1172 "params" : [
1173 {
1174 "api_version" : %API_VER%,
1175 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1176 "ledger_index_max" : -1,
1177 "ledger_index_min" : -1
1178 }
1179 ]
1180 })"},
1181 {"account_tx: ledger_index_min and _max plus trailing params.",
1182 __LINE__,
1183 {"account_tx",
1184 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1185 "-1",
1186 "413",
1187 "binary",
1188 "count",
1189 "descending"},
1191 R"({
1192 "method" : "account_tx",
1193 "params" : [
1194 {
1195 "api_version" : %API_VER%,
1196 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1197 "binary" : true,
1198 "count" : true,
1199 "descending" : true,
1200 "ledger_index_max" : 413,
1201 "ledger_index_min" : -1
1202 }
1203 ]
1204 })"},
1205 {"account_tx: ledger_index_min and _max plus limit.",
1206 __LINE__,
1207 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "247", "-1", "300"},
1209 R"({
1210 "method" : "account_tx",
1211 "params" : [
1212 {
1213 "api_version" : %API_VER%,
1214 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1215 "ledger_index_max" : -1,
1216 "ledger_index_min" : 247,
1217 "limit" : 300
1218 }
1219 ]
1220 })"},
1221 {"account_tx: ledger_index_min and _max, limit, trailing args.",
1222 __LINE__,
1223 {"account_tx",
1224 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1225 "247",
1226 "-1",
1227 "300",
1228 "count",
1229 "descending",
1230 "binary"},
1232 R"({
1233 "method" : "account_tx",
1234 "params" : [
1235 {
1236 "api_version" : %API_VER%,
1237 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1238 "binary" : true,
1239 "count" : true,
1240 "descending" : true,
1241 "ledger_index_max" : -1,
1242 "ledger_index_min" : 247,
1243 "limit" : 300
1244 }
1245 ]
1246 })"},
1247 {"account_tx: ledger_index_min and _max plus limit and offset.",
1248 __LINE__,
1249 {"account_tx",
1250 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1251 "589",
1252 "590",
1253 "67",
1254 "45"},
1256 R"({
1257 "method" : "account_tx",
1258 "params" : [
1259 {
1260 "api_version" : %API_VER%,
1261 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1262 "ledger_index_max" : 590,
1263 "ledger_index_min" : 589,
1264 "limit" : 67,
1265 "offset" : 45
1266 }
1267 ]
1268 })"},
1269 {"account_tx: ledger_index_min and _max, limit, offset, trailing.",
1270 __LINE__,
1271 {"account_tx",
1272 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1273 "589",
1274 "590",
1275 "67",
1276 "45",
1277 "descending",
1278 "count"},
1280 R"({
1281 "method" : "account_tx",
1282 "params" : [
1283 {
1284 "api_version" : %API_VER%,
1285 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1286 "count" : true,
1287 "descending" : true,
1288 "ledger_index_max" : 590,
1289 "ledger_index_min" : 589,
1290 "limit" : 67,
1291 "offset" : 45
1292 }
1293 ]
1294 })"},
1295 {"account_tx: too few arguments.",
1296 __LINE__,
1297 {
1298 "account_tx",
1299 },
1301 R"({
1302 "method" : "account_tx",
1303 "params" : [
1304 {
1305 "error" : "badSyntax",
1306 "error_code" : 1,
1307 "error_message" : "Syntax error."
1308 }
1309 ]
1310 })"},
1311 {"account_tx: too many arguments.",
1312 __LINE__,
1313 {"account_tx",
1314 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1315 "589",
1316 "590",
1317 "67",
1318 "45",
1319 "extra",
1320 "descending",
1321 "count",
1322 "binary"},
1324 R"({
1325 "method" : "account_tx",
1326 "params" : [
1327 {
1328 "error" : "badSyntax",
1329 "error_code" : 1,
1330 "error_message" : "Syntax error."
1331 }
1332 ]
1333 })"},
1334 {
1335 "account_tx: invalid accountID.",
1336 __LINE__,
1337 {"account_tx", "rHb9CJAWyB4rj9!VRWn96DkukG4bwdtyTh"},
1339 R"({
1340 "method" : "account_tx",
1341 "params" : [
1342 {
1343 "error" : "actMalformed",
1344 "error_code" : 35,
1345 "error_message" : "Account malformed."
1346 }
1347 ]
1348 })",
1349 },
1350 {
1351 // Note: not currently detected as bad input.
1352 "account_tx: invalid ledger.",
1353 __LINE__,
1354 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-478.7"},
1356 R"({
1357 "method" : "account_tx",
1358 "params" : [
1359 {
1360 "api_version" : %API_VER%,
1361 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1362 "ledger_index" : 0
1363 }
1364 ]
1365 })",
1366 },
1367 {
1368 "account_tx: max less than min.",
1369 __LINE__,
1370 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"},
1372 {
1373 R"({
1374 "method" : "account_tx",
1375 "params" : [
1376 {
1377 "error" : "lgrIdxsInvalid",
1378 "error_code" : 55,
1379 "error_message" : "Ledger indexes invalid."
1380 }
1381 ]
1382 })",
1383 R"({
1384 "method" : "account_tx",
1385 "params" : [
1386 {
1387 "error" : "notSynced",
1388 "error_code" : 55,
1389 "error_message" : "Not synced to the network."
1390 }
1391 ]
1392 })"},
1393 },
1394 {
1395 // Note: this really shouldn't throw, but does at the moment.
1396 "account_tx: non-integer min.",
1397 __LINE__,
1398 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Binary", "-1"},
1400 R"()",
1401 },
1402 {
1403 // Note: this really shouldn't throw, but does at the moment.
1404 "account_tx: non-integer max.",
1405 __LINE__,
1406 {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "counts"},
1408 R"()",
1409 },
1410 {
1411 // Note: this really shouldn't throw, but does at the moment.
1412 "account_tx: non-integer offset.",
1413 __LINE__,
1414 {"account_tx",
1415 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1416 "-1",
1417 "-1",
1418 "decending"},
1420 R"()",
1421 },
1422 {
1423 // Note: this really shouldn't throw, but does at the moment.
1424 "account_tx: non-integer limit.",
1425 __LINE__,
1426 {"account_tx",
1427 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1428 "-1",
1429 "-1",
1430 "300",
1431 "false"},
1433 R"()",
1434 },
1435 {// Note: this really shouldn't throw, but does at the moment.
1436 "account_tx: RIPD-1570.",
1437 __LINE__,
1438 {"account_tx",
1439 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1440 "-1",
1441 "-1",
1442 "2",
1443 "false",
1444 "false",
1445 "false"},
1447 R"()"},
1448
1449 // book_offers
1450 // -----------------------------------------------------------------
1451 {"book_offers: minimal no issuer.",
1452 __LINE__,
1453 {
1454 "book_offers",
1455 "USD",
1456 "EUR",
1457 },
1459 R"({
1460 "method" : "book_offers",
1461 "params" : [
1462 {
1463 "api_version" : %API_VER%,
1464 "taker_gets" : {
1465 "currency" : "EUR"
1466 },
1467 "taker_pays" : {
1468 "currency" : "USD"
1469 }
1470 }
1471 ]
1472 })"},
1473 {"book_offers: minimal with currency/issuer",
1474 __LINE__,
1475 {
1476 "book_offers",
1477 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1478 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1479 },
1481 R"({
1482 "method" : "book_offers",
1483 "params" : [
1484 {
1485 "api_version" : %API_VER%,
1486 "taker_gets" : {
1487 "currency" : "EUR",
1488 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1489 },
1490 "taker_pays" : {
1491 "currency" : "USD",
1492 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1493 }
1494 }
1495 ]
1496 })"},
1497 {// Note: documentation suggests that "issuer" is the wrong type.
1498 // Should it be "taker" instead?
1499 "book_offers: add issuer.",
1500 __LINE__,
1501 {"book_offers", "USD", "EUR", "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
1503 R"({
1504 "method" : "book_offers",
1505 "params" : [
1506 {
1507 "api_version" : %API_VER%,
1508 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1509 "taker_gets" : {
1510 "currency" : "EUR"
1511 },
1512 "taker_pays" : {
1513 "currency" : "USD"
1514 }
1515 }
1516 ]
1517 })"},
1518 {"book_offers: add issuer and numeric ledger index.",
1519 __LINE__,
1520 {"book_offers",
1521 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1522 "EUR",
1523 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1524 "666"},
1526 R"({
1527 "method" : "book_offers",
1528 "params" : [
1529 {
1530 "api_version" : %API_VER%,
1531 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1532 "ledger_index" : 666,
1533 "taker_gets" : {
1534 "currency" : "EUR"
1535 },
1536 "taker_pays" : {
1537 "currency" : "USD",
1538 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1539 }
1540 }
1541 ]
1542 })"},
1543 {"book_offers: add issuer and text ledger index.",
1544 __LINE__,
1545 {"book_offers",
1546 "USD",
1547 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1548 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1549 "current"},
1551 R"({
1552 "method" : "book_offers",
1553 "params" : [
1554 {
1555 "api_version" : %API_VER%,
1556 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1557 "ledger_index" : "current",
1558 "taker_gets" : {
1559 "currency" : "EUR",
1560 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1561 },
1562 "taker_pays" : {
1563 "currency" : "USD"
1564 }
1565 }
1566 ]
1567 })"},
1568 {"book_offers: add issuer and ledger hash.",
1569 __LINE__,
1570 {"book_offers",
1571 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1572 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1573 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1574 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
1576 R"({
1577 "method" : "book_offers",
1578 "params" : [
1579 {
1580 "api_version" : %API_VER%,
1581 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1582 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1583 "taker_gets" : {
1584 "currency" : "EUR",
1585 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1586 },
1587 "taker_pays" : {
1588 "currency" : "USD",
1589 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1590 }
1591 }
1592 ]
1593 })"},
1594 {"book_offers: issuer, ledger hash, and limit.",
1595 __LINE__,
1596 {
1597 "book_offers",
1598 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1599 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1600 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1601 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1602 "junk", // Note: indexing bug in parseBookOffers() requires junk
1603 // param.
1604 "200",
1605 },
1607 R"({
1608 "method" : "book_offers",
1609 "params" : [
1610 {
1611 "api_version" : %API_VER%,
1612 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1613 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1614 "limit" : 200,
1615 "proof" : true,
1616 "taker_gets" : {
1617 "currency" : "EUR",
1618 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1619 },
1620 "taker_pays" : {
1621 "currency" : "USD",
1622 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1623 }
1624 }
1625 ]
1626 })"},
1627 {// Note: parser supports "marker", but the docs don't cover it.
1628 "book_offers: issuer, ledger hash, limit, and marker.",
1629 __LINE__,
1630 {"book_offers",
1631 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1632 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1633 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1634 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1635 "junk", // Note: indexing bug in parseBookOffers() requires junk param.
1636 "200",
1637 "MyMarker"},
1639 R"({
1640 "method" : "book_offers",
1641 "params" : [
1642 {
1643 "api_version" : %API_VER%,
1644 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1645 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1646 "limit" : 200,
1647 "marker" : "MyMarker",
1648 "proof" : true,
1649 "taker_gets" : {
1650 "currency" : "EUR",
1651 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1652 },
1653 "taker_pays" : {
1654 "currency" : "USD",
1655 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1656 }
1657 }
1658 ]
1659 })"},
1660 {"book_offers: too few arguments.",
1661 __LINE__,
1662 {
1663 "book_offers",
1664 },
1666 R"({
1667 "method" : "book_offers",
1668 "params" : [
1669 {
1670 "error" : "badSyntax",
1671 "error_code" : 1,
1672 "error_message" : "Syntax error."
1673 }
1674 ]
1675 })"},
1676 {"book_offers: too many arguments.",
1677 __LINE__,
1678 {"book_offers",
1679 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1680 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1681 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1682 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1683 "junk", // Note: indexing bug in parseBookOffers() requires junk param.
1684 "200",
1685 "MyMarker",
1686 "extra"},
1688 R"({
1689 "method" : "book_offers",
1690 "params" : [
1691 {
1692 "error" : "badSyntax",
1693 "error_code" : 1,
1694 "error_message" : "Syntax error."
1695 }
1696 ]
1697 })"},
1698
1699 {"book_offers: taker pays no currency.",
1700 __LINE__,
1701 {
1702 "book_offers",
1703 "/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1704 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1705 },
1707 R"({
1708 "method" : "book_offers",
1709 "params" : [
1710 {
1711 "error" : "invalidParams",
1712 "error_code" : 31,
1713 "error_message" : "Invalid currency/issuer '/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'"
1714 }
1715 ]
1716 })"},
1717 {"book_offers: taker gets no currency.",
1718 __LINE__,
1719 {
1720 "book_offers",
1721 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1722 "/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1723 },
1725 R"({
1726 "method" : "book_offers",
1727 "params" : [
1728 {
1729 "error" : "invalidParams",
1730 "error_code" : 31,
1731 "error_message" : "Invalid currency/issuer '/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA'"
1732 }
1733 ]
1734 })"},
1735 {"book_offers: invalid issuer.",
1736 __LINE__,
1737 {"book_offers", "USD", "EUR", "not_a_valid_issuer"},
1739 R"({
1740 "method" : "book_offers",
1741 "params" : [
1742 {
1743 "api_version" : %API_VER%,
1744 "issuer" : "not_a_valid_issuer",
1745 "taker_gets" : {
1746 "currency" : "EUR"
1747 },
1748 "taker_pays" : {
1749 "currency" : "USD"
1750 }
1751 }
1752 ]
1753 })"},
1754 {"book_offers: invalid text ledger index.",
1755 __LINE__,
1756 {"book_offers",
1757 "USD",
1758 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1759 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1760 "not_a_ledger"},
1762 R"({
1763 "method" : "book_offers",
1764 "params" : [
1765 {
1766 "api_version" : %API_VER%,
1767 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1768 "ledger_index" : 0,
1769 "taker_gets" : {
1770 "currency" : "EUR",
1771 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1772 },
1773 "taker_pays" : {
1774 "currency" : "USD"
1775 }
1776 }
1777 ]
1778 })"},
1779 {// Note: this really shouldn't throw, but does at the moment.
1780 "book_offers: non-numeric limit.",
1781 __LINE__,
1782 {
1783 "book_offers",
1784 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1785 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1786 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1787 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1788 "junk", // Note: indexing bug in parseBookOffers() requires junk
1789 // param.
1790 "not_a_number",
1791 },
1793 R"()"},
1794
1795 // can_delete
1796 // ------------------------------------------------------------------
1797 {"can_delete: minimal.",
1798 __LINE__,
1799 {
1800 "can_delete",
1801 },
1803 R"({
1804 "method" : "can_delete",
1805 "params" : [
1806 {
1807 "api_version" : %API_VER%,
1808 }
1809 ]
1810 })"},
1811 {"can_delete: ledger index.",
1812 __LINE__,
1813 {
1814 "can_delete",
1815 "4294967295",
1816 },
1818 R"({
1819 "method" : "can_delete",
1820 "params" : [
1821 {
1822 "api_version" : %API_VER%,
1823 "can_delete" : 4294967295
1824 }
1825 ]
1826 })"},
1827 {"can_delete: ledger hash.",
1828 __LINE__,
1829 {
1830 "can_delete",
1831 "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
1832 },
1834 R"({
1835 "method" : "can_delete",
1836 "params" : [
1837 {
1838 "api_version" : %API_VER%,
1839 "can_delete" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210"
1840 }
1841 ]
1842 })"},
1843 {"can_delete: always.",
1844 __LINE__,
1845 {
1846 "can_delete",
1847 "always",
1848 },
1850 R"({
1851 "method" : "can_delete",
1852 "params" : [
1853 {
1854 "api_version" : %API_VER%,
1855 "can_delete" : "always"
1856 }
1857 ]
1858 })"},
1859 {"can_delete: never.",
1860 __LINE__,
1861 {
1862 "can_delete",
1863 "never",
1864 },
1866 R"({
1867 "method" : "can_delete",
1868 "params" : [
1869 {
1870 "api_version" : %API_VER%,
1871 "can_delete" : "never"
1872 }
1873 ]
1874 })"},
1875 {"can_delete: now.",
1876 __LINE__,
1877 {
1878 "can_delete",
1879 "now",
1880 },
1882 R"({
1883 "method" : "can_delete",
1884 "params" : [
1885 {
1886 "api_version" : %API_VER%,
1887 "can_delete" : "now"
1888 }
1889 ]
1890 })"},
1891 {"can_delete: too many arguments.",
1892 __LINE__,
1893 {"can_delete", "always", "never"},
1895 R"({
1896 "method" : "can_delete",
1897 "params" : [
1898 {
1899 "error" : "badSyntax",
1900 "error_code" : 1,
1901 "error_message" : "Syntax error."
1902 }
1903 ]
1904 })"},
1905 {"can_delete: invalid argument.",
1906 __LINE__,
1907 {"can_delete", "invalid"},
1909 R"({
1910 "method" : "can_delete",
1911 "params" : [
1912 {
1913 "api_version" : %API_VER%,
1914 "can_delete" : "invalid"
1915 }
1916 ]
1917 })"},
1918 {// Note: this should return an error but not throw.
1919 "can_delete: ledger index > 32 bits.",
1920 __LINE__,
1921 {
1922 "can_delete",
1923 "4294967296",
1924 },
1926 R"()"},
1927 {// Note: this really shouldn't throw since it's a legitimate ledger hash.
1928 "can_delete: ledger hash with no alphas.",
1929 __LINE__,
1930 {
1931 "can_delete",
1932 "0123456701234567012345670123456701234567012345670123456701234567",
1933 },
1935 R"()"},
1936
1937 // channel_authorize
1938 // -----------------------------------------------------------
1939 {"channel_authorize: minimal.",
1940 __LINE__,
1941 {"channel_authorize",
1942 "secret_can_be_anything",
1943 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1944 "18446744073709551615"},
1946 R"({
1947 "method" : "channel_authorize",
1948 "params" : [
1949 {
1950 "api_version" : %API_VER%,
1951 "amount" : "18446744073709551615",
1952 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1953 "secret" : "secret_can_be_anything"
1954 }
1955 ]
1956 })"},
1957 {"channel_authorize: too few arguments.",
1958 __LINE__,
1959 {
1960 "channel_authorize",
1961 "secret_can_be_anything",
1962 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1963 },
1965 R"({
1966 "method" : "channel_authorize",
1967 "params" : [
1968 {
1969 "error" : "badSyntax",
1970 "error_code" : 1,
1971 "error_message" : "Syntax error."
1972 }
1973 ]
1974 })"},
1975 {"channel_authorize: too many arguments.",
1976 __LINE__,
1977 {"channel_authorize",
1978 "secp256k1",
1979 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1980 "2000",
1981 "whatever",
1982 "whenever"},
1984 R"({
1985 "method" : "channel_authorize",
1986 "params" : [
1987 {
1988 "error" : "badSyntax",
1989 "error_code" : 1,
1990 "error_message" : "Syntax error."
1991 }
1992 ]
1993 })"},
1994 {"channel_authorize: bad key type.",
1995 __LINE__,
1996 {"channel_authorize",
1997 "secp257k1",
1998 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1999 "2000",
2000 "whatever"},
2002 R"({
2003 "method" : "channel_authorize",
2004 "params" : [
2005 {
2006 "error" : "badKeyType",
2007 "error_code" : 1,
2008 "error_message" : "Bad key type."
2009 }
2010 ]
2011 })"},
2012 {"channel_authorize: channel_id too short.",
2013 __LINE__,
2014 {"channel_authorize",
2015 "secret_can_be_anything",
2016 "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2017 "2000"},
2019 R"({
2020 "method" : "channel_authorize",
2021 "params" : [
2022 {
2023 "error" : "channelMalformed",
2024 "error_code" : 43,
2025 "error_message" : "Payment channel is malformed."
2026 }
2027 ]
2028 })"},
2029 {"channel_authorize: channel_id too long.",
2030 __LINE__,
2031 {"channel_authorize",
2032 "secret_can_be_anything",
2033 "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2034 "2000"},
2036 R"({
2037 "method" : "channel_authorize",
2038 "params" : [
2039 {
2040 "error" : "channelMalformed",
2041 "error_code" : 43,
2042 "error_message" : "Payment channel is malformed."
2043 }
2044 ]
2045 })"},
2046 {"channel_authorize: channel_id not hex.",
2047 __LINE__,
2048 {"channel_authorize",
2049 "secret_can_be_anything",
2050 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEZ",
2051 "2000"},
2053 R"({
2054 "method" : "channel_authorize",
2055 "params" : [
2056 {
2057 "error" : "channelMalformed",
2058 "error_code" : 43,
2059 "error_message" : "Payment channel is malformed."
2060 }
2061 ]
2062 })"},
2063 {"channel_authorize: negative amount.",
2064 __LINE__,
2065 {"channel_authorize",
2066 "secret_can_be_anything",
2067 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2068 "-1"},
2070 R"({
2071 "method" : "channel_authorize",
2072 "params" : [
2073 {
2074 "error" : "channelAmtMalformed",
2075 "error_code" : 44,
2076 "error_message" : "Payment channel amount is malformed."
2077 }
2078 ]
2079 })"},
2080 {"channel_authorize: amount > 64 bits.",
2081 __LINE__,
2082 {"channel_authorize",
2083 "secret_can_be_anything",
2084 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2085 "18446744073709551616"},
2087 R"({
2088 "method" : "channel_authorize",
2089 "params" : [
2090 {
2091 "error" : "channelAmtMalformed",
2092 "error_code" : 44,
2093 "error_message" : "Payment channel amount is malformed."
2094 }
2095 ]
2096 })"},
2097
2098 // channel_verify
2099 // --------------------------------------------------------------
2100 {"channel_verify: public key.",
2101 __LINE__,
2102 {"channel_verify",
2103 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2104 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2105 "0",
2106 "DEADBEEF"},
2108 R"({
2109 "method" : "channel_verify",
2110 "params" : [
2111 {
2112 "api_version" : %API_VER%,
2113 "amount" : "0",
2114 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2115 "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2116 "signature" : "DEADBEEF"
2117 }
2118 ]
2119 })"},
2120 {"channel_verify: public key hex.",
2121 __LINE__,
2122 {"channel_verify",
2123 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2124 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2125 "18446744073709551615",
2126 "DEADBEEF"},
2128 R"({
2129 "method" : "channel_verify",
2130 "params" : [
2131 {
2132 "api_version" : %API_VER%,
2133 "amount" : "18446744073709551615",
2134 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2135 "public_key" : "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2136 "signature" : "DEADBEEF"
2137 }
2138 ]
2139 })"},
2140 {"channel_verify: too few arguments.",
2141 __LINE__,
2142 {"channel_verify",
2143 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2144 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
2146 R"({
2147 "method" : "channel_verify",
2148 "params" : [
2149 {
2150 "error" : "badSyntax",
2151 "error_code" : 1,
2152 "error_message" : "Syntax error."
2153 }
2154 ]
2155 })"},
2156 {"channel_verify: too many arguments.",
2157 __LINE__,
2158 {"channel_verify",
2159 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2160 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2161 "2000",
2162 "DEADBEEF",
2163 "Whatever"},
2165 R"({
2166 "method" : "channel_verify",
2167 "params" : [
2168 {
2169 "error" : "badSyntax",
2170 "error_code" : 1,
2171 "error_message" : "Syntax error."
2172 }
2173 ]
2174 })"},
2175 {"channel_verify: malformed public key.",
2176 __LINE__,
2177 {"channel_verify",
2178 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9GoV",
2179 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2180 "2000",
2181 "DEADBEEF"},
2183 R"({
2184 "method" : "channel_verify",
2185 "params" : [
2186 {
2187 "error" : "publicMalformed",
2188 "error_code" : 60,
2189 "error_message" : "Public key is malformed."
2190 }
2191 ]
2192 })"},
2193 {"channel_verify: malformed hex public key.",
2194 __LINE__,
2195 {"channel_verify",
2196 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F",
2197 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2198 "2000",
2199 "DEADBEEF"},
2201 R"({
2202 "method" : "channel_verify",
2203 "params" : [
2204 {
2205 "error" : "publicMalformed",
2206 "error_code" : 60,
2207 "error_message" : "Public key is malformed."
2208 }
2209 ]
2210 })"},
2211 {"channel_verify: invalid channel id.",
2212 __LINE__,
2213 {"channel_verify",
2214 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2215 "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2216 "2000",
2217 "DEADBEEF"},
2219 R"({
2220 "method" : "channel_verify",
2221 "params" : [
2222 {
2223 "error" : "channelMalformed",
2224 "error_code" : 43,
2225 "error_message" : "Payment channel is malformed."
2226 }
2227 ]
2228 })"},
2229 {"channel_verify: short channel id.",
2230 __LINE__,
2231 {"channel_verify",
2232 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2233 "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2234 "2000",
2235 "DEADBEEF"},
2237 R"({
2238 "method" : "channel_verify",
2239 "params" : [
2240 {
2241 "error" : "channelMalformed",
2242 "error_code" : 43,
2243 "error_message" : "Payment channel is malformed."
2244 }
2245 ]
2246 })"},
2247 {"channel_verify: amount too small.",
2248 __LINE__,
2249 {"channel_verify",
2250 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2251 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2252 "-1",
2253 "DEADBEEF"},
2255 R"({
2256 "method" : "channel_verify",
2257 "params" : [
2258 {
2259 "error" : "channelAmtMalformed",
2260 "error_code" : 44,
2261 "error_message" : "Payment channel amount is malformed."
2262 }
2263 ]
2264 })"},
2265 {"channel_verify: amount too large.",
2266 __LINE__,
2267 {"channel_verify",
2268 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2269 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2270 "18446744073709551616",
2271 "DEADBEEF"},
2273 R"({
2274 "method" : "channel_verify",
2275 "params" : [
2276 {
2277 "error" : "channelAmtMalformed",
2278 "error_code" : 44,
2279 "error_message" : "Payment channel amount is malformed."
2280 }
2281 ]
2282 })"},
2283 {"channel_verify: non-hex signature.",
2284 __LINE__,
2285 {"channel_verify",
2286 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2287 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2288 "40000000",
2289 "ThisIsNotHexadecimal"},
2291 R"({
2292 "method" : "channel_verify",
2293 "params" : [
2294 {
2295 "api_version" : %API_VER%,
2296 "amount" : "40000000",
2297 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2298 "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2299 "signature" : "ThisIsNotHexadecimal"
2300 }
2301 ]
2302 })"},
2303
2304 // connect
2305 // ---------------------------------------------------------------------
2306 {"connect: minimal.",
2307 __LINE__,
2308 {
2309 "connect",
2310 "ThereIsNoCheckingOnTheIPFormat",
2311 },
2313 R"({
2314 "method" : "connect",
2315 "params" : [
2316 {
2317 "api_version" : %API_VER%,
2318 "ip" : "ThereIsNoCheckingOnTheIPFormat"
2319 }
2320 ]
2321 })"},
2322 {"connect: ip and port.",
2323 __LINE__,
2324 {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561"},
2326 R"({
2327 "method" : "connect",
2328 "params" : [
2329 {
2330 "api_version" : %API_VER%,
2331 "ip" : "ThereIsNoCheckingOnTheIPFormat",
2332 "port" : 6561
2333 }
2334 ]
2335 })"},
2336 {"connect: too few arguments.",
2337 __LINE__,
2338 {
2339 "connect",
2340 },
2342 R"({
2343 "method" : "connect",
2344 "params" : [
2345 {
2346 "error" : "badSyntax",
2347 "error_code" : 1,
2348 "error_message" : "Syntax error."
2349 }
2350 ]
2351 })"},
2352 {"connect: too many arguments.",
2353 __LINE__,
2354 {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561", "extra"},
2356 R"({
2357 "method" : "connect",
2358 "params" : [
2359 {
2360 "error" : "badSyntax",
2361 "error_code" : 1,
2362 "error_message" : "Syntax error."
2363 }
2364 ]
2365 })"},
2366 {// Note: this should return an error but not throw.
2367 "connect: port too small.",
2368 __LINE__,
2369 {
2370 "connect",
2371 "ThereIsNoCheckingOnTheIPFormat",
2372 "-1",
2373 },
2375 R"()"},
2376 {// Note: this should return an error but not throw.
2377 "connect: port too large.",
2378 __LINE__,
2379 {
2380 "connect",
2381 "ThereIsNoCheckingOnTheIPFormat",
2382 "4294967296",
2383 },
2385 R"()"},
2386
2387 // consensus_info
2388 // --------------------------------------------------------------
2389 {"consensus_info: minimal.",
2390 __LINE__,
2391 {
2392 "consensus_info",
2393 },
2395 R"({
2396 "method" : "consensus_info",
2397 "params" : [
2398 {
2399 "api_version" : %API_VER%
2400 }
2401 ]
2402 })"},
2403 {"consensus_info: too many arguments.",
2404 __LINE__,
2405 {"consensus_info", "whatever"},
2407 R"({
2408 "method" : "consensus_info",
2409 "params" : [
2410 {
2411 "error" : "badSyntax",
2412 "error_code" : 1,
2413 "error_message" : "Syntax error."
2414 }
2415 ]
2416 })"},
2417
2418 // deposit_authorized
2419 // ----------------------------------------------------------
2420 {"deposit_authorized: minimal.",
2421 __LINE__,
2422 {
2423 "deposit_authorized",
2424 "source_account_NotValidated",
2425 "destination_account_NotValidated",
2426 },
2428 R"({
2429 "method" : "deposit_authorized",
2430 "params" : [
2431 {
2432 "api_version" : %API_VER%,
2433 "destination_account" : "destination_account_NotValidated",
2434 "source_account" : "source_account_NotValidated"
2435 }
2436 ]
2437 })"},
2438 {"deposit_authorized: with text ledger index.",
2439 __LINE__,
2440 {"deposit_authorized",
2441 "source_account_NotValidated",
2442 "destination_account_NotValidated",
2443 "validated"},
2445 R"({
2446 "method" : "deposit_authorized",
2447 "params" : [
2448 {
2449 "api_version" : %API_VER%,
2450 "destination_account" : "destination_account_NotValidated",
2451 "ledger_index" : "validated",
2452 "source_account" : "source_account_NotValidated"
2453 }
2454 ]
2455 })"},
2456 {"deposit_authorized: with ledger index.",
2457 __LINE__,
2458 {"deposit_authorized",
2459 "source_account_NotValidated",
2460 "destination_account_NotValidated",
2461 "4294967295",
2462 "cred1",
2463 "cred2",
2464 "cred3",
2465 "cred4",
2466 "cred5",
2467 "cred6",
2468 "cred7",
2469 "cred8"},
2471 R"({
2472 "method" : "deposit_authorized",
2473 "params" : [
2474 {
2475 "api_version" : %API_VER%,
2476 "destination_account" : "destination_account_NotValidated",
2477 "ledger_index" : 4294967295,
2478 "source_account" : "source_account_NotValidated",
2479 "credentials": ["cred1", "cred2", "cred3", "cred4", "cred5", "cred6", "cred7", "cred8"]
2480 }
2481 ]
2482 })"},
2483 {"deposit_authorized: with ledger hash.",
2484 __LINE__,
2485 {"deposit_authorized",
2486 "source_account_NotValidated",
2487 "destination_account_NotValidated",
2488 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
2490 R"({
2491 "method" : "deposit_authorized",
2492 "params" : [
2493 {
2494 "api_version" : %API_VER%,
2495 "destination_account" : "destination_account_NotValidated",
2496 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
2497 "source_account" : "source_account_NotValidated"
2498 }
2499 ]
2500 })"},
2501 {"deposit_authorized: too few arguments.",
2502 __LINE__,
2503 {
2504 "deposit_authorized",
2505 "source_account_NotValidated",
2506 },
2508 R"({
2509 "method" : "deposit_authorized",
2510 "params" : [
2511 {
2512 "error" : "badSyntax",
2513 "error_code" : 1,
2514 "error_message" : "Syntax error."
2515 }
2516 ]
2517 })"},
2518 {"deposit_authorized: too many arguments.",
2519 __LINE__,
2520 {"deposit_authorized",
2521 "source_account_NotValidated",
2522 "destination_account_NotValidated",
2523 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
2524 "cred1",
2525 "cred2",
2526 "cred3",
2527 "cred4",
2528 "cred5",
2529 "cred6",
2530 "cred7",
2531 "cred8",
2532 "too_much"},
2534 R"({
2535 "method" : "deposit_authorized",
2536 "params" : [
2537 {
2538 "error" : "badSyntax",
2539 "error_code" : 1,
2540 "error_message" : "Syntax error."
2541 }
2542 ]
2543 })"},
2544 {"deposit_authorized: invalid ledger selection.",
2545 __LINE__,
2546 {
2547 "deposit_authorized",
2548 "source_account_NotValidated",
2549 "destination_account_NotValidated",
2550 "NotALedger",
2551 },
2553 R"({
2554 "method" : "deposit_authorized",
2555 "params" : [
2556 {
2557 "api_version" : %API_VER%,
2558 "destination_account" : "destination_account_NotValidated",
2559 "ledger_index" : 0,
2560 "source_account" : "source_account_NotValidated"
2561 }
2562 ]
2563 })"},
2564
2565 // feature
2566 // ---------------------------------------------------------------------
2567 {"feature: minimal.",
2568 __LINE__,
2569 {
2570 "feature",
2571 },
2573 R"({
2574 "method" : "feature",
2575 "params" : [
2576 {
2577 "api_version" : %API_VER%,
2578 }
2579 ]
2580 })"},
2581 {"feature: with name.",
2582 __LINE__,
2583 {"feature", "featureNameOrHexIsNotValidated"},
2585 R"({
2586 "method" : "feature",
2587 "params" : [
2588 {
2589 "api_version" : %API_VER%,
2590 "feature" : "featureNameOrHexIsNotValidated"
2591 }
2592 ]
2593 })"},
2594 {"feature: accept.",
2595 __LINE__,
2596 {"feature",
2597 "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA98"
2598 "76543210",
2599 "accept"},
2601 R"({
2602 "method" : "feature",
2603 "params" : [
2604 {
2605 "api_version" : %API_VER%,
2606 "feature" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
2607 "vetoed" : false
2608 }
2609 ]
2610 })"},
2611 {"feature: reject.",
2612 __LINE__,
2613 {"feature", "0", "reject"},
2615 R"({
2616 "method" : "feature",
2617 "params" : [
2618 {
2619 "api_version" : %API_VER%,
2620 "feature" : "0",
2621 "vetoed" : true
2622 }
2623 ]
2624 })"},
2625 {"feature: too many arguments.",
2626 __LINE__,
2627 {"feature", "featureNameOrHexIsNotValidated", "accept", "anotherArg"},
2629 R"({
2630 "method" : "feature",
2631 "params" : [
2632 {
2633 "error" : "badSyntax",
2634 "error_code" : 1,
2635 "error_message" : "Syntax error."
2636 }
2637 ]
2638 })"},
2639 {"feature: neither accept nor reject.",
2640 __LINE__,
2641 {
2642 "feature",
2643 "featureNameOrHexIsNotValidated",
2644 "veto",
2645 },
2647 R"({
2648 "method" : "feature",
2649 "params" : [
2650 {
2651 "error" : "invalidParams",
2652 "error_code" : 31,
2653 "error_message" : "Invalid parameters."
2654 }
2655 ]
2656 })"},
2657
2658 // fetch_info
2659 // ------------------------------------------------------------------
2660 {"fetch_info: minimal.",
2661 __LINE__,
2662 {
2663 "fetch_info",
2664 },
2666 R"({
2667 "method" : "fetch_info",
2668 "params" : [
2669 {
2670 "api_version" : %API_VER%,
2671 }
2672 ]
2673 })"},
2674 {"fetch_info: clear.",
2675 __LINE__,
2676 {"fetch_info", "clear"},
2678 R"({
2679 "method" : "fetch_info",
2680 "params" : [
2681 {
2682 "api_version" : %API_VER%,
2683 "clear" : true
2684 }
2685 ]
2686 })"},
2687 {"fetch_info: too many arguments.",
2688 __LINE__,
2689 {"fetch_info", "clear", "other"},
2691 R"({
2692 "method" : "fetch_info",
2693 "params" : [
2694 {
2695 "error" : "badSyntax",
2696 "error_code" : 1,
2697 "error_message" : "Syntax error."
2698 }
2699 ]
2700 })"},
2701 {"fetch_info: other trailing argument.",
2702 __LINE__,
2703 {"fetch_info", "too"},
2705 R"({
2706 "method" : "fetch_info",
2707 "params" : [
2708 {
2709 "api_version" : %API_VER%,
2710 "too" : true
2711 }
2712 ]
2713 })"},
2714
2715 // gateway_balances
2716 // ------------------------------------------------------------
2717 {"gateway_balances: minimal.",
2718 __LINE__,
2719 {"gateway_balances", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2721 R"({
2722 "method" : "gateway_balances",
2723 "params" : [
2724 {
2725 "api_version" : %API_VER%,
2726 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2727 }
2728 ]
2729 })"},
2730 {"gateway_balances: with ledger index.",
2731 __LINE__,
2732 {"gateway_balances", "890765", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2734 R"({
2735 "method" : "gateway_balances",
2736 "params" : [
2737 {
2738 "api_version" : %API_VER%,
2739 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2740 "ledger_index" : "890765"
2741 }
2742 ]
2743 })"},
2744 {"gateway_balances: with text ledger index.",
2745 __LINE__,
2746 {"gateway_balances", "current", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2748 R"({
2749 "method" : "gateway_balances",
2750 "params" : [
2751 {
2752 "api_version" : %API_VER%,
2753 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2754 "ledger_index" : "current"
2755 }
2756 ]
2757 })"},
2758 {"gateway_balances: with 64 character ledger hash.",
2759 __LINE__,
2760 {"gateway_balances",
2761 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2762 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2764 R"({
2765 "method" : "gateway_balances",
2766 "params" : [
2767 {
2768 "api_version" : %API_VER%,
2769 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2770 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
2771 }
2772 ]
2773 })"},
2774 {"gateway_balances: 1 hotwallet.",
2775 __LINE__,
2776 {"gateway_balances",
2777 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2778 "hotwallet_is_not_validated"},
2780 R"({
2781 "method" : "gateway_balances",
2782 "params" : [
2783 {
2784 "api_version" : %API_VER%,
2785 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2786 "hotwallet" : [ "hotwallet_is_not_validated" ]
2787 }
2788 ]
2789 })"},
2790 {"gateway_balances: 3 hotwallets.",
2791 __LINE__,
2792 {
2793 "gateway_balances",
2794 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2795 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2796 "hotwallet_is_not_validated_1",
2797 "hotwallet_is_not_validated_2",
2798 "hotwallet_is_not_validated_3",
2799 },
2801 R"({
2802 "method" : "gateway_balances",
2803 "params" : [
2804 {
2805 "api_version" : %API_VER%,
2806 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2807 "hotwallet" : [
2808 "hotwallet_is_not_validated_1",
2809 "hotwallet_is_not_validated_2",
2810 "hotwallet_is_not_validated_3"
2811 ],
2812 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
2813 }
2814 ]
2815 })"},
2816 {"gateway_balances: too few arguments.",
2817 __LINE__,
2818 {
2819 "gateway_balances",
2820 },
2822 R"({
2823 "method" : "gateway_balances",
2824 "params" : [
2825 {
2826 "error" : "badSyntax",
2827 "error_code" : 1,
2828 "error_message" : "Syntax error."
2829 }
2830 ]
2831 })"},
2832 {"gateway_balances: empty first argument.",
2833 __LINE__,
2834 {"gateway_balances", ""},
2836 R"({
2837 "method" : "gateway_balances",
2838 "params" : [
2839 {
2840 "error" : "invalidParams",
2841 "error_code" : 31,
2842 "error_message" : "Invalid first parameter"
2843 }
2844 ]
2845 })"},
2846 {"gateway_balances: with ledger index but no gateway.",
2847 __LINE__,
2848 {
2849 "gateway_balances",
2850 "890765",
2851 },
2853 R"({
2854 "method" : "gateway_balances",
2855 "params" : [
2856 {
2857 "error" : "invalidParams",
2858 "error_code" : 31,
2859 "error_message" : "Invalid hotwallet"
2860 }
2861 ]
2862 })"},
2863 {"gateway_balances: with text ledger index but no gateway.",
2864 __LINE__,
2865 {
2866 "gateway_balances",
2867 "current",
2868 },
2870 R"({
2871 "method" : "gateway_balances",
2872 "params" : [
2873 {
2874 "error" : "invalidParams",
2875 "error_code" : 31,
2876 "error_message" : "Invalid hotwallet"
2877 }
2878 ]
2879 })"},
2880 {"gateway_balances: with 64 character ledger hash but no gateway.",
2881 __LINE__,
2882 {
2883 "gateway_balances",
2884 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2885 },
2887 R"({
2888 "method" : "gateway_balances",
2889 "params" : [
2890 {
2891 "error" : "invalidParams",
2892 "error_code" : 31,
2893 "error_message" : "Invalid hotwallet"
2894 }
2895 ]
2896 })"},
2897
2898 // get_counts
2899 // ------------------------------------------------------------------
2900 {"get_counts: minimal.",
2901 __LINE__,
2902 {
2903 "get_counts",
2904 },
2906 R"({
2907 "method" : "get_counts",
2908 "params" : [
2909 {
2910 "api_version" : %API_VER%,
2911 }
2912 ]
2913 })"},
2914 {"get_counts: with maximum count.",
2915 __LINE__,
2916 {"get_counts", "100"},
2918 R"({
2919 "method" : "get_counts",
2920 "params" : [
2921 {
2922 "api_version" : %API_VER%,
2923 "min_count" : 100
2924 }
2925 ]
2926 })"},
2927 {"get_counts: too many arguments.",
2928 __LINE__,
2929 {"get_counts", "100", "whatever"},
2931 R"({
2932 "method" : "get_counts",
2933 "params" : [
2934 {
2935 "error" : "badSyntax",
2936 "error_code" : 1,
2937 "error_message" : "Syntax error."
2938 }
2939 ]
2940 })"},
2941 {"get_counts: count too small.",
2942 __LINE__,
2943 {
2944 "get_counts",
2945 "-1",
2946 },
2948 R"()"},
2949 {"get_counts: count too large.",
2950 __LINE__,
2951 {"get_counts", "4294967296"},
2953 R"()"},
2954
2955 // json
2956 // ------------------------------------------------------------------------
2957 {"json: minimal.",
2958 __LINE__,
2959 {
2960 "json",
2961 "command",
2962 R"({"json_argument":true})",
2963 },
2965 R"({
2966 "method" : "command",
2967 "params" : [
2968 {
2969 "api_version" : %API_VER%,
2970 "json_argument" : true,
2971 "method" : "command"
2972 }
2973 ]
2974 })"},
2975 {"json: null object.",
2976 __LINE__,
2977 {
2978 "json",
2979 "command",
2980 R"({})",
2981 },
2983 R"({
2984 "method" : "command",
2985 "params" : [
2986 {
2987 "api_version" : %API_VER%,
2988 "method" : "command"
2989 }
2990 ]
2991 })"},
2992 {"json: too few arguments.",
2993 __LINE__,
2994 {"json", "command"},
2996 R"({
2997 "method" : "json",
2998 "params" : [
2999 {
3000 "error" : "badSyntax",
3001 "error_code" : 1,
3002 "error_message" : "Syntax error."
3003 }
3004 ]
3005 })"},
3006 {"json: too many arguments.",
3007 __LINE__,
3008 {"json", "command", R"({"json_argument":true})", "extra"},
3010 R"({
3011 "method" : "json",
3012 "params" : [
3013 {
3014 "error" : "badSyntax",
3015 "error_code" : 1,
3016 "error_message" : "Syntax error."
3017 }
3018 ]
3019 })"},
3020 {"json: array, not object.",
3021 __LINE__,
3022 {
3023 "json",
3024 "command",
3025 R"(["arg1","arg2"])",
3026 },
3028 R"({
3029 "method" : "json",
3030 "params" : [
3031 {
3032 "error" : "invalidParams",
3033 "error_code" : 31,
3034 "error_message" : "Invalid parameters."
3035 }
3036 ]
3037 })"},
3038 {"json: invalid json (note closing comma).",
3039 __LINE__,
3040 {
3041 "json",
3042 "command",
3043 R"({"json_argument":true,})",
3044 },
3046 R"({
3047 "method" : "json",
3048 "params" : [
3049 {
3050 "error" : "invalidParams",
3051 "error_code" : 31,
3052 "error_message" : "Invalid parameters."
3053 }
3054 ]
3055 })"},
3056
3057 // json2
3058 // -----------------------------------------------------------------------
3059 {"json2: minimal object.",
3060 __LINE__,
3061 {
3062 "json2",
3063 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"})",
3064 },
3066 R"({
3067 "id" : "A1",
3068 "jsonrpc" : "2.0",
3069 "method" : "call_1",
3070 "params" : [
3071 {
3072 "api_version" : %API_VER%,
3073 "id" : "A1",
3074 "jsonrpc" : "2.0",
3075 "method" : "call_1",
3076 "ripplerpc" : "2.0"
3077 }
3078 ],
3079 "ripplerpc" : "2.0"
3080 })"},
3081 {"json2: object with nested params.",
3082 __LINE__,
3083 {
3084 "json2",
3085 R"({
3086 "jsonrpc" : "2.0",
3087 "ripplerpc" : "2.0",
3088 "id" : "A1",
3089 "method" : "call_1",
3090 "params" : [{"inner_arg" : "yup"}]
3091 })",
3092 },
3094 R"({
3095 "id" : "A1",
3096 "jsonrpc" : "2.0",
3097 "method" : "call_1",
3098 "params" : [
3099 {
3100 "api_version" : %API_VER%,
3101 "0" : {
3102 "inner_arg" : "yup"
3103 },
3104 "id" : "A1",
3105 "jsonrpc" : "2.0",
3106 "method" : "call_1",
3107 "ripplerpc" : "2.0"
3108 }
3109 ],
3110 "ripplerpc" : "2.0"
3111 })"},
3112 {"json2: minimal array.",
3113 __LINE__,
3114 {
3115 "json2",
3116 R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"}])",
3117 },
3119 R"({
3120 "method" : "json2",
3121 "params" : [
3122 [
3123 {
3124 "api_version" : %API_VER%,
3125 "id" : "A1",
3126 "jsonrpc" : "2.0",
3127 "method" : "call_1",
3128 "ripplerpc" : "2.0"
3129 }
3130 ]
3131 ]
3132 })"},
3133 {"json2: array with object with nested params.",
3134 __LINE__,
3135 {
3136 "json2",
3137 R"([
3138 {"jsonrpc":"2.0",
3139 "ripplerpc":"2.0",
3140 "id":"A1",
3141 "method":"call_1",
3142 "params" : [{"inner_arg" : "yup"}]}
3143 ])",
3144 },
3146 R"({
3147 "method" : "json2",
3148 "params" : [
3149 [
3150 {
3151 "api_version" : %API_VER%,
3152 "0" : {
3153 "inner_arg" : "yup"
3154 },
3155 "id" : "A1",
3156 "jsonrpc" : "2.0",
3157 "method" : "call_1",
3158 "ripplerpc" : "2.0"
3159 }
3160 ]
3161 ]})"},
3162 {"json2: too few arguments.",
3163 __LINE__,
3164 {
3165 "json2",
3166 },
3168 R"({
3169 "method" : "json2",
3170 "params" : [
3171 {
3172 "error" : "badSyntax",
3173 "error_code" : 1,
3174 "error_message" : "Syntax error."
3175 }
3176 ]
3177 })"},
3178 {"json2: too many arguments.",
3179 __LINE__,
3180 {"json2",
3181 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_this"})",
3182 "extra"},
3184 R"({
3185 "method" : "json2",
3186 "params" : [
3187 {
3188 "error" : "badSyntax",
3189 "error_code" : 1,
3190 "error_message" : "Syntax error."
3191 }
3192 ]
3193 })"},
3194 {"json2: malformed json (note extra comma).",
3195 __LINE__,
3196 {
3197 "json2",
3198 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",})",
3199 },
3201 R"({
3202 "id" : "A1",
3203 "jsonrpc" : "2.0",
3204 "method" : "json2",
3205 "params" : [
3206 {
3207 "error" : "invalidParams",
3208 "error_code" : 31,
3209 "error_message" : "Invalid parameters.",
3210 "id" : "A1",
3211 "jsonrpc" : "2.0",
3212 "ripplerpc" : "2.0"
3213 }
3214 ],
3215 "ripplerpc" : "2.0"
3216 })"},
3217 {"json2: omit jsonrpc.",
3218 __LINE__,
3219 {
3220 "json2",
3221 R"({"ripplerpc":"2.0","id":"A1","method":"call_1"})",
3222 },
3224 R"({
3225 "id" : "A1",
3226 "method" : "json2",
3227 "params" : [
3228 {
3229 "error" : "invalidParams",
3230 "error_code" : 31,
3231 "error_message" : "Invalid parameters.",
3232 "id" : "A1",
3233 "ripplerpc" : "2.0"
3234 }
3235 ],
3236 "ripplerpc" : "2.0"
3237 })"},
3238 {"json2: wrong jsonrpc version.",
3239 __LINE__,
3240 {
3241 "json2",
3242 R"({"jsonrpc":"2.1","ripplerpc":"2.0","id":"A1","method":"call_1"})",
3243 },
3245 R"({
3246 "id" : "A1",
3247 "jsonrpc" : "2.1",
3248 "method" : "json2",
3249 "params" : [
3250 {
3251 "error" : "invalidParams",
3252 "error_code" : 31,
3253 "error_message" : "Invalid parameters.",
3254 "id" : "A1",
3255 "jsonrpc" : "2.1",
3256 "ripplerpc" : "2.0"
3257 }
3258 ],
3259 "ripplerpc" : "2.0"
3260 })"},
3261 {"json2: omit ripplerpc.",
3262 __LINE__,
3263 {
3264 "json2",
3265 R"({"jsonrpc":"2.0","id":"A1","method":"call_1"})",
3266 },
3268 R"({
3269 "id" : "A1",
3270 "jsonrpc" : "2.0",
3271 "method" : "json2",
3272 "params" : [
3273 {
3274 "error" : "invalidParams",
3275 "error_code" : 31,
3276 "error_message" : "Invalid parameters.",
3277 "id" : "A1",
3278 "jsonrpc" : "2.0"
3279 }
3280 ]
3281 })"},
3282 {"json2: wrong ripplerpc version.",
3283 __LINE__,
3284 {
3285 "json2",
3286 R"({"jsonrpc":"2.0","ripplerpc":"2.00","id":"A1","method":"call_1"})",
3287 },
3289 R"({
3290 "id" : "A1",
3291 "jsonrpc" : "2.0",
3292 "method" : "json2",
3293 "params" : [
3294 {
3295 "error" : "invalidParams",
3296 "error_code" : 31,
3297 "error_message" : "Invalid parameters.",
3298 "id" : "A1",
3299 "jsonrpc" : "2.0",
3300 "ripplerpc" : "2.00"
3301 }
3302 ],
3303 "ripplerpc" : "2.00"
3304 })"},
3305 {"json2: omit id.",
3306 __LINE__,
3307 {
3308 "json2",
3309 R"({"jsonrpc":"2.0","ripplerpc":"2.0","method":"call_1"})",
3310 },
3312 R"({
3313 "jsonrpc" : "2.0",
3314 "method" : "json2",
3315 "params" : [
3316 {
3317 "error" : "invalidParams",
3318 "error_code" : 31,
3319 "error_message" : "Invalid parameters.",
3320 "jsonrpc" : "2.0",
3321 "ripplerpc" : "2.0"
3322 }
3323 ],
3324 "ripplerpc" : "2.0"
3325 })"},
3326 {"json2: omit method.",
3327 __LINE__,
3328 {
3329 "json2",
3330 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1"})",
3331 },
3333 R"({
3334 "id" : "A1",
3335 "jsonrpc" : "2.0",
3336 "method" : "json2",
3337 "params" : [
3338 {
3339 "error" : "invalidParams",
3340 "error_code" : 31,
3341 "error_message" : "Invalid parameters.",
3342 "id" : "A1",
3343 "jsonrpc" : "2.0",
3344 "ripplerpc" : "2.0"
3345 }
3346 ],
3347 "ripplerpc" : "2.0"
3348 })"},
3349 {"json2: empty outer array.",
3350 __LINE__,
3351 {
3352 "json2",
3353 R"([])",
3354 },
3356 R"({
3357 "method" : "json2",
3358 "params" : [
3359 {
3360 "error" : "invalidParams",
3361 "error_code" : 31,
3362 "error_message" : "Invalid parameters."
3363 }
3364 ]
3365 })"},
3366 {"json2: empty inner array.",
3367 __LINE__,
3368 {
3369 "json2",
3370 R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",[]}])",
3371 },
3373 R"({
3374 "method" : "json2",
3375 "params" : [
3376 {
3377 "error" : "invalidParams",
3378 "error_code" : 31,
3379 "error_message" : "Invalid parameters."
3380 }
3381 ]
3382 })"},
3383 {"json2: array with non-json2 object.",
3384 __LINE__,
3385 {
3386 "json2",
3387 R"([
3388 {"jsonrpc" : "2.1",
3389 "ripplerpc" : "2.0",
3390 "id" : "A1",
3391 "method" : "call_1"
3392 }
3393 ])",
3394 },
3396 R"({
3397 "method" : "json2",
3398 "params" : [
3399 {
3400 "error" : "invalidParams",
3401 "error_code" : 31,
3402 "error_message" : "Invalid parameters."
3403 }
3404 ]
3405 })"},
3406 {"json2: non-object or -array inner params member.",
3407 __LINE__,
3408 {
3409 "json2",
3410 R"({
3411 "jsonrpc" : "2.0",
3412 "ripplerpc" : "2.0",
3413 "id" : "A1",
3414 "method" : "call_1",
3415 "params" : true
3416 })",
3417 },
3419 R"({
3420 "id" : "A1",
3421 "jsonrpc" : "2.0",
3422 "method" : "json2",
3423 "params" : [
3424 {
3425 "error" : "invalidParams",
3426 "error_code" : 31,
3427 "error_message" : "Invalid parameters.",
3428 "id" : "A1",
3429 "jsonrpc" : "2.0",
3430 "ripplerpc" : "2.0"
3431 }
3432 ],
3433 "ripplerpc" : "2.0"
3434 })"},
3435
3436 // ledger
3437 // ----------------------------------------------------------------------
3438 {"ledger: minimal.",
3439 __LINE__,
3440 {"ledger"},
3442 R"({
3443 "method" : "ledger",
3444 "params" : [
3445 {
3446 "api_version" : %API_VER%,
3447 }
3448 ]
3449 })"},
3450 {"ledger: ledger index.",
3451 __LINE__,
3452 {"ledger", "4294967295"},
3454 R"({
3455 "method" : "ledger",
3456 "params" : [
3457 {
3458 "api_version" : %API_VER%,
3459 "ledger_index" : 4294967295
3460 }
3461 ]
3462 })"},
3463 {"ledger: text ledger index.",
3464 __LINE__,
3465 {"ledger", "validated"},
3467 R"({
3468 "method" : "ledger",
3469 "params" : [
3470 {
3471 "api_version" : %API_VER%,
3472 "ledger_index" : "validated"
3473 }
3474 ]
3475 })"},
3476 {"ledger: ledger hash.",
3477 __LINE__,
3478 {"ledger",
3479 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3481 R"({
3482 "method" : "ledger",
3483 "params" : [
3484 {
3485 "api_version" : %API_VER%,
3486 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3487 }
3488 ]
3489 })"},
3490 {"ledger: full.",
3491 __LINE__,
3492 {"ledger", "current", "full"},
3494 R"({
3495 "method" : "ledger",
3496 "params" : [
3497 {
3498 "api_version" : %API_VER%,
3499 "full" : true,
3500 "ledger_index" : "current"
3501 }
3502 ]
3503 })"},
3504 {"ledger: tx.",
3505 __LINE__,
3506 {"ledger", "closed", "tx"},
3508 R"({
3509 "method" : "ledger",
3510 "params" : [
3511 {
3512 "api_version" : %API_VER%,
3513 "expand" : true,
3514 "ledger_index" : "closed",
3515 "transactions" : true
3516 }
3517 ]
3518 })"},
3519 {"ledger: too many arguments.",
3520 __LINE__,
3521 {"ledger", "4294967295", "spare"},
3523 R"({
3524 "method" : "ledger",
3525 "params" : [
3526 {
3527 "api_version" : %API_VER%,
3528 "ledger_index" : 4294967295
3529 }
3530 ]
3531 })"},
3532 {"ledger: ledger index too small.",
3533 __LINE__,
3534 {"ledger", "-1"},
3536 R"({
3537 "method" : "ledger",
3538 "params" : [
3539 {
3540 "api_version" : %API_VER%,
3541 "ledger_index" : 0
3542 }
3543 ]
3544 })"},
3545 {"ledger: ledger index too big.",
3546 __LINE__,
3547 {"ledger", "4294967296"},
3549 R"({
3550 "method" : "ledger",
3551 "params" : [
3552 {
3553 "api_version" : %API_VER%,
3554 "ledger_index" : 0
3555 }
3556 ]
3557 })"},
3558 {"ledger: invalid ledger text.",
3559 __LINE__,
3560 {"ledger", "latest"},
3562 R"({
3563 "method" : "ledger",
3564 "params" : [
3565 {
3566 "api_version" : %API_VER%,
3567 "ledger_index" : 0
3568 }
3569 ]
3570 })"},
3571 {"ledger: unsupported final argument.",
3572 __LINE__,
3573 {"ledger", "current", "expand"},
3575 R"({
3576 "method" : "ledger",
3577 "params" : [
3578 {
3579 "api_version" : %API_VER%,
3580 "ledger_index" : "current"
3581 }
3582 ]
3583 })"},
3584
3585 // ledger_closed
3586 // ---------------------------------------------------------------
3587 {"ledger_closed: minimal.",
3588 __LINE__,
3589 {"ledger_closed"},
3591 R"({
3592 "method" : "ledger_closed",
3593 "params" : [
3594 {
3595 "api_version" : %API_VER%,
3596 }
3597 ]
3598 })"},
3599 {"ledger_closed: too many arguments.",
3600 __LINE__,
3601 {"ledger_closed", "today"},
3603 R"({
3604 "method" : "ledger_closed",
3605 "params" : [
3606 {
3607 "error" : "badSyntax",
3608 "error_code" : 1,
3609 "error_message" : "Syntax error."
3610 }
3611 ]
3612 })"},
3613
3614 // ledger_current
3615 // --------------------------------------------------------------
3616 {"ledger_current: minimal.",
3617 __LINE__,
3618 {"ledger_current"},
3620 R"({
3621 "method" : "ledger_current",
3622 "params" : [
3623 {
3624 "api_version" : %API_VER%,
3625 }
3626 ]
3627 })"},
3628 {"ledger_current: too many arguments.",
3629 __LINE__,
3630 {"ledger_current", "today"},
3632 R"({
3633 "method" : "ledger_current",
3634 "params" : [
3635 {
3636 "error" : "badSyntax",
3637 "error_code" : 1,
3638 "error_message" : "Syntax error."
3639 }
3640 ]
3641 })"},
3642
3643 // ledger_header
3644 // ---------------------------------------------------------------
3645 {"ledger_header: ledger index.",
3646 __LINE__,
3647 {"ledger_header", "4294967295"},
3649 R"({
3650 "method" : "ledger_header",
3651 "params" : [
3652 {
3653 "api_version" : %API_VER%,
3654 "ledger_index" : 4294967295
3655 }
3656 ]
3657 })"},
3658 {"ledger_header: ledger hash.",
3659 __LINE__,
3660 {"ledger_header",
3661 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3663 R"({
3664 "method" : "ledger_header",
3665 "params" : [
3666 {
3667 "api_version" : %API_VER%,
3668 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3669 }
3670 ]
3671 })"},
3672 {"ledger_header: too few arguments.",
3673 __LINE__,
3674 {
3675 "ledger_header",
3676 },
3678 R"({
3679 "method" : "ledger_header",
3680 "params" : [
3681 {
3682 "error" : "badSyntax",
3683 "error_code" : 1,
3684 "error_message" : "Syntax error."
3685 }
3686 ]
3687 })"},
3688 {"ledger_header: too many arguments.",
3689 __LINE__,
3690 {"ledger_header", "4294967295", "spare"},
3692 R"({
3693 "method" : "ledger_header",
3694 "params" : [
3695 {
3696 "error" : "badSyntax",
3697 "error_code" : 1,
3698 "error_message" : "Syntax error."
3699 }
3700 ]
3701 })"},
3702 {"ledger_header: text ledger index.",
3703 __LINE__,
3704 {"ledger_header", "current"},
3706 R"({
3707 "method" : "ledger_header",
3708 "params" : [
3709 {
3710 "api_version" : %API_VER%,
3711 "ledger_index" : 0
3712 }
3713 ]
3714 })"},
3715 {"ledger_header: ledger index too small.",
3716 __LINE__,
3717 {"ledger_header", "-1"},
3719 R"({
3720 "method" : "ledger_header",
3721 "params" : [
3722 {
3723 "api_version" : %API_VER%,
3724 "ledger_index" : 0
3725 }
3726 ]
3727 })"},
3728 {"ledger_header: ledger index too big.",
3729 __LINE__,
3730 {"ledger_header", "4294967296"},
3732 R"({
3733 "method" : "ledger_header",
3734 "params" : [
3735 {
3736 "api_version" : %API_VER%,
3737 "ledger_index" : 0
3738 }
3739 ]
3740 })"},
3741
3742 // ledger_request
3743 // --------------------------------------------------------------
3744 {"ledger_request: ledger index.",
3745 __LINE__,
3746 {"ledger_request", "4294967295"},
3748 R"({
3749 "method" : "ledger_request",
3750 "params" : [
3751 {
3752 "api_version" : %API_VER%,
3753 "ledger_index" : 4294967295
3754 }
3755 ]
3756 })"},
3757 {"ledger_request: ledger hash.",
3758 __LINE__,
3759 {"ledger_request",
3760 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3762 R"({
3763 "method" : "ledger_request",
3764 "params" : [
3765 {
3766 "api_version" : %API_VER%,
3767 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3768 }
3769 ]
3770 })"},
3771 {"ledger_request: too few arguments.",
3772 __LINE__,
3773 {
3774 "ledger_request",
3775 },
3777 R"({
3778 "method" : "ledger_request",
3779 "params" : [
3780 {
3781 "error" : "badSyntax",
3782 "error_code" : 1,
3783 "error_message" : "Syntax error."
3784 }
3785 ]
3786 })"},
3787 {"ledger_request: too many arguments.",
3788 __LINE__,
3789 {"ledger_request", "4294967295", "spare"},
3791 R"({
3792 "method" : "ledger_request",
3793 "params" : [
3794 {
3795 "error" : "badSyntax",
3796 "error_code" : 1,
3797 "error_message" : "Syntax error."
3798 }
3799 ]
3800 })"},
3801 {"ledger_request: text ledger index.",
3802 __LINE__,
3803 {"ledger_request", "current"},
3805 R"({
3806 "method" : "ledger_request",
3807 "params" : [
3808 {
3809 "api_version" : %API_VER%,
3810 "ledger_index" : 0
3811 }
3812 ]
3813 })"},
3814 {"ledger_request: ledger index too small.",
3815 __LINE__,
3816 {"ledger_request", "-1"},
3818 R"({
3819 "method" : "ledger_request",
3820 "params" : [
3821 {
3822 "api_version" : %API_VER%,
3823 "ledger_index" : 0
3824 }
3825 ]
3826 })"},
3827 {"ledger_request: ledger index too big.",
3828 __LINE__,
3829 {"ledger_request", "4294967296"},
3831 R"({
3832 "method" : "ledger_request",
3833 "params" : [
3834 {
3835 "api_version" : %API_VER%,
3836 "ledger_index" : 0
3837 }
3838 ]
3839 })"},
3840
3841 // log_level
3842 // -------------------------------------------------------------------
3843 {"log_level: minimal.",
3844 __LINE__,
3845 {
3846 "log_level",
3847 },
3849 R"({
3850 "method" : "log_level",
3851 "params" : [
3852 {
3853 "api_version" : %API_VER%,
3854 }
3855 ]
3856 })"},
3857 {"log_level: fatal.",
3858 __LINE__,
3859 {"log_level", "fatal"},
3861 R"({
3862 "method" : "log_level",
3863 "params" : [
3864 {
3865 "api_version" : %API_VER%,
3866 "severity" : "fatal"
3867 }
3868 ]
3869 })"},
3870 {"log_level: error.",
3871 __LINE__,
3872 {"log_level", "error"},
3874 R"({
3875 "method" : "log_level",
3876 "params" : [
3877 {
3878 "api_version" : %API_VER%,
3879 "severity" : "error"
3880 }
3881 ]
3882 })"},
3883 {"log_level: warn.",
3884 __LINE__,
3885 {"log_level", "warn"},
3887 R"({
3888 "method" : "log_level",
3889 "params" : [
3890 {
3891 "api_version" : %API_VER%,
3892 "severity" : "warn"
3893 }
3894 ]
3895 })"},
3896 {"log_level: debug.",
3897 __LINE__,
3898 {"log_level", "debug"},
3900 R"({
3901 "method" : "log_level",
3902 "params" : [
3903 {
3904 "api_version" : %API_VER%,
3905 "severity" : "debug"
3906 }
3907 ]
3908 })"},
3909 {"log_level: trace.",
3910 __LINE__,
3911 {"log_level", "trace"},
3913 R"({
3914 "method" : "log_level",
3915 "params" : [
3916 {
3917 "api_version" : %API_VER%,
3918 "severity" : "trace"
3919 }
3920 ]
3921 })"},
3922 {"log_level: base partition.",
3923 __LINE__,
3924 {"log_level", "base", "trace"},
3926 R"({
3927 "method" : "log_level",
3928 "params" : [
3929 {
3930 "api_version" : %API_VER%,
3931 "partition" : "base",
3932 "severity" : "trace"
3933 }
3934 ]
3935 })"},
3936 {"log_level: partiton_name.",
3937 __LINE__,
3938 {"log_level", "partition_name", "fatal"},
3940 R"({
3941 "method" : "log_level",
3942 "params" : [
3943 {
3944 "api_version" : %API_VER%,
3945 "partition" : "partition_name",
3946 "severity" : "fatal"
3947 }
3948 ]
3949 })"},
3950 {"log_level: too many arguments.",
3951 __LINE__,
3952 {"log_level", "partition_name", "fatal", "extra"},
3954 R"({
3955 "method" : "log_level",
3956 "params" : [
3957 {
3958 "error" : "badSyntax",
3959 "error_code" : 1,
3960 "error_message" : "Syntax error."
3961 }
3962 ]
3963 })"},
3964 {"log_level: invalid severity.",
3965 __LINE__,
3966 {"log_level", "err"},
3968 R"({
3969 "method" : "log_level",
3970 "params" : [
3971 {
3972 "api_version" : %API_VER%,
3973 "severity" : "err"
3974 }
3975 ]
3976 })"},
3977 {"log_level: swap partition name and severity.",
3978 __LINE__,
3979 {
3980 "log_level",
3981 "fatal",
3982 "partition_name",
3983 },
3985 R"({
3986 "method" : "log_level",
3987 "params" : [
3988 {
3989 "api_version" : %API_VER%,
3990 "partition" : "fatal",
3991 "severity" : "partition_name"
3992 }
3993 ]
3994 })"},
3995
3996 // logrotate
3997 // -------------------------------------------------------------------
3998 {"logrotate: minimal.",
3999 __LINE__,
4000 {
4001 "logrotate",
4002 },
4004 R"({
4005 "method" : "logrotate",
4006 "params" : [
4007 {
4008 "api_version" : %API_VER%,
4009 }
4010 ]
4011 })"},
4012 {"logrotate: too many arguments.",
4013 __LINE__,
4014 {"logrotate", "extra"},
4016 R"({
4017 "method" : "logrotate",
4018 "params" : [
4019 {
4020 "error" : "badSyntax",
4021 "error_code" : 1,
4022 "error_message" : "Syntax error."
4023 }
4024 ]
4025 })"},
4026
4027 // owner_info
4028 // ------------------------------------------------------------------
4029 {"owner_info: minimal.",
4030 __LINE__,
4031 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
4033 R"({
4034 "method" : "owner_info",
4035 "params" : [
4036 {
4037 "api_version" : %API_VER%,
4038 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
4039 }
4040 ]
4041 })"},
4042 {"owner_info: with numeric ledger index.",
4043 __LINE__,
4044 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
4046 R"({
4047 "method" : "owner_info",
4048 "params" : [
4049 {
4050 "api_version" : %API_VER%,
4051 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4052 "ledger_index" : 987654321
4053 }
4054 ]
4055 })"},
4056 {"owner_info: with text ledger index.",
4057 __LINE__,
4058 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
4060 R"({
4061 "method" : "owner_info",
4062 "params" : [
4063 {
4064 "api_version" : %API_VER%,
4065 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4066 "ledger_index" : "validated"
4067 }
4068 ]
4069 })"},
4070 {"owner_info: with ledger hash.",
4071 __LINE__,
4072 {"owner_info",
4073 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4074 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
4076 R"({
4077 "method" : "owner_info",
4078 "params" : [
4079 {
4080 "api_version" : %API_VER%,
4081 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4082 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
4083 }
4084 ]
4085 })"},
4086 {"owner_info: with ledger index.",
4087 __LINE__,
4088 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
4090 R"({
4091 "method" : "owner_info",
4092 "params" : [
4093 {
4094 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4095 "api_version" : %API_VER%,
4096 "ledger_index" : "validated"
4097 }
4098 ]
4099 })"},
4100 {"owner_info: too few arguments.",
4101 __LINE__,
4102 {
4103 "owner_info",
4104 },
4106 R"({
4107 "method" : "owner_info",
4108 "params" : [
4109 {
4110 "error" : "badSyntax",
4111 "error_code" : 1,
4112 "error_message" : "Syntax error."
4113 }
4114 ]
4115 })"},
4116 {"owner_info: too many arguments.",
4117 __LINE__,
4118 {
4119 "owner_info",
4120 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4121 "current",
4122 "extra1",
4123 "extra2",
4124 },
4126 R"({
4127 "method" : "owner_info",
4128 "params" : [
4129 {
4130 "error" : "badSyntax",
4131 "error_code" : 1,
4132 "error_message" : "Syntax error."
4133 }
4134 ]
4135 })"},
4136 {
4137 "owner_info: invalid accountID.",
4138 __LINE__,
4139 {
4140 "owner_info",
4141 "", // Note: very few values are detected as bad!
4142 },
4144 R"({
4145 "method" : "owner_info",
4146 "params" : [
4147 {
4148 "error" : "actMalformed",
4149 "error_code" : 35,
4150 "error_message" : "Account malformed."
4151 }
4152 ]
4153 })",
4154 },
4155 {
4156 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
4157 // cannot currently occur because jvParseLedger() always returns true.
4158 "owner_info: invalid ledger selection.",
4159 __LINE__,
4160 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
4162 R"({
4163 "method" : "owner_info",
4164 "params" : [
4165 {
4166 "api_version" : %API_VER%,
4167 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4168 "ledger_index" : 0
4169 }
4170 ]
4171 })",
4172 },
4173 {
4174 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
4175 // cannot currently occur because jvParseLedger() always returns true.
4176 "owner_info: invalid ledger selection.",
4177 __LINE__,
4178 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
4180 R"({
4181 "method" : "owner_info",
4182 "params" : [
4183 {
4184 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4185 "api_version" : %API_VER%,
4186 "ledger_index" : 0
4187 }
4188 ]
4189 })",
4190 },
4191
4192 // peers
4193 // -----------------------------------------------------------------------
4194 {"peers: minimal.",
4195 __LINE__,
4196 {
4197 "peers",
4198 },
4200 R"({
4201 "method" : "peers",
4202 "params" : [
4203 {
4204 "api_version" : %API_VER%,
4205 }
4206 ]
4207 })"},
4208 {"peers: too many arguments.",
4209 __LINE__,
4210 {"peers", "extra"},
4212 R"({
4213 "method" : "peers",
4214 "params" : [
4215 {
4216 "error" : "badSyntax",
4217 "error_code" : 1,
4218 "error_message" : "Syntax error."
4219 }
4220 ]
4221 })"},
4222
4223 // peer_reservations_add
4224 // -------------------------------------------------------
4225 {"peer_reservations_add: minimal.",
4226 __LINE__,
4227 {"peer_reservations_add", "public_key_string"},
4229 R"({
4230 "method" : "peer_reservations_add",
4231 "params" : [
4232 {
4233 "api_version" : %API_VER%,
4234 "public_key" : "public_key_string"
4235 }
4236 ]
4237 })"},
4238 {"peer_reservations_add: with description.",
4239 __LINE__,
4240 {"peer_reservations_add", "public_key_string", "public_key_description"},
4242 R"({
4243 "method" : "peer_reservations_add",
4244 "params" : [
4245 {
4246 "api_version" : %API_VER%,
4247 "description" : "public_key_description",
4248 "public_key" : "public_key_string"
4249 }
4250 ]
4251 })"},
4252 {"peer_reservations_add: too few arguments.",
4253 __LINE__,
4254 {"peer_reservations_add"},
4256 R"({
4257 "method" : "peer_reservations_add",
4258 "params" : [
4259 {
4260 "error" : "badSyntax",
4261 "error_code" : 1,
4262 "error_message" : "Syntax error."
4263 }
4264 ]
4265 })"},
4266 {"peer_reservations_add: too many arguments.",
4267 __LINE__,
4268 {"peer_reservations_add",
4269 "public_key_string",
4270 "public_key_description",
4271 "spare"},
4273 R"({
4274 "method" : "peer_reservations_add",
4275 "params" : [
4276 {
4277 "error" : "badSyntax",
4278 "error_code" : 1,
4279 "error_message" : "Syntax error."
4280 }
4281 ]
4282 })"},
4283
4284 // peer_reservations_del
4285 // -------------------------------------------------------
4286 {"peer_reservations_del: minimal.",
4287 __LINE__,
4288 {"peer_reservations_del", "public_key_string"},
4290 R"({
4291 "method" : "peer_reservations_del",
4292 "params" : [
4293 {
4294 "api_version" : %API_VER%,
4295 "public_key" : "public_key_string"
4296 }
4297 ]
4298 })"},
4299 {"peer_reservations_del: too few arguments.",
4300 __LINE__,
4301 {"peer_reservations_del"},
4303 R"({
4304 "method" : "peer_reservations_del",
4305 "params" : [
4306 {
4307 "error" : "badSyntax",
4308 "error_code" : 1,
4309 "error_message" : "Syntax error."
4310 }
4311 ]
4312 })"},
4313 {"peer_reservations_del: too many arguments.",
4314 __LINE__,
4315 {"peer_reservations_del",
4316 "public_key_string",
4317 "public_key_description",
4318 "spare"},
4320 R"({
4321 "method" : "peer_reservations_del",
4322 "params" : [
4323 {
4324 "error" : "badSyntax",
4325 "error_code" : 1,
4326 "error_message" : "Syntax error."
4327 }
4328 ]
4329 })"},
4330
4331 // ping
4332 // ------------------------------------------------------------------------
4333 {"ping: minimal.",
4334 __LINE__,
4335 {
4336 "ping",
4337 },
4339 R"({
4340 "method" : "ping",
4341 "params" : [
4342 {
4343 "api_version" : %API_VER%,
4344 }
4345 ]
4346 })"},
4347 {"ping: too many arguments.",
4348 __LINE__,
4349 {"ping", "extra"},
4351 R"({
4352 "method" : "ping",
4353 "params" : [
4354 {
4355 "error" : "badSyntax",
4356 "error_code" : 1,
4357 "error_message" : "Syntax error."
4358 }
4359 ]
4360 })"},
4361
4362 // print
4363 // -----------------------------------------------------------------------
4364 {"print: minimal.",
4365 __LINE__,
4366 {
4367 "print",
4368 },
4370 R"({
4371 "method" : "print",
4372 "params" : [
4373 {
4374 "api_version" : %API_VER%,
4375 }
4376 ]
4377 })"},
4378 {// The docs indicate that no arguments are allowed. So should this error?
4379 "print: extra argument.",
4380 __LINE__,
4381 {"print", "extra"},
4383 R"({
4384 "method" : "print",
4385 "params" : [
4386 {
4387 "api_version" : %API_VER%,
4388 "params" : [ "extra" ]
4389 }
4390 ]
4391 })"},
4392 {"print: too many arguments.",
4393 __LINE__,
4394 {"print", "extra1", "extra2"},
4396 R"({
4397 "method" : "print",
4398 "params" : [
4399 {
4400 "error" : "badSyntax",
4401 "error_code" : 1,
4402 "error_message" : "Syntax error."
4403 }
4404 ]
4405 })"},
4406
4407 // random
4408 // ----------------------------------------------------------------------
4409 {"random: minimal.",
4410 __LINE__,
4411 {
4412 "random",
4413 },
4415 R"({
4416 "method" : "random",
4417 "params" : [
4418 {
4419 "api_version" : %API_VER%,
4420 }
4421 ]
4422 })"},
4423 {"random: too many arguments.",
4424 __LINE__,
4425 {"random", "extra"},
4427 R"({
4428 "method" : "random",
4429 "params" : [
4430 {
4431 "error" : "badSyntax",
4432 "error_code" : 1,
4433 "error_message" : "Syntax error."
4434 }
4435 ]
4436 })"},
4437
4438 // ripple_path_find
4439 // ------------------------------------------------------------
4440 {"ripple_path_find: minimal.",
4441 __LINE__,
4442 {
4443 "ripple_path_find",
4444 R"({"json_argument":true})",
4445 },
4447 R"({
4448 "method" : "ripple_path_find",
4449 "params" : [
4450 {
4451 "api_version" : %API_VER%,
4452 "json_argument" : true
4453 }
4454 ]
4455 })"},
4456 {"ripple_path_find: ledger index.",
4457 __LINE__,
4458 {"ripple_path_find", R"({"json_argument":true})", "4294967295"},
4460 R"({
4461 "method" : "ripple_path_find",
4462 "params" : [
4463 {
4464 "api_version" : %API_VER%,
4465 "json_argument" : true,
4466 "ledger_index" : 4294967295
4467 }
4468 ]
4469 })"},
4470 {"ripple_path_find: text ledger index.",
4471 __LINE__,
4472 {"ripple_path_find", R"({"json_argument":true})", "closed"},
4474 R"({
4475 "method" : "ripple_path_find",
4476 "params" : [
4477 {
4478 "api_version" : %API_VER%,
4479 "json_argument" : true,
4480 "ledger_index" : "closed"
4481 }
4482 ]
4483 })"},
4484 {"ripple_path_find: ledger hash.",
4485 __LINE__,
4486 {"ripple_path_find",
4487 R"({"json_argument":true})",
4488 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"},
4490 R"({
4491 "method" : "ripple_path_find",
4492 "params" : [
4493 {
4494 "api_version" : %API_VER%,
4495 "json_argument" : true,
4496 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
4497 }
4498 ]
4499 })"},
4500
4501 {"ripple_path_find: too few arguments.",
4502 __LINE__,
4503 {
4504 "ripple_path_find",
4505 },
4507 R"({
4508 "method" : "ripple_path_find",
4509 "params" : [
4510 {
4511 "error" : "badSyntax",
4512 "error_code" : 1,
4513 "error_message" : "Syntax error."
4514 }
4515 ]
4516 })"},
4517 {"ripple_path_find: too many arguments.",
4518 __LINE__,
4519 {"ripple_path_find", R"({"json_argument":true})", "current", "extra"},
4521 R"({
4522 "method" : "ripple_path_find",
4523 "params" : [
4524 {
4525 "error" : "badSyntax",
4526 "error_code" : 1,
4527 "error_message" : "Syntax error."
4528 }
4529 ]
4530 })"},
4531 {"ripple_path_find: invalid json (note extra comma).",
4532 __LINE__,
4533 {
4534 "ripple_path_find",
4535 R"({"json_argument":true,})",
4536 },
4538 R"({
4539 "method" : "ripple_path_find",
4540 "params" : [
4541 {
4542 "error" : "invalidParams",
4543 "error_code" : 31,
4544 "error_message" : "Invalid parameters."
4545 }
4546 ]
4547 })"},
4548 {"ripple_path_find: ledger index too small.",
4549 __LINE__,
4550 {"ripple_path_find", R"({"json_argument":true})", "-1"},
4552 R"({
4553 "method" : "ripple_path_find",
4554 "params" : [
4555 {
4556 "api_version" : %API_VER%,
4557 "json_argument" : true,
4558 "ledger_index" : 0
4559 }
4560 ]
4561 })"},
4562 {"ripple_path_find: ledger index too big.",
4563 __LINE__,
4564 {"ripple_path_find", R"({"json_argument":true})", "4294967296"},
4566 R"({
4567 "method" : "ripple_path_find",
4568 "params" : [
4569 {
4570 "api_version" : %API_VER%,
4571 "json_argument" : true,
4572 "ledger_index" : 0
4573 }
4574 ]
4575 })"},
4576 {"ripple_path_find: invalid text ledger index.",
4577 __LINE__,
4578 {"ripple_path_find", R"({"json_argument":true})", "cur"},
4580 R"({
4581 "method" : "ripple_path_find",
4582 "params" : [
4583 {
4584 "api_version" : %API_VER%,
4585 "json_argument" : true,
4586 "ledger_index" : 0
4587 }
4588 ]
4589 })"},
4590
4591 // sign
4592 // ------------------------------------------------------------------------
4593 {"sign: minimal.",
4594 __LINE__,
4595 {
4596 "sign",
4597 "my_secret",
4598 R"({"json_argument":true})",
4599 },
4601 R"({
4602 "method" : "sign",
4603 "params" : [
4604 {
4605 "api_version" : %API_VER%,
4606 "secret" : "my_secret",
4607 "tx_json" : {
4608 "json_argument" : true
4609 }
4610 }
4611 ]
4612 })"},
4613 {"sign: offline.",
4614 __LINE__,
4615 {"sign", "my_secret", R"({"json_argument":true})", "offline"},
4617 R"({
4618 "method" : "sign",
4619 "params" : [
4620 {
4621 "api_version" : %API_VER%,
4622 "offline" : true,
4623 "secret" : "my_secret",
4624 "tx_json" : {
4625 "json_argument" : true
4626 }
4627 }
4628 ]
4629 })"},
4630 {"sign: too few arguments.",
4631 __LINE__,
4632 {"sign", "contents_of_blob"},
4634 R"({
4635 "method" : "sign",
4636 "params" : [
4637 {
4638 "error" : "badSyntax",
4639 "error_code" : 1,
4640 "error_message" : "Syntax error."
4641 }
4642 ]
4643 })"},
4644 {"sign: too many arguments.",
4645 __LINE__,
4646 {"sign", "my_secret", R"({"json_argument":true})", "offline", "extra"},
4648 R"({
4649 "method" : "sign",
4650 "params" : [
4651 {
4652 "error" : "badSyntax",
4653 "error_code" : 1,
4654 "error_message" : "Syntax error."
4655 }
4656 ]
4657 })"},
4658 {"sign: invalid JSON (note extra comma).",
4659 __LINE__,
4660 {
4661 "sign",
4662 "my_secret",
4663 R"({"json_argument":true,})",
4664 },
4666 R"({
4667 "method" : "sign",
4668 "params" : [
4669 {
4670 "error" : "invalidParams",
4671 "error_code" : 31,
4672 "error_message" : "Invalid parameters."
4673 }
4674 ]
4675 })"},
4676 {"sign: invalid final argument.",
4677 __LINE__,
4678 {"sign", "my_secret", R"({"json_argument":true})", "offlin"},
4680 R"({
4681 "method" : "sign",
4682 "params" : [
4683 {
4684 "error" : "invalidParams",
4685 "error_code" : 31,
4686 "error_message" : "Invalid parameters."
4687 }
4688 ]
4689 })"},
4690
4691 // sign_for
4692 // --------------------------------------------------------------------
4693 {"sign_for: minimal.",
4694 __LINE__,
4695 {
4696 "sign_for",
4697 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4698 "my_secret",
4699 R"({"json_argument":true})",
4700 },
4702 R"({
4703 "method" : "sign_for",
4704 "params" : [
4705 {
4706 "api_version" : %API_VER%,
4707 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4708 "secret" : "my_secret",
4709 "tx_json" : {
4710 "json_argument" : true
4711 }
4712 }
4713 ]
4714 })"},
4715 {"sign_for: offline.",
4716 __LINE__,
4717 {"sign_for",
4718 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4719 "my_secret",
4720 R"({"json_argument":true})",
4721 "offline"},
4723 R"({
4724 "method" : "sign_for",
4725 "params" : [
4726 {
4727 "api_version" : %API_VER%,
4728 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4729 "offline" : true,
4730 "secret" : "my_secret",
4731 "tx_json" : {
4732 "json_argument" : true
4733 }
4734 }
4735 ]
4736 })"},
4737 {"sign_for: too few arguments.",
4738 __LINE__,
4739 {
4740 "sign_for",
4741 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4742 "my_secret",
4743 },
4745 R"({
4746 "method" : "sign_for",
4747 "params" : [
4748 {
4749 "error" : "badSyntax",
4750 "error_code" : 1,
4751 "error_message" : "Syntax error."
4752 }
4753 ]
4754 })"},
4755 {"sign_for: too many arguments.",
4756 __LINE__,
4757 {"sign_for",
4758 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4759 "my_secret",
4760 R"({"json_argument":true})",
4761 "offline",
4762 "extra"},
4764 R"({
4765 "method" : "sign_for",
4766 "params" : [
4767 {
4768 "error" : "badSyntax",
4769 "error_code" : 1,
4770 "error_message" : "Syntax error."
4771 }
4772 ]
4773 })"},
4774 {"sign_for: invalid json (note extra comma).",
4775 __LINE__,
4776 {
4777 "sign_for",
4778 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4779 "my_secret",
4780 R"({"json_argument":true,})",
4781 },
4783 R"({
4784 "method" : "sign_for",
4785 "params" : [
4786 {
4787 "error" : "invalidParams",
4788 "error_code" : 31,
4789 "error_message" : "Invalid parameters."
4790 }
4791 ]
4792 })"},
4793 {"sign_for: invalid final argument.",
4794 __LINE__,
4795 {"sign_for",
4796 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4797 "my_secret",
4798 R"({"json_argument":true})",
4799 "ofline"},
4801 R"({
4802 "method" : "sign_for",
4803 "params" : [
4804 {
4805 "error" : "invalidParams",
4806 "error_code" : 31,
4807 "error_message" : "Invalid parameters."
4808 }
4809 ]
4810 })"},
4811
4812 // submit
4813 // ----------------------------------------------------------------------
4814 {"submit: blob.",
4815 __LINE__,
4816 {"submit", "the blob is unvalidated and may be any length..."},
4818 R"({
4819 "method" : "submit",
4820 "params" : [
4821 {
4822 "api_version" : %API_VER%,
4823 "tx_blob" : "the blob is unvalidated and may be any length..."
4824 }
4825 ]
4826 })"},
4827 {"submit: json.",
4828 __LINE__,
4829 {
4830 "submit",
4831 "my_secret",
4832 R"({"json_argument":true})",
4833 },
4835 R"({
4836 "method" : "submit",
4837 "params" : [
4838 {
4839 "api_version" : %API_VER%,
4840 "secret" : "my_secret",
4841 "tx_json" : {
4842 "json_argument" : true
4843 }
4844 }
4845 ]
4846 })"},
4847 {"submit: too few arguments.",
4848 __LINE__,
4849 {
4850 "submit",
4851 },
4853 R"({
4854 "method" : "submit",
4855 "params" : [
4856 {
4857 "error" : "badSyntax",
4858 "error_code" : 1,
4859 "error_message" : "Syntax error."
4860 }
4861 ]
4862 })"},
4863 {// Note: I believe this _ought_ to be detected as too many arguments.
4864 "submit: four arguments.",
4865 __LINE__,
4866 {"submit", "my_secret", R"({"json_argument":true})", "offline"},
4868 R"({
4869 "method" : "submit",
4870 "params" : [
4871 {
4872 "api_version" : %API_VER%,
4873 "offline" : true,
4874 "secret" : "my_secret",
4875 "tx_json" : {
4876 "json_argument" : true
4877 }
4878 }
4879 ]
4880 })"},
4881 {"submit: too many arguments.",
4882 __LINE__,
4883 {"submit", "my_secret", R"({"json_argument":true})", "offline", "extra"},
4885 R"({
4886 "method" : "submit",
4887 "params" : [
4888 {
4889 "error" : "badSyntax",
4890 "error_code" : 1,
4891 "error_message" : "Syntax error."
4892 }
4893 ]
4894 })"},
4895 {"submit: invalid json (note extra comma).",
4896 __LINE__,
4897 {
4898 "submit",
4899 "my_secret",
4900 R"({"json_argument":true,})",
4901 },
4903 R"({
4904 "method" : "submit",
4905 "params" : [
4906 {
4907 "error" : "invalidParams",
4908 "error_code" : 31,
4909 "error_message" : "Invalid parameters."
4910 }
4911 ]
4912 })"},
4913 {"submit: last argument not \"offline\".",
4914 __LINE__,
4915 {"submit", "my_secret", R"({"json_argument":true})", "offlne"},
4917 R"({
4918 "method" : "submit",
4919 "params" : [
4920 {
4921 "error" : "invalidParams",
4922 "error_code" : 31,
4923 "error_message" : "Invalid parameters."
4924 }
4925 ]
4926 })"},
4927
4928 // submit_multisigned
4929 // ----------------------------------------------------------
4930 {"submit_multisigned: json.",
4931 __LINE__,
4932 {
4933 "submit_multisigned",
4934 R"({"json_argument":true})",
4935 },
4937 R"({
4938 "method" : "submit_multisigned",
4939 "params" : [
4940 {
4941 "api_version" : %API_VER%,
4942 "tx_json" : {
4943 "json_argument" : true
4944 }
4945 }
4946 ]
4947 })"},
4948 {"submit_multisigned: too few arguments.",
4949 __LINE__,
4950 {
4951 "submit_multisigned",
4952 },
4954 R"({
4955 "method" : "submit_multisigned",
4956 "params" : [
4957 {
4958 "error" : "badSyntax",
4959 "error_code" : 1,
4960 "error_message" : "Syntax error."
4961 }
4962 ]
4963 })"},
4964 {"submit_multisigned: too many arguments.",
4965 __LINE__,
4966 {"submit_multisigned", R"({"json_argument":true})", "extra"},
4968 R"({
4969 "method" : "submit_multisigned",
4970 "params" : [
4971 {
4972 "error" : "badSyntax",
4973 "error_code" : 1,
4974 "error_message" : "Syntax error."
4975 }
4976 ]
4977 })"},
4978 {"submit_multisigned: invalid json (note extra comma).",
4979 __LINE__,
4980 {
4981 "submit_multisigned",
4982 R"({"json_argument":true,})",
4983 },
4985 R"({
4986 "method" : "submit_multisigned",
4987 "params" : [
4988 {
4989 "error" : "invalidParams",
4990 "error_code" : 31,
4991 "error_message" : "Invalid parameters."
4992 }
4993 }
4994 ]
4995 })"},
4996
4997 // server_info
4998 // -----------------------------------------------------------------
4999 {"server_info: minimal.",
5000 __LINE__,
5001 {
5002 "server_info",
5003 },
5005 R"({
5006 "method" : "server_info",
5007 "params" : [
5008 {
5009 "api_version" : %API_VER%,
5010 }
5011 ]
5012 })"},
5013 {"server_info: counters.",
5014 __LINE__,
5015 {"server_info", "counters"},
5017 R"({
5018 "method" : "server_info",
5019 "params" : [
5020 {
5021 "api_version" : %API_VER%,
5022 "counters" : true
5023 }
5024 ]
5025 })"},
5026 {"server_info: too many arguments.",
5027 __LINE__,
5028 {"server_info", "counters", "extra"},
5030 R"({
5031 "method" : "server_info",
5032 "params" : [
5033 {
5034 "error" : "badSyntax",
5035 "error_code" : 1,
5036 "error_message" : "Syntax error."
5037 }
5038 ]
5039 })"},
5040 {"server_info: non-counters argument.",
5041 __LINE__,
5042 {"server_info", "counter"},
5044 R"({
5045 "method" : "server_info",
5046 "params" : [
5047 {
5048 "api_version" : %API_VER%,
5049 }
5050 ]
5051 })"},
5052
5053 // server_state
5054 // ----------------------------------------------------------------
5055 {"server_state: minimal.",
5056 __LINE__,
5057 {
5058 "server_state",
5059 },
5061 R"({
5062 "method" : "server_state",
5063 "params" : [
5064 {
5065 "api_version" : %API_VER%,
5066 }
5067 ]
5068 })"},
5069 {"server_state: counters.",
5070 __LINE__,
5071 {"server_state", "counters"},
5073 R"({
5074 "method" : "server_state",
5075 "params" : [
5076 {
5077 "api_version" : %API_VER%,
5078 "counters" : true
5079 }
5080 ]
5081 })"},
5082 {"server_state: too many arguments.",
5083 __LINE__,
5084 {"server_state", "counters", "extra"},
5086 R"({
5087 "method" : "server_state",
5088 "params" : [
5089 {
5090 "error" : "badSyntax",
5091 "error_code" : 1,
5092 "error_message" : "Syntax error."
5093 }
5094 ]
5095 })"},
5096 {"server_state: non-counters argument.",
5097 __LINE__,
5098 {"server_state", "counter"},
5100 R"({
5101 "method" : "server_state",
5102 "params" : [
5103 {
5104 "api_version" : %API_VER%,
5105 }
5106 ]
5107 })"},
5108
5109 // stop
5110 // ------------------------------------------------------------------------
5111 {"stop: minimal.",
5112 __LINE__,
5113 {
5114 "stop",
5115 },
5117 R"({
5118 "method" : "stop",
5119 "params" : [
5120 {
5121 "api_version" : %API_VER%,
5122 }
5123 ]
5124 })"},
5125 {"stop: too many arguments.",
5126 __LINE__,
5127 {"stop", "extra"},
5129 R"({
5130 "method" : "stop",
5131 "params" : [
5132 {
5133 "error" : "badSyntax",
5134 "error_code" : 1,
5135 "error_message" : "Syntax error."
5136 }
5137 ]
5138 })"},
5139
5140 // transaction_entry
5141 // -----------------------------------------------------------
5142 {"transaction_entry: ledger index.",
5143 __LINE__,
5144 {"transaction_entry",
5145 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5146 "4294967295"},
5148 R"({
5149 "method" : "transaction_entry",
5150 "params" : [
5151 {
5152 "api_version" : %API_VER%,
5153 "ledger_index" : 4294967295,
5154 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5155 }
5156 ]
5157 })"},
5158 {"transaction_entry: text ledger index.",
5159 __LINE__,
5160 {"transaction_entry",
5161 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5162 "current"},
5164 R"({
5165 "method" : "transaction_entry",
5166 "params" : [
5167 {
5168 "api_version" : %API_VER%,
5169 "ledger_index" : "current",
5170 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5171 }
5172 ]
5173 })"},
5174 {"transaction_entry: ledger hash.",
5175 __LINE__,
5176 {"transaction_entry",
5177 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5178 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210"},
5180 R"({
5181 "method" : "transaction_entry",
5182 "params" : [
5183 {
5184 "api_version" : %API_VER%,
5185 "ledger_hash" : "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210",
5186 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5187 }
5188 ]
5189 })"},
5190 {"transaction_entry: too few arguments.",
5191 __LINE__,
5192 {
5193 "transaction_entry",
5194 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5195 },
5197 R"({
5198 "method" : "transaction_entry",
5199 "params" : [
5200 {
5201 "error" : "badSyntax",
5202 "error_code" : 1,
5203 "error_message" : "Syntax error."
5204 }
5205 ]
5206 })"},
5207 {"transaction_entry: too many arguments.",
5208 __LINE__,
5209 {"transaction_entry",
5210 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5211 "validated",
5212 "extra"},
5214 R"({
5215 "method" : "transaction_entry",
5216 "params" : [
5217 {
5218 "error" : "badSyntax",
5219 "error_code" : 1,
5220 "error_message" : "Syntax error."
5221 }
5222 ]
5223 })"},
5224 {"transaction_entry: short tx_hash.",
5225 __LINE__,
5226 {
5227 "transaction_entry",
5228 "123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5229 "validated",
5230 },
5232 R"({
5233 "method" : "transaction_entry",
5234 "params" : [
5235 {
5236 "error" : "invalidParams",
5237 "error_code" : 31,
5238 "error_message" : "Invalid parameters."
5239 }
5240 ]
5241 })"},
5242 {"transaction_entry: long tx_hash.",
5243 __LINE__,
5244 {
5245 "transaction_entry",
5246 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUVW",
5247 "validated",
5248 },
5250 R"({
5251 "method" : "transaction_entry",
5252 "params" : [
5253 {
5254 "error" : "invalidParams",
5255 "error_code" : 31,
5256 "error_message" : "Invalid parameters."
5257 }
5258 ]
5259 })"},
5260 {"transaction_entry: small ledger index.",
5261 __LINE__,
5262 {
5263 "transaction_entry",
5264 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5265 "0",
5266 },
5268 R"({
5269 "method" : "transaction_entry",
5270 "params" : [
5271 {
5272 "error" : "invalidParams",
5273 "error_code" : 31,
5274 "error_message" : "Invalid parameters."
5275 }
5276 ]
5277 })"},
5278 {"transaction_entry: large ledger index.",
5279 __LINE__,
5280 {
5281 "transaction_entry",
5282 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5283 "4294967296",
5284 },
5286 R"({
5287 "method" : "transaction_entry",
5288 "params" : [
5289 {
5290 "error" : "invalidParams",
5291 "error_code" : 31,
5292 "error_message" : "Invalid parameters."
5293 }
5294 ]
5295 })"},
5296 {"transaction_entry: short ledger hash.",
5297 __LINE__,
5298 {
5299 "transaction_entry",
5300 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5301 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA987654321",
5302 },
5304 R"({
5305 "method" : "transaction_entry",
5306 "params" : [
5307 {
5308 "error" : "invalidParams",
5309 "error_code" : 31,
5310 "error_message" : "Invalid parameters."
5311 }
5312 ]
5313 })"},
5314 {"transaction_entry: long ledger hash.",
5315 __LINE__,
5316 {
5317 "transaction_entry",
5318 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5319 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210Z",
5320 },
5322 R"({
5323 "method" : "transaction_entry",
5324 "params" : [
5325 {
5326 "error" : "invalidParams",
5327 "error_code" : 31,
5328 "error_message" : "Invalid parameters."
5329 }
5330 ]
5331 })"},
5332
5333 // tx
5334 // --------------------------------------------------------------------------
5335 {"tx: ctid. minimal",
5336 __LINE__,
5337 {"tx", "FFFFFFFFFFFFFFFF", "1", "2"},
5339 R"({
5340 "method" : "tx",
5341 "params" : [
5342 {
5343 "api_version" : %API_VER%,
5344 "ctid" : "FFFFFFFFFFFFFFFF",
5345 "max_ledger" : "2",
5346 "min_ledger" : "1"
5347 }
5348 ]
5349 })"},
5350 {"tx: ctid. binary",
5351 __LINE__,
5352 {"tx", "FFFFFFFFFFFFFFFF", "binary", "1", "2"},
5354 R"({
5355 "method" : "tx",
5356 "params" : [
5357 {
5358 "api_version" : %API_VER%,
5359 "binary" : true,
5360 "ctid" : "FFFFFFFFFFFFFFFF",
5361 "max_ledger" : "2",
5362 "min_ledger" : "1"
5363 }
5364 ]
5365 })"},
5366 {"tx: minimal.",
5367 __LINE__,
5368 {"tx", "transaction_hash_is_not_validated"},
5370 R"({
5371 "method" : "tx",
5372 "params" : [
5373 {
5374 "api_version" : %API_VER%,
5375 "transaction" : "transaction_hash_is_not_validated"
5376 }
5377 ]
5378 })"},
5379 {"tx: binary.",
5380 __LINE__,
5381 {"tx", "transaction_hash_is_not_validated", "binary"},
5383 R"({
5384 "method" : "tx",
5385 "params" : [
5386 {
5387 "api_version" : %API_VER%,
5388 "binary" : true,
5389 "transaction" : "transaction_hash_is_not_validated"
5390 }
5391 ]
5392 })"},
5393 {"tx: too few arguments.",
5394 __LINE__,
5395 {
5396 "tx",
5397 },
5399 R"({
5400 "method" : "tx",
5401 "params" : [
5402 {
5403 "error" : "badSyntax",
5404 "error_code" : 1,
5405 "error_message" : "Syntax error."
5406 }
5407 ]
5408 })"},
5409 {"tx: too many arguments.",
5410 __LINE__,
5411 {"tx", "transaction_hash_is_not_validated", "binary", "1", "2", "extra"},
5413 R"({
5414 "method" : "tx",
5415 "params" : [
5416 {
5417 "error" : "badSyntax",
5418 "error_code" : 1,
5419 "error_message" : "Syntax error."
5420 }
5421 ]
5422 })"},
5423 {"tx: invalid final argument is apparently ignored.",
5424 __LINE__,
5425 {"tx", "transaction_hash_is_not_validated", "bin"},
5427 R"({
5428 "method" : "tx",
5429 "params" : [
5430 {
5431 "api_version" : %API_VER%,
5432 "transaction" : "transaction_hash_is_not_validated"
5433 }
5434 ]
5435 })"},
5436
5437 // tx_history
5438 // ------------------------------------------------------------------
5439 {"tx_history: minimal.",
5440 __LINE__,
5441 {"tx_history", "0"},
5443 R"({
5444 "method" : "tx_history",
5445 "params" : [
5446 {
5447 "api_version" : %API_VER%,
5448 "start" : 0
5449 }
5450 ]
5451 })"},
5452 {"tx_history: too few arguments.",
5453 __LINE__,
5454 {
5455 "tx_history",
5456 },
5458 R"({
5459 "method" : "tx_history",
5460 "params" : [
5461 {
5462 "error" : "badSyntax",
5463 "error_code" : 1,
5464 "error_message" : "Syntax error."
5465 }
5466 ]
5467 })"},
5468 {"tx_history: too many arguments.",
5469 __LINE__,
5470 {"tx_history", "0", "1"},
5472 R"({
5473 "method" : "tx_history",
5474 "params" : [
5475 {
5476 "error" : "badSyntax",
5477 "error_code" : 1,
5478 "error_message" : "Syntax error."
5479 }
5480 ]
5481 })"},
5482 {
5483 // Note: this really shouldn't throw, but does at the moment.
5484 "tx_history: start too small.",
5485 __LINE__,
5486 {"tx_history", "-1"},
5488 R"()",
5489 },
5490 {
5491 // Note: this really shouldn't throw, but does at the moment.
5492 "tx_history: start too big.",
5493 __LINE__,
5494 {"tx_history", "4294967296"},
5496 R"()",
5497 },
5498 {
5499 // Note: this really shouldn't throw, but does at the moment.
5500 "tx_history: start not integer.",
5501 __LINE__,
5502 {"tx_history", "beginning"},
5504 R"()",
5505 },
5506
5507 // unl_list
5508 // --------------------------------------------------------------------
5509 {"unl_list: minimal.",
5510 __LINE__,
5511 {
5512 "unl_list",
5513 },
5515 R"({
5516 "method" : "unl_list",
5517 "params" : [
5518 {
5519 "api_version" : %API_VER%,
5520 }
5521 ]
5522 })"},
5523 {"unl_list: too many arguments.",
5524 __LINE__,
5525 {"unl_list", "extra"},
5527 R"({
5528 "method" : "unl_list",
5529 "params" : [
5530 {
5531 "error" : "badSyntax",
5532 "error_code" : 1,
5533 "error_message" : "Syntax error."
5534 }
5535 ]
5536 })"},
5537
5538 // validation_create
5539 // -----------------------------------------------------------
5540 {"validation_create: minimal.",
5541 __LINE__,
5542 {
5543 "validation_create",
5544 },
5546 R"({
5547 "method" : "validation_create",
5548 "params" : [
5549 {
5550 "api_version" : %API_VER%,
5551 }
5552 ]
5553 })"},
5554 {"validation_create: with secret.",
5555 __LINE__,
5556 {"validation_create", "the form of the secret is not validated"},
5558 R"({
5559 "method" : "validation_create",
5560 "params" : [
5561 {
5562 "api_version" : %API_VER%,
5563 "secret" : "the form of the secret is not validated"
5564 }
5565 ]
5566 })"},
5567 {"validation_create: too many arguments.",
5568 __LINE__,
5569 {"validation_create", "the form of the secret is not validated", "extra"},
5571 R"({
5572 "method" : "validation_create",
5573 "params" : [
5574 {
5575 "error" : "badSyntax",
5576 "error_code" : 1,
5577 "error_message" : "Syntax error."
5578 }
5579 ]
5580 })"},
5581
5582 // version
5583 // ---------------------------------------------------------------------
5584 {"version: minimal.",
5585 __LINE__,
5586 {
5587 "version",
5588 },
5590 R"({
5591 "method" : "version",
5592 "params" : [
5593 {
5594 "api_version" : %API_VER%,
5595 }
5596 ]
5597 })"},
5598 {"version: too many arguments.",
5599 __LINE__,
5600 {"version", "extra"},
5602 R"({
5603 "method" : "version",
5604 "params" : [
5605 {
5606 "error" : "badSyntax",
5607 "error_code" : 1,
5608 "error_message" : "Syntax error."
5609 }
5610 ]
5611 })"},
5612
5613 // wallet_propose
5614 // --------------------------------------------------------------
5615 {"wallet_propose: minimal.",
5616 __LINE__,
5617 {
5618 "wallet_propose",
5619 },
5621 R"({
5622 "method" : "wallet_propose",
5623 "params" : [
5624 {
5625 "api_version" : %API_VER%,
5626 }
5627 ]
5628 })"},
5629 {"wallet_propose: with passphrase.",
5630 __LINE__,
5631 {"wallet_propose", "the form of the passphrase is not validated"},
5633 R"({
5634 "method" : "wallet_propose",
5635 "params" : [
5636 {
5637 "api_version" : %API_VER%,
5638 "passphrase" : "the form of the passphrase is not validated"
5639 }
5640 ]
5641 })"},
5642 {"wallet_propose: too many arguments.",
5643 __LINE__,
5644 {"wallet_propose", "the form of the passphrase is not validated", "extra"},
5646 R"({
5647 "method" : "wallet_propose",
5648 "params" : [
5649 {
5650 "error" : "badSyntax",
5651 "error_code" : 1,
5652 "error_message" : "Syntax error."
5653 }
5654 ]
5655 })"},
5656
5657 // internal
5658 // --------------------------------------------------------------------
5659 {"internal: minimal.",
5660 __LINE__,
5661 {"internal", "command_name"},
5663 R"({
5664 "method" : "internal",
5665 "params" : [
5666 {
5667 "api_version" : %API_VER%,
5668 "internal_command" : "command_name",
5669 "params" : []
5670 }
5671 ]
5672 })"},
5673 {"internal: with parameters.",
5674 __LINE__,
5675 {"internal",
5676 "command_name",
5677 "string_arg",
5678 "1",
5679 "-1",
5680 "4294967296",
5681 "3.14159"},
5683 R"({
5684 "method" : "internal",
5685 "params" : [
5686 {
5687 "api_version" : %API_VER%,
5688 "internal_command" : "command_name",
5689 "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
5690 }
5691 ]
5692 })"},
5693 {"internal: too few arguments.",
5694 __LINE__,
5695 {
5696 "internal",
5697 },
5699 R"({
5700 "method" : "internal",
5701 "params" : [
5702 {
5703 "error" : "badSyntax",
5704 "error_code" : 1,
5705 "error_message" : "Syntax error."
5706 }
5707 ]
5708 })"},
5709
5710 // path_find
5711 // -------------------------------------------------------------------
5712 {"path_find: minimal.",
5713 __LINE__,
5714 {
5715 "path_find",
5716 },
5718 R"({
5719 "method" : "path_find",
5720 "params" : [
5721 {
5722 "error" : "noEvents",
5723 "error_code" : 7,
5724 "error_message" : "Current transport does not support events."
5725 }
5726 ]
5727 })"},
5728 {"path_find: with arguments.",
5729 __LINE__,
5730 {"path_find", "string_arg", "1", "-1", "4294967296", "3.14159"},
5732 R"({
5733 "method" : "path_find",
5734 "params" : [
5735 {
5736 "error" : "noEvents",
5737 "error_code" : 7,
5738 "error_message" : "Current transport does not support events."
5739 }
5740 ]
5741 })"},
5742
5743 // subscribe
5744 // -------------------------------------------------------------------
5745 {"subscribe: minimal.",
5746 __LINE__,
5747 {
5748 "subscribe",
5749 },
5751 R"({
5752 "method" : "subscribe",
5753 "params" : [
5754 {
5755 "error" : "noEvents",
5756 "error_code" : 7,
5757 "error_message" : "Current transport does not support events."
5758 }
5759 ]
5760 })"},
5761 {"subscribe: with arguments.",
5762 __LINE__,
5763 {"subscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
5765 R"({
5766 "method" : "subscribe",
5767 "params" : [
5768 {
5769 "error" : "noEvents",
5770 "error_code" : 7,
5771 "error_message" : "Current transport does not support events."
5772 }
5773 ]
5774 })"},
5775
5776 // unsubscribe
5777 // -----------------------------------------------------------------
5778 {"unsubscribe: minimal.",
5779 __LINE__,
5780 {
5781 "unsubscribe",
5782 },
5784 R"({
5785 "method" : "unsubscribe",
5786 "params" : [
5787 {
5788 "error" : "noEvents",
5789 "error_code" : 7,
5790 "error_message" : "Current transport does not support events."
5791 }
5792 ]
5793 })"},
5794 {"unsubscribe: with arguments.",
5795 __LINE__,
5796 {"unsubscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
5798 R"({
5799 "method" : "unsubscribe",
5800 "params" : [
5801 {
5802 "error" : "noEvents",
5803 "error_code" : 7,
5804 "error_message" : "Current transport does not support events."
5805 }
5806 ]
5807 })"},
5808
5809 // unknown_command
5810 // -------------------------------------------------------------
5811 {"unknown_command: minimal.",
5812 __LINE__,
5813 {
5814 "unknown_command",
5815 },
5817 R"({
5818 "method" : "unknown_command",
5819 "params" : [
5820 {
5821 "api_version" : %API_VER%,
5822 }
5823 ]
5824 })"},
5825 {"unknown_command: with arguments.",
5826 __LINE__,
5827 {"unknown_command", "string_arg", "1", "-1", "4294967296", "3.14159"},
5829 R"({
5830 "method" : "unknown_command",
5831 "params" : [
5832 {
5833 "api_version" : %API_VER%,
5834 "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
5835 }
5836 ]
5837 })"},
5838};
5839
5841updateAPIVersionString(const char* const req, unsigned apiVersion)
5842{
5843 std::string const version_str = std::to_string(apiVersion);
5844 static auto const place_holder = "%API_VER%";
5845 std::string jr(req);
5846 boost::replace_all(jr, place_holder, version_str);
5847 return jr;
5848}
5849
5851makeNetworkConfig(uint32_t networkID)
5852{
5853 using namespace test::jtx;
5854 return envconfig([&](std::unique_ptr<Config> cfg) {
5855 cfg->NETWORK_ID = networkID;
5856 return cfg;
5857 });
5858}
5859
5861{
5862public:
5863 void
5864 testRPCCall(unsigned apiVersion)
5865 {
5866 testcase << "RPCCall API version " << apiVersion;
5867 if (!BEAST_EXPECT(
5868 apiVersion >= RPC::apiMinimumSupportedVersion &&
5869 apiVersion <= RPC::apiMaximumValidVersion))
5870 return;
5871
5872 test::jtx::Env env(
5873 *this, makeNetworkConfig(11111)); // Used only for its Journal.
5874
5875 // For each RPCCall test.
5876 for (RPCCallTestData const& rpcCallTest : rpcCallTestArray)
5877 {
5878 if (!BEAST_EXPECT(!rpcCallTest.exp.empty()))
5879 break;
5880
5881 std::vector<std::string> const args{
5882 rpcCallTest.args.begin(), rpcCallTest.args.end()};
5883
5884 const char* const expVersioned =
5885 (apiVersion - RPC::apiMinimumSupportedVersion) <
5886 rpcCallTest.exp.size()
5887 ? rpcCallTest.exp[apiVersion - RPC::apiMinimumSupportedVersion]
5888 : rpcCallTest.exp.back();
5889
5890 // Note that, over the long term, none of these tests should
5891 // throw. But, for the moment, some of them do. So handle it.
5892 Json::Value got;
5893 try
5894 {
5895 got = jtx::cmdToJSONRPC(args, env.journal, apiVersion);
5896 }
5897 catch (std::bad_cast const&)
5898 {
5899 if ((rpcCallTest.throwsWhat == RPCCallTestData::bad_cast) &&
5900 (std::strlen(expVersioned) == 0))
5901 {
5902 pass();
5903 }
5904 else
5905 {
5906 fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
5907 }
5908 // Try the next test.
5909 continue;
5910 }
5911
5912 Json::Value exp;
5914 updateAPIVersionString(expVersioned, apiVersion), exp);
5915
5916 // Lambda to remove the "params[0u]:error_code" field if present.
5917 // Error codes are not expected to be stable between releases.
5918 auto rmErrorCode = [](Json::Value& json) {
5919 if (json.isMember(jss::params) && json[jss::params].isArray() &&
5920 json[jss::params].size() > 0 &&
5921 json[jss::params][0u].isObject())
5922 {
5923 json[jss::params][0u].removeMember(jss::error_code);
5924 }
5925 };
5926 rmErrorCode(got);
5927 rmErrorCode(exp);
5928
5929 // Pass if we didn't expect a throw and we got what we expected.
5930 if ((rpcCallTest.throwsWhat == RPCCallTestData::no_exception) &&
5931 (got == exp))
5932 {
5933 pass();
5934 }
5935 else
5936 {
5937 fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
5938 }
5939 }
5940 }
5941
5942 void
5943 run() override
5944 {
5946 }
5947};
5948
5949BEAST_DEFINE_TESTSUITE(RPCCall, app, ripple);
5950
5951} // namespace test
5952} // namespace ripple
T begin(T... args)
T bind_front(T... args)
Unserialize a JSON document into a Value.
Definition: json_reader.h:37
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
Definition: json_reader.cpp:73
Represents a JSON value.
Definition: json_value.h:147
A testsuite class.
Definition: suite.h:53
void pass()
Record a successful test condition.
Definition: suite.h:509
testcase_t testcase
Memberspace for declaring test cases.
Definition: suite.h:153
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition: suite.h:531
void testRPCCall(unsigned apiVersion)
void run() override
Runs the suite.
A transaction testing environment.
Definition: Env.h:117
beast::Journal const journal
Definition: Env.h:158
Inject raw JSON.
Definition: jtx_json.h:32
static constexpr auto apiMaximumValidVersion
Definition: ApiVersion.h:63
static constexpr auto apiMinimumSupportedVersion
Definition: ApiVersion.h:57
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:54
Json::Value cmdToJSONRPC(std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
Given a rippled unit test rpc command, return the corresponding JSON.
Definition: utility.cpp:79
std::string updateAPIVersionString(const char *const req, unsigned apiVersion)
static RPCCallTestData const rpcCallTestArray[]
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
void forAllApiVersions(Fn const &fn, Args &&... args)
Definition: ApiVersion.h:102
T strlen(T... args)
RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, char const *exp_)
RPCCallTestData & operator=(RPCCallTestData const &)=delete
RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, std::initializer_list< char const * > exp_)
std::vector< char const * > exp
RPCCallTestData(RPCCallTestData &&)=delete
RPCCallTestData & operator=(RPCCallTestData &&)=delete
std::vector< char const * > const args
RPCCallTestData(RPCCallTestData const &)=delete
char const *const description
T to_string(T... args)