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