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 "junk", // Note: indexing bug in parseBookOffers() requires junk
1588 // param.
1589 "200",
1590 },
1592 R"({
1593 "method" : "book_offers",
1594 "params" : [
1595 {
1596 "api_version" : %API_VER%,
1597 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1598 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1599 "limit" : 200,
1600 "proof" : true,
1601 "taker_gets" : {
1602 "currency" : "EUR",
1603 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1604 },
1605 "taker_pays" : {
1606 "currency" : "USD",
1607 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1608 }
1609 }
1610 ]
1611 })"},
1612 {// Note: parser supports "marker", but the docs don't cover it.
1613 "book_offers: issuer, ledger hash, limit, and marker.",
1614 __LINE__,
1615 {"book_offers",
1616 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1617 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1618 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1619 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1620 "junk", // Note: indexing bug in parseBookOffers() requires junk param.
1621 "200",
1622 "MyMarker"},
1624 R"({
1625 "method" : "book_offers",
1626 "params" : [
1627 {
1628 "api_version" : %API_VER%,
1629 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1630 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1631 "limit" : 200,
1632 "marker" : "MyMarker",
1633 "proof" : true,
1634 "taker_gets" : {
1635 "currency" : "EUR",
1636 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1637 },
1638 "taker_pays" : {
1639 "currency" : "USD",
1640 "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
1641 }
1642 }
1643 ]
1644 })"},
1645 {"book_offers: too few arguments.",
1646 __LINE__,
1647 {
1648 "book_offers",
1649 },
1651 R"({
1652 "method" : "book_offers",
1653 "params" : [
1654 {
1655 "error" : "badSyntax",
1656 "error_code" : 1,
1657 "error_message" : "Syntax error."
1658 }
1659 ]
1660 })"},
1661 {"book_offers: too many arguments.",
1662 __LINE__,
1663 {"book_offers",
1664 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1665 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1666 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1667 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1668 "junk", // Note: indexing bug in parseBookOffers() requires junk param.
1669 "200",
1670 "MyMarker",
1671 "extra"},
1673 R"({
1674 "method" : "book_offers",
1675 "params" : [
1676 {
1677 "error" : "badSyntax",
1678 "error_code" : 1,
1679 "error_message" : "Syntax error."
1680 }
1681 ]
1682 })"},
1683
1684 {"book_offers: taker pays no currency.",
1685 __LINE__,
1686 {
1687 "book_offers",
1688 "/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1689 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1690 },
1692 R"({
1693 "method" : "book_offers",
1694 "params" : [
1695 {
1696 "error" : "invalidParams",
1697 "error_code" : 31,
1698 "error_message" : "Invalid currency/issuer '/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'"
1699 }
1700 ]
1701 })"},
1702 {"book_offers: taker gets no currency.",
1703 __LINE__,
1704 {
1705 "book_offers",
1706 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1707 "/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1708 },
1710 R"({
1711 "method" : "book_offers",
1712 "params" : [
1713 {
1714 "error" : "invalidParams",
1715 "error_code" : 31,
1716 "error_message" : "Invalid currency/issuer '/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA'"
1717 }
1718 ]
1719 })"},
1720 {"book_offers: invalid issuer.",
1721 __LINE__,
1722 {"book_offers", "USD", "EUR", "not_a_valid_issuer"},
1724 R"({
1725 "method" : "book_offers",
1726 "params" : [
1727 {
1728 "api_version" : %API_VER%,
1729 "issuer" : "not_a_valid_issuer",
1730 "taker_gets" : {
1731 "currency" : "EUR"
1732 },
1733 "taker_pays" : {
1734 "currency" : "USD"
1735 }
1736 }
1737 ]
1738 })"},
1739 {"book_offers: invalid text ledger index.",
1740 __LINE__,
1741 {"book_offers",
1742 "USD",
1743 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1744 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1745 "not_a_ledger"},
1747 R"({
1748 "method" : "book_offers",
1749 "params" : [
1750 {
1751 "api_version" : %API_VER%,
1752 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1753 "ledger_index" : 0,
1754 "taker_gets" : {
1755 "currency" : "EUR",
1756 "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
1757 },
1758 "taker_pays" : {
1759 "currency" : "USD"
1760 }
1761 }
1762 ]
1763 })"},
1764 {// Note: this really shouldn't throw, but does at the moment.
1765 "book_offers: non-numeric limit.",
1766 __LINE__,
1767 {
1768 "book_offers",
1769 "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1770 "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1771 "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1772 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
1773 "junk", // Note: indexing bug in parseBookOffers() requires junk
1774 // param.
1775 "not_a_number",
1776 },
1778 R"()"},
1779
1780 // can_delete
1781 // ------------------------------------------------------------------
1782 {"can_delete: minimal.",
1783 __LINE__,
1784 {
1785 "can_delete",
1786 },
1788 R"({
1789 "method" : "can_delete",
1790 "params" : [
1791 {
1792 "api_version" : %API_VER%,
1793 }
1794 ]
1795 })"},
1796 {"can_delete: ledger index.",
1797 __LINE__,
1798 {
1799 "can_delete",
1800 "4294967295",
1801 },
1803 R"({
1804 "method" : "can_delete",
1805 "params" : [
1806 {
1807 "api_version" : %API_VER%,
1808 "can_delete" : 4294967295
1809 }
1810 ]
1811 })"},
1812 {"can_delete: ledger hash.",
1813 __LINE__,
1814 {
1815 "can_delete",
1816 "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
1817 },
1819 R"({
1820 "method" : "can_delete",
1821 "params" : [
1822 {
1823 "api_version" : %API_VER%,
1824 "can_delete" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210"
1825 }
1826 ]
1827 })"},
1828 {"can_delete: always.",
1829 __LINE__,
1830 {
1831 "can_delete",
1832 "always",
1833 },
1835 R"({
1836 "method" : "can_delete",
1837 "params" : [
1838 {
1839 "api_version" : %API_VER%,
1840 "can_delete" : "always"
1841 }
1842 ]
1843 })"},
1844 {"can_delete: never.",
1845 __LINE__,
1846 {
1847 "can_delete",
1848 "never",
1849 },
1851 R"({
1852 "method" : "can_delete",
1853 "params" : [
1854 {
1855 "api_version" : %API_VER%,
1856 "can_delete" : "never"
1857 }
1858 ]
1859 })"},
1860 {"can_delete: now.",
1861 __LINE__,
1862 {
1863 "can_delete",
1864 "now",
1865 },
1867 R"({
1868 "method" : "can_delete",
1869 "params" : [
1870 {
1871 "api_version" : %API_VER%,
1872 "can_delete" : "now"
1873 }
1874 ]
1875 })"},
1876 {"can_delete: too many arguments.",
1877 __LINE__,
1878 {"can_delete", "always", "never"},
1880 R"({
1881 "method" : "can_delete",
1882 "params" : [
1883 {
1884 "error" : "badSyntax",
1885 "error_code" : 1,
1886 "error_message" : "Syntax error."
1887 }
1888 ]
1889 })"},
1890 {"can_delete: invalid argument.",
1891 __LINE__,
1892 {"can_delete", "invalid"},
1894 R"({
1895 "method" : "can_delete",
1896 "params" : [
1897 {
1898 "api_version" : %API_VER%,
1899 "can_delete" : "invalid"
1900 }
1901 ]
1902 })"},
1903 {// Note: this should return an error but not throw.
1904 "can_delete: ledger index > 32 bits.",
1905 __LINE__,
1906 {
1907 "can_delete",
1908 "4294967296",
1909 },
1911 R"()"},
1912 {// Note: this really shouldn't throw since it's a legitimate ledger hash.
1913 "can_delete: ledger hash with no alphas.",
1914 __LINE__,
1915 {
1916 "can_delete",
1917 "0123456701234567012345670123456701234567012345670123456701234567",
1918 },
1920 R"()"},
1921
1922 // channel_authorize
1923 // -----------------------------------------------------------
1924 {"channel_authorize: minimal.",
1925 __LINE__,
1926 {"channel_authorize",
1927 "secret_can_be_anything",
1928 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1929 "18446744073709551615"},
1931 R"({
1932 "method" : "channel_authorize",
1933 "params" : [
1934 {
1935 "api_version" : %API_VER%,
1936 "amount" : "18446744073709551615",
1937 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1938 "secret" : "secret_can_be_anything"
1939 }
1940 ]
1941 })"},
1942 {"channel_authorize: too few arguments.",
1943 __LINE__,
1944 {
1945 "channel_authorize",
1946 "secret_can_be_anything",
1947 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1948 },
1950 R"({
1951 "method" : "channel_authorize",
1952 "params" : [
1953 {
1954 "error" : "badSyntax",
1955 "error_code" : 1,
1956 "error_message" : "Syntax error."
1957 }
1958 ]
1959 })"},
1960 {"channel_authorize: too many arguments.",
1961 __LINE__,
1962 {"channel_authorize",
1963 "secp256k1",
1964 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1965 "2000",
1966 "whatever",
1967 "whenever"},
1969 R"({
1970 "method" : "channel_authorize",
1971 "params" : [
1972 {
1973 "error" : "badSyntax",
1974 "error_code" : 1,
1975 "error_message" : "Syntax error."
1976 }
1977 ]
1978 })"},
1979 {"channel_authorize: bad key type.",
1980 __LINE__,
1981 {"channel_authorize",
1982 "secp257k1",
1983 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
1984 "2000",
1985 "whatever"},
1987 R"({
1988 "method" : "channel_authorize",
1989 "params" : [
1990 {
1991 "error" : "badKeyType",
1992 "error_code" : 1,
1993 "error_message" : "Bad key type."
1994 }
1995 ]
1996 })"},
1997 {"channel_authorize: channel_id too short.",
1998 __LINE__,
1999 {"channel_authorize",
2000 "secret_can_be_anything",
2001 "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2002 "2000"},
2004 R"({
2005 "method" : "channel_authorize",
2006 "params" : [
2007 {
2008 "error" : "channelMalformed",
2009 "error_code" : 43,
2010 "error_message" : "Payment channel is malformed."
2011 }
2012 ]
2013 })"},
2014 {"channel_authorize: channel_id too long.",
2015 __LINE__,
2016 {"channel_authorize",
2017 "secret_can_be_anything",
2018 "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2019 "2000"},
2021 R"({
2022 "method" : "channel_authorize",
2023 "params" : [
2024 {
2025 "error" : "channelMalformed",
2026 "error_code" : 43,
2027 "error_message" : "Payment channel is malformed."
2028 }
2029 ]
2030 })"},
2031 {"channel_authorize: channel_id not hex.",
2032 __LINE__,
2033 {"channel_authorize",
2034 "secret_can_be_anything",
2035 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEZ",
2036 "2000"},
2038 R"({
2039 "method" : "channel_authorize",
2040 "params" : [
2041 {
2042 "error" : "channelMalformed",
2043 "error_code" : 43,
2044 "error_message" : "Payment channel is malformed."
2045 }
2046 ]
2047 })"},
2048 {"channel_authorize: negative amount.",
2049 __LINE__,
2050 {"channel_authorize",
2051 "secret_can_be_anything",
2052 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2053 "-1"},
2055 R"({
2056 "method" : "channel_authorize",
2057 "params" : [
2058 {
2059 "error" : "channelAmtMalformed",
2060 "error_code" : 44,
2061 "error_message" : "Payment channel amount is malformed."
2062 }
2063 ]
2064 })"},
2065 {"channel_authorize: amount > 64 bits.",
2066 __LINE__,
2067 {"channel_authorize",
2068 "secret_can_be_anything",
2069 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2070 "18446744073709551616"},
2072 R"({
2073 "method" : "channel_authorize",
2074 "params" : [
2075 {
2076 "error" : "channelAmtMalformed",
2077 "error_code" : 44,
2078 "error_message" : "Payment channel amount is malformed."
2079 }
2080 ]
2081 })"},
2082
2083 // channel_verify
2084 // --------------------------------------------------------------
2085 {"channel_verify: public key.",
2086 __LINE__,
2087 {"channel_verify",
2088 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2089 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2090 "0",
2091 "DEADBEEF"},
2093 R"({
2094 "method" : "channel_verify",
2095 "params" : [
2096 {
2097 "api_version" : %API_VER%,
2098 "amount" : "0",
2099 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2100 "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2101 "signature" : "DEADBEEF"
2102 }
2103 ]
2104 })"},
2105 {"channel_verify: public key hex.",
2106 __LINE__,
2107 {"channel_verify",
2108 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2109 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2110 "18446744073709551615",
2111 "DEADBEEF"},
2113 R"({
2114 "method" : "channel_verify",
2115 "params" : [
2116 {
2117 "api_version" : %API_VER%,
2118 "amount" : "18446744073709551615",
2119 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2120 "public_key" : "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2121 "signature" : "DEADBEEF"
2122 }
2123 ]
2124 })"},
2125 {"channel_verify: too few arguments.",
2126 __LINE__,
2127 {"channel_verify",
2128 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2129 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
2131 R"({
2132 "method" : "channel_verify",
2133 "params" : [
2134 {
2135 "error" : "badSyntax",
2136 "error_code" : 1,
2137 "error_message" : "Syntax error."
2138 }
2139 ]
2140 })"},
2141 {"channel_verify: too many arguments.",
2142 __LINE__,
2143 {"channel_verify",
2144 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2145 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2146 "2000",
2147 "DEADBEEF",
2148 "Whatever"},
2150 R"({
2151 "method" : "channel_verify",
2152 "params" : [
2153 {
2154 "error" : "badSyntax",
2155 "error_code" : 1,
2156 "error_message" : "Syntax error."
2157 }
2158 ]
2159 })"},
2160 {"channel_verify: malformed public key.",
2161 __LINE__,
2162 {"channel_verify",
2163 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9GoV",
2164 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2165 "2000",
2166 "DEADBEEF"},
2168 R"({
2169 "method" : "channel_verify",
2170 "params" : [
2171 {
2172 "error" : "publicMalformed",
2173 "error_code" : 60,
2174 "error_message" : "Public key is malformed."
2175 }
2176 ]
2177 })"},
2178 {"channel_verify: malformed hex public key.",
2179 __LINE__,
2180 {"channel_verify",
2181 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F",
2182 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2183 "2000",
2184 "DEADBEEF"},
2186 R"({
2187 "method" : "channel_verify",
2188 "params" : [
2189 {
2190 "error" : "publicMalformed",
2191 "error_code" : 60,
2192 "error_message" : "Public key is malformed."
2193 }
2194 ]
2195 })"},
2196 {"channel_verify: invalid channel id.",
2197 __LINE__,
2198 {"channel_verify",
2199 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2200 "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2201 "2000",
2202 "DEADBEEF"},
2204 R"({
2205 "method" : "channel_verify",
2206 "params" : [
2207 {
2208 "error" : "channelMalformed",
2209 "error_code" : 43,
2210 "error_message" : "Payment channel is malformed."
2211 }
2212 ]
2213 })"},
2214 {"channel_verify: short channel id.",
2215 __LINE__,
2216 {"channel_verify",
2217 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2218 "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2219 "2000",
2220 "DEADBEEF"},
2222 R"({
2223 "method" : "channel_verify",
2224 "params" : [
2225 {
2226 "error" : "channelMalformed",
2227 "error_code" : 43,
2228 "error_message" : "Payment channel is malformed."
2229 }
2230 ]
2231 })"},
2232 {"channel_verify: amount too small.",
2233 __LINE__,
2234 {"channel_verify",
2235 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2236 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2237 "-1",
2238 "DEADBEEF"},
2240 R"({
2241 "method" : "channel_verify",
2242 "params" : [
2243 {
2244 "error" : "channelAmtMalformed",
2245 "error_code" : 44,
2246 "error_message" : "Payment channel amount is malformed."
2247 }
2248 ]
2249 })"},
2250 {"channel_verify: amount too large.",
2251 __LINE__,
2252 {"channel_verify",
2253 "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
2254 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2255 "18446744073709551616",
2256 "DEADBEEF"},
2258 R"({
2259 "method" : "channel_verify",
2260 "params" : [
2261 {
2262 "error" : "channelAmtMalformed",
2263 "error_code" : 44,
2264 "error_message" : "Payment channel amount is malformed."
2265 }
2266 ]
2267 })"},
2268 {"channel_verify: non-hex signature.",
2269 __LINE__,
2270 {"channel_verify",
2271 "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2272 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2273 "40000000",
2274 "ThisIsNotHexadecimal"},
2276 R"({
2277 "method" : "channel_verify",
2278 "params" : [
2279 {
2280 "api_version" : %API_VER%,
2281 "amount" : "40000000",
2282 "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
2283 "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
2284 "signature" : "ThisIsNotHexadecimal"
2285 }
2286 ]
2287 })"},
2288
2289 // connect
2290 // ---------------------------------------------------------------------
2291 {"connect: minimal.",
2292 __LINE__,
2293 {
2294 "connect",
2295 "ThereIsNoCheckingOnTheIPFormat",
2296 },
2298 R"({
2299 "method" : "connect",
2300 "params" : [
2301 {
2302 "api_version" : %API_VER%,
2303 "ip" : "ThereIsNoCheckingOnTheIPFormat"
2304 }
2305 ]
2306 })"},
2307 {"connect: ip and port.",
2308 __LINE__,
2309 {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561"},
2311 R"({
2312 "method" : "connect",
2313 "params" : [
2314 {
2315 "api_version" : %API_VER%,
2316 "ip" : "ThereIsNoCheckingOnTheIPFormat",
2317 "port" : 6561
2318 }
2319 ]
2320 })"},
2321 {"connect: too few arguments.",
2322 __LINE__,
2323 {
2324 "connect",
2325 },
2327 R"({
2328 "method" : "connect",
2329 "params" : [
2330 {
2331 "error" : "badSyntax",
2332 "error_code" : 1,
2333 "error_message" : "Syntax error."
2334 }
2335 ]
2336 })"},
2337 {"connect: too many arguments.",
2338 __LINE__,
2339 {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561", "extra"},
2341 R"({
2342 "method" : "connect",
2343 "params" : [
2344 {
2345 "error" : "badSyntax",
2346 "error_code" : 1,
2347 "error_message" : "Syntax error."
2348 }
2349 ]
2350 })"},
2351 {// Note: this should return an error but not throw.
2352 "connect: port too small.",
2353 __LINE__,
2354 {
2355 "connect",
2356 "ThereIsNoCheckingOnTheIPFormat",
2357 "-1",
2358 },
2360 R"()"},
2361 {// Note: this should return an error but not throw.
2362 "connect: port too large.",
2363 __LINE__,
2364 {
2365 "connect",
2366 "ThereIsNoCheckingOnTheIPFormat",
2367 "4294967296",
2368 },
2370 R"()"},
2371
2372 // consensus_info
2373 // --------------------------------------------------------------
2374 {"consensus_info: minimal.",
2375 __LINE__,
2376 {
2377 "consensus_info",
2378 },
2380 R"({
2381 "method" : "consensus_info",
2382 "params" : [
2383 {
2384 "api_version" : %API_VER%
2385 }
2386 ]
2387 })"},
2388 {"consensus_info: too many arguments.",
2389 __LINE__,
2390 {"consensus_info", "whatever"},
2392 R"({
2393 "method" : "consensus_info",
2394 "params" : [
2395 {
2396 "error" : "badSyntax",
2397 "error_code" : 1,
2398 "error_message" : "Syntax error."
2399 }
2400 ]
2401 })"},
2402
2403 // deposit_authorized
2404 // ----------------------------------------------------------
2405 {"deposit_authorized: minimal.",
2406 __LINE__,
2407 {
2408 "deposit_authorized",
2409 "source_account_NotValidated",
2410 "destination_account_NotValidated",
2411 },
2413 R"({
2414 "method" : "deposit_authorized",
2415 "params" : [
2416 {
2417 "api_version" : %API_VER%,
2418 "destination_account" : "destination_account_NotValidated",
2419 "source_account" : "source_account_NotValidated"
2420 }
2421 ]
2422 })"},
2423 {"deposit_authorized: with text ledger index.",
2424 __LINE__,
2425 {"deposit_authorized",
2426 "source_account_NotValidated",
2427 "destination_account_NotValidated",
2428 "validated"},
2430 R"({
2431 "method" : "deposit_authorized",
2432 "params" : [
2433 {
2434 "api_version" : %API_VER%,
2435 "destination_account" : "destination_account_NotValidated",
2436 "ledger_index" : "validated",
2437 "source_account" : "source_account_NotValidated"
2438 }
2439 ]
2440 })"},
2441 {"deposit_authorized: with ledger index.",
2442 __LINE__,
2443 {"deposit_authorized",
2444 "source_account_NotValidated",
2445 "destination_account_NotValidated",
2446 "4294967295",
2447 "cred1",
2448 "cred2",
2449 "cred3",
2450 "cred4",
2451 "cred5",
2452 "cred6",
2453 "cred7",
2454 "cred8"},
2456 R"({
2457 "method" : "deposit_authorized",
2458 "params" : [
2459 {
2460 "api_version" : %API_VER%,
2461 "destination_account" : "destination_account_NotValidated",
2462 "ledger_index" : 4294967295,
2463 "source_account" : "source_account_NotValidated",
2464 "credentials": ["cred1", "cred2", "cred3", "cred4", "cred5", "cred6", "cred7", "cred8"]
2465 }
2466 ]
2467 })"},
2468 {"deposit_authorized: with ledger hash.",
2469 __LINE__,
2470 {"deposit_authorized",
2471 "source_account_NotValidated",
2472 "destination_account_NotValidated",
2473 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
2475 R"({
2476 "method" : "deposit_authorized",
2477 "params" : [
2478 {
2479 "api_version" : %API_VER%,
2480 "destination_account" : "destination_account_NotValidated",
2481 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
2482 "source_account" : "source_account_NotValidated"
2483 }
2484 ]
2485 })"},
2486 {"deposit_authorized: too few arguments.",
2487 __LINE__,
2488 {
2489 "deposit_authorized",
2490 "source_account_NotValidated",
2491 },
2493 R"({
2494 "method" : "deposit_authorized",
2495 "params" : [
2496 {
2497 "error" : "badSyntax",
2498 "error_code" : 1,
2499 "error_message" : "Syntax error."
2500 }
2501 ]
2502 })"},
2503 {"deposit_authorized: too many arguments.",
2504 __LINE__,
2505 {"deposit_authorized",
2506 "source_account_NotValidated",
2507 "destination_account_NotValidated",
2508 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
2509 "cred1",
2510 "cred2",
2511 "cred3",
2512 "cred4",
2513 "cred5",
2514 "cred6",
2515 "cred7",
2516 "cred8",
2517 "too_much"},
2519 R"({
2520 "method" : "deposit_authorized",
2521 "params" : [
2522 {
2523 "error" : "badSyntax",
2524 "error_code" : 1,
2525 "error_message" : "Syntax error."
2526 }
2527 ]
2528 })"},
2529 {"deposit_authorized: invalid ledger selection.",
2530 __LINE__,
2531 {
2532 "deposit_authorized",
2533 "source_account_NotValidated",
2534 "destination_account_NotValidated",
2535 "NotALedger",
2536 },
2538 R"({
2539 "method" : "deposit_authorized",
2540 "params" : [
2541 {
2542 "api_version" : %API_VER%,
2543 "destination_account" : "destination_account_NotValidated",
2544 "ledger_index" : 0,
2545 "source_account" : "source_account_NotValidated"
2546 }
2547 ]
2548 })"},
2549
2550 // feature
2551 // ---------------------------------------------------------------------
2552 {"feature: minimal.",
2553 __LINE__,
2554 {
2555 "feature",
2556 },
2558 R"({
2559 "method" : "feature",
2560 "params" : [
2561 {
2562 "api_version" : %API_VER%,
2563 }
2564 ]
2565 })"},
2566 {"feature: with name.",
2567 __LINE__,
2568 {"feature", "featureNameOrHexIsNotValidated"},
2570 R"({
2571 "method" : "feature",
2572 "params" : [
2573 {
2574 "api_version" : %API_VER%,
2575 "feature" : "featureNameOrHexIsNotValidated"
2576 }
2577 ]
2578 })"},
2579 {"feature: accept.",
2580 __LINE__,
2581 {"feature",
2582 "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA98"
2583 "76543210",
2584 "accept"},
2586 R"({
2587 "method" : "feature",
2588 "params" : [
2589 {
2590 "api_version" : %API_VER%,
2591 "feature" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
2592 "vetoed" : false
2593 }
2594 ]
2595 })"},
2596 {"feature: reject.",
2597 __LINE__,
2598 {"feature", "0", "reject"},
2600 R"({
2601 "method" : "feature",
2602 "params" : [
2603 {
2604 "api_version" : %API_VER%,
2605 "feature" : "0",
2606 "vetoed" : true
2607 }
2608 ]
2609 })"},
2610 {"feature: too many arguments.",
2611 __LINE__,
2612 {"feature", "featureNameOrHexIsNotValidated", "accept", "anotherArg"},
2614 R"({
2615 "method" : "feature",
2616 "params" : [
2617 {
2618 "error" : "badSyntax",
2619 "error_code" : 1,
2620 "error_message" : "Syntax error."
2621 }
2622 ]
2623 })"},
2624 {"feature: neither accept nor reject.",
2625 __LINE__,
2626 {
2627 "feature",
2628 "featureNameOrHexIsNotValidated",
2629 "veto",
2630 },
2632 R"({
2633 "method" : "feature",
2634 "params" : [
2635 {
2636 "error" : "invalidParams",
2637 "error_code" : 31,
2638 "error_message" : "Invalid parameters."
2639 }
2640 ]
2641 })"},
2642
2643 // fetch_info
2644 // ------------------------------------------------------------------
2645 {"fetch_info: minimal.",
2646 __LINE__,
2647 {
2648 "fetch_info",
2649 },
2651 R"({
2652 "method" : "fetch_info",
2653 "params" : [
2654 {
2655 "api_version" : %API_VER%,
2656 }
2657 ]
2658 })"},
2659 {"fetch_info: clear.",
2660 __LINE__,
2661 {"fetch_info", "clear"},
2663 R"({
2664 "method" : "fetch_info",
2665 "params" : [
2666 {
2667 "api_version" : %API_VER%,
2668 "clear" : true
2669 }
2670 ]
2671 })"},
2672 {"fetch_info: too many arguments.",
2673 __LINE__,
2674 {"fetch_info", "clear", "other"},
2676 R"({
2677 "method" : "fetch_info",
2678 "params" : [
2679 {
2680 "error" : "badSyntax",
2681 "error_code" : 1,
2682 "error_message" : "Syntax error."
2683 }
2684 ]
2685 })"},
2686 {"fetch_info: other trailing argument.",
2687 __LINE__,
2688 {"fetch_info", "too"},
2690 R"({
2691 "method" : "fetch_info",
2692 "params" : [
2693 {
2694 "api_version" : %API_VER%,
2695 "too" : true
2696 }
2697 ]
2698 })"},
2699
2700 // gateway_balances
2701 // ------------------------------------------------------------
2702 {"gateway_balances: minimal.",
2703 __LINE__,
2704 {"gateway_balances", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2706 R"({
2707 "method" : "gateway_balances",
2708 "params" : [
2709 {
2710 "api_version" : %API_VER%,
2711 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2712 }
2713 ]
2714 })"},
2715 {"gateway_balances: with ledger index.",
2716 __LINE__,
2717 {"gateway_balances", "890765", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2719 R"({
2720 "method" : "gateway_balances",
2721 "params" : [
2722 {
2723 "api_version" : %API_VER%,
2724 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2725 "ledger_index" : "890765"
2726 }
2727 ]
2728 })"},
2729 {"gateway_balances: with text ledger index.",
2730 __LINE__,
2731 {"gateway_balances", "current", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2733 R"({
2734 "method" : "gateway_balances",
2735 "params" : [
2736 {
2737 "api_version" : %API_VER%,
2738 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2739 "ledger_index" : "current"
2740 }
2741 ]
2742 })"},
2743 {"gateway_balances: with 64 character ledger hash.",
2744 __LINE__,
2745 {"gateway_balances",
2746 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2747 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
2749 R"({
2750 "method" : "gateway_balances",
2751 "params" : [
2752 {
2753 "api_version" : %API_VER%,
2754 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2755 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
2756 }
2757 ]
2758 })"},
2759 {"gateway_balances: 1 hotwallet.",
2760 __LINE__,
2761 {"gateway_balances",
2762 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2763 "hotwallet_is_not_validated"},
2765 R"({
2766 "method" : "gateway_balances",
2767 "params" : [
2768 {
2769 "api_version" : %API_VER%,
2770 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2771 "hotwallet" : [ "hotwallet_is_not_validated" ]
2772 }
2773 ]
2774 })"},
2775 {"gateway_balances: 3 hotwallets.",
2776 __LINE__,
2777 {
2778 "gateway_balances",
2779 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2780 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2781 "hotwallet_is_not_validated_1",
2782 "hotwallet_is_not_validated_2",
2783 "hotwallet_is_not_validated_3",
2784 },
2786 R"({
2787 "method" : "gateway_balances",
2788 "params" : [
2789 {
2790 "api_version" : %API_VER%,
2791 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2792 "hotwallet" : [
2793 "hotwallet_is_not_validated_1",
2794 "hotwallet_is_not_validated_2",
2795 "hotwallet_is_not_validated_3"
2796 ],
2797 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
2798 }
2799 ]
2800 })"},
2801 {"gateway_balances: too few arguments.",
2802 __LINE__,
2803 {
2804 "gateway_balances",
2805 },
2807 R"({
2808 "method" : "gateway_balances",
2809 "params" : [
2810 {
2811 "error" : "badSyntax",
2812 "error_code" : 1,
2813 "error_message" : "Syntax error."
2814 }
2815 ]
2816 })"},
2817 {"gateway_balances: empty first argument.",
2818 __LINE__,
2819 {"gateway_balances", ""},
2821 R"({
2822 "method" : "gateway_balances",
2823 "params" : [
2824 {
2825 "error" : "invalidParams",
2826 "error_code" : 31,
2827 "error_message" : "Invalid first parameter"
2828 }
2829 ]
2830 })"},
2831 {"gateway_balances: with ledger index but no gateway.",
2832 __LINE__,
2833 {
2834 "gateway_balances",
2835 "890765",
2836 },
2838 R"({
2839 "method" : "gateway_balances",
2840 "params" : [
2841 {
2842 "error" : "invalidParams",
2843 "error_code" : 31,
2844 "error_message" : "Invalid hotwallet"
2845 }
2846 ]
2847 })"},
2848 {"gateway_balances: with text ledger index but no gateway.",
2849 __LINE__,
2850 {
2851 "gateway_balances",
2852 "current",
2853 },
2855 R"({
2856 "method" : "gateway_balances",
2857 "params" : [
2858 {
2859 "error" : "invalidParams",
2860 "error_code" : 31,
2861 "error_message" : "Invalid hotwallet"
2862 }
2863 ]
2864 })"},
2865 {"gateway_balances: with 64 character ledger hash but no gateway.",
2866 __LINE__,
2867 {
2868 "gateway_balances",
2869 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
2870 },
2872 R"({
2873 "method" : "gateway_balances",
2874 "params" : [
2875 {
2876 "error" : "invalidParams",
2877 "error_code" : 31,
2878 "error_message" : "Invalid hotwallet"
2879 }
2880 ]
2881 })"},
2882
2883 // get_counts
2884 // ------------------------------------------------------------------
2885 {"get_counts: minimal.",
2886 __LINE__,
2887 {
2888 "get_counts",
2889 },
2891 R"({
2892 "method" : "get_counts",
2893 "params" : [
2894 {
2895 "api_version" : %API_VER%,
2896 }
2897 ]
2898 })"},
2899 {"get_counts: with maximum count.",
2900 __LINE__,
2901 {"get_counts", "100"},
2903 R"({
2904 "method" : "get_counts",
2905 "params" : [
2906 {
2907 "api_version" : %API_VER%,
2908 "min_count" : 100
2909 }
2910 ]
2911 })"},
2912 {"get_counts: too many arguments.",
2913 __LINE__,
2914 {"get_counts", "100", "whatever"},
2916 R"({
2917 "method" : "get_counts",
2918 "params" : [
2919 {
2920 "error" : "badSyntax",
2921 "error_code" : 1,
2922 "error_message" : "Syntax error."
2923 }
2924 ]
2925 })"},
2926 {"get_counts: count too small.",
2927 __LINE__,
2928 {
2929 "get_counts",
2930 "-1",
2931 },
2933 R"()"},
2934 {"get_counts: count too large.",
2935 __LINE__,
2936 {"get_counts", "4294967296"},
2938 R"()"},
2939
2940 // json
2941 // ------------------------------------------------------------------------
2942 {"json: minimal.",
2943 __LINE__,
2944 {
2945 "json",
2946 "command",
2947 R"({"json_argument":true})",
2948 },
2950 R"({
2951 "method" : "command",
2952 "params" : [
2953 {
2954 "api_version" : %API_VER%,
2955 "json_argument" : true,
2956 "method" : "command"
2957 }
2958 ]
2959 })"},
2960 {"json: null object.",
2961 __LINE__,
2962 {
2963 "json",
2964 "command",
2965 R"({})",
2966 },
2968 R"({
2969 "method" : "command",
2970 "params" : [
2971 {
2972 "api_version" : %API_VER%,
2973 "method" : "command"
2974 }
2975 ]
2976 })"},
2977 {"json: too few arguments.",
2978 __LINE__,
2979 {"json", "command"},
2981 R"({
2982 "method" : "json",
2983 "params" : [
2984 {
2985 "error" : "badSyntax",
2986 "error_code" : 1,
2987 "error_message" : "Syntax error."
2988 }
2989 ]
2990 })"},
2991 {"json: too many arguments.",
2992 __LINE__,
2993 {"json", "command", R"({"json_argument":true})", "extra"},
2995 R"({
2996 "method" : "json",
2997 "params" : [
2998 {
2999 "error" : "badSyntax",
3000 "error_code" : 1,
3001 "error_message" : "Syntax error."
3002 }
3003 ]
3004 })"},
3005 {"json: array, not object.",
3006 __LINE__,
3007 {
3008 "json",
3009 "command",
3010 R"(["arg1","arg2"])",
3011 },
3013 R"({
3014 "method" : "json",
3015 "params" : [
3016 {
3017 "error" : "invalidParams",
3018 "error_code" : 31,
3019 "error_message" : "Invalid parameters."
3020 }
3021 ]
3022 })"},
3023 {"json: invalid json (note closing comma).",
3024 __LINE__,
3025 {
3026 "json",
3027 "command",
3028 R"({"json_argument":true,})",
3029 },
3031 R"({
3032 "method" : "json",
3033 "params" : [
3034 {
3035 "error" : "invalidParams",
3036 "error_code" : 31,
3037 "error_message" : "Invalid parameters."
3038 }
3039 ]
3040 })"},
3041
3042 // json2
3043 // -----------------------------------------------------------------------
3044 {"json2: minimal object.",
3045 __LINE__,
3046 {
3047 "json2",
3048 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"})",
3049 },
3051 R"({
3052 "id" : "A1",
3053 "jsonrpc" : "2.0",
3054 "method" : "call_1",
3055 "params" : [
3056 {
3057 "api_version" : %API_VER%,
3058 "id" : "A1",
3059 "jsonrpc" : "2.0",
3060 "method" : "call_1",
3061 "ripplerpc" : "2.0"
3062 }
3063 ],
3064 "ripplerpc" : "2.0"
3065 })"},
3066 {"json2: object with nested params.",
3067 __LINE__,
3068 {
3069 "json2",
3070 R"({
3071 "jsonrpc" : "2.0",
3072 "ripplerpc" : "2.0",
3073 "id" : "A1",
3074 "method" : "call_1",
3075 "params" : [{"inner_arg" : "yup"}]
3076 })",
3077 },
3079 R"({
3080 "id" : "A1",
3081 "jsonrpc" : "2.0",
3082 "method" : "call_1",
3083 "params" : [
3084 {
3085 "api_version" : %API_VER%,
3086 "0" : {
3087 "inner_arg" : "yup"
3088 },
3089 "id" : "A1",
3090 "jsonrpc" : "2.0",
3091 "method" : "call_1",
3092 "ripplerpc" : "2.0"
3093 }
3094 ],
3095 "ripplerpc" : "2.0"
3096 })"},
3097 {"json2: minimal array.",
3098 __LINE__,
3099 {
3100 "json2",
3101 R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"}])",
3102 },
3104 R"({
3105 "method" : "json2",
3106 "params" : [
3107 [
3108 {
3109 "api_version" : %API_VER%,
3110 "id" : "A1",
3111 "jsonrpc" : "2.0",
3112 "method" : "call_1",
3113 "ripplerpc" : "2.0"
3114 }
3115 ]
3116 ]
3117 })"},
3118 {"json2: array with object with nested params.",
3119 __LINE__,
3120 {
3121 "json2",
3122 R"([
3123 {"jsonrpc":"2.0",
3124 "ripplerpc":"2.0",
3125 "id":"A1",
3126 "method":"call_1",
3127 "params" : [{"inner_arg" : "yup"}]}
3128 ])",
3129 },
3131 R"({
3132 "method" : "json2",
3133 "params" : [
3134 [
3135 {
3136 "api_version" : %API_VER%,
3137 "0" : {
3138 "inner_arg" : "yup"
3139 },
3140 "id" : "A1",
3141 "jsonrpc" : "2.0",
3142 "method" : "call_1",
3143 "ripplerpc" : "2.0"
3144 }
3145 ]
3146 ]})"},
3147 {"json2: too few arguments.",
3148 __LINE__,
3149 {
3150 "json2",
3151 },
3153 R"({
3154 "method" : "json2",
3155 "params" : [
3156 {
3157 "error" : "badSyntax",
3158 "error_code" : 1,
3159 "error_message" : "Syntax error."
3160 }
3161 ]
3162 })"},
3163 {"json2: too many arguments.",
3164 __LINE__,
3165 {"json2",
3166 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_this"})",
3167 "extra"},
3169 R"({
3170 "method" : "json2",
3171 "params" : [
3172 {
3173 "error" : "badSyntax",
3174 "error_code" : 1,
3175 "error_message" : "Syntax error."
3176 }
3177 ]
3178 })"},
3179 {"json2: malformed json (note extra comma).",
3180 __LINE__,
3181 {
3182 "json2",
3183 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",})",
3184 },
3186 R"({
3187 "id" : "A1",
3188 "jsonrpc" : "2.0",
3189 "method" : "json2",
3190 "params" : [
3191 {
3192 "error" : "invalidParams",
3193 "error_code" : 31,
3194 "error_message" : "Invalid parameters.",
3195 "id" : "A1",
3196 "jsonrpc" : "2.0",
3197 "ripplerpc" : "2.0"
3198 }
3199 ],
3200 "ripplerpc" : "2.0"
3201 })"},
3202 {"json2: omit jsonrpc.",
3203 __LINE__,
3204 {
3205 "json2",
3206 R"({"ripplerpc":"2.0","id":"A1","method":"call_1"})",
3207 },
3209 R"({
3210 "id" : "A1",
3211 "method" : "json2",
3212 "params" : [
3213 {
3214 "error" : "invalidParams",
3215 "error_code" : 31,
3216 "error_message" : "Invalid parameters.",
3217 "id" : "A1",
3218 "ripplerpc" : "2.0"
3219 }
3220 ],
3221 "ripplerpc" : "2.0"
3222 })"},
3223 {"json2: wrong jsonrpc version.",
3224 __LINE__,
3225 {
3226 "json2",
3227 R"({"jsonrpc":"2.1","ripplerpc":"2.0","id":"A1","method":"call_1"})",
3228 },
3230 R"({
3231 "id" : "A1",
3232 "jsonrpc" : "2.1",
3233 "method" : "json2",
3234 "params" : [
3235 {
3236 "error" : "invalidParams",
3237 "error_code" : 31,
3238 "error_message" : "Invalid parameters.",
3239 "id" : "A1",
3240 "jsonrpc" : "2.1",
3241 "ripplerpc" : "2.0"
3242 }
3243 ],
3244 "ripplerpc" : "2.0"
3245 })"},
3246 {"json2: omit ripplerpc.",
3247 __LINE__,
3248 {
3249 "json2",
3250 R"({"jsonrpc":"2.0","id":"A1","method":"call_1"})",
3251 },
3253 R"({
3254 "id" : "A1",
3255 "jsonrpc" : "2.0",
3256 "method" : "json2",
3257 "params" : [
3258 {
3259 "error" : "invalidParams",
3260 "error_code" : 31,
3261 "error_message" : "Invalid parameters.",
3262 "id" : "A1",
3263 "jsonrpc" : "2.0"
3264 }
3265 ]
3266 })"},
3267 {"json2: wrong ripplerpc version.",
3268 __LINE__,
3269 {
3270 "json2",
3271 R"({"jsonrpc":"2.0","ripplerpc":"2.00","id":"A1","method":"call_1"})",
3272 },
3274 R"({
3275 "id" : "A1",
3276 "jsonrpc" : "2.0",
3277 "method" : "json2",
3278 "params" : [
3279 {
3280 "error" : "invalidParams",
3281 "error_code" : 31,
3282 "error_message" : "Invalid parameters.",
3283 "id" : "A1",
3284 "jsonrpc" : "2.0",
3285 "ripplerpc" : "2.00"
3286 }
3287 ],
3288 "ripplerpc" : "2.00"
3289 })"},
3290 {"json2: omit id.",
3291 __LINE__,
3292 {
3293 "json2",
3294 R"({"jsonrpc":"2.0","ripplerpc":"2.0","method":"call_1"})",
3295 },
3297 R"({
3298 "jsonrpc" : "2.0",
3299 "method" : "json2",
3300 "params" : [
3301 {
3302 "error" : "invalidParams",
3303 "error_code" : 31,
3304 "error_message" : "Invalid parameters.",
3305 "jsonrpc" : "2.0",
3306 "ripplerpc" : "2.0"
3307 }
3308 ],
3309 "ripplerpc" : "2.0"
3310 })"},
3311 {"json2: omit method.",
3312 __LINE__,
3313 {
3314 "json2",
3315 R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1"})",
3316 },
3318 R"({
3319 "id" : "A1",
3320 "jsonrpc" : "2.0",
3321 "method" : "json2",
3322 "params" : [
3323 {
3324 "error" : "invalidParams",
3325 "error_code" : 31,
3326 "error_message" : "Invalid parameters.",
3327 "id" : "A1",
3328 "jsonrpc" : "2.0",
3329 "ripplerpc" : "2.0"
3330 }
3331 ],
3332 "ripplerpc" : "2.0"
3333 })"},
3334 {"json2: empty outer array.",
3335 __LINE__,
3336 {
3337 "json2",
3338 R"([])",
3339 },
3341 R"({
3342 "method" : "json2",
3343 "params" : [
3344 {
3345 "error" : "invalidParams",
3346 "error_code" : 31,
3347 "error_message" : "Invalid parameters."
3348 }
3349 ]
3350 })"},
3351 {"json2: empty inner array.",
3352 __LINE__,
3353 {
3354 "json2",
3355 R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",[]}])",
3356 },
3358 R"({
3359 "method" : "json2",
3360 "params" : [
3361 {
3362 "error" : "invalidParams",
3363 "error_code" : 31,
3364 "error_message" : "Invalid parameters."
3365 }
3366 ]
3367 })"},
3368 {"json2: array with non-json2 object.",
3369 __LINE__,
3370 {
3371 "json2",
3372 R"([
3373 {"jsonrpc" : "2.1",
3374 "ripplerpc" : "2.0",
3375 "id" : "A1",
3376 "method" : "call_1"
3377 }
3378 ])",
3379 },
3381 R"({
3382 "method" : "json2",
3383 "params" : [
3384 {
3385 "error" : "invalidParams",
3386 "error_code" : 31,
3387 "error_message" : "Invalid parameters."
3388 }
3389 ]
3390 })"},
3391 {"json2: non-object or -array inner params member.",
3392 __LINE__,
3393 {
3394 "json2",
3395 R"({
3396 "jsonrpc" : "2.0",
3397 "ripplerpc" : "2.0",
3398 "id" : "A1",
3399 "method" : "call_1",
3400 "params" : true
3401 })",
3402 },
3404 R"({
3405 "id" : "A1",
3406 "jsonrpc" : "2.0",
3407 "method" : "json2",
3408 "params" : [
3409 {
3410 "error" : "invalidParams",
3411 "error_code" : 31,
3412 "error_message" : "Invalid parameters.",
3413 "id" : "A1",
3414 "jsonrpc" : "2.0",
3415 "ripplerpc" : "2.0"
3416 }
3417 ],
3418 "ripplerpc" : "2.0"
3419 })"},
3420
3421 // ledger
3422 // ----------------------------------------------------------------------
3423 {"ledger: minimal.",
3424 __LINE__,
3425 {"ledger"},
3427 R"({
3428 "method" : "ledger",
3429 "params" : [
3430 {
3431 "api_version" : %API_VER%,
3432 }
3433 ]
3434 })"},
3435 {"ledger: ledger index.",
3436 __LINE__,
3437 {"ledger", "4294967295"},
3439 R"({
3440 "method" : "ledger",
3441 "params" : [
3442 {
3443 "api_version" : %API_VER%,
3444 "ledger_index" : 4294967295
3445 }
3446 ]
3447 })"},
3448 {"ledger: text ledger index.",
3449 __LINE__,
3450 {"ledger", "validated"},
3452 R"({
3453 "method" : "ledger",
3454 "params" : [
3455 {
3456 "api_version" : %API_VER%,
3457 "ledger_index" : "validated"
3458 }
3459 ]
3460 })"},
3461 {"ledger: ledger hash.",
3462 __LINE__,
3463 {"ledger",
3464 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3466 R"({
3467 "method" : "ledger",
3468 "params" : [
3469 {
3470 "api_version" : %API_VER%,
3471 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3472 }
3473 ]
3474 })"},
3475 {"ledger: full.",
3476 __LINE__,
3477 {"ledger", "current", "full"},
3479 R"({
3480 "method" : "ledger",
3481 "params" : [
3482 {
3483 "api_version" : %API_VER%,
3484 "full" : true,
3485 "ledger_index" : "current"
3486 }
3487 ]
3488 })"},
3489 {"ledger: tx.",
3490 __LINE__,
3491 {"ledger", "closed", "tx"},
3493 R"({
3494 "method" : "ledger",
3495 "params" : [
3496 {
3497 "api_version" : %API_VER%,
3498 "expand" : true,
3499 "ledger_index" : "closed",
3500 "transactions" : true
3501 }
3502 ]
3503 })"},
3504 {"ledger: too many arguments.",
3505 __LINE__,
3506 {"ledger", "4294967295", "spare"},
3508 R"({
3509 "method" : "ledger",
3510 "params" : [
3511 {
3512 "api_version" : %API_VER%,
3513 "ledger_index" : 4294967295
3514 }
3515 ]
3516 })"},
3517 {"ledger: ledger index too small.",
3518 __LINE__,
3519 {"ledger", "-1"},
3521 R"({
3522 "method" : "ledger",
3523 "params" : [
3524 {
3525 "api_version" : %API_VER%,
3526 "ledger_index" : 0
3527 }
3528 ]
3529 })"},
3530 {"ledger: ledger index too big.",
3531 __LINE__,
3532 {"ledger", "4294967296"},
3534 R"({
3535 "method" : "ledger",
3536 "params" : [
3537 {
3538 "api_version" : %API_VER%,
3539 "ledger_index" : 0
3540 }
3541 ]
3542 })"},
3543 {"ledger: invalid ledger text.",
3544 __LINE__,
3545 {"ledger", "latest"},
3547 R"({
3548 "method" : "ledger",
3549 "params" : [
3550 {
3551 "api_version" : %API_VER%,
3552 "ledger_index" : 0
3553 }
3554 ]
3555 })"},
3556 {"ledger: unsupported final argument.",
3557 __LINE__,
3558 {"ledger", "current", "expand"},
3560 R"({
3561 "method" : "ledger",
3562 "params" : [
3563 {
3564 "api_version" : %API_VER%,
3565 "ledger_index" : "current"
3566 }
3567 ]
3568 })"},
3569
3570 // ledger_closed
3571 // ---------------------------------------------------------------
3572 {"ledger_closed: minimal.",
3573 __LINE__,
3574 {"ledger_closed"},
3576 R"({
3577 "method" : "ledger_closed",
3578 "params" : [
3579 {
3580 "api_version" : %API_VER%,
3581 }
3582 ]
3583 })"},
3584 {"ledger_closed: too many arguments.",
3585 __LINE__,
3586 {"ledger_closed", "today"},
3588 R"({
3589 "method" : "ledger_closed",
3590 "params" : [
3591 {
3592 "error" : "badSyntax",
3593 "error_code" : 1,
3594 "error_message" : "Syntax error."
3595 }
3596 ]
3597 })"},
3598
3599 // ledger_current
3600 // --------------------------------------------------------------
3601 {"ledger_current: minimal.",
3602 __LINE__,
3603 {"ledger_current"},
3605 R"({
3606 "method" : "ledger_current",
3607 "params" : [
3608 {
3609 "api_version" : %API_VER%,
3610 }
3611 ]
3612 })"},
3613 {"ledger_current: too many arguments.",
3614 __LINE__,
3615 {"ledger_current", "today"},
3617 R"({
3618 "method" : "ledger_current",
3619 "params" : [
3620 {
3621 "error" : "badSyntax",
3622 "error_code" : 1,
3623 "error_message" : "Syntax error."
3624 }
3625 ]
3626 })"},
3627
3628 // ledger_header
3629 // ---------------------------------------------------------------
3630 {"ledger_header: ledger index.",
3631 __LINE__,
3632 {"ledger_header", "4294967295"},
3634 R"({
3635 "method" : "ledger_header",
3636 "params" : [
3637 {
3638 "api_version" : %API_VER%,
3639 "ledger_index" : 4294967295
3640 }
3641 ]
3642 })"},
3643 {"ledger_header: ledger hash.",
3644 __LINE__,
3645 {"ledger_header",
3646 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3648 R"({
3649 "method" : "ledger_header",
3650 "params" : [
3651 {
3652 "api_version" : %API_VER%,
3653 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3654 }
3655 ]
3656 })"},
3657 {"ledger_header: too few arguments.",
3658 __LINE__,
3659 {
3660 "ledger_header",
3661 },
3663 R"({
3664 "method" : "ledger_header",
3665 "params" : [
3666 {
3667 "error" : "badSyntax",
3668 "error_code" : 1,
3669 "error_message" : "Syntax error."
3670 }
3671 ]
3672 })"},
3673 {"ledger_header: too many arguments.",
3674 __LINE__,
3675 {"ledger_header", "4294967295", "spare"},
3677 R"({
3678 "method" : "ledger_header",
3679 "params" : [
3680 {
3681 "error" : "badSyntax",
3682 "error_code" : 1,
3683 "error_message" : "Syntax error."
3684 }
3685 ]
3686 })"},
3687 {"ledger_header: text ledger index.",
3688 __LINE__,
3689 {"ledger_header", "current"},
3691 R"({
3692 "method" : "ledger_header",
3693 "params" : [
3694 {
3695 "api_version" : %API_VER%,
3696 "ledger_index" : 0
3697 }
3698 ]
3699 })"},
3700 {"ledger_header: ledger index too small.",
3701 __LINE__,
3702 {"ledger_header", "-1"},
3704 R"({
3705 "method" : "ledger_header",
3706 "params" : [
3707 {
3708 "api_version" : %API_VER%,
3709 "ledger_index" : 0
3710 }
3711 ]
3712 })"},
3713 {"ledger_header: ledger index too big.",
3714 __LINE__,
3715 {"ledger_header", "4294967296"},
3717 R"({
3718 "method" : "ledger_header",
3719 "params" : [
3720 {
3721 "api_version" : %API_VER%,
3722 "ledger_index" : 0
3723 }
3724 ]
3725 })"},
3726
3727 // ledger_request
3728 // --------------------------------------------------------------
3729 {"ledger_request: ledger index.",
3730 __LINE__,
3731 {"ledger_request", "4294967295"},
3733 R"({
3734 "method" : "ledger_request",
3735 "params" : [
3736 {
3737 "api_version" : %API_VER%,
3738 "ledger_index" : 4294967295
3739 }
3740 ]
3741 })"},
3742 {"ledger_request: ledger hash.",
3743 __LINE__,
3744 {"ledger_request",
3745 "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
3747 R"({
3748 "method" : "ledger_request",
3749 "params" : [
3750 {
3751 "api_version" : %API_VER%,
3752 "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
3753 }
3754 ]
3755 })"},
3756 {"ledger_request: too few arguments.",
3757 __LINE__,
3758 {
3759 "ledger_request",
3760 },
3762 R"({
3763 "method" : "ledger_request",
3764 "params" : [
3765 {
3766 "error" : "badSyntax",
3767 "error_code" : 1,
3768 "error_message" : "Syntax error."
3769 }
3770 ]
3771 })"},
3772 {"ledger_request: too many arguments.",
3773 __LINE__,
3774 {"ledger_request", "4294967295", "spare"},
3776 R"({
3777 "method" : "ledger_request",
3778 "params" : [
3779 {
3780 "error" : "badSyntax",
3781 "error_code" : 1,
3782 "error_message" : "Syntax error."
3783 }
3784 ]
3785 })"},
3786 {"ledger_request: text ledger index.",
3787 __LINE__,
3788 {"ledger_request", "current"},
3790 R"({
3791 "method" : "ledger_request",
3792 "params" : [
3793 {
3794 "api_version" : %API_VER%,
3795 "ledger_index" : 0
3796 }
3797 ]
3798 })"},
3799 {"ledger_request: ledger index too small.",
3800 __LINE__,
3801 {"ledger_request", "-1"},
3803 R"({
3804 "method" : "ledger_request",
3805 "params" : [
3806 {
3807 "api_version" : %API_VER%,
3808 "ledger_index" : 0
3809 }
3810 ]
3811 })"},
3812 {"ledger_request: ledger index too big.",
3813 __LINE__,
3814 {"ledger_request", "4294967296"},
3816 R"({
3817 "method" : "ledger_request",
3818 "params" : [
3819 {
3820 "api_version" : %API_VER%,
3821 "ledger_index" : 0
3822 }
3823 ]
3824 })"},
3825
3826 // log_level
3827 // -------------------------------------------------------------------
3828 {"log_level: minimal.",
3829 __LINE__,
3830 {
3831 "log_level",
3832 },
3834 R"({
3835 "method" : "log_level",
3836 "params" : [
3837 {
3838 "api_version" : %API_VER%,
3839 }
3840 ]
3841 })"},
3842 {"log_level: fatal.",
3843 __LINE__,
3844 {"log_level", "fatal"},
3846 R"({
3847 "method" : "log_level",
3848 "params" : [
3849 {
3850 "api_version" : %API_VER%,
3851 "severity" : "fatal"
3852 }
3853 ]
3854 })"},
3855 {"log_level: error.",
3856 __LINE__,
3857 {"log_level", "error"},
3859 R"({
3860 "method" : "log_level",
3861 "params" : [
3862 {
3863 "api_version" : %API_VER%,
3864 "severity" : "error"
3865 }
3866 ]
3867 })"},
3868 {"log_level: warn.",
3869 __LINE__,
3870 {"log_level", "warn"},
3872 R"({
3873 "method" : "log_level",
3874 "params" : [
3875 {
3876 "api_version" : %API_VER%,
3877 "severity" : "warn"
3878 }
3879 ]
3880 })"},
3881 {"log_level: debug.",
3882 __LINE__,
3883 {"log_level", "debug"},
3885 R"({
3886 "method" : "log_level",
3887 "params" : [
3888 {
3889 "api_version" : %API_VER%,
3890 "severity" : "debug"
3891 }
3892 ]
3893 })"},
3894 {"log_level: trace.",
3895 __LINE__,
3896 {"log_level", "trace"},
3898 R"({
3899 "method" : "log_level",
3900 "params" : [
3901 {
3902 "api_version" : %API_VER%,
3903 "severity" : "trace"
3904 }
3905 ]
3906 })"},
3907 {"log_level: base partition.",
3908 __LINE__,
3909 {"log_level", "base", "trace"},
3911 R"({
3912 "method" : "log_level",
3913 "params" : [
3914 {
3915 "api_version" : %API_VER%,
3916 "partition" : "base",
3917 "severity" : "trace"
3918 }
3919 ]
3920 })"},
3921 {"log_level: partiton_name.",
3922 __LINE__,
3923 {"log_level", "partition_name", "fatal"},
3925 R"({
3926 "method" : "log_level",
3927 "params" : [
3928 {
3929 "api_version" : %API_VER%,
3930 "partition" : "partition_name",
3931 "severity" : "fatal"
3932 }
3933 ]
3934 })"},
3935 {"log_level: too many arguments.",
3936 __LINE__,
3937 {"log_level", "partition_name", "fatal", "extra"},
3939 R"({
3940 "method" : "log_level",
3941 "params" : [
3942 {
3943 "error" : "badSyntax",
3944 "error_code" : 1,
3945 "error_message" : "Syntax error."
3946 }
3947 ]
3948 })"},
3949 {"log_level: invalid severity.",
3950 __LINE__,
3951 {"log_level", "err"},
3953 R"({
3954 "method" : "log_level",
3955 "params" : [
3956 {
3957 "api_version" : %API_VER%,
3958 "severity" : "err"
3959 }
3960 ]
3961 })"},
3962 {"log_level: swap partition name and severity.",
3963 __LINE__,
3964 {
3965 "log_level",
3966 "fatal",
3967 "partition_name",
3968 },
3970 R"({
3971 "method" : "log_level",
3972 "params" : [
3973 {
3974 "api_version" : %API_VER%,
3975 "partition" : "fatal",
3976 "severity" : "partition_name"
3977 }
3978 ]
3979 })"},
3980
3981 // logrotate
3982 // -------------------------------------------------------------------
3983 {"logrotate: minimal.",
3984 __LINE__,
3985 {
3986 "logrotate",
3987 },
3989 R"({
3990 "method" : "logrotate",
3991 "params" : [
3992 {
3993 "api_version" : %API_VER%,
3994 }
3995 ]
3996 })"},
3997 {"logrotate: too many arguments.",
3998 __LINE__,
3999 {"logrotate", "extra"},
4001 R"({
4002 "method" : "logrotate",
4003 "params" : [
4004 {
4005 "error" : "badSyntax",
4006 "error_code" : 1,
4007 "error_message" : "Syntax error."
4008 }
4009 ]
4010 })"},
4011
4012 // owner_info
4013 // ------------------------------------------------------------------
4014 {"owner_info: minimal.",
4015 __LINE__,
4016 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
4018 R"({
4019 "method" : "owner_info",
4020 "params" : [
4021 {
4022 "api_version" : %API_VER%,
4023 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
4024 }
4025 ]
4026 })"},
4027 {"owner_info: with numeric ledger index.",
4028 __LINE__,
4029 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
4031 R"({
4032 "method" : "owner_info",
4033 "params" : [
4034 {
4035 "api_version" : %API_VER%,
4036 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4037 "ledger_index" : 987654321
4038 }
4039 ]
4040 })"},
4041 {"owner_info: with text ledger index.",
4042 __LINE__,
4043 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
4045 R"({
4046 "method" : "owner_info",
4047 "params" : [
4048 {
4049 "api_version" : %API_VER%,
4050 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4051 "ledger_index" : "validated"
4052 }
4053 ]
4054 })"},
4055 {"owner_info: with ledger hash.",
4056 __LINE__,
4057 {"owner_info",
4058 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4059 "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
4061 R"({
4062 "method" : "owner_info",
4063 "params" : [
4064 {
4065 "api_version" : %API_VER%,
4066 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4067 "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
4068 }
4069 ]
4070 })"},
4071 {"owner_info: with ledger index.",
4072 __LINE__,
4073 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
4075 R"({
4076 "method" : "owner_info",
4077 "params" : [
4078 {
4079 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4080 "api_version" : %API_VER%,
4081 "ledger_index" : "validated"
4082 }
4083 ]
4084 })"},
4085 {"owner_info: too few arguments.",
4086 __LINE__,
4087 {
4088 "owner_info",
4089 },
4091 R"({
4092 "method" : "owner_info",
4093 "params" : [
4094 {
4095 "error" : "badSyntax",
4096 "error_code" : 1,
4097 "error_message" : "Syntax error."
4098 }
4099 ]
4100 })"},
4101 {"owner_info: too many arguments.",
4102 __LINE__,
4103 {
4104 "owner_info",
4105 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4106 "current",
4107 "extra1",
4108 "extra2",
4109 },
4111 R"({
4112 "method" : "owner_info",
4113 "params" : [
4114 {
4115 "error" : "badSyntax",
4116 "error_code" : 1,
4117 "error_message" : "Syntax error."
4118 }
4119 ]
4120 })"},
4121 {
4122 "owner_info: invalid accountID.",
4123 __LINE__,
4124 {
4125 "owner_info",
4126 "", // Note: very few values are detected as bad!
4127 },
4129 R"({
4130 "method" : "owner_info",
4131 "params" : [
4132 {
4133 "error" : "actMalformed",
4134 "error_code" : 35,
4135 "error_message" : "Account malformed."
4136 }
4137 ]
4138 })",
4139 },
4140 {
4141 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
4142 // cannot currently occur because jvParseLedger() always returns true.
4143 "owner_info: invalid ledger selection.",
4144 __LINE__,
4145 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
4147 R"({
4148 "method" : "owner_info",
4149 "params" : [
4150 {
4151 "api_version" : %API_VER%,
4152 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4153 "ledger_index" : 0
4154 }
4155 ]
4156 })",
4157 },
4158 {
4159 // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
4160 // cannot currently occur because jvParseLedger() always returns true.
4161 "owner_info: invalid ledger selection.",
4162 __LINE__,
4163 {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
4165 R"({
4166 "method" : "owner_info",
4167 "params" : [
4168 {
4169 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4170 "api_version" : %API_VER%,
4171 "ledger_index" : 0
4172 }
4173 ]
4174 })",
4175 },
4176
4177 // peers
4178 // -----------------------------------------------------------------------
4179 {"peers: minimal.",
4180 __LINE__,
4181 {
4182 "peers",
4183 },
4185 R"({
4186 "method" : "peers",
4187 "params" : [
4188 {
4189 "api_version" : %API_VER%,
4190 }
4191 ]
4192 })"},
4193 {"peers: too many arguments.",
4194 __LINE__,
4195 {"peers", "extra"},
4197 R"({
4198 "method" : "peers",
4199 "params" : [
4200 {
4201 "error" : "badSyntax",
4202 "error_code" : 1,
4203 "error_message" : "Syntax error."
4204 }
4205 ]
4206 })"},
4207
4208 // peer_reservations_add
4209 // -------------------------------------------------------
4210 {"peer_reservations_add: minimal.",
4211 __LINE__,
4212 {"peer_reservations_add", "public_key_string"},
4214 R"({
4215 "method" : "peer_reservations_add",
4216 "params" : [
4217 {
4218 "api_version" : %API_VER%,
4219 "public_key" : "public_key_string"
4220 }
4221 ]
4222 })"},
4223 {"peer_reservations_add: with description.",
4224 __LINE__,
4225 {"peer_reservations_add", "public_key_string", "public_key_description"},
4227 R"({
4228 "method" : "peer_reservations_add",
4229 "params" : [
4230 {
4231 "api_version" : %API_VER%,
4232 "description" : "public_key_description",
4233 "public_key" : "public_key_string"
4234 }
4235 ]
4236 })"},
4237 {"peer_reservations_add: too few arguments.",
4238 __LINE__,
4239 {"peer_reservations_add"},
4241 R"({
4242 "method" : "peer_reservations_add",
4243 "params" : [
4244 {
4245 "error" : "badSyntax",
4246 "error_code" : 1,
4247 "error_message" : "Syntax error."
4248 }
4249 ]
4250 })"},
4251 {"peer_reservations_add: too many arguments.",
4252 __LINE__,
4253 {"peer_reservations_add",
4254 "public_key_string",
4255 "public_key_description",
4256 "spare"},
4258 R"({
4259 "method" : "peer_reservations_add",
4260 "params" : [
4261 {
4262 "error" : "badSyntax",
4263 "error_code" : 1,
4264 "error_message" : "Syntax error."
4265 }
4266 ]
4267 })"},
4268
4269 // peer_reservations_del
4270 // -------------------------------------------------------
4271 {"peer_reservations_del: minimal.",
4272 __LINE__,
4273 {"peer_reservations_del", "public_key_string"},
4275 R"({
4276 "method" : "peer_reservations_del",
4277 "params" : [
4278 {
4279 "api_version" : %API_VER%,
4280 "public_key" : "public_key_string"
4281 }
4282 ]
4283 })"},
4284 {"peer_reservations_del: too few arguments.",
4285 __LINE__,
4286 {"peer_reservations_del"},
4288 R"({
4289 "method" : "peer_reservations_del",
4290 "params" : [
4291 {
4292 "error" : "badSyntax",
4293 "error_code" : 1,
4294 "error_message" : "Syntax error."
4295 }
4296 ]
4297 })"},
4298 {"peer_reservations_del: too many arguments.",
4299 __LINE__,
4300 {"peer_reservations_del",
4301 "public_key_string",
4302 "public_key_description",
4303 "spare"},
4305 R"({
4306 "method" : "peer_reservations_del",
4307 "params" : [
4308 {
4309 "error" : "badSyntax",
4310 "error_code" : 1,
4311 "error_message" : "Syntax error."
4312 }
4313 ]
4314 })"},
4315
4316 // ping
4317 // ------------------------------------------------------------------------
4318 {"ping: minimal.",
4319 __LINE__,
4320 {
4321 "ping",
4322 },
4324 R"({
4325 "method" : "ping",
4326 "params" : [
4327 {
4328 "api_version" : %API_VER%,
4329 }
4330 ]
4331 })"},
4332 {"ping: too many arguments.",
4333 __LINE__,
4334 {"ping", "extra"},
4336 R"({
4337 "method" : "ping",
4338 "params" : [
4339 {
4340 "error" : "badSyntax",
4341 "error_code" : 1,
4342 "error_message" : "Syntax error."
4343 }
4344 ]
4345 })"},
4346
4347 // print
4348 // -----------------------------------------------------------------------
4349 {"print: minimal.",
4350 __LINE__,
4351 {
4352 "print",
4353 },
4355 R"({
4356 "method" : "print",
4357 "params" : [
4358 {
4359 "api_version" : %API_VER%,
4360 }
4361 ]
4362 })"},
4363 {// The docs indicate that no arguments are allowed. So should this error?
4364 "print: extra argument.",
4365 __LINE__,
4366 {"print", "extra"},
4368 R"({
4369 "method" : "print",
4370 "params" : [
4371 {
4372 "api_version" : %API_VER%,
4373 "params" : [ "extra" ]
4374 }
4375 ]
4376 })"},
4377 {"print: too many arguments.",
4378 __LINE__,
4379 {"print", "extra1", "extra2"},
4381 R"({
4382 "method" : "print",
4383 "params" : [
4384 {
4385 "error" : "badSyntax",
4386 "error_code" : 1,
4387 "error_message" : "Syntax error."
4388 }
4389 ]
4390 })"},
4391
4392 // random
4393 // ----------------------------------------------------------------------
4394 {"random: minimal.",
4395 __LINE__,
4396 {
4397 "random",
4398 },
4400 R"({
4401 "method" : "random",
4402 "params" : [
4403 {
4404 "api_version" : %API_VER%,
4405 }
4406 ]
4407 })"},
4408 {"random: too many arguments.",
4409 __LINE__,
4410 {"random", "extra"},
4412 R"({
4413 "method" : "random",
4414 "params" : [
4415 {
4416 "error" : "badSyntax",
4417 "error_code" : 1,
4418 "error_message" : "Syntax error."
4419 }
4420 ]
4421 })"},
4422
4423 // ripple_path_find
4424 // ------------------------------------------------------------
4425 {"ripple_path_find: minimal.",
4426 __LINE__,
4427 {
4428 "ripple_path_find",
4429 R"({"json_argument":true})",
4430 },
4432 R"({
4433 "method" : "ripple_path_find",
4434 "params" : [
4435 {
4436 "api_version" : %API_VER%,
4437 "json_argument" : true
4438 }
4439 ]
4440 })"},
4441 {"ripple_path_find: ledger index.",
4442 __LINE__,
4443 {"ripple_path_find", R"({"json_argument":true})", "4294967295"},
4445 R"({
4446 "method" : "ripple_path_find",
4447 "params" : [
4448 {
4449 "api_version" : %API_VER%,
4450 "json_argument" : true,
4451 "ledger_index" : 4294967295
4452 }
4453 ]
4454 })"},
4455 {"ripple_path_find: text ledger index.",
4456 __LINE__,
4457 {"ripple_path_find", R"({"json_argument":true})", "closed"},
4459 R"({
4460 "method" : "ripple_path_find",
4461 "params" : [
4462 {
4463 "api_version" : %API_VER%,
4464 "json_argument" : true,
4465 "ledger_index" : "closed"
4466 }
4467 ]
4468 })"},
4469 {"ripple_path_find: ledger hash.",
4470 __LINE__,
4471 {"ripple_path_find",
4472 R"({"json_argument":true})",
4473 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"},
4475 R"({
4476 "method" : "ripple_path_find",
4477 "params" : [
4478 {
4479 "api_version" : %API_VER%,
4480 "json_argument" : true,
4481 "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
4482 }
4483 ]
4484 })"},
4485
4486 {"ripple_path_find: too few arguments.",
4487 __LINE__,
4488 {
4489 "ripple_path_find",
4490 },
4492 R"({
4493 "method" : "ripple_path_find",
4494 "params" : [
4495 {
4496 "error" : "badSyntax",
4497 "error_code" : 1,
4498 "error_message" : "Syntax error."
4499 }
4500 ]
4501 })"},
4502 {"ripple_path_find: too many arguments.",
4503 __LINE__,
4504 {"ripple_path_find", R"({"json_argument":true})", "current", "extra"},
4506 R"({
4507 "method" : "ripple_path_find",
4508 "params" : [
4509 {
4510 "error" : "badSyntax",
4511 "error_code" : 1,
4512 "error_message" : "Syntax error."
4513 }
4514 ]
4515 })"},
4516 {"ripple_path_find: invalid json (note extra comma).",
4517 __LINE__,
4518 {
4519 "ripple_path_find",
4520 R"({"json_argument":true,})",
4521 },
4523 R"({
4524 "method" : "ripple_path_find",
4525 "params" : [
4526 {
4527 "error" : "invalidParams",
4528 "error_code" : 31,
4529 "error_message" : "Invalid parameters."
4530 }
4531 ]
4532 })"},
4533 {"ripple_path_find: ledger index too small.",
4534 __LINE__,
4535 {"ripple_path_find", R"({"json_argument":true})", "-1"},
4537 R"({
4538 "method" : "ripple_path_find",
4539 "params" : [
4540 {
4541 "api_version" : %API_VER%,
4542 "json_argument" : true,
4543 "ledger_index" : 0
4544 }
4545 ]
4546 })"},
4547 {"ripple_path_find: ledger index too big.",
4548 __LINE__,
4549 {"ripple_path_find", R"({"json_argument":true})", "4294967296"},
4551 R"({
4552 "method" : "ripple_path_find",
4553 "params" : [
4554 {
4555 "api_version" : %API_VER%,
4556 "json_argument" : true,
4557 "ledger_index" : 0
4558 }
4559 ]
4560 })"},
4561 {"ripple_path_find: invalid text ledger index.",
4562 __LINE__,
4563 {"ripple_path_find", R"({"json_argument":true})", "cur"},
4565 R"({
4566 "method" : "ripple_path_find",
4567 "params" : [
4568 {
4569 "api_version" : %API_VER%,
4570 "json_argument" : true,
4571 "ledger_index" : 0
4572 }
4573 ]
4574 })"},
4575
4576 // sign
4577 // ------------------------------------------------------------------------
4578 {"sign: minimal.",
4579 __LINE__,
4580 {
4581 "sign",
4582 "my_secret",
4583 R"({"json_argument":true})",
4584 },
4586 R"({
4587 "method" : "sign",
4588 "params" : [
4589 {
4590 "api_version" : %API_VER%,
4591 "secret" : "my_secret",
4592 "tx_json" : {
4593 "json_argument" : true
4594 }
4595 }
4596 ]
4597 })"},
4598 {"sign: offline.",
4599 __LINE__,
4600 {"sign", "my_secret", R"({"json_argument":true})", "offline"},
4602 R"({
4603 "method" : "sign",
4604 "params" : [
4605 {
4606 "api_version" : %API_VER%,
4607 "offline" : true,
4608 "secret" : "my_secret",
4609 "tx_json" : {
4610 "json_argument" : true
4611 }
4612 }
4613 ]
4614 })"},
4615 {"sign: too few arguments.",
4616 __LINE__,
4617 {"sign", "contents_of_blob"},
4619 R"({
4620 "method" : "sign",
4621 "params" : [
4622 {
4623 "error" : "badSyntax",
4624 "error_code" : 1,
4625 "error_message" : "Syntax error."
4626 }
4627 ]
4628 })"},
4629 {"sign: offline flag with signature_target.",
4630 __LINE__,
4631 {"sign", "my_secret", R"({"json_argument":true})", "offline", "extra"},
4633 R"({
4634 "method" : "sign",
4635 "params" : [
4636 {
4637 "api_version" : %API_VER%,
4638 "offline" : true,
4639 "secret" : "my_secret",
4640 "signature_target" : "extra",
4641 "tx_json" :
4642 {
4643 "json_argument" : true
4644 }
4645 }
4646 ]
4647 })"},
4648 {"sign: too many arguments.",
4649 __LINE__,
4650 {"sign",
4651 "my_secret",
4652 R"({"json_argument":true})",
4653 "offline",
4654 "CounterpartySignature",
4655 "extra"},
4657 R"({
4658 "method" : "sign",
4659 "params" : [
4660 {
4661 "error" : "badSyntax",
4662 "error_code" : 1,
4663 "error_message" : "Syntax error."
4664 }
4665 ]
4666 })"},
4667 {"sign: invalid JSON (note extra comma).",
4668 __LINE__,
4669 {
4670 "sign",
4671 "my_secret",
4672 R"({"json_argument":true,})",
4673 },
4675 R"({
4676 "method" : "sign",
4677 "params" : [
4678 {
4679 "error" : "invalidParams",
4680 "error_code" : 31,
4681 "error_message" : "Invalid parameters."
4682 }
4683 ]
4684 })"},
4685 {"sign: misspelled offline flag interpreted as signature_target.",
4686 __LINE__,
4687 {"sign", "my_secret", R"({"json_argument":true})", "offlin"},
4689 R"({
4690 "method" : "sign",
4691 "params" : [
4692 {
4693 "api_version" : %API_VER%,
4694 "secret" : "my_secret",
4695 "signature_target" : "offlin",
4696 "tx_json" :
4697 {
4698 "json_argument" : true
4699 }
4700 }
4701 ]
4702 })"},
4703
4704 // sign_for
4705 // --------------------------------------------------------------------
4706 {"sign_for: minimal.",
4707 __LINE__,
4708 {
4709 "sign_for",
4710 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4711 "my_secret",
4712 R"({"json_argument":true})",
4713 },
4715 R"({
4716 "method" : "sign_for",
4717 "params" : [
4718 {
4719 "api_version" : %API_VER%,
4720 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4721 "secret" : "my_secret",
4722 "tx_json" : {
4723 "json_argument" : true
4724 }
4725 }
4726 ]
4727 })"},
4728 {"sign_for: offline.",
4729 __LINE__,
4730 {"sign_for",
4731 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4732 "my_secret",
4733 R"({"json_argument":true})",
4734 "offline"},
4736 R"({
4737 "method" : "sign_for",
4738 "params" : [
4739 {
4740 "api_version" : %API_VER%,
4741 "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4742 "offline" : true,
4743 "secret" : "my_secret",
4744 "tx_json" : {
4745 "json_argument" : true
4746 }
4747 }
4748 ]
4749 })"},
4750 {"sign_for: too few arguments.",
4751 __LINE__,
4752 {
4753 "sign_for",
4754 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4755 "my_secret",
4756 },
4758 R"({
4759 "method" : "sign_for",
4760 "params" : [
4761 {
4762 "error" : "badSyntax",
4763 "error_code" : 1,
4764 "error_message" : "Syntax error."
4765 }
4766 ]
4767 })"},
4768 {"sign_for: too many arguments.",
4769 __LINE__,
4770 {"sign_for",
4771 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4772 "my_secret",
4773 R"({"json_argument":true})",
4774 "offline",
4775 "extra"},
4777 R"({
4778 "method" : "sign_for",
4779 "params" : [
4780 {
4781 "error" : "badSyntax",
4782 "error_code" : 1,
4783 "error_message" : "Syntax error."
4784 }
4785 ]
4786 })"},
4787 {"sign_for: invalid json (note extra comma).",
4788 __LINE__,
4789 {
4790 "sign_for",
4791 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4792 "my_secret",
4793 R"({"json_argument":true,})",
4794 },
4796 R"({
4797 "method" : "sign_for",
4798 "params" : [
4799 {
4800 "error" : "invalidParams",
4801 "error_code" : 31,
4802 "error_message" : "Invalid parameters."
4803 }
4804 ]
4805 })"},
4806 {"sign_for: invalid final argument.",
4807 __LINE__,
4808 {"sign_for",
4809 "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
4810 "my_secret",
4811 R"({"json_argument":true})",
4812 "ofline"},
4814 R"({
4815 "method" : "sign_for",
4816 "params" : [
4817 {
4818 "error" : "invalidParams",
4819 "error_code" : 31,
4820 "error_message" : "Invalid parameters."
4821 }
4822 ]
4823 })"},
4824
4825 // submit
4826 // ----------------------------------------------------------------------
4827 {"submit: blob.",
4828 __LINE__,
4829 {"submit", "the blob is unvalidated and may be any length..."},
4831 R"({
4832 "method" : "submit",
4833 "params" : [
4834 {
4835 "api_version" : %API_VER%,
4836 "tx_blob" : "the blob is unvalidated and may be any length..."
4837 }
4838 ]
4839 })"},
4840 {"submit: json.",
4841 __LINE__,
4842 {
4843 "submit",
4844 "my_secret",
4845 R"({"json_argument":true})",
4846 },
4848 R"({
4849 "method" : "submit",
4850 "params" : [
4851 {
4852 "api_version" : %API_VER%,
4853 "secret" : "my_secret",
4854 "tx_json" : {
4855 "json_argument" : true
4856 }
4857 }
4858 ]
4859 })"},
4860 {"submit: too few arguments.",
4861 __LINE__,
4862 {
4863 "submit",
4864 },
4866 R"({
4867 "method" : "submit",
4868 "params" : [
4869 {
4870 "error" : "badSyntax",
4871 "error_code" : 1,
4872 "error_message" : "Syntax error."
4873 }
4874 ]
4875 })"},
4876 {// Note: I believe this _ought_ to be detected as too many arguments.
4877 "submit: four arguments.",
4878 __LINE__,
4879 {"submit", "my_secret", R"({"json_argument":true})", "offline"},
4881 R"({
4882 "method" : "submit",
4883 "params" : [
4884 {
4885 "api_version" : %API_VER%,
4886 "offline" : true,
4887 "secret" : "my_secret",
4888 "tx_json" : {
4889 "json_argument" : true
4890 }
4891 }
4892 ]
4893 })"},
4894 {"submit: offline flag with signature_target.",
4895 __LINE__,
4896 {"submit", "my_secret", R"({"json_argument":true})", "offline", "extra"},
4898 R"({
4899 "method" : "submit",
4900 "params" : [
4901 {
4902 "api_version" : %API_VER%,
4903 "offline" : true,
4904 "secret" : "my_secret",
4905 "signature_target" : "extra",
4906 "tx_json" :
4907 {
4908 "json_argument" : true
4909 }
4910 }
4911 ]
4912 })"},
4913 {"submit: too many arguments.",
4914 __LINE__,
4915 {"submit",
4916 "my_secret",
4917 R"({"json_argument":true})",
4918 "offline",
4919 "CounterpartySignature",
4920 "extra"},
4922 R"({
4923 "method" : "submit",
4924 "params" : [
4925 {
4926 "error" : "badSyntax",
4927 "error_code" : 1,
4928 "error_message" : "Syntax error."
4929 }
4930 ]
4931 })"},
4932 {"submit: invalid json (note extra comma).",
4933 __LINE__,
4934 {
4935 "submit",
4936 "my_secret",
4937 R"({"json_argument":true,})",
4938 },
4940 R"({
4941 "method" : "submit",
4942 "params" : [
4943 {
4944 "error" : "invalidParams",
4945 "error_code" : 31,
4946 "error_message" : "Invalid parameters."
4947 }
4948 ]
4949 })"},
4950 {"submit: misspelled offline flag interpreted as signature_target.",
4951 __LINE__,
4952 {"submit", "my_secret", R"({"json_argument":true})", "offlne"},
4954 R"({
4955 "method" : "submit",
4956 "params" : [
4957 {
4958 "api_version" : %API_VER%,
4959 "secret" : "my_secret",
4960 "signature_target" : "offlne",
4961 "tx_json" :
4962 {
4963 "json_argument" : true
4964 }
4965 }
4966 ]
4967 })"},
4968
4969 // submit_multisigned
4970 // ----------------------------------------------------------
4971 {"submit_multisigned: json.",
4972 __LINE__,
4973 {
4974 "submit_multisigned",
4975 R"({"json_argument":true})",
4976 },
4978 R"({
4979 "method" : "submit_multisigned",
4980 "params" : [
4981 {
4982 "api_version" : %API_VER%,
4983 "tx_json" : {
4984 "json_argument" : true
4985 }
4986 }
4987 ]
4988 })"},
4989 {"submit_multisigned: too few arguments.",
4990 __LINE__,
4991 {
4992 "submit_multisigned",
4993 },
4995 R"({
4996 "method" : "submit_multisigned",
4997 "params" : [
4998 {
4999 "error" : "badSyntax",
5000 "error_code" : 1,
5001 "error_message" : "Syntax error."
5002 }
5003 ]
5004 })"},
5005 {"submit_multisigned: too many arguments.",
5006 __LINE__,
5007 {"submit_multisigned", R"({"json_argument":true})", "extra"},
5009 R"({
5010 "method" : "submit_multisigned",
5011 "params" : [
5012 {
5013 "error" : "badSyntax",
5014 "error_code" : 1,
5015 "error_message" : "Syntax error."
5016 }
5017 ]
5018 })"},
5019 {"submit_multisigned: invalid json (note extra comma).",
5020 __LINE__,
5021 {
5022 "submit_multisigned",
5023 R"({"json_argument":true,})",
5024 },
5026 R"({
5027 "method" : "submit_multisigned",
5028 "params" : [
5029 {
5030 "error" : "invalidParams",
5031 "error_code" : 31,
5032 "error_message" : "Invalid parameters."
5033 }
5034 }
5035 ]
5036 })"},
5037
5038 // server_info
5039 // -----------------------------------------------------------------
5040 {"server_info: minimal.",
5041 __LINE__,
5042 {
5043 "server_info",
5044 },
5046 R"({
5047 "method" : "server_info",
5048 "params" : [
5049 {
5050 "api_version" : %API_VER%,
5051 }
5052 ]
5053 })"},
5054 {"server_info: counters.",
5055 __LINE__,
5056 {"server_info", "counters"},
5058 R"({
5059 "method" : "server_info",
5060 "params" : [
5061 {
5062 "api_version" : %API_VER%,
5063 "counters" : true
5064 }
5065 ]
5066 })"},
5067 {"server_info: too many arguments.",
5068 __LINE__,
5069 {"server_info", "counters", "extra"},
5071 R"({
5072 "method" : "server_info",
5073 "params" : [
5074 {
5075 "error" : "badSyntax",
5076 "error_code" : 1,
5077 "error_message" : "Syntax error."
5078 }
5079 ]
5080 })"},
5081 {"server_info: non-counters argument.",
5082 __LINE__,
5083 {"server_info", "counter"},
5085 R"({
5086 "method" : "server_info",
5087 "params" : [
5088 {
5089 "api_version" : %API_VER%,
5090 }
5091 ]
5092 })"},
5093
5094 // server_state
5095 // ----------------------------------------------------------------
5096 {"server_state: minimal.",
5097 __LINE__,
5098 {
5099 "server_state",
5100 },
5102 R"({
5103 "method" : "server_state",
5104 "params" : [
5105 {
5106 "api_version" : %API_VER%,
5107 }
5108 ]
5109 })"},
5110 {"server_state: counters.",
5111 __LINE__,
5112 {"server_state", "counters"},
5114 R"({
5115 "method" : "server_state",
5116 "params" : [
5117 {
5118 "api_version" : %API_VER%,
5119 "counters" : true
5120 }
5121 ]
5122 })"},
5123 {"server_state: too many arguments.",
5124 __LINE__,
5125 {"server_state", "counters", "extra"},
5127 R"({
5128 "method" : "server_state",
5129 "params" : [
5130 {
5131 "error" : "badSyntax",
5132 "error_code" : 1,
5133 "error_message" : "Syntax error."
5134 }
5135 ]
5136 })"},
5137 {"server_state: non-counters argument.",
5138 __LINE__,
5139 {"server_state", "counter"},
5141 R"({
5142 "method" : "server_state",
5143 "params" : [
5144 {
5145 "api_version" : %API_VER%,
5146 }
5147 ]
5148 })"},
5149
5150 // stop
5151 // ------------------------------------------------------------------------
5152 {"stop: minimal.",
5153 __LINE__,
5154 {
5155 "stop",
5156 },
5158 R"({
5159 "method" : "stop",
5160 "params" : [
5161 {
5162 "api_version" : %API_VER%,
5163 }
5164 ]
5165 })"},
5166 {"stop: too many arguments.",
5167 __LINE__,
5168 {"stop", "extra"},
5170 R"({
5171 "method" : "stop",
5172 "params" : [
5173 {
5174 "error" : "badSyntax",
5175 "error_code" : 1,
5176 "error_message" : "Syntax error."
5177 }
5178 ]
5179 })"},
5180
5181 // transaction_entry
5182 // -----------------------------------------------------------
5183 {"transaction_entry: ledger index.",
5184 __LINE__,
5185 {"transaction_entry",
5186 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5187 "4294967295"},
5189 R"({
5190 "method" : "transaction_entry",
5191 "params" : [
5192 {
5193 "api_version" : %API_VER%,
5194 "ledger_index" : 4294967295,
5195 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5196 }
5197 ]
5198 })"},
5199 {"transaction_entry: text ledger index.",
5200 __LINE__,
5201 {"transaction_entry",
5202 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5203 "current"},
5205 R"({
5206 "method" : "transaction_entry",
5207 "params" : [
5208 {
5209 "api_version" : %API_VER%,
5210 "ledger_index" : "current",
5211 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5212 }
5213 ]
5214 })"},
5215 {"transaction_entry: ledger hash.",
5216 __LINE__,
5217 {"transaction_entry",
5218 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5219 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210"},
5221 R"({
5222 "method" : "transaction_entry",
5223 "params" : [
5224 {
5225 "api_version" : %API_VER%,
5226 "ledger_hash" : "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210",
5227 "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
5228 }
5229 ]
5230 })"},
5231 {"transaction_entry: too few arguments.",
5232 __LINE__,
5233 {
5234 "transaction_entry",
5235 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5236 },
5238 R"({
5239 "method" : "transaction_entry",
5240 "params" : [
5241 {
5242 "error" : "badSyntax",
5243 "error_code" : 1,
5244 "error_message" : "Syntax error."
5245 }
5246 ]
5247 })"},
5248 {"transaction_entry: too many arguments.",
5249 __LINE__,
5250 {"transaction_entry",
5251 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5252 "validated",
5253 "extra"},
5255 R"({
5256 "method" : "transaction_entry",
5257 "params" : [
5258 {
5259 "error" : "badSyntax",
5260 "error_code" : 1,
5261 "error_message" : "Syntax error."
5262 }
5263 ]
5264 })"},
5265 {"transaction_entry: short tx_hash.",
5266 __LINE__,
5267 {
5268 "transaction_entry",
5269 "123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5270 "validated",
5271 },
5273 R"({
5274 "method" : "transaction_entry",
5275 "params" : [
5276 {
5277 "error" : "invalidParams",
5278 "error_code" : 31,
5279 "error_message" : "Invalid parameters."
5280 }
5281 ]
5282 })"},
5283 {"transaction_entry: long tx_hash.",
5284 __LINE__,
5285 {
5286 "transaction_entry",
5287 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUVW",
5288 "validated",
5289 },
5291 R"({
5292 "method" : "transaction_entry",
5293 "params" : [
5294 {
5295 "error" : "invalidParams",
5296 "error_code" : 31,
5297 "error_message" : "Invalid parameters."
5298 }
5299 ]
5300 })"},
5301 {"transaction_entry: small ledger index.",
5302 __LINE__,
5303 {
5304 "transaction_entry",
5305 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5306 "0",
5307 },
5309 R"({
5310 "method" : "transaction_entry",
5311 "params" : [
5312 {
5313 "error" : "invalidParams",
5314 "error_code" : 31,
5315 "error_message" : "Invalid parameters."
5316 }
5317 ]
5318 })"},
5319 {"transaction_entry: large ledger index.",
5320 __LINE__,
5321 {
5322 "transaction_entry",
5323 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5324 "4294967296",
5325 },
5327 R"({
5328 "method" : "transaction_entry",
5329 "params" : [
5330 {
5331 "error" : "invalidParams",
5332 "error_code" : 31,
5333 "error_message" : "Invalid parameters."
5334 }
5335 ]
5336 })"},
5337 {"transaction_entry: short ledger hash.",
5338 __LINE__,
5339 {
5340 "transaction_entry",
5341 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5342 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA987654321",
5343 },
5345 R"({
5346 "method" : "transaction_entry",
5347 "params" : [
5348 {
5349 "error" : "invalidParams",
5350 "error_code" : 31,
5351 "error_message" : "Invalid parameters."
5352 }
5353 ]
5354 })"},
5355 {"transaction_entry: long ledger hash.",
5356 __LINE__,
5357 {
5358 "transaction_entry",
5359 "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
5360 "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210Z",
5361 },
5363 R"({
5364 "method" : "transaction_entry",
5365 "params" : [
5366 {
5367 "error" : "invalidParams",
5368 "error_code" : 31,
5369 "error_message" : "Invalid parameters."
5370 }
5371 ]
5372 })"},
5373
5374 // tx
5375 // --------------------------------------------------------------------------
5376 {"tx: ctid. minimal",
5377 __LINE__,
5378 {"tx", "FFFFFFFFFFFFFFFF", "1", "2"},
5380 R"({
5381 "method" : "tx",
5382 "params" : [
5383 {
5384 "api_version" : %API_VER%,
5385 "ctid" : "FFFFFFFFFFFFFFFF",
5386 "max_ledger" : "2",
5387 "min_ledger" : "1"
5388 }
5389 ]
5390 })"},
5391 {"tx: ctid. binary",
5392 __LINE__,
5393 {"tx", "FFFFFFFFFFFFFFFF", "binary", "1", "2"},
5395 R"({
5396 "method" : "tx",
5397 "params" : [
5398 {
5399 "api_version" : %API_VER%,
5400 "binary" : true,
5401 "ctid" : "FFFFFFFFFFFFFFFF",
5402 "max_ledger" : "2",
5403 "min_ledger" : "1"
5404 }
5405 ]
5406 })"},
5407 {"tx: minimal.",
5408 __LINE__,
5409 {"tx", "transaction_hash_is_not_validated"},
5411 R"({
5412 "method" : "tx",
5413 "params" : [
5414 {
5415 "api_version" : %API_VER%,
5416 "transaction" : "transaction_hash_is_not_validated"
5417 }
5418 ]
5419 })"},
5420 {"tx: binary.",
5421 __LINE__,
5422 {"tx", "transaction_hash_is_not_validated", "binary"},
5424 R"({
5425 "method" : "tx",
5426 "params" : [
5427 {
5428 "api_version" : %API_VER%,
5429 "binary" : true,
5430 "transaction" : "transaction_hash_is_not_validated"
5431 }
5432 ]
5433 })"},
5434 {"tx: too few arguments.",
5435 __LINE__,
5436 {
5437 "tx",
5438 },
5440 R"({
5441 "method" : "tx",
5442 "params" : [
5443 {
5444 "error" : "badSyntax",
5445 "error_code" : 1,
5446 "error_message" : "Syntax error."
5447 }
5448 ]
5449 })"},
5450 {"tx: too many arguments.",
5451 __LINE__,
5452 {"tx", "transaction_hash_is_not_validated", "binary", "1", "2", "extra"},
5454 R"({
5455 "method" : "tx",
5456 "params" : [
5457 {
5458 "error" : "badSyntax",
5459 "error_code" : 1,
5460 "error_message" : "Syntax error."
5461 }
5462 ]
5463 })"},
5464 {"tx: invalid final argument is apparently ignored.",
5465 __LINE__,
5466 {"tx", "transaction_hash_is_not_validated", "bin"},
5468 R"({
5469 "method" : "tx",
5470 "params" : [
5471 {
5472 "api_version" : %API_VER%,
5473 "transaction" : "transaction_hash_is_not_validated"
5474 }
5475 ]
5476 })"},
5477
5478 // tx_history
5479 // ------------------------------------------------------------------
5480 {"tx_history: minimal.",
5481 __LINE__,
5482 {"tx_history", "0"},
5484 R"({
5485 "method" : "tx_history",
5486 "params" : [
5487 {
5488 "api_version" : %API_VER%,
5489 "start" : 0
5490 }
5491 ]
5492 })"},
5493 {"tx_history: too few arguments.",
5494 __LINE__,
5495 {
5496 "tx_history",
5497 },
5499 R"({
5500 "method" : "tx_history",
5501 "params" : [
5502 {
5503 "error" : "badSyntax",
5504 "error_code" : 1,
5505 "error_message" : "Syntax error."
5506 }
5507 ]
5508 })"},
5509 {"tx_history: too many arguments.",
5510 __LINE__,
5511 {"tx_history", "0", "1"},
5513 R"({
5514 "method" : "tx_history",
5515 "params" : [
5516 {
5517 "error" : "badSyntax",
5518 "error_code" : 1,
5519 "error_message" : "Syntax error."
5520 }
5521 ]
5522 })"},
5523 {
5524 // Note: this really shouldn't throw, but does at the moment.
5525 "tx_history: start too small.",
5526 __LINE__,
5527 {"tx_history", "-1"},
5529 R"()",
5530 },
5531 {
5532 // Note: this really shouldn't throw, but does at the moment.
5533 "tx_history: start too big.",
5534 __LINE__,
5535 {"tx_history", "4294967296"},
5537 R"()",
5538 },
5539 {
5540 // Note: this really shouldn't throw, but does at the moment.
5541 "tx_history: start not integer.",
5542 __LINE__,
5543 {"tx_history", "beginning"},
5545 R"()",
5546 },
5547
5548 // unl_list
5549 // --------------------------------------------------------------------
5550 {"unl_list: minimal.",
5551 __LINE__,
5552 {
5553 "unl_list",
5554 },
5556 R"({
5557 "method" : "unl_list",
5558 "params" : [
5559 {
5560 "api_version" : %API_VER%,
5561 }
5562 ]
5563 })"},
5564 {"unl_list: too many arguments.",
5565 __LINE__,
5566 {"unl_list", "extra"},
5568 R"({
5569 "method" : "unl_list",
5570 "params" : [
5571 {
5572 "error" : "badSyntax",
5573 "error_code" : 1,
5574 "error_message" : "Syntax error."
5575 }
5576 ]
5577 })"},
5578
5579 // validation_create
5580 // -----------------------------------------------------------
5581 {"validation_create: minimal.",
5582 __LINE__,
5583 {
5584 "validation_create",
5585 },
5587 R"({
5588 "method" : "validation_create",
5589 "params" : [
5590 {
5591 "api_version" : %API_VER%,
5592 }
5593 ]
5594 })"},
5595 {"validation_create: with secret.",
5596 __LINE__,
5597 {"validation_create", "the form of the secret is not validated"},
5599 R"({
5600 "method" : "validation_create",
5601 "params" : [
5602 {
5603 "api_version" : %API_VER%,
5604 "secret" : "the form of the secret is not validated"
5605 }
5606 ]
5607 })"},
5608 {"validation_create: too many arguments.",
5609 __LINE__,
5610 {"validation_create", "the form of the secret is not validated", "extra"},
5612 R"({
5613 "method" : "validation_create",
5614 "params" : [
5615 {
5616 "error" : "badSyntax",
5617 "error_code" : 1,
5618 "error_message" : "Syntax error."
5619 }
5620 ]
5621 })"},
5622
5623 // version
5624 // ---------------------------------------------------------------------
5625 {"version: minimal.",
5626 __LINE__,
5627 {
5628 "version",
5629 },
5631 R"({
5632 "method" : "version",
5633 "params" : [
5634 {
5635 "api_version" : %API_VER%,
5636 }
5637 ]
5638 })"},
5639 {"version: too many arguments.",
5640 __LINE__,
5641 {"version", "extra"},
5643 R"({
5644 "method" : "version",
5645 "params" : [
5646 {
5647 "error" : "badSyntax",
5648 "error_code" : 1,
5649 "error_message" : "Syntax error."
5650 }
5651 ]
5652 })"},
5653
5654 // wallet_propose
5655 // --------------------------------------------------------------
5656 {"wallet_propose: minimal.",
5657 __LINE__,
5658 {
5659 "wallet_propose",
5660 },
5662 R"({
5663 "method" : "wallet_propose",
5664 "params" : [
5665 {
5666 "api_version" : %API_VER%,
5667 }
5668 ]
5669 })"},
5670 {"wallet_propose: with passphrase.",
5671 __LINE__,
5672 {"wallet_propose", "the form of the passphrase is not validated"},
5674 R"({
5675 "method" : "wallet_propose",
5676 "params" : [
5677 {
5678 "api_version" : %API_VER%,
5679 "passphrase" : "the form of the passphrase is not validated"
5680 }
5681 ]
5682 })"},
5683 {"wallet_propose: too many arguments.",
5684 __LINE__,
5685 {"wallet_propose", "the form of the passphrase is not validated", "extra"},
5687 R"({
5688 "method" : "wallet_propose",
5689 "params" : [
5690 {
5691 "error" : "badSyntax",
5692 "error_code" : 1,
5693 "error_message" : "Syntax error."
5694 }
5695 ]
5696 })"},
5697
5698 // internal
5699 // --------------------------------------------------------------------
5700 {"internal: minimal.",
5701 __LINE__,
5702 {"internal", "command_name"},
5704 R"({
5705 "method" : "internal",
5706 "params" : [
5707 {
5708 "api_version" : %API_VER%,
5709 "internal_command" : "command_name",
5710 "params" : []
5711 }
5712 ]
5713 })"},
5714 {"internal: with parameters.",
5715 __LINE__,
5716 {"internal",
5717 "command_name",
5718 "string_arg",
5719 "1",
5720 "-1",
5721 "4294967296",
5722 "3.14159"},
5724 R"({
5725 "method" : "internal",
5726 "params" : [
5727 {
5728 "api_version" : %API_VER%,
5729 "internal_command" : "command_name",
5730 "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
5731 }
5732 ]
5733 })"},
5734 {"internal: too few arguments.",
5735 __LINE__,
5736 {
5737 "internal",
5738 },
5740 R"({
5741 "method" : "internal",
5742 "params" : [
5743 {
5744 "error" : "badSyntax",
5745 "error_code" : 1,
5746 "error_message" : "Syntax error."
5747 }
5748 ]
5749 })"},
5750
5751 // path_find
5752 // -------------------------------------------------------------------
5753 {"path_find: minimal.",
5754 __LINE__,
5755 {
5756 "path_find",
5757 },
5759 R"({
5760 "method" : "path_find",
5761 "params" : [
5762 {
5763 "error" : "noEvents",
5764 "error_code" : 7,
5765 "error_message" : "Current transport does not support events."
5766 }
5767 ]
5768 })"},
5769 {"path_find: with arguments.",
5770 __LINE__,
5771 {"path_find", "string_arg", "1", "-1", "4294967296", "3.14159"},
5773 R"({
5774 "method" : "path_find",
5775 "params" : [
5776 {
5777 "error" : "noEvents",
5778 "error_code" : 7,
5779 "error_message" : "Current transport does not support events."
5780 }
5781 ]
5782 })"},
5783
5784 // subscribe
5785 // -------------------------------------------------------------------
5786 {"subscribe: minimal.",
5787 __LINE__,
5788 {
5789 "subscribe",
5790 },
5792 R"({
5793 "method" : "subscribe",
5794 "params" : [
5795 {
5796 "error" : "noEvents",
5797 "error_code" : 7,
5798 "error_message" : "Current transport does not support events."
5799 }
5800 ]
5801 })"},
5802 {"subscribe: with arguments.",
5803 __LINE__,
5804 {"subscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
5806 R"({
5807 "method" : "subscribe",
5808 "params" : [
5809 {
5810 "error" : "noEvents",
5811 "error_code" : 7,
5812 "error_message" : "Current transport does not support events."
5813 }
5814 ]
5815 })"},
5816
5817 // unsubscribe
5818 // -----------------------------------------------------------------
5819 {"unsubscribe: minimal.",
5820 __LINE__,
5821 {
5822 "unsubscribe",
5823 },
5825 R"({
5826 "method" : "unsubscribe",
5827 "params" : [
5828 {
5829 "error" : "noEvents",
5830 "error_code" : 7,
5831 "error_message" : "Current transport does not support events."
5832 }
5833 ]
5834 })"},
5835 {"unsubscribe: with arguments.",
5836 __LINE__,
5837 {"unsubscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
5839 R"({
5840 "method" : "unsubscribe",
5841 "params" : [
5842 {
5843 "error" : "noEvents",
5844 "error_code" : 7,
5845 "error_message" : "Current transport does not support events."
5846 }
5847 ]
5848 })"},
5849
5850 // unknown_command
5851 // -------------------------------------------------------------
5852 {"unknown_command: minimal.",
5853 __LINE__,
5854 {
5855 "unknown_command",
5856 },
5858 R"({
5859 "method" : "unknown_command",
5860 "params" : [
5861 {
5862 "api_version" : %API_VER%,
5863 }
5864 ]
5865 })"},
5866 {"unknown_command: with arguments.",
5867 __LINE__,
5868 {"unknown_command", "string_arg", "1", "-1", "4294967296", "3.14159"},
5870 R"({
5871 "method" : "unknown_command",
5872 "params" : [
5873 {
5874 "api_version" : %API_VER%,
5875 "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
5876 }
5877 ]
5878 })"},
5879};
5880
5882updateAPIVersionString(char const* const req, unsigned apiVersion)
5883{
5884 std::string const version_str = std::to_string(apiVersion);
5885 static auto const place_holder = "%API_VER%";
5886 std::string jr(req);
5887 boost::replace_all(jr, place_holder, version_str);
5888 return jr;
5889}
5890
5892makeNetworkConfig(uint32_t networkID)
5893{
5894 using namespace test::jtx;
5895 return envconfig([&](std::unique_ptr<Config> cfg) {
5896 cfg->NETWORK_ID = networkID;
5897 return cfg;
5898 });
5899}
5900
5902{
5903public:
5904 void
5905 testRPCCall(unsigned apiVersion)
5906 {
5907 testcase << "RPCCall API version " << apiVersion;
5908 if (!BEAST_EXPECT(
5909 apiVersion >= RPC::apiMinimumSupportedVersion &&
5910 apiVersion <= RPC::apiMaximumValidVersion))
5911 return;
5912
5913 test::jtx::Env env(
5914 *this, makeNetworkConfig(11111)); // Used only for its Journal.
5915
5916 // For each RPCCall test.
5917 for (RPCCallTestData const& rpcCallTest : rpcCallTestArray)
5918 {
5919 if (!BEAST_EXPECT(!rpcCallTest.exp.empty()))
5920 break;
5921
5922 std::vector<std::string> const args{
5923 rpcCallTest.args.begin(), rpcCallTest.args.end()};
5924
5925 char const* const expVersioned =
5926 (apiVersion - RPC::apiMinimumSupportedVersion) <
5927 rpcCallTest.exp.size()
5928 ? rpcCallTest.exp[apiVersion - RPC::apiMinimumSupportedVersion]
5929 : rpcCallTest.exp.back();
5930
5931 // Note that, over the long term, none of these tests should
5932 // throw. But, for the moment, some of them do. So handle it.
5933 Json::Value got;
5934 try
5935 {
5936 got = jtx::cmdToJSONRPC(args, env.journal, apiVersion);
5937 }
5938 catch (std::bad_cast const&)
5939 {
5940 if ((rpcCallTest.throwsWhat == RPCCallTestData::bad_cast) &&
5941 (std::strlen(expVersioned) == 0))
5942 {
5943 pass();
5944 }
5945 else
5946 {
5947 fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
5948 }
5949 // Try the next test.
5950 continue;
5951 }
5952
5953 Json::Value exp;
5955 updateAPIVersionString(expVersioned, apiVersion), exp);
5956
5957 // Lambda to remove the "params[0u]:error_code" field if present.
5958 // Error codes are not expected to be stable between releases.
5959 auto rmErrorCode = [](Json::Value& json) {
5960 if (json.isMember(jss::params) && json[jss::params].isArray() &&
5961 json[jss::params].size() > 0 &&
5962 json[jss::params][0u].isObject())
5963 {
5964 json[jss::params][0u].removeMember(jss::error_code);
5965 }
5966 };
5967 rmErrorCode(got);
5968 rmErrorCode(exp);
5969
5970 // Pass if we didn't expect a throw and we got what we expected.
5971 if ((rpcCallTest.throwsWhat == RPCCallTestData::no_exception) &&
5972 (got == exp))
5973 {
5974 pass();
5975 }
5976 else
5977 {
5978 fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
5979 }
5980 }
5981 }
5982
5983 void
5984 run() override
5985 {
5987 }
5988};
5989
5990BEAST_DEFINE_TESTSUITE(RPCCall, rpc, ripple);
5991
5992} // namespace test
5993} // 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:130
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)