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>
52 char const* description_,
71 {
"Minimal payment, no Amount only DeliverMax",
74 "command": "doesnt_matter",
75 "secret": "masterpassphrase",
77 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
78 "DeliverMax": "1000000000",
79 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
80 "TransactionType": "Payment"
85 "Missing field 'account'.",
86 "Missing field 'tx_json.Sequence'."}}},
88 {
"Pass in Fee with minimal payment, both Amount and DeliverMax.",
91 "command": "doesnt_matter",
92 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
93 "secret": "masterpassphrase",
96 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
97 "Amount": "1000000000",
98 "DeliverMax": "1000000000",
99 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
100 "TransactionType": "Payment"
105 "Missing field 'tx_json.Sequence'.",
106 "Missing field 'tx_json.Sequence'."}}},
108 {
"Pass in Sequence, no Amount only DeliverMax",
111 "command": "doesnt_matter",
112 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
113 "secret": "masterpassphrase",
116 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
117 "DeliverMax": "1000000000",
118 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
119 "TransactionType": "Payment"
124 "Missing field 'tx_json.Fee'.",
125 "Missing field 'tx_json.SigningPubKey'."}}},
127 {
"Pass in Sequence and Fee with minimal payment, both Amount and "
131 "command": "doesnt_matter",
132 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
133 "secret": "masterpassphrase",
137 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
138 "Amount": "1000000000",
139 "DeliverMax": "1000000000",
140 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
141 "TransactionType": "Payment"
146 "A Signer may not be the transaction's Account "
147 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
148 "Missing field 'tx_json.SigningPubKey'."}}},
150 {
"Add 'fee_mult_max' field.",
153 "command": "doesnt_matter",
154 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
155 "secret": "masterpassphrase",
159 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
160 "Amount": "1000000000",
161 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
162 "TransactionType": "Payment"
167 "Missing field 'tx_json.Fee'.",
168 "Missing field 'tx_json.SigningPubKey'."}}},
170 {
"Add 'fee_mult_max' and 'fee_div_max' field.",
173 "command": "doesnt_matter",
174 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
175 "secret": "masterpassphrase",
180 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
181 "Amount": "1000000000",
182 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
183 "TransactionType": "Payment"
188 "Missing field 'tx_json.Fee'.",
189 "Missing field 'tx_json.SigningPubKey'."}}},
191 {
"fee_mult_max is ignored if 'Fee' is present.",
194 "command": "doesnt_matter",
195 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
196 "secret": "masterpassphrase",
201 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
202 "Amount": "1000000000",
203 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
204 "TransactionType": "Payment"
209 "A Signer may not be the transaction's Account "
210 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
211 "Missing field 'tx_json.SigningPubKey'."}}},
213 {
"fee_div_max is ignored if 'Fee' is present.",
216 "command": "doesnt_matter",
217 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
218 "secret": "masterpassphrase",
224 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
225 "Amount": "1000000000",
226 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
227 "TransactionType": "Payment"
232 "A Signer may not be the transaction's Account "
233 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
234 "Missing field 'tx_json.SigningPubKey'."}}},
236 {
"Invalid 'fee_mult_max' field.",
239 "command": "doesnt_matter",
240 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
241 "secret": "masterpassphrase",
242 "fee_mult_max": "NotAFeeMultiplier",
245 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
246 "Amount": "1000000000",
247 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
248 "TransactionType": "Payment"
251 {{"Invalid field 'fee_mult_max', not a positive integer.",
252 "Invalid field 'fee_mult_max', not a positive integer.",
253 "Missing field 'tx_json.Fee'.",
254 "Missing field 'tx_json.SigningPubKey'."}}},
256 {
"Invalid 'fee_div_max' field.",
259 "command": "doesnt_matter",
260 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
261 "secret": "masterpassphrase",
263 "fee_div_max": "NotAFeeMultiplier",
266 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
267 "Amount": "1000000000",
268 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
269 "TransactionType": "Payment"
272 {{"Invalid field 'fee_div_max', not a positive integer.",
273 "Invalid field 'fee_div_max', not a positive integer.",
274 "Missing field 'tx_json.Fee'.",
275 "Missing field 'tx_json.SigningPubKey'."}}},
277 {
"Invalid value for 'fee_mult_max' field.",
280 "command": "doesnt_matter",
281 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
282 "secret": "masterpassphrase",
286 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
287 "Amount": "1000000000",
288 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
289 "TransactionType": "Payment"
292 {{"Fee of 10 exceeds the requested tx limit of 0",
293 "Fee of 10 exceeds the requested tx limit of 0",
294 "Missing field 'tx_json.Fee'.",
295 "Missing field 'tx_json.SigningPubKey'."}}},
297 {
"Invalid value for 'fee_div_max' field.",
300 "command": "doesnt_matter",
301 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
302 "secret": "masterpassphrase",
307 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
308 "Amount": "1000000000",
309 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
310 "TransactionType": "Payment"
313 {{"Fee of 10 exceeds the requested tx limit of 5",
314 "Fee of 10 exceeds the requested tx limit of 5",
315 "Missing field 'tx_json.Fee'.",
316 "Missing field 'tx_json.SigningPubKey'."}}},
318 {
"Invalid zero value for 'fee_div_max' field.",
321 "command": "doesnt_matter",
322 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
323 "secret": "masterpassphrase",
328 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
329 "Amount": "1000000000",
330 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
331 "TransactionType": "Payment"
334 {{"Invalid field 'fee_div_max', not a positive integer.",
335 "Invalid field 'fee_div_max', not a positive integer.",
336 "Missing field 'tx_json.Fee'.",
337 "Missing field 'tx_json.SigningPubKey'."}}},
339 {
"Missing 'Amount'.",
342 "command": "doesnt_matter",
343 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
344 "secret": "masterpassphrase",
346 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
347 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
348 "TransactionType": "Payment"
351 {{"Missing field 'tx_json.Amount'.",
352 "Missing field 'tx_json.Amount'.",
353 "Missing field 'tx_json.Sequence'.",
354 "Missing field 'tx_json.Sequence'."}}},
356 {
"Invalid 'Amount'.",
359 "command": "doesnt_matter",
360 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
361 "secret": "masterpassphrase",
363 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
364 "Amount": "NotAnAmount",
365 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
366 "TransactionType": "Payment"
369 {{"Invalid field 'tx_json.Amount'.",
370 "Invalid field 'tx_json.Amount'.",
371 "Missing field 'tx_json.Sequence'.",
372 "Missing field 'tx_json.Sequence'."}}},
374 {
"Missing 'Destination'.",
377 "command": "doesnt_matter",
378 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
379 "secret": "masterpassphrase",
381 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
382 "Amount": "1000000000",
383 "TransactionType": "Payment"
386 {{"Missing field 'tx_json.Destination'.",
387 "Missing field 'tx_json.Destination'.",
388 "Missing field 'tx_json.Sequence'.",
389 "Missing field 'tx_json.Sequence'."}}},
391 {
"Invalid 'Destination'.",
394 "command": "doesnt_matter",
395 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
396 "secret": "masterpassphrase",
398 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
399 "Amount": "1000000000",
400 "Destination": "NotADestination",
401 "TransactionType": "Payment"
404 {{"Invalid field 'tx_json.Destination'.",
405 "Invalid field 'tx_json.Destination'.",
406 "Missing field 'tx_json.Sequence'.",
407 "Missing field 'tx_json.Sequence'."}}},
409 {
"Cannot create XRP to XRP paths.",
412 "command": "doesnt_matter",
413 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
414 "secret": "masterpassphrase",
417 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
418 "Amount": "1000000000",
419 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
420 "TransactionType": "Payment"
423 {{"Cannot build XRP to XRP paths.",
424 "Cannot build XRP to XRP paths.",
425 "Missing field 'tx_json.Sequence'.",
426 "Missing field 'tx_json.Sequence'."}}},
428 {
"Successful 'build_path'.",
431 "command": "doesnt_matter",
432 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
433 "secret": "masterpassphrase",
436 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
440 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
442 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
443 "TransactionType": "Payment"
448 "Missing field 'tx_json.Sequence'.",
449 "Missing field 'tx_json.Sequence'."}}},
451 {
"Not valid to include both 'Paths' and 'build_path'.",
454 "command": "doesnt_matter",
455 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
456 "secret": "masterpassphrase",
459 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
463 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
465 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
467 "TransactionType": "Payment"
470 {{"Cannot specify both 'tx_json.Paths' and 'build_path'",
471 "Cannot specify both 'tx_json.Paths' and 'build_path'",
472 "Missing field 'tx_json.Sequence'.",
473 "Missing field 'tx_json.Sequence'."}}},
475 {
"Successful 'SendMax'.",
478 "command": "doesnt_matter",
479 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
480 "secret": "masterpassphrase",
483 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
487 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
492 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
494 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
495 "TransactionType": "Payment"
500 "Missing field 'tx_json.Sequence'.",
501 "Missing field 'tx_json.Sequence'."}}},
503 {
"'Amount' may not be XRP for pathfinding, but 'SendMax' may be XRP.",
506 "command": "doesnt_matter",
507 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
508 "secret": "masterpassphrase",
511 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
515 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
518 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
519 "TransactionType": "Payment"
524 "Missing field 'tx_json.Sequence'.",
525 "Missing field 'tx_json.Sequence'."}}},
527 {
"'secret' must be present.",
530 "command": "doesnt_matter",
531 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
533 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
534 "Amount": "1000000000",
535 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
536 "TransactionType": "Payment"
539 {{"Missing field 'secret'.",
540 "Missing field 'secret'.",
541 "Missing field 'tx_json.Sequence'.",
542 "Missing field 'tx_json.Sequence'."}}},
544 {
"'secret' must be non-empty.",
547 "command": "doesnt_matter",
548 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
551 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
552 "Amount": "1000000000",
553 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
554 "TransactionType": "Payment"
557 {{"Invalid field 'secret'.",
558 "Invalid field 'secret'.",
559 "Missing field 'tx_json.Sequence'.",
560 "Missing field 'tx_json.Sequence'."}}},
562 {
"Use 'seed' instead of 'secret'.",
565 "command": "doesnt_matter",
566 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
567 "key_type": "ed25519",
568 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
570 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
571 "Amount": "1000000000",
572 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
573 "TransactionType": "Payment"
578 "Missing field 'tx_json.Sequence'.",
579 "Missing field 'tx_json.Sequence'."}}},
581 {
"Malformed 'seed'.",
584 "command": "doesnt_matter",
585 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
586 "key_type": "ed25519",
587 "seed": "not a seed",
589 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
590 "Amount": "1000000000",
591 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
592 "TransactionType": "Payment"
595 {{"Disallowed seed.",
597 "Missing field 'tx_json.Sequence'.",
598 "Missing field 'tx_json.Sequence'."}}},
600 {
"'tx_json' must be present.",
603 "command": "doesnt_matter",
604 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
605 "secret": "masterpassphrase",
607 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
608 "Amount": "1000000000",
609 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
610 "TransactionType": "Payment"
613 {{"Missing field 'tx_json'.",
614 "Missing field 'tx_json'.",
615 "Missing field 'tx_json'.",
616 "Missing field 'tx_json'."}}},
618 {
"'TransactionType' must be present.",
621 "command": "doesnt_matter",
622 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
623 "secret": "masterpassphrase",
625 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
626 "Amount": "1000000000",
627 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
630 {{"Missing field 'tx_json.TransactionType'.",
631 "Missing field 'tx_json.TransactionType'.",
632 "Missing field 'tx_json.Sequence'.",
633 "Missing field 'tx_json.Sequence'."}}},
635 {
"The 'TransactionType' must be a pre-established transaction type.",
638 "command": "doesnt_matter",
639 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
640 "secret": "masterpassphrase",
642 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
643 "Amount": "1000000000",
644 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
645 "TransactionType": "tt"
648 {{"Field 'tx_json.TransactionType' has invalid data.",
649 "Field 'tx_json.TransactionType' has invalid data.",
650 "Missing field 'tx_json.Sequence'.",
651 "Missing field 'tx_json.Sequence'."}}},
653 {
"The 'TransactionType' may be represented with an integer.",
656 "command": "doesnt_matter",
657 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
658 "secret": "masterpassphrase",
660 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
661 "Amount": "1000000000",
662 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
668 "Missing field 'tx_json.Sequence'.",
669 "Missing field 'tx_json.Sequence'."}}},
671 {
"'Account' must be present.",
674 "command": "doesnt_matter",
675 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
676 "secret": "masterpassphrase",
678 "Amount": "1000000000",
679 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
680 "TransactionType": "Payment"
683 {{"Missing field 'tx_json.Account'.",
684 "Missing field 'tx_json.Account'.",
685 "Missing field 'tx_json.Sequence'.",
686 "Missing field 'tx_json.Sequence'."}}},
688 {
"'Account' must be well formed.",
691 "command": "doesnt_matter",
692 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
693 "secret": "masterpassphrase",
695 "Account": "NotAnAccount",
696 "Amount": "1000000000",
697 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
698 "TransactionType": "Payment"
701 {{"Invalid field 'tx_json.Account'.",
702 "Invalid field 'tx_json.Account'.",
703 "Missing field 'tx_json.Sequence'.",
704 "Missing field 'tx_json.Sequence'."}}},
706 {
"The 'offline' tag may be added to the transaction.",
709 "command": "doesnt_matter",
710 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
711 "secret": "masterpassphrase",
714 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
715 "Amount": "1000000000",
716 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
717 "TransactionType": "Payment"
722 "Missing field 'tx_json.Sequence'.",
723 "Missing field 'tx_json.Sequence'."}}},
725 {
"If 'offline' is true then a 'Sequence' field must be supplied.",
728 "command": "doesnt_matter",
729 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
730 "secret": "masterpassphrase",
734 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
735 "Amount": "1000000000",
736 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
737 "TransactionType": "Payment"
740 {{"Missing field 'tx_json.Sequence'.",
741 "Missing field 'tx_json.Sequence'.",
742 "Missing field 'tx_json.Sequence'.",
743 "Missing field 'tx_json.Sequence'."}}},
745 {
"If 'offline' is true then a 'Fee' field must be supplied.",
748 "command": "doesnt_matter",
749 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
750 "secret": "masterpassphrase",
754 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
755 "Amount": "1000000000",
756 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
757 "TransactionType": "Payment"
760 {{"Missing field 'tx_json.Fee'.",
761 "Missing field 'tx_json.Fee'.",
762 "Missing field 'tx_json.Fee'.",
763 "Missing field 'tx_json.SigningPubKey'."}}},
765 {
"Valid transaction if 'offline' is true.",
768 "command": "doesnt_matter",
769 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
770 "secret": "masterpassphrase",
775 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
776 "Amount": "1000000000",
777 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
778 "TransactionType": "Payment"
783 "A Signer may not be the transaction's Account "
784 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
785 "Missing field 'tx_json.SigningPubKey'."}}},
787 {
"'offline' and 'build_path' are mutually exclusive.",
790 "command": "doesnt_matter",
791 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
792 "secret": "masterpassphrase",
798 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
799 "Amount": "1000000000",
800 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
801 "TransactionType": "Payment"
804 {{"Field 'build_path' not allowed in this context.",
805 "Field 'build_path' not allowed in this context.",
806 "Field 'build_path' not allowed in this context.",
807 "Missing field 'tx_json.SigningPubKey'."}}},
809 {
"A 'Flags' field may be specified.",
812 "command": "doesnt_matter",
813 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
814 "secret": "masterpassphrase",
817 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
818 "Amount": "1000000000",
819 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
820 "TransactionType": "Payment"
825 "Missing field 'tx_json.Sequence'.",
826 "Missing field 'tx_json.Sequence'."}}},
828 {
"The 'Flags' field must be numeric.",
831 "command": "doesnt_matter",
832 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
833 "secret": "masterpassphrase",
835 "Flags": "NotGoodFlags",
836 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
837 "Amount": "1000000000",
838 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
839 "TransactionType": "Payment"
842 {{"Field 'tx_json.Flags' has invalid data.",
843 "Field 'tx_json.Flags' has invalid data.",
844 "Missing field 'tx_json.Sequence'.",
845 "Missing field 'tx_json.Sequence'."}}},
847 {
"It's okay to add a 'debug_signing' field.",
850 "command": "doesnt_matter",
851 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
852 "secret": "masterpassphrase",
855 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
856 "Amount": "1000000000",
857 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
858 "TransactionType": "Payment"
863 "Missing field 'tx_json.Sequence'.",
864 "Missing field 'tx_json.Sequence'."}}},
866 {
"Single-sign a multisigned transaction.",
869 "command": "doesnt_matter",
870 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
873 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
874 "Amount" : "1000000000",
875 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
881 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
882 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
883 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
887 "SigningPubKey" : "",
888 "TransactionType" : "Payment"
891 {{"Already multisigned.",
892 "Already multisigned.",
893 "Secret does not match account.",
896 {
"Minimal sign_for.",
899 "command": "doesnt_matter",
900 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
901 "secret": "masterpassphrase",
903 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
904 "Amount": "1000000000",
905 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
909 "TransactionType": "Payment"
912 {{"Secret does not match account.",
913 "Secret does not match account.",
915 "Missing field 'tx_json.Signers'."}}},
917 {
"Minimal offline sign_for.",
920 "command": "doesnt_matter",
921 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
922 "secret": "masterpassphrase",
925 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
926 "Amount": "1000000000",
927 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
931 "TransactionType": "Payment"
934 {{"",
"",
"",
"Missing field 'tx_json.Signers'."}}},
936 {
"Offline sign_for using 'seed' instead of 'secret'.",
939 "command": "doesnt_matter",
940 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
941 "key_type": "ed25519",
942 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
945 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
946 "Amount": "1000000000",
947 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
951 "TransactionType": "Payment"
954 {{"",
"",
"",
"Missing field 'tx_json.Signers'."}}},
956 {
"Malformed seed in sign_for.",
959 "command": "doesnt_matter",
960 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
961 "key_type": "ed25519",
962 "seed": "sh1yJfwoi98zCygwjUzuHmJDeVKd",
965 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
966 "Amount": "1000000000",
967 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
971 "TransactionType": "Payment"
974 {{"Disallowed seed.",
977 "Missing field 'tx_json.Signers'."}}},
979 {
"Missing 'Account' in sign_for.",
982 "command": "doesnt_matter",
983 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
984 "secret": "masterpassphrase",
986 "Amount": "1000000000",
987 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
991 "TransactionType": "Payment"
994 {{"Missing field 'tx_json.Account'.",
995 "Missing field 'tx_json.Account'.",
996 "Missing field 'tx_json.Account'.",
997 "Missing field 'tx_json.Account'."}}},
999 {
"Missing 'Amount' in sign_for.",
1002 "command": "doesnt_matter",
1003 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1004 "secret": "masterpassphrase",
1006 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1007 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1010 "SigningPubKey": "",
1011 "TransactionType": "Payment"
1014 {{"Missing field 'tx_json.Amount'.",
1015 "Missing field 'tx_json.Amount'.",
1016 "Missing field 'tx_json.Amount'.",
1017 "Missing field 'tx_json.Amount'."}}},
1019 {
"Missing 'Destination' in sign_for.",
1022 "command": "doesnt_matter",
1023 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1024 "secret": "masterpassphrase",
1026 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1027 "Amount": "1000000000",
1030 "SigningPubKey": "",
1031 "TransactionType": "Payment"
1034 {{"Missing field 'tx_json.Destination'.",
1035 "Missing field 'tx_json.Destination'.",
1036 "Missing field 'tx_json.Destination'.",
1037 "Missing field 'tx_json.Destination'."}}},
1039 {
"Missing 'Destination' in sign_for, use DeliverMax",
1042 "command": "doesnt_matter",
1043 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1044 "secret": "masterpassphrase",
1046 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1047 "DeliverMax": "1000000000",
1050 "SigningPubKey": "",
1051 "TransactionType": "Payment"
1054 {{"Missing field 'tx_json.Destination'.",
1055 "Missing field 'tx_json.Destination'.",
1056 "Missing field 'tx_json.Destination'.",
1057 "Missing field 'tx_json.Destination'."}}},
1059 {
"Missing 'Fee' in sign_for.",
1062 "command": "doesnt_matter",
1063 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1064 "secret": "masterpassphrase",
1066 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1067 "Amount": "1000000000",
1068 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1070 "SigningPubKey": "",
1071 "TransactionType": "Payment"
1074 {{"Secret does not match account.",
1075 "Secret does not match account.",
1076 "Missing field 'tx_json.Fee'.",
1077 "Missing field 'tx_json.Fee'."}}},
1079 {
"Missing 'Sequence' in sign_for.",
1082 "command": "doesnt_matter",
1083 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1084 "secret": "masterpassphrase",
1086 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1087 "Amount": "1000000000",
1088 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1090 "SigningPubKey": "",
1091 "TransactionType": "Payment"
1094 {{"Secret does not match account.",
1095 "Secret does not match account.",
1096 "Missing field 'tx_json.Sequence'.",
1097 "Missing field 'tx_json.Sequence'."}}},
1099 {
"Missing 'SigningPubKey' in sign_for is automatically filled in.",
1102 "command": "doesnt_matter",
1103 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1104 "secret": "masterpassphrase",
1106 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1107 "Amount": "1000000000",
1108 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1111 "TransactionType": "Payment"
1114 {{"Secret does not match account.",
1115 "Secret does not match account.",
1117 "Missing field 'tx_json.SigningPubKey'."}}},
1119 {
"In sign_for, an account may not sign for itself.",
1122 "command": "doesnt_matter",
1123 "account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1126 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1127 "Amount": "1000000000",
1128 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1131 "TransactionType": "Payment"
1136 "A Signer may not be the transaction's Account "
1137 "(rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA).",
1138 "Missing field 'tx_json.SigningPubKey'."}}},
1140 {
"Cannot put duplicate accounts in Signers array",
1143 "command": "doesnt_matter",
1144 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1145 "secret": "masterpassphrase",
1147 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1148 "Amount" : "1000000000",
1149 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1155 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1156 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1157 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1161 "SigningPubKey" : "",
1162 "TransactionType" : "Payment"
1165 {{"Already multisigned.",
1166 "Already multisigned.",
1167 "Duplicate Signers:Signer:Account entries "
1168 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh) are not allowed.",
1171 {
"Correctly append to pre-established Signers array",
1174 "command": "doesnt_matter",
1175 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1178 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1179 "Amount" : "1000000000",
1180 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1186 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1187 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1188 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1192 "SigningPubKey" : "",
1193 "TransactionType" : "Payment"
1196 {{"Already multisigned.",
"Already multisigned.",
"",
""}}},
1198 {
"Append to pre-established Signers array with bad signature",
1201 "command": "doesnt_matter",
1202 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1205 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1206 "Amount" : "1000000000",
1207 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1213 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1214 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1215 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ACB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1219 "SigningPubKey" : "",
1220 "TransactionType" : "Payment"
1223 {{"Already multisigned.",
1224 "Already multisigned.",
1225 "Invalid signature.",
1226 "Invalid signature."}}},
1228 {
"Non-empty 'SigningPubKey' in sign_for.",
1231 "command": "doesnt_matter",
1232 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1233 "secret": "masterpassphrase",
1235 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1236 "Amount": "1000000000",
1237 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1240 "SigningPubKey": "1",
1241 "TransactionType": "Payment"
1244 {{"Secret does not match account.",
1245 "Secret does not match account.",
1246 "When multi-signing 'tx_json.SigningPubKey' must be empty.",
1247 "When multi-signing 'tx_json.SigningPubKey' must be empty."}}},
1249 {
"Missing 'TransactionType' in sign_for.",
1252 "command": "doesnt_matter",
1253 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1254 "secret": "masterpassphrase",
1256 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1257 "Amount": "1000000000",
1258 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1261 "SigningPubKey": "",
1264 {{"Missing field 'tx_json.TransactionType'.",
1265 "Missing field 'tx_json.TransactionType'.",
1266 "Missing field 'tx_json.TransactionType'.",
1267 "Missing field 'tx_json.TransactionType'."}}},
1269 {
"TxnSignature in sign_for.",
1272 "command": "doesnt_matter",
1273 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1276 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1277 "Amount" : "1000000000",
1278 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1284 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1285 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1286 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1290 "SigningPubKey" : "",
1291 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998",
1292 "TransactionType" : "Payment"
1295 {{"Already multisigned.",
1296 "Already multisigned.",
1297 "Already single-signed.",
1298 "Signing of transaction is malformed."}}},
1300 {
"Invalid field 'tx_json': string instead of object",
1303 "command": "doesnt_matter",
1304 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1305 "secret": "masterpassphrase",
1308 {{"Invalid field 'tx_json', not object.",
1309 "Invalid field 'tx_json', not object.",
1310 "Invalid field 'tx_json', not object.",
1311 "Invalid field 'tx_json', not object."}}},
1313 {
"Invalid field 'tx_json': integer instead of object",
1316 "command": "doesnt_matter",
1317 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1318 "secret": "masterpassphrase",
1321 {{"Invalid field 'tx_json', not object.",
1322 "Invalid field 'tx_json', not object.",
1323 "Invalid field 'tx_json', not object.",
1324 "Invalid field 'tx_json', not object."}}},
1326 {
"Invalid field 'tx_json': array instead of object",
1329 "command": "doesnt_matter",
1330 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1331 "secret": "masterpassphrase",
1332 "tx_json": [ "hello", "world" ]
1334 {{"Invalid field 'tx_json', not object.",
1335 "Invalid field 'tx_json', not object.",
1336 "Invalid field 'tx_json', not object.",
1337 "Invalid field 'tx_json', not object."}}},
1339 {
"Pass in Fee with minimal payment, both Amount and DeliverMax.",
1342 "command": "doesnt_matter",
1343 "account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1344 "secret": "ssgN6zTvtM1q9XV8DvJpWm8LBYWiY",
1347 "Account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1348 "Amount": "1000000000",
1349 "DeliverMax": "1000000000",
1350 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1351 "TransactionType": "Payment"
1354 {{"Source account not found.",
1355 "Source account not found.",
1356 "Missing field 'tx_json.Sequence'.",
1357 "Missing field 'tx_json.Sequence'."}}},
1359 {
"Minimal submit_multisigned.",
1362 "command": "submit_multisigned",
1364 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1365 "Amount": "1000000000",
1366 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1372 "Account" : "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1373 "SigningPubKey" : "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
1374 "TxnSignature" : "3045022100909D01399AFFAD1E30D250CE61F93975B7F61E47B5244D78C3E86D9806535D95022012E389E0ACB016334052B7FE07FA6CEFDC8BE82CB410FA841D5049641C89DC8F"
1378 "SigningPubKey": "",
1379 "TransactionType": "Payment"
1382 {{"Missing field 'secret'.",
1383 "Missing field 'secret'.",
1384 "Missing field 'account'.",
1387 {
"Minimal submit_multisigned with bad signature.",
1390 "command": "submit_multisigned",
1392 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1393 "Amount": "1000000000",
1394 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1400 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1401 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1402 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1406 "SigningPubKey": "",
1407 "TransactionType": "Payment"
1410 {{"Missing field 'secret'.",
1411 "Missing field 'secret'.",
1412 "Missing field 'account'.",
1413 "Invalid signature."}}},
1415 {
"Missing tx_json in submit_multisigned.",
1418 "command": "submit_multisigned",
1422 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1423 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1424 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1429 {{"Missing field 'secret'.",
1430 "Missing field 'secret'.",
1431 "Missing field 'account'.",
1432 "Missing field 'tx_json'."}}},
1434 {
"Missing sequence in submit_multisigned.",
1437 "command": "submit_multisigned",
1439 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1440 "Amount": "1000000000",
1441 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1446 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1447 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1448 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1452 "SigningPubKey": "",
1453 "TransactionType": "Payment"
1456 {{"Missing field 'secret'.",
1457 "Missing field 'secret'.",
1458 "Missing field 'account'.",
1459 "Missing field 'tx_json.Sequence'."}}},
1461 {
"Missing SigningPubKey in submit_multisigned.",
1464 "command": "submit_multisigned",
1466 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1467 "Amount": "1000000000",
1468 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1473 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1474 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1475 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1480 "TransactionType": "Payment"
1483 {{"Missing field 'secret'.",
1484 "Missing field 'secret'.",
1485 "Missing field 'account'.",
1486 "Missing field 'tx_json.SigningPubKey'."}}},
1488 {
"Non-empty SigningPubKey in submit_multisigned.",
1491 "command": "submit_multisigned",
1493 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1494 "Amount": "1000000000",
1495 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1501 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1502 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1503 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1507 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
1508 "TransactionType": "Payment"
1511 {{"Missing field 'secret'.",
1512 "Missing field 'secret'.",
1513 "Missing field 'account'.",
1514 "When multi-signing 'tx_json.SigningPubKey' must be empty."}}},
1516 {
"Missing TransactionType in submit_multisigned.",
1519 "command": "submit_multisigned",
1521 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1522 "Amount": "1000000000",
1523 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1528 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1529 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1530 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1535 "SigningPubKey": "",
1538 {{"Missing field 'secret'.",
1539 "Missing field 'secret'.",
1540 "Missing field 'account'.",
1541 "Missing field 'tx_json.TransactionType'."}}},
1543 {
"Missing Account in submit_multisigned.",
1546 "command": "submit_multisigned",
1548 "Amount": "1000000000",
1549 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1555 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1556 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1557 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1561 "SigningPubKey": "",
1562 "TransactionType": "Payment"
1565 {{"Missing field 'secret'.",
1566 "Missing field 'secret'.",
1567 "Missing field 'account'.",
1568 "Missing field 'tx_json.Account'."}}},
1570 {
"Malformed Account in submit_multisigned.",
1573 "command": "submit_multisigned",
1575 "Account": "NotAnAccount",
1576 "Amount": "1000000000",
1577 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1583 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1584 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1585 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1589 "SigningPubKey": "",
1590 "TransactionType": "Payment"
1593 {{"Missing field 'secret'.",
1594 "Missing field 'secret'.",
1595 "Missing field 'account'.",
1596 "Invalid field 'tx_json.Account'."}}},
1598 {
"Account not in ledger in submit_multisigned.",
1601 "command": "submit_multisigned",
1603 "Account": "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd",
1604 "Amount": "1000000000",
1605 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1611 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1612 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1613 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1617 "SigningPubKey": "",
1618 "TransactionType": "Payment"
1621 {{"Missing field 'secret'.",
1622 "Missing field 'secret'.",
1623 "Missing field 'account'.",
1624 "Source account not found."}}},
1626 {
"Missing Fee in submit_multisigned.",
1629 "command": "submit_multisigned",
1631 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1632 "Amount": "1000000000",
1633 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1638 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1639 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1640 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1644 "SigningPubKey": "",
1645 "TransactionType": "Payment"
1648 {{"Missing field 'secret'.",
1649 "Missing field 'secret'.",
1650 "Missing field 'account'.",
1651 "Missing field 'tx_json.Fee'."}}},
1653 {
"Non-numeric Fee in submit_multisigned.",
1656 "command": "submit_multisigned",
1658 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1659 "Amount": "1000000000",
1660 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1666 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1667 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1668 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1672 "SigningPubKey": "",
1673 "TransactionType": "Payment"
1676 {{"Missing field 'secret'.",
1677 "Missing field 'secret'.",
1678 "Missing field 'account'.",
1679 "Field 'tx_json.Fee' has invalid data."}}},
1681 {
"Missing Amount in submit_multisigned Payment.",
1684 "command": "submit_multisigned",
1686 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1687 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1693 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1694 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1695 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1699 "SigningPubKey": "",
1700 "TransactionType": "Payment"
1703 {{"Missing field 'secret'.",
1704 "Missing field 'secret'.",
1705 "Missing field 'account'.",
1706 "Missing field 'tx_json.Amount'."}}},
1708 {
"Invalid Amount in submit_multisigned Payment.",
1711 "command": "submit_multisigned",
1713 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1714 "Amount": "NotANumber",
1715 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1721 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1722 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1723 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1727 "SigningPubKey": "",
1728 "TransactionType": "Payment"
1731 {{"Missing field 'secret'.",
1732 "Missing field 'secret'.",
1733 "Missing field 'account'.",
1734 "Invalid field 'tx_json.Amount'."}}},
1736 {
"Invalid DeliverMax in submit_multisigned Payment.",
1739 "command": "submit_multisigned",
1741 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1742 "DeliverMax": "NotANumber",
1743 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1749 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1750 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1751 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1755 "SigningPubKey": "",
1756 "TransactionType": "Payment"
1759 {{"Missing field 'secret'.",
1760 "Missing field 'secret'.",
1761 "Missing field 'account'.",
1762 "Invalid field 'tx_json.Amount'."}}},
1764 {
"No build_path in submit_multisigned.",
1767 "command": "submit_multisigned",
1770 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1771 "Amount": "1000000000",
1772 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1778 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1779 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1780 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1784 "SigningPubKey": "",
1785 "TransactionType": "Payment"
1788 {{"Missing field 'secret'.",
1789 "Missing field 'secret'.",
1790 "Missing field 'account'.",
1791 "Field 'build_path' not allowed in this context."}}},
1793 {
"Missing Destination in submit_multisigned Payment.",
1796 "command": "submit_multisigned",
1798 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1799 "Amount": "1000000000",
1805 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1806 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1807 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1811 "SigningPubKey": "",
1812 "TransactionType": "Payment"
1815 {{"Missing field 'secret'.",
1816 "Missing field 'secret'.",
1817 "Missing field 'account'.",
1818 "Missing field 'tx_json.Destination'."}}},
1820 {
"Malformed Destination in submit_multisigned Payment.",
1823 "command": "submit_multisigned",
1825 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1826 "Amount": "1000000000",
1827 "Destination": "NotADestination",
1833 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1834 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1835 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1839 "SigningPubKey": "",
1840 "TransactionType": "Payment"
1843 {{"Missing field 'secret'.",
1844 "Missing field 'secret'.",
1845 "Missing field 'account'.",
1846 "Invalid field 'tx_json.Destination'."}}},
1848 {
"Missing Signers field in submit_multisigned.",
1851 "command": "submit_multisigned",
1853 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1854 "Amount": "1000000000",
1855 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1858 "SigningPubKey": "",
1859 "TransactionType": "Payment"
1862 {{"Missing field 'secret'.",
1863 "Missing field 'secret'.",
1864 "Missing field 'account'.",
1865 "Missing field 'tx_json.Signers'."}}},
1867 {
"Signers not an array in submit_multisigned.",
1870 "command": "submit_multisigned",
1872 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1873 "Amount": "1000000000",
1874 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1878 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1879 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1880 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1882 "SigningPubKey": "",
1883 "TransactionType": "Payment"
1886 {{"Missing field 'secret'.",
1887 "Missing field 'secret'.",
1888 "Missing field 'account'.",
1889 "Field 'tx_json.Signers' is not a JSON array."}}},
1891 {
"Empty Signers array in submit_multisigned.",
1894 "command": "submit_multisigned",
1896 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1897 "Amount": "1000000000",
1898 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1903 "SigningPubKey": "",
1904 "TransactionType": "Payment"
1907 {{"Missing field 'secret'.",
1908 "Missing field 'secret'.",
1909 "Missing field 'account'.",
1910 "tx_json.Signers array may not be empty."}}},
1912 {
"Duplicate Signer in submit_multisigned.",
1915 "command": "submit_multisigned",
1917 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1918 "Amount": "1000000000",
1919 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1925 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1926 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1927 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1932 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1933 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1934 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1938 "SigningPubKey": "",
1939 "TransactionType": "Payment"
1942 {{"Missing field 'secret'.",
1943 "Missing field 'secret'.",
1944 "Missing field 'account'.",
1945 "Duplicate Signers:Signer:Account entries "
1946 "(rPcNzota6B8YBokhYtcTNqQVCngtbnWfux) are not allowed."}}},
1948 {
"Signer is tx_json Account in submit_multisigned.",
1951 "command": "submit_multisigned",
1953 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1954 "Amount": "1000000000",
1955 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1961 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1962 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1963 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1967 "SigningPubKey": "",
1968 "TransactionType": "Payment"
1971 {{"Missing field 'secret'.",
1972 "Missing field 'secret'.",
1973 "Missing field 'account'.",
1974 "A Signer may not be the transaction's Account "
1975 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh)."}}},
1977 {
"Empty Signers array in submit_multisigned, use DeliverMax",
1980 "command": "submit_multisigned",
1982 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1983 "DeliverMax": "10000000",
1984 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1989 "SigningPubKey": "",
1990 "TransactionType": "Payment"
1993 {{"Missing field 'secret'.",
1994 "Missing field 'secret'.",
1995 "Missing field 'account'.",
1996 "tx_json.Signers array may not be empty."}}},
1998 {
"Empty Signers array in submit_multisigned, use DeliverMax and Amount",
2001 "command": "submit_multisigned",
2003 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2004 "Amount": "10000000",
2005 "DeliverMax": "10000000",
2006 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2011 "SigningPubKey": "",
2012 "TransactionType": "Payment"
2015 {{"Missing field 'secret'.",
2016 "Missing field 'secret'.",
2017 "Missing field 'account'.",
2018 "tx_json.Signers array may not be empty."}}},
2020 {
"Payment cannot specify different DeliverMax and Amount.",
2023 "command": "doesnt_matter",
2024 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2025 "secret": "masterpassphrase",
2028 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2029 "Amount": "1000000000",
2030 "DeliverMax": "1000000020",
2031 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2034 "SigningPubKey": "",
2035 "TransactionType": "Payment"
2038 {{"Cannot specify differing 'Amount' and 'DeliverMax'",
2039 "Cannot specify differing 'Amount' and 'DeliverMax'",
2040 "Cannot specify differing 'Amount' and 'DeliverMax'",
2041 "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");
2072 "{ \"fee_mult_max\" : 1, \"tx_json\" : { } } ", req);
2084 req[jss::tx_json].isMember(jss::Fee) &&
2085 req[jss::tx_json][jss::Fee] == 10);
2091 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 2, "
2092 "\"tx_json\" : { } } ",
2105 req[jss::tx_json].isMember(jss::Fee) &&
2106 req[jss::tx_json][jss::Fee] == 10);
2112 "{ \"fee_mult_max\" : 0, \"tx_json\" : { } } ", req);
2123 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2131 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 6, "
2132 "\"tx_json\" : { } } ",
2144 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2150 "{ \"fee_mult_max\" : 0, \"fee_div_max\" : 2, "
2151 "\"tx_json\" : { } } ",
2163 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2169 "{ \"fee_mult_max\" : 10, \"fee_div_max\" : 0, "
2170 "\"tx_json\" : { } } ",
2182 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2200 BEAST_EXPECT(result.
size() == 0);
2202 req[jss::tx_json].isMember(jss::Fee) &&
2203 req[jss::tx_json][jss::Fee] ==
2204 env.
current()->fees().increment.jsonClipped());
2211 testcase(
"autofill escalated fees");
2212 using namespace test::jtx;
2214 cfg->loadFromString(
"[" SECTION_SIGNING_SUPPORT
"]\ntrue");
2215 cfg->section(
"transaction_queue")
2216 .
set(
"minimum_txn_in_ledger_standalone",
"3");
2219 LoadFeeTrack const& feeTrackOuter = env.app().getFeeTrack();
2226 "fee_mult_max" : 1000,
2241 req[jss::tx_json].isMember(jss::Fee) &&
2242 req[jss::tx_json][jss::Fee] == 10);
2265 req[jss::tx_json].isMember(jss::Fee) &&
2266 req[jss::tx_json][jss::Fee] == 10);
2270 for (
auto i = 0; i < 4; ++i)
2272 env(noop(env.master));
2280 "fee_mult_max" : 1000,
2295 req[jss::tx_json].isMember(jss::Fee) &&
2296 req[jss::tx_json][jss::Fee] == 8889);
2318 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2326 "fee_mult_max" : 1000,
2341 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
2349 "fee_mult_max" : 8000,
2365 req[jss::tx_json].isMember(jss::Fee) &&
2366 req[jss::tx_json][jss::Fee] == 8889);
2374 "fee_mult_max" : -5,
2416 "fee_mult_max" : -2,
2438 toSign[jss::tx_json] = noop(env.master);
2439 toSign[jss::secret] =
"masterpassphrase";
2440 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2441 auto result = rpcResult[jss::result];
2445 result[jss::tx_json].isMember(jss::Fee) &&
2446 result[jss::tx_json][jss::Fee] ==
"10");
2448 result[jss::tx_json].isMember(jss::Sequence) &&
2449 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2458 auto metrics = env.app().getTxQ().getMetrics(*env.current());
2459 if (metrics.openLedgerFeeLevel > metrics.minProcessingFeeLevel)
2461 env(noop(env.master));
2465 toSign[jss::tx_json] = noop(env.master);
2466 toSign[jss::secret] =
"masterpassphrase";
2467 toSign[jss::fee_mult_max] = 900;
2468 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2469 auto result = rpcResult[jss::result];
2473 result[jss::tx_json].isMember(jss::Fee) &&
2474 result[jss::tx_json][jss::Fee] ==
"7813");
2476 result[jss::tx_json].isMember(jss::Sequence) &&
2477 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2486 auto& feeTrack = env.app().getFeeTrack();
2487 BEAST_EXPECT(feeTrack.getLoadFactor() == 256);
2488 for (
int i = 0; i < 8; ++i)
2489 feeTrack.raiseLocalFee();
2490 BEAST_EXPECT(feeTrack.getLoadFactor() == 1220);
2494 toSign[jss::tx_json] = noop(env.master);
2495 toSign[jss::secret] =
"masterpassphrase";
2496 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2497 auto result = rpcResult[jss::result];
2501 result[jss::tx_json].isMember(jss::Fee) &&
2502 result[jss::tx_json][jss::Fee] ==
"47");
2504 result[jss::tx_json].isMember(jss::Sequence) &&
2505 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2516 auto metrics = env.app().getTxQ().getMetrics(*env.current());
2517 if (metrics.openLedgerFeeLevel > metrics.minProcessingFeeLevel)
2519 env(noop(env.master), fee(47));
2525 toSign[jss::tx_json] = noop(env.master);
2526 toSign[jss::secret] =
"masterpassphrase";
2528 toSign[jss::fee_mult_max] = 700;
2529 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2530 auto result = rpcResult[jss::result];
2534 result[jss::tx_json].isMember(jss::Fee) &&
2535 result[jss::tx_json][jss::Fee] ==
"6806");
2537 result[jss::tx_json].isMember(jss::Sequence) &&
2538 result[jss::tx_json][jss::Sequence].isConvertibleTo(
2547 using namespace test::jtx;
2549 cfg->NETWORK_ID = 1025;
2555 toSign[jss::tx_json] = noop(env.master);
2557 BEAST_EXPECT(!toSign[jss::tx_json].isMember(jss::NetworkID));
2558 toSign[jss::secret] =
"masterpassphrase";
2559 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
2560 auto result = rpcResult[jss::result];
2564 result[jss::tx_json].isMember(jss::NetworkID) &&
2565 result[jss::tx_json][jss::NetworkID] == 1025);
2584 using namespace std::chrono_literals;
2586 test::jtx::Account
const a{
"a"};
2587 test::jtx::Account
const g{
"g"};
2588 auto const USD = g[
"USD"];
2597 test::jtx::Env env(*
this);
2601 env(
trust(a, USD(1000)));
2602 env(
trust(env.master, USD(1000)));
2603 env(
pay(g, a, USD(50)));
2604 env(
pay(g, env.master, USD(50)));
2630 static TestStuff
const testFuncs[] = {
2637 "submit_multisigned",
2640 for (
auto testFunc : testFuncs)
2648 Throw<std::runtime_error>(
2649 "Internal JSONRPC_test error. Bad test JSON.");
2651 static Role const testedRoles[] = {
2654 for (
Role testRole : testedRoles)
2657 auto const signFn = get<0>(testFunc);
2658 if (signFn !=
nullptr)
2660 assert(get<1>(testFunc) ==
nullptr);
2671 auto const submitFn = get<1>(testFunc);
2672 assert(submitFn !=
nullptr);
2685 errStr = result[
"error_message"].
asString();
2687 if (errStr == txnTest.expMsg[get<3>(testFunc)])
2694 description << txnTest.description <<
" Called "
2695 << get<2>(testFunc) <<
"(). Got \'"
2697 fail(description.
str(), __FILE__, txnTest.line);
2715BEAST_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.
testcase_t testcase
Memberspace for declaring test cases.
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.
void testAutoFillNetworkID()
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