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