21#include <test/jtx/envconfig.h>
22#include <xrpld/app/misc/LoadFeeTrack.h>
23#include <xrpld/app/misc/TxQ.h>
24#include <xrpld/core/ConfigSections.h>
25#include <xrpld/rpc/detail/TransactionSign.h>
26#include <xrpl/basics/contract.h>
27#include <xrpl/beast/unit_test.h>
28#include <xrpl/json/json_reader.h>
29#include <xrpl/protocol/ErrorCodes.h>
30#include <xrpl/protocol/Feature.h>
53 char const* description_,
72 {
"Minimal payment, no Amount only DeliverMax",
75 "command": "doesnt_matter",
76 "secret": "masterpassphrase",
78 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
79 "DeliverMax": "1000000000",
80 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
81 "TransactionType": "Payment"
86 "Missing field 'account'.",
87 "Missing field 'tx_json.Sequence'."}}},
89 {
"Pass in Fee with minimal payment, both Amount and DeliverMax.",
92 "command": "doesnt_matter",
93 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
94 "secret": "masterpassphrase",
97 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
98 "Amount": "1000000000",
99 "DeliverMax": "1000000000",
100 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
101 "TransactionType": "Payment"
106 "Missing field 'tx_json.Sequence'.",
107 "Missing field 'tx_json.Sequence'."}}},
109 {
"Pass in Sequence, no Amount only DeliverMax",
112 "command": "doesnt_matter",
113 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
114 "secret": "masterpassphrase",
117 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
118 "DeliverMax": "1000000000",
119 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
120 "TransactionType": "Payment"
125 "Missing field 'tx_json.Fee'.",
126 "Missing field 'tx_json.SigningPubKey'."}}},
128 {
"Pass in Sequence and Fee with minimal payment, both Amount and "
132 "command": "doesnt_matter",
133 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
134 "secret": "masterpassphrase",
138 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
139 "Amount": "1000000000",
140 "DeliverMax": "1000000000",
141 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
142 "TransactionType": "Payment"
147 "A Signer may not be the transaction's Account "
148 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
149 "Missing field 'tx_json.SigningPubKey'."}}},
151 {
"Add 'fee_mult_max' field.",
154 "command": "doesnt_matter",
155 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
156 "secret": "masterpassphrase",
160 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
161 "Amount": "1000000000",
162 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
163 "TransactionType": "Payment"
168 "Missing field 'tx_json.Fee'.",
169 "Missing field 'tx_json.SigningPubKey'."}}},
171 {
"Add 'fee_mult_max' and 'fee_div_max' field.",
174 "command": "doesnt_matter",
175 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
176 "secret": "masterpassphrase",
181 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
182 "Amount": "1000000000",
183 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
184 "TransactionType": "Payment"
189 "Missing field 'tx_json.Fee'.",
190 "Missing field 'tx_json.SigningPubKey'."}}},
192 {
"fee_mult_max is ignored if 'Fee' is present.",
195 "command": "doesnt_matter",
196 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
197 "secret": "masterpassphrase",
202 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
203 "Amount": "1000000000",
204 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
205 "TransactionType": "Payment"
210 "A Signer may not be the transaction's Account "
211 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
212 "Missing field 'tx_json.SigningPubKey'."}}},
214 {
"fee_div_max is ignored if 'Fee' is present.",
217 "command": "doesnt_matter",
218 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
219 "secret": "masterpassphrase",
225 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
226 "Amount": "1000000000",
227 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
228 "TransactionType": "Payment"
233 "A Signer may not be the transaction's Account "
234 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
235 "Missing field 'tx_json.SigningPubKey'."}}},
237 {
"Invalid 'fee_mult_max' field.",
240 "command": "doesnt_matter",
241 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
242 "secret": "masterpassphrase",
243 "fee_mult_max": "NotAFeeMultiplier",
246 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
247 "Amount": "1000000000",
248 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
249 "TransactionType": "Payment"
252 {{"Invalid field 'fee_mult_max', not a positive integer.",
253 "Invalid field 'fee_mult_max', not a positive integer.",
254 "Missing field 'tx_json.Fee'.",
255 "Missing field 'tx_json.SigningPubKey'."}}},
257 {
"Invalid 'fee_div_max' field.",
260 "command": "doesnt_matter",
261 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
262 "secret": "masterpassphrase",
264 "fee_div_max": "NotAFeeMultiplier",
267 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
268 "Amount": "1000000000",
269 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
270 "TransactionType": "Payment"
273 {{"Invalid field 'fee_div_max', not a positive integer.",
274 "Invalid field 'fee_div_max', not a positive integer.",
275 "Missing field 'tx_json.Fee'.",
276 "Missing field 'tx_json.SigningPubKey'."}}},
278 {
"Invalid value for 'fee_mult_max' field.",
281 "command": "doesnt_matter",
282 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
283 "secret": "masterpassphrase",
287 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
288 "Amount": "1000000000",
289 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
290 "TransactionType": "Payment"
293 {{"Fee of 10 exceeds the requested tx limit of 0",
294 "Fee of 10 exceeds the requested tx limit of 0",
295 "Missing field 'tx_json.Fee'.",
296 "Missing field 'tx_json.SigningPubKey'."}}},
298 {
"Invalid value for 'fee_div_max' field.",
301 "command": "doesnt_matter",
302 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
303 "secret": "masterpassphrase",
308 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
309 "Amount": "1000000000",
310 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
311 "TransactionType": "Payment"
314 {{"Fee of 10 exceeds the requested tx limit of 5",
315 "Fee of 10 exceeds the requested tx limit of 5",
316 "Missing field 'tx_json.Fee'.",
317 "Missing field 'tx_json.SigningPubKey'."}}},
319 {
"Invalid zero value for 'fee_div_max' field.",
322 "command": "doesnt_matter",
323 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
324 "secret": "masterpassphrase",
329 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
330 "Amount": "1000000000",
331 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
332 "TransactionType": "Payment"
335 {{"Invalid field 'fee_div_max', not a positive integer.",
336 "Invalid field 'fee_div_max', not a positive integer.",
337 "Missing field 'tx_json.Fee'.",
338 "Missing field 'tx_json.SigningPubKey'."}}},
340 {
"Missing 'Amount'.",
343 "command": "doesnt_matter",
344 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
345 "secret": "masterpassphrase",
347 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
348 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
349 "TransactionType": "Payment"
352 {{"Missing field 'tx_json.Amount'.",
353 "Missing field 'tx_json.Amount'.",
354 "Missing field 'tx_json.Sequence'.",
355 "Missing field 'tx_json.Sequence'."}}},
357 {
"Invalid 'Amount'.",
360 "command": "doesnt_matter",
361 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
362 "secret": "masterpassphrase",
364 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
365 "Amount": "NotAnAmount",
366 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
367 "TransactionType": "Payment"
370 {{"Invalid field 'tx_json.Amount'.",
371 "Invalid field 'tx_json.Amount'.",
372 "Missing field 'tx_json.Sequence'.",
373 "Missing field 'tx_json.Sequence'."}}},
375 {
"Missing 'Destination'.",
378 "command": "doesnt_matter",
379 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
380 "secret": "masterpassphrase",
382 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
383 "Amount": "1000000000",
384 "TransactionType": "Payment"
387 {{"Missing field 'tx_json.Destination'.",
388 "Missing field 'tx_json.Destination'.",
389 "Missing field 'tx_json.Sequence'.",
390 "Missing field 'tx_json.Sequence'."}}},
392 {
"Invalid 'Destination'.",
395 "command": "doesnt_matter",
396 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
397 "secret": "masterpassphrase",
399 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
400 "Amount": "1000000000",
401 "Destination": "NotADestination",
402 "TransactionType": "Payment"
405 {{"Invalid field 'tx_json.Destination'.",
406 "Invalid field 'tx_json.Destination'.",
407 "Missing field 'tx_json.Sequence'.",
408 "Missing field 'tx_json.Sequence'."}}},
410 {
"Cannot create XRP to XRP paths.",
413 "command": "doesnt_matter",
414 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
415 "secret": "masterpassphrase",
418 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
419 "Amount": "1000000000",
420 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
421 "TransactionType": "Payment"
424 {{"Cannot build XRP to XRP paths.",
425 "Cannot build XRP to XRP paths.",
426 "Missing field 'tx_json.Sequence'.",
427 "Missing field 'tx_json.Sequence'."}}},
429 {
"Successful 'build_path'.",
432 "command": "doesnt_matter",
433 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
434 "secret": "masterpassphrase",
437 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
441 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
443 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
444 "TransactionType": "Payment"
449 "Missing field 'tx_json.Sequence'.",
450 "Missing field 'tx_json.Sequence'."}}},
452 {
"Not valid to include both 'Paths' and 'build_path'.",
455 "command": "doesnt_matter",
456 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
457 "secret": "masterpassphrase",
460 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
464 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
466 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
468 "TransactionType": "Payment"
471 {{"Cannot specify both 'tx_json.Paths' and 'build_path'",
472 "Cannot specify both 'tx_json.Paths' and 'build_path'",
473 "Missing field 'tx_json.Sequence'.",
474 "Missing field 'tx_json.Sequence'."}}},
476 {
"Successful 'SendMax'.",
479 "command": "doesnt_matter",
480 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
481 "secret": "masterpassphrase",
484 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
488 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
493 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
495 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
496 "TransactionType": "Payment"
501 "Missing field 'tx_json.Sequence'.",
502 "Missing field 'tx_json.Sequence'."}}},
504 {
"'Amount' may not be XRP for pathfinding, but 'SendMax' may be XRP.",
507 "command": "doesnt_matter",
508 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
509 "secret": "masterpassphrase",
512 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
516 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
519 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
520 "TransactionType": "Payment"
525 "Missing field 'tx_json.Sequence'.",
526 "Missing field 'tx_json.Sequence'."}}},
528 {
"'secret' must be present.",
531 "command": "doesnt_matter",
532 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
534 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
535 "Amount": "1000000000",
536 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
537 "TransactionType": "Payment"
540 {{"Missing field 'secret'.",
541 "Missing field 'secret'.",
542 "Missing field 'tx_json.Sequence'.",
543 "Missing field 'tx_json.Sequence'."}}},
545 {
"'secret' must be non-empty.",
548 "command": "doesnt_matter",
549 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
552 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
553 "Amount": "1000000000",
554 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
555 "TransactionType": "Payment"
558 {{"Invalid field 'secret'.",
559 "Invalid field 'secret'.",
560 "Missing field 'tx_json.Sequence'.",
561 "Missing field 'tx_json.Sequence'."}}},
563 {
"Use 'seed' instead of 'secret'.",
566 "command": "doesnt_matter",
567 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
568 "key_type": "ed25519",
569 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
571 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
572 "Amount": "1000000000",
573 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
574 "TransactionType": "Payment"
579 "Missing field 'tx_json.Sequence'.",
580 "Missing field 'tx_json.Sequence'."}}},
582 {
"Malformed 'seed'.",
585 "command": "doesnt_matter",
586 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
587 "key_type": "ed25519",
588 "seed": "not a seed",
590 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
591 "Amount": "1000000000",
592 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
593 "TransactionType": "Payment"
596 {{"Disallowed seed.",
598 "Missing field 'tx_json.Sequence'.",
599 "Missing field 'tx_json.Sequence'."}}},
601 {
"'tx_json' must be present.",
604 "command": "doesnt_matter",
605 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
606 "secret": "masterpassphrase",
608 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
609 "Amount": "1000000000",
610 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
611 "TransactionType": "Payment"
614 {{"Missing field 'tx_json'.",
615 "Missing field 'tx_json'.",
616 "Missing field 'tx_json'.",
617 "Missing field 'tx_json'."}}},
619 {
"'TransactionType' must be present.",
622 "command": "doesnt_matter",
623 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
624 "secret": "masterpassphrase",
626 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
627 "Amount": "1000000000",
628 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
631 {{"Missing field 'tx_json.TransactionType'.",
632 "Missing field 'tx_json.TransactionType'.",
633 "Missing field 'tx_json.Sequence'.",
634 "Missing field 'tx_json.Sequence'."}}},
636 {
"The 'TransactionType' must be a pre-established transaction type.",
639 "command": "doesnt_matter",
640 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
641 "secret": "masterpassphrase",
643 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
644 "Amount": "1000000000",
645 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
646 "TransactionType": "tt"
649 {{"Field 'tx_json.TransactionType' has invalid data.",
650 "Field 'tx_json.TransactionType' has invalid data.",
651 "Missing field 'tx_json.Sequence'.",
652 "Missing field 'tx_json.Sequence'."}}},
654 {
"The 'TransactionType' may be represented with an integer.",
657 "command": "doesnt_matter",
658 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
659 "secret": "masterpassphrase",
661 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
662 "Amount": "1000000000",
663 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
669 "Missing field 'tx_json.Sequence'.",
670 "Missing field 'tx_json.Sequence'."}}},
672 {
"'Account' must be present.",
675 "command": "doesnt_matter",
676 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
677 "secret": "masterpassphrase",
679 "Amount": "1000000000",
680 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
681 "TransactionType": "Payment"
684 {{"Missing field 'tx_json.Account'.",
685 "Missing field 'tx_json.Account'.",
686 "Missing field 'tx_json.Sequence'.",
687 "Missing field 'tx_json.Sequence'."}}},
689 {
"'Account' must be well formed.",
692 "command": "doesnt_matter",
693 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
694 "secret": "masterpassphrase",
696 "Account": "NotAnAccount",
697 "Amount": "1000000000",
698 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
699 "TransactionType": "Payment"
702 {{"Invalid field 'tx_json.Account'.",
703 "Invalid field 'tx_json.Account'.",
704 "Missing field 'tx_json.Sequence'.",
705 "Missing field 'tx_json.Sequence'."}}},
707 {
"The 'offline' tag may be added to the transaction.",
710 "command": "doesnt_matter",
711 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
712 "secret": "masterpassphrase",
715 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
716 "Amount": "1000000000",
717 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
718 "TransactionType": "Payment"
723 "Missing field 'tx_json.Sequence'.",
724 "Missing field 'tx_json.Sequence'."}}},
726 {
"If 'offline' is true then a 'Sequence' field must be supplied.",
729 "command": "doesnt_matter",
730 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
731 "secret": "masterpassphrase",
735 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
736 "Amount": "1000000000",
737 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
738 "TransactionType": "Payment"
741 {{"Missing field 'tx_json.Sequence'.",
742 "Missing field 'tx_json.Sequence'.",
743 "Missing field 'tx_json.Sequence'.",
744 "Missing field 'tx_json.Sequence'."}}},
746 {
"If 'offline' is true then a 'Fee' field must be supplied.",
749 "command": "doesnt_matter",
750 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
751 "secret": "masterpassphrase",
755 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
756 "Amount": "1000000000",
757 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
758 "TransactionType": "Payment"
761 {{"Missing field 'tx_json.Fee'.",
762 "Missing field 'tx_json.Fee'.",
763 "Missing field 'tx_json.Fee'.",
764 "Missing field 'tx_json.SigningPubKey'."}}},
766 {
"Valid transaction if 'offline' is true.",
769 "command": "doesnt_matter",
770 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
771 "secret": "masterpassphrase",
776 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
777 "Amount": "1000000000",
778 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
779 "TransactionType": "Payment"
784 "A Signer may not be the transaction's Account "
785 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
786 "Missing field 'tx_json.SigningPubKey'."}}},
788 {
"'offline' and 'build_path' are mutually exclusive.",
791 "command": "doesnt_matter",
792 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
793 "secret": "masterpassphrase",
799 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
800 "Amount": "1000000000",
801 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
802 "TransactionType": "Payment"
805 {{"Field 'build_path' not allowed in this context.",
806 "Field 'build_path' not allowed in this context.",
807 "Field 'build_path' not allowed in this context.",
808 "Missing field 'tx_json.SigningPubKey'."}}},
810 {
"A 'Flags' field may be specified.",
813 "command": "doesnt_matter",
814 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
815 "secret": "masterpassphrase",
818 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
819 "Amount": "1000000000",
820 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
821 "TransactionType": "Payment"
826 "Missing field 'tx_json.Sequence'.",
827 "Missing field 'tx_json.Sequence'."}}},
829 {
"The 'Flags' field must be numeric.",
832 "command": "doesnt_matter",
833 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
834 "secret": "masterpassphrase",
836 "Flags": "NotGoodFlags",
837 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
838 "Amount": "1000000000",
839 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
840 "TransactionType": "Payment"
843 {{"Field 'tx_json.Flags' has invalid data.",
844 "Field 'tx_json.Flags' has invalid data.",
845 "Missing field 'tx_json.Sequence'.",
846 "Missing field 'tx_json.Sequence'."}}},
848 {
"It's okay to add a 'debug_signing' field.",
851 "command": "doesnt_matter",
852 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
853 "secret": "masterpassphrase",
856 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
857 "Amount": "1000000000",
858 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
859 "TransactionType": "Payment"
864 "Missing field 'tx_json.Sequence'.",
865 "Missing field 'tx_json.Sequence'."}}},
867 {
"Single-sign a multisigned transaction.",
870 "command": "doesnt_matter",
871 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
874 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
875 "Amount" : "1000000000",
876 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
882 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
883 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
884 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
888 "SigningPubKey" : "",
889 "TransactionType" : "Payment"
892 {{"Already multisigned.",
893 "Already multisigned.",
894 "Secret does not match account.",
897 {
"Minimal sign_for.",
900 "command": "doesnt_matter",
901 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
902 "secret": "masterpassphrase",
904 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
905 "Amount": "1000000000",
906 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
910 "TransactionType": "Payment"
913 {{"Secret does not match account.",
914 "Secret does not match account.",
916 "Missing field 'tx_json.Signers'."}}},
918 {
"Minimal offline sign_for.",
921 "command": "doesnt_matter",
922 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
923 "secret": "masterpassphrase",
926 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
927 "Amount": "1000000000",
928 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
932 "TransactionType": "Payment"
935 {{"",
"",
"",
"Missing field 'tx_json.Signers'."}}},
937 {
"Offline sign_for using 'seed' instead of 'secret'.",
940 "command": "doesnt_matter",
941 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
942 "key_type": "ed25519",
943 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
946 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
947 "Amount": "1000000000",
948 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
952 "TransactionType": "Payment"
955 {{"",
"",
"",
"Missing field 'tx_json.Signers'."}}},
957 {
"Malformed seed in sign_for.",
960 "command": "doesnt_matter",
961 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
962 "key_type": "ed25519",
963 "seed": "sh1yJfwoi98zCygwjUzuHmJDeVKd",
966 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
967 "Amount": "1000000000",
968 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
972 "TransactionType": "Payment"
975 {{"Disallowed seed.",
978 "Missing field 'tx_json.Signers'."}}},
980 {
"Missing 'Account' in sign_for.",
983 "command": "doesnt_matter",
984 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
985 "secret": "masterpassphrase",
987 "Amount": "1000000000",
988 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
992 "TransactionType": "Payment"
995 {{"Missing field 'tx_json.Account'.",
996 "Missing field 'tx_json.Account'.",
997 "Missing field 'tx_json.Account'.",
998 "Missing field 'tx_json.Account'."}}},
1000 {
"Missing 'Amount' in sign_for.",
1003 "command": "doesnt_matter",
1004 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1005 "secret": "masterpassphrase",
1007 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1008 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1011 "SigningPubKey": "",
1012 "TransactionType": "Payment"
1015 {{"Missing field 'tx_json.Amount'.",
1016 "Missing field 'tx_json.Amount'.",
1017 "Missing field 'tx_json.Amount'.",
1018 "Missing field 'tx_json.Amount'."}}},
1020 {
"Missing 'Destination' in sign_for.",
1023 "command": "doesnt_matter",
1024 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1025 "secret": "masterpassphrase",
1027 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1028 "Amount": "1000000000",
1031 "SigningPubKey": "",
1032 "TransactionType": "Payment"
1035 {{"Missing field 'tx_json.Destination'.",
1036 "Missing field 'tx_json.Destination'.",
1037 "Missing field 'tx_json.Destination'.",
1038 "Missing field 'tx_json.Destination'."}}},
1040 {
"Missing 'Destination' in sign_for, use DeliverMax",
1043 "command": "doesnt_matter",
1044 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1045 "secret": "masterpassphrase",
1047 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1048 "DeliverMax": "1000000000",
1051 "SigningPubKey": "",
1052 "TransactionType": "Payment"
1055 {{"Missing field 'tx_json.Destination'.",
1056 "Missing field 'tx_json.Destination'.",
1057 "Missing field 'tx_json.Destination'.",
1058 "Missing field 'tx_json.Destination'."}}},
1060 {
"Missing 'Fee' in sign_for.",
1063 "command": "doesnt_matter",
1064 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1065 "secret": "masterpassphrase",
1067 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1068 "Amount": "1000000000",
1069 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1071 "SigningPubKey": "",
1072 "TransactionType": "Payment"
1075 {{"Secret does not match account.",
1076 "Secret does not match account.",
1077 "Missing field 'tx_json.Fee'.",
1078 "Missing field 'tx_json.Fee'."}}},
1080 {
"Missing 'Sequence' in sign_for.",
1083 "command": "doesnt_matter",
1084 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1085 "secret": "masterpassphrase",
1087 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1088 "Amount": "1000000000",
1089 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1091 "SigningPubKey": "",
1092 "TransactionType": "Payment"
1095 {{"Secret does not match account.",
1096 "Secret does not match account.",
1097 "Missing field 'tx_json.Sequence'.",
1098 "Missing field 'tx_json.Sequence'."}}},
1100 {
"Missing 'SigningPubKey' in sign_for is automatically filled in.",
1103 "command": "doesnt_matter",
1104 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1105 "secret": "masterpassphrase",
1107 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1108 "Amount": "1000000000",
1109 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1112 "TransactionType": "Payment"
1115 {{"Secret does not match account.",
1116 "Secret does not match account.",
1118 "Missing field 'tx_json.SigningPubKey'."}}},
1120 {
"In sign_for, an account may not sign for itself.",
1123 "command": "doesnt_matter",
1124 "account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1127 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1128 "Amount": "1000000000",
1129 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1132 "TransactionType": "Payment"
1137 "A Signer may not be the transaction's Account "
1138 "(rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA).",
1139 "Missing field 'tx_json.SigningPubKey'."}}},
1141 {
"Cannot put duplicate accounts in Signers array",
1144 "command": "doesnt_matter",
1145 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1146 "secret": "masterpassphrase",
1148 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1149 "Amount" : "1000000000",
1150 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1156 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1157 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1158 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1162 "SigningPubKey" : "",
1163 "TransactionType" : "Payment"
1166 {{"Already multisigned.",
1167 "Already multisigned.",
1168 "Duplicate Signers:Signer:Account entries "
1169 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh) are not allowed.",
1172 {
"Correctly append to pre-established Signers array",
1175 "command": "doesnt_matter",
1176 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1179 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1180 "Amount" : "1000000000",
1181 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1187 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1188 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1189 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1193 "SigningPubKey" : "",
1194 "TransactionType" : "Payment"
1197 {{"Already multisigned.",
"Already multisigned.",
"",
""}}},
1199 {
"Append to pre-established Signers array with bad signature",
1202 "command": "doesnt_matter",
1203 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1206 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1207 "Amount" : "1000000000",
1208 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1214 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1215 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1216 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ACB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1220 "SigningPubKey" : "",
1221 "TransactionType" : "Payment"
1224 {{"Already multisigned.",
1225 "Already multisigned.",
1226 "Invalid signature.",
1227 "Invalid signature."}}},
1229 {
"Non-empty 'SigningPubKey' in sign_for.",
1232 "command": "doesnt_matter",
1233 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1234 "secret": "masterpassphrase",
1236 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1237 "Amount": "1000000000",
1238 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1241 "SigningPubKey": "1",
1242 "TransactionType": "Payment"
1245 {{"Secret does not match account.",
1246 "Secret does not match account.",
1247 "When multi-signing 'tx_json.SigningPubKey' must be empty.",
1248 "When multi-signing 'tx_json.SigningPubKey' must be empty."}}},
1250 {
"Missing 'TransactionType' in sign_for.",
1253 "command": "doesnt_matter",
1254 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1255 "secret": "masterpassphrase",
1257 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1258 "Amount": "1000000000",
1259 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1262 "SigningPubKey": "",
1265 {{"Missing field 'tx_json.TransactionType'.",
1266 "Missing field 'tx_json.TransactionType'.",
1267 "Missing field 'tx_json.TransactionType'.",
1268 "Missing field 'tx_json.TransactionType'."}}},
1270 {
"TxnSignature in sign_for.",
1273 "command": "doesnt_matter",
1274 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1277 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1278 "Amount" : "1000000000",
1279 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1285 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1286 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1287 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1291 "SigningPubKey" : "",
1292 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998",
1293 "TransactionType" : "Payment"
1296 {{"Already multisigned.",
1297 "Already multisigned.",
1298 "Already single-signed.",
1299 "Signing of transaction is malformed."}}},
1301 {
"Invalid field 'tx_json': string instead of object",
1304 "command": "doesnt_matter",
1305 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1306 "secret": "masterpassphrase",
1309 {{"Invalid field 'tx_json', not object.",
1310 "Invalid field 'tx_json', not object.",
1311 "Invalid field 'tx_json', not object.",
1312 "Invalid field 'tx_json', not object."}}},
1314 {
"Invalid field 'tx_json': integer instead of object",
1317 "command": "doesnt_matter",
1318 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1319 "secret": "masterpassphrase",
1322 {{"Invalid field 'tx_json', not object.",
1323 "Invalid field 'tx_json', not object.",
1324 "Invalid field 'tx_json', not object.",
1325 "Invalid field 'tx_json', not object."}}},
1327 {
"Invalid field 'tx_json': array instead of object",
1330 "command": "doesnt_matter",
1331 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1332 "secret": "masterpassphrase",
1333 "tx_json": [ "hello", "world" ]
1335 {{"Invalid field 'tx_json', not object.",
1336 "Invalid field 'tx_json', not object.",
1337 "Invalid field 'tx_json', not object.",
1338 "Invalid field 'tx_json', not object."}}},
1340 {
"Pass in Fee with minimal payment, both Amount and DeliverMax.",
1343 "command": "doesnt_matter",
1344 "account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1345 "secret": "ssgN6zTvtM1q9XV8DvJpWm8LBYWiY",
1348 "Account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1349 "Amount": "1000000000",
1350 "DeliverMax": "1000000000",
1351 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1352 "TransactionType": "Payment"
1355 {{"Source account not found.",
1356 "Source account not found.",
1357 "Missing field 'tx_json.Sequence'.",
1358 "Missing field 'tx_json.Sequence'."}}},
1360 {
"Minimal submit_multisigned.",
1363 "command": "submit_multisigned",
1365 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1366 "Amount": "1000000000",
1367 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1373 "Account" : "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1374 "SigningPubKey" : "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
1375 "TxnSignature" : "3045022100909D01399AFFAD1E30D250CE61F93975B7F61E47B5244D78C3E86D9806535D95022012E389E0ACB016334052B7FE07FA6CEFDC8BE82CB410FA841D5049641C89DC8F"
1379 "SigningPubKey": "",
1380 "TransactionType": "Payment"
1383 {{"Missing field 'secret'.",
1384 "Missing field 'secret'.",
1385 "Missing field 'account'.",
1388 {
"Minimal submit_multisigned with bad signature.",
1391 "command": "submit_multisigned",
1393 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1394 "Amount": "1000000000",
1395 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1401 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1402 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1403 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1407 "SigningPubKey": "",
1408 "TransactionType": "Payment"
1411 {{"Missing field 'secret'.",
1412 "Missing field 'secret'.",
1413 "Missing field 'account'.",
1414 "Invalid signature."}}},
1416 {
"Missing tx_json in submit_multisigned.",
1419 "command": "submit_multisigned",
1423 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1424 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1425 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1430 {{"Missing field 'secret'.",
1431 "Missing field 'secret'.",
1432 "Missing field 'account'.",
1433 "Missing field 'tx_json'."}}},
1435 {
"Missing sequence in submit_multisigned.",
1438 "command": "submit_multisigned",
1440 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1441 "Amount": "1000000000",
1442 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1447 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1448 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1449 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1453 "SigningPubKey": "",
1454 "TransactionType": "Payment"
1457 {{"Missing field 'secret'.",
1458 "Missing field 'secret'.",
1459 "Missing field 'account'.",
1460 "Missing field 'tx_json.Sequence'."}}},
1462 {
"Missing SigningPubKey in submit_multisigned.",
1465 "command": "submit_multisigned",
1467 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1468 "Amount": "1000000000",
1469 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1474 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1475 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1476 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1481 "TransactionType": "Payment"
1484 {{"Missing field 'secret'.",
1485 "Missing field 'secret'.",
1486 "Missing field 'account'.",
1487 "Missing field 'tx_json.SigningPubKey'."}}},
1489 {
"Non-empty SigningPubKey in submit_multisigned.",
1492 "command": "submit_multisigned",
1494 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1495 "Amount": "1000000000",
1496 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1502 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1503 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1504 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1508 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
1509 "TransactionType": "Payment"
1512 {{"Missing field 'secret'.",
1513 "Missing field 'secret'.",
1514 "Missing field 'account'.",
1515 "When multi-signing 'tx_json.SigningPubKey' must be empty."}}},
1517 {
"Missing TransactionType in submit_multisigned.",
1520 "command": "submit_multisigned",
1522 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1523 "Amount": "1000000000",
1524 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1529 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1530 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1531 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1536 "SigningPubKey": "",
1539 {{"Missing field 'secret'.",
1540 "Missing field 'secret'.",
1541 "Missing field 'account'.",
1542 "Missing field 'tx_json.TransactionType'."}}},
1544 {
"Missing Account in submit_multisigned.",
1547 "command": "submit_multisigned",
1549 "Amount": "1000000000",
1550 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1556 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1557 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1558 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1562 "SigningPubKey": "",
1563 "TransactionType": "Payment"
1566 {{"Missing field 'secret'.",
1567 "Missing field 'secret'.",
1568 "Missing field 'account'.",
1569 "Missing field 'tx_json.Account'."}}},
1571 {
"Malformed Account in submit_multisigned.",
1574 "command": "submit_multisigned",
1576 "Account": "NotAnAccount",
1577 "Amount": "1000000000",
1578 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1584 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1585 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1586 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1590 "SigningPubKey": "",
1591 "TransactionType": "Payment"
1594 {{"Missing field 'secret'.",
1595 "Missing field 'secret'.",
1596 "Missing field 'account'.",
1597 "Invalid field 'tx_json.Account'."}}},
1599 {
"Account not in ledger in submit_multisigned.",
1602 "command": "submit_multisigned",
1604 "Account": "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd",
1605 "Amount": "1000000000",
1606 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1612 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1613 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1614 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1618 "SigningPubKey": "",
1619 "TransactionType": "Payment"
1622 {{"Missing field 'secret'.",
1623 "Missing field 'secret'.",
1624 "Missing field 'account'.",
1625 "Source account not found."}}},
1627 {
"Missing Fee in submit_multisigned.",
1630 "command": "submit_multisigned",
1632 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1633 "Amount": "1000000000",
1634 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1639 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1640 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1641 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1645 "SigningPubKey": "",
1646 "TransactionType": "Payment"
1649 {{"Missing field 'secret'.",
1650 "Missing field 'secret'.",
1651 "Missing field 'account'.",
1652 "Missing field 'tx_json.Fee'."}}},
1654 {
"Non-numeric Fee in submit_multisigned.",
1657 "command": "submit_multisigned",
1659 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1660 "Amount": "1000000000",
1661 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1667 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1668 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1669 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1673 "SigningPubKey": "",
1674 "TransactionType": "Payment"
1677 {{"Missing field 'secret'.",
1678 "Missing field 'secret'.",
1679 "Missing field 'account'.",
1680 "Field 'tx_json.Fee' has invalid data."}}},
1682 {
"Missing Amount in submit_multisigned Payment.",
1685 "command": "submit_multisigned",
1687 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1688 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1694 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1695 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1696 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1700 "SigningPubKey": "",
1701 "TransactionType": "Payment"
1704 {{"Missing field 'secret'.",
1705 "Missing field 'secret'.",
1706 "Missing field 'account'.",
1707 "Missing field 'tx_json.Amount'."}}},
1709 {
"Invalid Amount in submit_multisigned Payment.",
1712 "command": "submit_multisigned",
1714 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1715 "Amount": "NotANumber",
1716 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1722 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1723 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1724 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1728 "SigningPubKey": "",
1729 "TransactionType": "Payment"
1732 {{"Missing field 'secret'.",
1733 "Missing field 'secret'.",
1734 "Missing field 'account'.",
1735 "Invalid field 'tx_json.Amount'."}}},
1737 {
"Invalid DeliverMax in submit_multisigned Payment.",
1740 "command": "submit_multisigned",
1742 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1743 "DeliverMax": "NotANumber",
1744 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1750 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1751 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1752 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1756 "SigningPubKey": "",
1757 "TransactionType": "Payment"
1760 {{"Missing field 'secret'.",
1761 "Missing field 'secret'.",
1762 "Missing field 'account'.",
1763 "Invalid field 'tx_json.Amount'."}}},
1765 {
"No build_path in submit_multisigned.",
1768 "command": "submit_multisigned",
1771 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1772 "Amount": "1000000000",
1773 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1779 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1780 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1781 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1785 "SigningPubKey": "",
1786 "TransactionType": "Payment"
1789 {{"Missing field 'secret'.",
1790 "Missing field 'secret'.",
1791 "Missing field 'account'.",
1792 "Field 'build_path' not allowed in this context."}}},
1794 {
"Missing Destination in submit_multisigned Payment.",
1797 "command": "submit_multisigned",
1799 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1800 "Amount": "1000000000",
1806 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1807 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1808 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1812 "SigningPubKey": "",
1813 "TransactionType": "Payment"
1816 {{"Missing field 'secret'.",
1817 "Missing field 'secret'.",
1818 "Missing field 'account'.",
1819 "Missing field 'tx_json.Destination'."}}},
1821 {
"Malformed Destination in submit_multisigned Payment.",
1824 "command": "submit_multisigned",
1826 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1827 "Amount": "1000000000",
1828 "Destination": "NotADestination",
1834 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1835 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1836 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1840 "SigningPubKey": "",
1841 "TransactionType": "Payment"
1844 {{"Missing field 'secret'.",
1845 "Missing field 'secret'.",
1846 "Missing field 'account'.",
1847 "Invalid field 'tx_json.Destination'."}}},
1849 {
"Missing Signers field in submit_multisigned.",
1852 "command": "submit_multisigned",
1854 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1855 "Amount": "1000000000",
1856 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1859 "SigningPubKey": "",
1860 "TransactionType": "Payment"
1863 {{"Missing field 'secret'.",
1864 "Missing field 'secret'.",
1865 "Missing field 'account'.",
1866 "Missing field 'tx_json.Signers'."}}},
1868 {
"Signers not an array in submit_multisigned.",
1871 "command": "submit_multisigned",
1873 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1874 "Amount": "1000000000",
1875 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1879 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1880 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1881 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1883 "SigningPubKey": "",
1884 "TransactionType": "Payment"
1887 {{"Missing field 'secret'.",
1888 "Missing field 'secret'.",
1889 "Missing field 'account'.",
1890 "Field 'tx_json.Signers' is not a JSON array."}}},
1892 {
"Empty Signers array in submit_multisigned.",
1895 "command": "submit_multisigned",
1897 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1898 "Amount": "1000000000",
1899 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1904 "SigningPubKey": "",
1905 "TransactionType": "Payment"
1908 {{"Missing field 'secret'.",
1909 "Missing field 'secret'.",
1910 "Missing field 'account'.",
1911 "tx_json.Signers array may not be empty."}}},
1913 {
"Duplicate Signer in submit_multisigned.",
1916 "command": "submit_multisigned",
1918 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1919 "Amount": "1000000000",
1920 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1926 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1927 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1928 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1933 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1934 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1935 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1939 "SigningPubKey": "",
1940 "TransactionType": "Payment"
1943 {{"Missing field 'secret'.",
1944 "Missing field 'secret'.",
1945 "Missing field 'account'.",
1946 "Duplicate Signers:Signer:Account entries "
1947 "(rPcNzota6B8YBokhYtcTNqQVCngtbnWfux) are not allowed."}}},
1949 {
"Signer is tx_json Account in submit_multisigned.",
1952 "command": "submit_multisigned",
1954 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1955 "Amount": "1000000000",
1956 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1962 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1963 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1964 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1968 "SigningPubKey": "",
1969 "TransactionType": "Payment"
1972 {{"Missing field 'secret'.",
1973 "Missing field 'secret'.",
1974 "Missing field 'account'.",
1975 "A Signer may not be the transaction's Account "
1976 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh)."}}},
1978 {
"Empty Signers array in submit_multisigned, use DeliverMax",
1981 "command": "submit_multisigned",
1983 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1984 "DeliverMax": "10000000",
1985 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1990 "SigningPubKey": "",
1991 "TransactionType": "Payment"
1994 {{"Missing field 'secret'.",
1995 "Missing field 'secret'.",
1996 "Missing field 'account'.",
1997 "tx_json.Signers array may not be empty."}}},
1999 {
"Empty Signers array in submit_multisigned, use DeliverMax and Amount",
2002 "command": "submit_multisigned",
2004 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2005 "Amount": "10000000",
2006 "DeliverMax": "10000000",
2007 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2012 "SigningPubKey": "",
2013 "TransactionType": "Payment"
2016 {{"Missing field 'secret'.",
2017 "Missing field 'secret'.",
2018 "Missing field 'account'.",
2019 "tx_json.Signers array may not be empty."}}},
2021 {
"Payment cannot specify different DeliverMax and Amount.",
2024 "command": "doesnt_matter",
2025 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2026 "secret": "masterpassphrase",
2029 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2030 "Amount": "1000000000",
2031 "DeliverMax": "1000000020",
2032 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2035 "SigningPubKey": "",
2036 "TransactionType": "Payment"
2039 {{"Cannot specify differing 'Amount' and 'DeliverMax'",
2040 "Cannot specify differing 'Amount' and 'DeliverMax'",
2041 "Cannot specify differing 'Amount' and 'DeliverMax'",
2042 "Cannot specify differing 'Amount' and 'DeliverMax'"}}},
2054 env.
rpc(
"bad_command", R
"({"MakingThisUp": 0})")};
2056 BEAST_EXPECT(result[jss::result][jss::error] == "unknownCmd");
2058 result[jss::result][jss::request][jss::command] ==
"bad_command");
2071 "{ \"fee_mult_max\" : 1, \"tx_json\" : { } } ", req);
2083 req[jss::tx_json].isMember(jss::Fee) &&
2084 req[jss::tx_json][jss::Fee] == 10);
2090 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 2, "
2091 "\"tx_json\" : { } } ",
2104 req[jss::tx_json].isMember(jss::Fee) &&
2105 req[jss::tx_json][jss::Fee] == 10);
2111 "{ \"fee_mult_max\" : 0, \"tx_json\" : { } } ", req);
2122 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2130 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 6, "
2131 "\"tx_json\" : { } } ",
2143 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2149 "{ \"fee_mult_max\" : 0, \"fee_div_max\" : 2, "
2150 "\"tx_json\" : { } } ",
2162 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2168 "{ \"fee_mult_max\" : 10, \"fee_div_max\" : 0, "
2169 "\"tx_json\" : { } } ",
2181 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2199 BEAST_EXPECT(result.
size() == 0);
2201 req[jss::tx_json].isMember(jss::Fee) &&
2202 req[jss::tx_json][jss::Fee] ==
2203 env.
current()->fees().increment.jsonClipped());
2210 using namespace test::jtx;
2212 cfg->loadFromString(
"[" SECTION_SIGNING_SUPPORT
"]\ntrue");
2213 cfg->section(
"transaction_queue")
2214 .
set(
"minimum_txn_in_ledger_standalone",
"3");
2217 LoadFeeTrack const& feeTrackOuter = env.app().getFeeTrack();
2224 "fee_mult_max" : 1000,
2239 req[jss::tx_json].isMember(jss::Fee) &&
2240 req[jss::tx_json][jss::Fee] == 10);
2263 req[jss::tx_json].isMember(jss::Fee) &&
2264 req[jss::tx_json][jss::Fee] == 10);
2268 for (
auto i = 0; i < 4; ++i)
2270 env(noop(env.master));
2278 "fee_mult_max" : 1000,
2293 req[jss::tx_json].isMember(jss::Fee) &&
2294 req[jss::tx_json][jss::Fee] == 8889);
2316 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2324 "fee_mult_max" : 1000,
2339 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2347 "fee_mult_max" : 8000,
2363 req[jss::tx_json].isMember(jss::Fee) &&
2364 req[jss::tx_json][jss::Fee] == 8889);
2372 "fee_mult_max" : -5,
2414 "fee_mult_max" : -2,
2436 toSign[jss::tx_json] = noop(env.master);
2437 toSign[jss::secret] =
"masterpassphrase";
2438 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2439 auto result = rpcResult[jss::result];
2443 result[jss::tx_json].isMember(jss::Fee) &&
2444 result[jss::tx_json][jss::Fee] ==
"10");
2446 result[jss::tx_json].isMember(jss::Sequence) &&
2447 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2456 auto metrics = env.app().getTxQ().getMetrics(*env.current());
2457 if (metrics.openLedgerFeeLevel > metrics.minProcessingFeeLevel)
2459 env(noop(env.master));
2463 toSign[jss::tx_json] = noop(env.master);
2464 toSign[jss::secret] =
"masterpassphrase";
2465 toSign[jss::fee_mult_max] = 900;
2466 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2467 auto result = rpcResult[jss::result];
2471 result[jss::tx_json].isMember(jss::Fee) &&
2472 result[jss::tx_json][jss::Fee] ==
"7813");
2474 result[jss::tx_json].isMember(jss::Sequence) &&
2475 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2484 auto& feeTrack = env.app().getFeeTrack();
2485 BEAST_EXPECT(feeTrack.getLoadFactor() == 256);
2486 for (
int i = 0; i < 8; ++i)
2487 feeTrack.raiseLocalFee();
2488 BEAST_EXPECT(feeTrack.getLoadFactor() == 1220);
2492 toSign[jss::tx_json] = noop(env.master);
2493 toSign[jss::secret] =
"masterpassphrase";
2494 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2495 auto result = rpcResult[jss::result];
2499 result[jss::tx_json].isMember(jss::Fee) &&
2500 result[jss::tx_json][jss::Fee] ==
"47");
2502 result[jss::tx_json].isMember(jss::Sequence) &&
2503 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2514 auto metrics = env.app().getTxQ().getMetrics(*env.current());
2515 if (metrics.openLedgerFeeLevel > metrics.minProcessingFeeLevel)
2517 env(noop(env.master), fee(47));
2523 toSign[jss::tx_json] = noop(env.master);
2524 toSign[jss::secret] =
"masterpassphrase";
2526 toSign[jss::fee_mult_max] = 700;
2527 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2528 auto result = rpcResult[jss::result];
2532 result[jss::tx_json].isMember(jss::Fee) &&
2533 result[jss::tx_json][jss::Fee] ==
"6806");
2535 result[jss::tx_json].isMember(jss::Sequence) &&
2536 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2555 using namespace std::chrono_literals;
2557 test::jtx::Account
const a{
"a"};
2558 test::jtx::Account
const g{
"g"};
2559 auto const USD = g[
"USD"];
2568 test::jtx::Env env(*
this);
2572 env(
trust(a, USD(1000)));
2573 env(
trust(env.master, USD(1000)));
2574 env(
pay(g, a, USD(50)));
2575 env(
pay(g, env.master, USD(50)));
2601 static TestStuff
const testFuncs[] = {
2608 "submit_multisigned",
2611 for (
auto testFunc : testFuncs)
2619 Throw<std::runtime_error>(
2620 "Internal JSONRPC_test error. Bad test JSON.");
2622 static Role const testedRoles[] = {
2625 for (
Role testRole : testedRoles)
2628 auto const signFn = get<0>(testFunc);
2629 if (signFn !=
nullptr)
2631 assert(get<1>(testFunc) ==
nullptr);
2642 auto const submitFn = get<1>(testFunc);
2643 assert(submitFn !=
nullptr);
2656 errStr = result[
"error_message"].
asString();
2658 if (errStr == txnTest.expMsg[get<3>(testFunc)])
2665 description << txnTest.description <<
" Called "
2666 << get<2>(testFunc) <<
"(). Got \'"
2668 fail(description.
str(), __FILE__, txnTest.line);
2685BEAST_DEFINE_TESTSUITE(JSONRPC, ripple_app,
ripple);
Unserialize a JSON document into a Value.
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
UInt size() const
Number of values in array or object.
std::string asString() const
Returns the unquoted string value.
void pass()
Record a successful test condition.
void fail(String const &reason, char const *file, int line)
Record a failure.
virtual Config & config()=0
virtual LoadFeeTrack & getFeeTrack()=0
Manages the current fee schedule.
std::uint32_t getLoadFactor() const
void testAutoFillEscalatedFees()
void testTransactionRPC()
static void fakeProcessTransaction(std::shared_ptr< Transaction > &, bool, bool, NetworkOPs::FailHard)
void run() override
Runs the suite.
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
@ uintValue
unsigned integer value
Json::Value transactionSign(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)> ProcessTransactionFn
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
static constexpr std::integral_constant< unsigned, Version > apiVersion
Json::Value transactionSubmit(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
Json::Value transactionSignFor(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
static constexpr TxnTestData txnTestArray[]
Json::Value checkFee(Json::Value &request, Role const role, bool doAutoFill, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app)
Fill in the fee on behalf of the client.
Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
Json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
std::string to_string(base_uint< Bits, Tag > const &a)
Role
Indicates the level of administrative permission to grant.
TxnTestData(TxnTestData const &)=delete
std::array< char const *const, 4 > const expMsg
TxnTestData & operator=(TxnTestData &&)=delete
TxnTestData & operator=(TxnTestData const &)=delete
constexpr TxnTestData(char const *description_, int line_, char const *json_, std::array< char const *const, 4 > const &expMsg_)
char const *const description
TxnTestData(TxnTestData &&)=delete