1#include <test/jtx/Account.h>
2#include <test/jtx/Env.h>
3#include <test/jtx/Env_ss.h>
4#include <test/jtx/acctdelete.h>
5#include <test/jtx/amount.h>
6#include <test/jtx/batch.h>
7#include <test/jtx/envconfig.h>
8#include <test/jtx/fee.h>
9#include <test/jtx/multisign.h>
10#include <test/jtx/noop.h>
11#include <test/jtx/pay.h>
12#include <test/jtx/trust.h>
14#include <xrpld/app/misc/TxQ.h>
15#include <xrpld/rpc/Role.h>
16#include <xrpld/rpc/detail/TransactionSign.h>
18#include <xrpl/basics/contract.h>
19#include <xrpl/beast/unit_test/suite.h>
20#include <xrpl/config/Constants.h>
21#include <xrpl/json/json_reader.h>
22#include <xrpl/json/json_value.h>
23#include <xrpl/json/to_string.h>
24#include <xrpl/protocol/ErrorCodes.h>
25#include <xrpl/protocol/KeyType.h>
26#include <xrpl/protocol/TxFlags.h>
27#include <xrpl/protocol/jss.h>
28#include <xrpl/server/LoadFeeTrack.h>
29#include <xrpl/server/NetworkOPs.h>
93 "Minimal payment, no Amount only DeliverMax",
96 "command": "dummy_command",
97 "secret": "masterpassphrase",
99 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
100 "DeliverMax": "1000000000",
101 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
102 "TransactionType": "Payment"
116 "Pass in Fee with minimal payment, both Amount and DeliverMax.",
119 "command": "dummy_command",
120 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
121 "secret": "masterpassphrase",
124 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
125 "Amount": "1000000000",
126 "DeliverMax": "1000000000",
127 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
128 "TransactionType": "Payment"
142 "Pass in Sequence, no Amount only DeliverMax",
145 "command": "dummy_command",
146 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
147 "secret": "masterpassphrase",
150 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
151 "DeliverMax": "1000000000",
152 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
153 "TransactionType": "Payment"
161 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
167 "Pass in Sequence and Fee with minimal payment, both Amount and "
171 "command": "dummy_command",
172 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
173 "secret": "masterpassphrase",
177 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
178 "Amount": "1000000000",
179 "DeliverMax": "1000000000",
180 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
181 "TransactionType": "Payment"
191 "A Signer may not be the transaction's Account "
192 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
194 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
200 "Add 'fee_mult_max' field.",
203 "command": "dummy_command",
204 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
205 "secret": "masterpassphrase",
209 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
210 "Amount": "1000000000",
211 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
212 "TransactionType": "Payment"
220 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
226 "Add 'fee_mult_max' and 'fee_div_max' field.",
229 "command": "dummy_command",
230 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
231 "secret": "masterpassphrase",
236 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
237 "Amount": "1000000000",
238 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
239 "TransactionType": "Payment"
247 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
253 "fee_mult_max is ignored if 'Fee' is present.",
256 "command": "dummy_command",
257 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
258 "secret": "masterpassphrase",
263 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
264 "Amount": "1000000000",
265 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
266 "TransactionType": "Payment"
276 "A Signer may not be the transaction's Account "
277 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
279 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
285 "fee_div_max is ignored if 'Fee' is present.",
288 "command": "dummy_command",
289 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
290 "secret": "masterpassphrase",
296 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
297 "Amount": "1000000000",
298 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
299 "TransactionType": "Payment"
309 "A Signer may not be the transaction's Account "
310 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
312 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
318 "Invalid 'fee_mult_max' field.",
321 "command": "dummy_command",
322 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
323 "secret": "masterpassphrase",
324 "fee_mult_max": "NotAFeeMultiplier",
327 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
328 "Amount": "1000000000",
329 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
330 "TransactionType": "Payment"
335 {"highFee",
RpcHighFee,
"Invalid field 'fee_mult_max', not a positive integer."},
336 {
"highFee",
RpcHighFee,
"Invalid field 'fee_mult_max', not a positive integer."},
338 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
344 "Invalid 'fee_div_max' field.",
347 "command": "dummy_command",
348 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
349 "secret": "masterpassphrase",
351 "fee_div_max": "NotAFeeMultiplier",
354 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
355 "Amount": "1000000000",
356 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
357 "TransactionType": "Payment"
362 {"highFee",
RpcHighFee,
"Invalid field 'fee_div_max', not a positive integer."},
363 {
"highFee",
RpcHighFee,
"Invalid field 'fee_div_max', not a positive integer."},
365 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
371 "Invalid value for 'fee_mult_max' field.",
374 "command": "dummy_command",
375 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
376 "secret": "masterpassphrase",
380 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
381 "Amount": "1000000000",
382 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
383 "TransactionType": "Payment"
388 {"highFee",
RpcHighFee,
"Fee of 10 exceeds the requested tx limit of 0"},
389 {
"highFee",
RpcHighFee,
"Fee of 10 exceeds the requested tx limit of 0"},
391 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
397 "Invalid value for 'fee_div_max' field.",
400 "command": "dummy_command",
401 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
402 "secret": "masterpassphrase",
407 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
408 "Amount": "1000000000",
409 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
410 "TransactionType": "Payment"
415 {"highFee",
RpcHighFee,
"Fee of 10 exceeds the requested tx limit of 5"},
416 {
"highFee",
RpcHighFee,
"Fee of 10 exceeds the requested tx limit of 5"},
418 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
424 "Invalid zero value for 'fee_div_max' field.",
427 "command": "dummy_command",
428 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
429 "secret": "masterpassphrase",
434 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
435 "Amount": "1000000000",
436 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
437 "TransactionType": "Payment"
445 "Invalid field 'fee_div_max', not a positive integer.",
450 "Invalid field 'fee_div_max', not a positive integer.",
453 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
462 "command": "dummy_command",
463 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
464 "secret": "masterpassphrase",
466 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
467 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
468 "TransactionType": "Payment"
485 "command": "dummy_command",
486 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
487 "secret": "masterpassphrase",
489 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
490 "Amount": "NotAnAmount",
491 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
492 "TransactionType": "Payment"
506 "Missing 'Destination'.",
509 "command": "dummy_command",
510 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
511 "secret": "masterpassphrase",
513 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
514 "Amount": "1000000000",
515 "TransactionType": "Payment"
520 {"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
521 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
529 "Invalid 'Destination'.",
532 "command": "dummy_command",
533 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
534 "secret": "masterpassphrase",
536 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
537 "Amount": "1000000000",
538 "Destination": "NotADestination",
539 "TransactionType": "Payment"
544 {"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json.Destination'."},
545 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json.Destination'."},
553 "Cannot create XRP to XRP paths.",
556 "command": "dummy_command",
557 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
558 "secret": "masterpassphrase",
561 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
562 "Amount": "1000000000",
563 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
564 "TransactionType": "Payment"
578 "Successful 'build_path'.",
581 "command": "dummy_command",
582 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
583 "secret": "masterpassphrase",
586 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
590 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
592 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
593 "TransactionType": "Payment"
607 "Not valid to include both 'Paths' and 'build_path'.",
610 "command": "dummy_command",
611 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
612 "secret": "masterpassphrase",
615 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
619 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
621 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
623 "TransactionType": "Payment"
631 "Cannot specify both 'tx_json.Paths' and 'build_path'",
636 "Cannot specify both 'tx_json.Paths' and 'build_path'",
645 "Successful 'SendMax'.",
648 "command": "dummy_command",
649 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
650 "secret": "masterpassphrase",
653 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
657 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
662 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
664 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
665 "TransactionType": "Payment"
679 "'Amount' may not be XRP for pathfinding, but 'SendMax' may be XRP.",
682 "command": "dummy_command",
683 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
684 "secret": "masterpassphrase",
687 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
691 "issuer": "rLPwWB1itaUGMV8kbMLLysjGkEpTM2Soy4"
694 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
695 "TransactionType": "Payment"
709 "'secret' must be present.",
712 "command": "dummy_command",
713 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
715 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
716 "Amount": "1000000000",
717 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
718 "TransactionType": "Payment"
732 "'secret' must be non-empty.",
735 "command": "dummy_command",
736 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
739 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
740 "Amount": "1000000000",
741 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
742 "TransactionType": "Payment"
747 {"badSeed",
RpcBadSeed,
"Invalid field 'secret'."},
748 {
"badSeed",
RpcBadSeed,
"Invalid field 'secret'."},
756 "Use 'seed' instead of 'secret'.",
759 "command": "dummy_command",
760 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
761 "key_type": "ed25519",
762 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
764 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
765 "Amount": "1000000000",
766 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
767 "TransactionType": "Payment"
784 "command": "dummy_command",
785 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
786 "key_type": "ed25519",
787 "seed": "not a seed",
789 "Account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
790 "Amount": "1000000000",
791 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
792 "TransactionType": "Payment"
806 "'tx_json' must be present.",
809 "command": "dummy_command",
810 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
811 "secret": "masterpassphrase",
813 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
814 "Amount": "1000000000",
815 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
816 "TransactionType": "Payment"
830 "'TransactionType' must be present.",
833 "command": "dummy_command",
834 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
835 "secret": "masterpassphrase",
837 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
838 "Amount": "1000000000",
839 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
844 {"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
845 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
853 "The 'TransactionType' must be a pre-established transaction type.",
856 "command": "dummy_command",
857 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
858 "secret": "masterpassphrase",
860 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
861 "Amount": "1000000000",
862 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
863 "TransactionType": "tt"
871 "Field 'tx_json.TransactionType' has invalid data.",
876 "Field 'tx_json.TransactionType' has invalid data.",
885 "The 'TransactionType' may be represented with an integer.",
888 "command": "dummy_command",
889 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
890 "secret": "masterpassphrase",
892 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
893 "Amount": "1000000000",
894 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
909 "'Account' must be present.",
912 "command": "dummy_command",
913 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
914 "secret": "masterpassphrase",
916 "Amount": "1000000000",
917 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
918 "TransactionType": "Payment"
932 "'Account' must be well formed.",
935 "command": "dummy_command",
936 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
937 "secret": "masterpassphrase",
939 "Account": "NotAnAccount",
940 "Amount": "1000000000",
941 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
942 "TransactionType": "Payment"
956 "The 'offline' tag may be added to the transaction.",
959 "command": "dummy_command",
960 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
961 "secret": "masterpassphrase",
964 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
965 "Amount": "1000000000",
966 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
967 "TransactionType": "Payment"
981 "If 'offline' is true then a 'Sequence' field must be supplied.",
984 "command": "dummy_command",
985 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
986 "secret": "masterpassphrase",
990 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
991 "Amount": "1000000000",
992 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
993 "TransactionType": "Payment"
1007 "If 'offline' is true then a 'Fee' field must be supplied.",
1010 "command": "dummy_command",
1011 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1012 "secret": "masterpassphrase",
1016 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1017 "Amount": "1000000000",
1018 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1019 "TransactionType": "Payment"
1027 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1033 "Valid transaction if 'offline' is true.",
1036 "command": "dummy_command",
1037 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1038 "secret": "masterpassphrase",
1043 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1044 "Amount": "1000000000",
1045 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1046 "TransactionType": "Payment"
1056 "A Signer may not be the transaction's Account "
1057 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
1059 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1065 "'offline' and 'build_path' are mutually exclusive.",
1068 "command": "dummy_command",
1069 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1070 "secret": "masterpassphrase",
1076 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1077 "Amount": "1000000000",
1078 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1079 "TransactionType": "Payment"
1087 "Field 'build_path' not allowed in this context.",
1092 "Field 'build_path' not allowed in this context.",
1097 "Field 'build_path' not allowed in this context.",
1099 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1105 "A 'Flags' field may be specified.",
1108 "command": "dummy_command",
1109 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1110 "secret": "masterpassphrase",
1113 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1114 "Amount": "1000000000",
1115 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1116 "TransactionType": "Payment"
1130 "The 'Flags' field must be numeric.",
1133 "command": "dummy_command",
1134 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1135 "secret": "masterpassphrase",
1137 "Flags": "NotGoodFlags",
1138 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1139 "Amount": "1000000000",
1140 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1141 "TransactionType": "Payment"
1146 {"invalidParams",
RpcInvalidParams,
"Field 'tx_json.Flags' has invalid data."},
1147 {
"invalidParams",
RpcInvalidParams,
"Field 'tx_json.Flags' has invalid data."},
1155 "It's okay to add a 'debug_signing' field.",
1158 "command": "dummy_command",
1159 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1160 "secret": "masterpassphrase",
1163 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1164 "Amount": "1000000000",
1165 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1166 "TransactionType": "Payment"
1180 "Single-sign a multisigned transaction.",
1183 "command": "dummy_command",
1184 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1187 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1188 "Amount" : "1000000000",
1189 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1195 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1196 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1197 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1201 "SigningPubKey" : "",
1202 "TransactionType" : "Payment"
1209 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1216 "Minimal sign_for.",
1219 "command": "dummy_command",
1220 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1221 "secret": "masterpassphrase",
1223 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1224 "Amount": "1000000000",
1225 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1228 "SigningPubKey": "",
1229 "TransactionType": "Payment"
1234 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
1235 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1243 "Minimal offline sign_for.",
1246 "command": "dummy_command",
1247 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1248 "secret": "masterpassphrase",
1251 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1252 "Amount": "1000000000",
1253 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1256 "SigningPubKey": "",
1257 "TransactionType": "Payment"
1271 "Offline sign_for using 'seed' instead of 'secret'.",
1274 "command": "dummy_command",
1275 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
1276 "key_type": "ed25519",
1277 "seed": "sh1yJfwoi98zCygwijUzuHmJDeVKd",
1280 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1281 "Amount": "1000000000",
1282 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
1285 "SigningPubKey": "",
1286 "TransactionType": "Payment"
1300 "Malformed seed in sign_for.",
1303 "command": "dummy_command",
1304 "account": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
1305 "key_type": "ed25519",
1306 "seed": "sh1yJfwoi98zCygwjUzuHmJDeVKd",
1309 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1310 "Amount": "1000000000",
1311 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
1314 "SigningPubKey": "",
1315 "TransactionType": "Payment"
1329 "Missing 'Account' in sign_for.",
1332 "command": "dummy_command",
1333 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1334 "secret": "masterpassphrase",
1336 "Amount": "1000000000",
1337 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1340 "SigningPubKey": "",
1341 "TransactionType": "Payment"
1355 "Missing 'Amount' in sign_for.",
1358 "command": "dummy_command",
1359 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1360 "secret": "masterpassphrase",
1362 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1363 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1366 "SigningPubKey": "",
1367 "TransactionType": "Payment"
1381 "Missing 'Destination' in sign_for.",
1384 "command": "dummy_command",
1385 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1386 "secret": "masterpassphrase",
1388 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1389 "Amount": "1000000000",
1392 "SigningPubKey": "",
1393 "TransactionType": "Payment"
1398 {"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1399 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1400 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1401 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1407 "Missing 'Destination' in sign_for, use DeliverMax",
1410 "command": "dummy_command",
1411 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1412 "secret": "masterpassphrase",
1414 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1415 "DeliverMax": "1000000000",
1418 "SigningPubKey": "",
1419 "TransactionType": "Payment"
1424 {"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1425 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1426 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1427 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
1433 "Missing 'Fee' in sign_for.",
1436 "command": "dummy_command",
1437 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1438 "secret": "masterpassphrase",
1440 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1441 "Amount": "1000000000",
1442 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1444 "SigningPubKey": "",
1445 "TransactionType": "Payment"
1450 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
1451 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1459 "Missing 'Sequence' in sign_for.",
1462 "command": "dummy_command",
1463 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1464 "secret": "masterpassphrase",
1466 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1467 "Amount": "1000000000",
1468 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1470 "SigningPubKey": "",
1471 "TransactionType": "Payment"
1476 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
1477 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1485 "Missing 'SigningPubKey' in sign_for is automatically filled in.",
1488 "command": "dummy_command",
1489 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1490 "secret": "masterpassphrase",
1492 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1493 "Amount": "1000000000",
1494 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1497 "TransactionType": "Payment"
1502 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
1503 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1505 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1511 "In sign_for, an account may not sign for itself.",
1514 "command": "dummy_command",
1515 "account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1518 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1519 "Amount": "1000000000",
1520 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1523 "TransactionType": "Payment"
1533 "A Signer may not be the transaction's Account "
1534 "(rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA).",
1536 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1542 "Cannot put duplicate accounts in Signers array",
1545 "command": "dummy_command",
1546 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1547 "secret": "masterpassphrase",
1549 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1550 "Amount" : "1000000000",
1551 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1557 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1558 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1559 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1563 "SigningPubKey" : "",
1564 "TransactionType" : "Payment"
1574 "Duplicate Signers:Signer:Account entries "
1575 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh) are not allowed.",
1583 "Correctly append to pre-established Signers array",
1586 "command": "dummy_command",
1587 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1590 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1591 "Amount" : "1000000000",
1592 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1598 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1599 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1600 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1604 "SigningPubKey" : "",
1605 "TransactionType" : "Payment"
1619 "Append to pre-established Signers array with bad signature",
1622 "command": "dummy_command",
1623 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1626 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1627 "Amount" : "1000000000",
1628 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1634 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1635 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1636 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ACB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1640 "SigningPubKey" : "",
1641 "TransactionType" : "Payment"
1655 "Non-empty 'SigningPubKey' in sign_for.",
1658 "command": "dummy_command",
1659 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1660 "secret": "masterpassphrase",
1662 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1663 "Amount": "1000000000",
1664 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1667 "SigningPubKey": "1",
1668 "TransactionType": "Payment"
1673 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
1674 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
1678 "When multi-signing 'tx_json.SigningPubKey' must be empty.",
1683 "When multi-signing 'tx_json.SigningPubKey' must be empty.",
1690 "Missing 'TransactionType' in sign_for.",
1693 "command": "dummy_command",
1694 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1695 "secret": "masterpassphrase",
1697 "Account": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1698 "Amount": "1000000000",
1699 "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1702 "SigningPubKey": "",
1707 {"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
1708 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
1709 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
1710 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
1716 "TxnSignature in sign_for.",
1719 "command": "dummy_command",
1720 "account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1723 "Account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1724 "Amount" : "1000000000",
1725 "Destination" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1731 "Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1732 "SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
1733 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998"
1737 "SigningPubKey" : "",
1738 "TxnSignature" : "304502210080EB23E78A841DDC5E3A4F10DE6EAF052207D6B519BF8954467ADB221B3F349002202CA458E8D4E4DE7176D27A91628545E7B295A5DFC8ADF0B5CD3E279B6FA02998",
1739 "TransactionType" : "Payment"
1753 "Invalid field 'tx_json': string instead of object",
1756 "command": "dummy_command",
1757 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1758 "secret": "masterpassphrase",
1763 {"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1764 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1765 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1766 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1772 "Invalid field 'tx_json': integer instead of object",
1775 "command": "dummy_command",
1776 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1777 "secret": "masterpassphrase",
1782 {"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1783 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1784 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1785 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1791 "Invalid field 'tx_json': array instead of object",
1794 "command": "dummy_command",
1795 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1796 "secret": "masterpassphrase",
1797 "tx_json": [ "hello", "world" ]
1801 {"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1802 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1803 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1804 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json', not object."},
1810 "Pass in Fee with minimal payment, both Amount and DeliverMax.",
1813 "command": "dummy_command",
1814 "account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1815 "secret": "ssgN6zTvtM1q9XV8DvJpWm8LBYWiY",
1818 "Account": "r9zN9x52FiCFAcicCLMQKbj1nxYhxJbbSy",
1819 "Amount": "1000000000",
1820 "DeliverMax": "1000000000",
1821 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1822 "TransactionType": "Payment"
1836 "Minimal submit_multisigned.",
1839 "command": "submit_multisigned",
1841 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1842 "Amount": "1000000000",
1843 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1849 "Account" : "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1850 "SigningPubKey" : "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
1851 "TxnSignature" : "3045022100909D01399AFFAD1E30D250CE61F93975B7F61E47B5244D78C3E86D9806535D95022012E389E0ACB016334052B7FE07FA6CEFDC8BE82CB410FA841D5049641C89DC8F"
1855 "SigningPubKey": "",
1856 "TransactionType": "Payment"
1870 "Minimal submit_multisigned with bad signature.",
1873 "command": "submit_multisigned",
1875 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1876 "Amount": "1000000000",
1877 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1883 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1884 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1885 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1889 "SigningPubKey": "",
1890 "TransactionType": "Payment"
1904 "Missing tx_json in submit_multisigned.",
1907 "command": "submit_multisigned",
1911 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1912 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1913 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1929 "Missing sequence in submit_multisigned.",
1932 "command": "submit_multisigned",
1934 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1935 "Amount": "1000000000",
1936 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1941 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1942 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1943 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1947 "SigningPubKey": "",
1948 "TransactionType": "Payment"
1962 "Missing SigningPubKey in submit_multisigned.",
1965 "command": "submit_multisigned",
1967 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1968 "Amount": "1000000000",
1969 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
1974 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
1975 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
1976 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
1981 "TransactionType": "Payment"
1989 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.SigningPubKey'."},
1995 "Non-empty SigningPubKey in submit_multisigned.",
1998 "command": "submit_multisigned",
2000 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2001 "Amount": "1000000000",
2002 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2008 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2009 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2010 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2014 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8",
2015 "TransactionType": "Payment"
2026 "When multi-signing 'tx_json.SigningPubKey' must be empty.",
2033 "Missing TransactionType in submit_multisigned.",
2036 "command": "submit_multisigned",
2038 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2039 "Amount": "1000000000",
2040 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2045 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2046 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2047 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2052 "SigningPubKey": "",
2060 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.TransactionType'."},
2066 "Missing Account in submit_multisigned.",
2069 "command": "submit_multisigned",
2071 "Amount": "1000000000",
2072 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2078 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2079 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2080 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2084 "SigningPubKey": "",
2085 "TransactionType": "Payment"
2099 "Malformed Account in submit_multisigned.",
2102 "command": "submit_multisigned",
2104 "Account": "NotAnAccount",
2105 "Amount": "1000000000",
2106 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2112 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2113 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2114 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2118 "SigningPubKey": "",
2119 "TransactionType": "Payment"
2133 "Account not in ledger in submit_multisigned.",
2136 "command": "submit_multisigned",
2138 "Account": "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd",
2139 "Amount": "1000000000",
2140 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2146 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2147 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2148 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2152 "SigningPubKey": "",
2153 "TransactionType": "Payment"
2167 "Missing Fee in submit_multisigned.",
2170 "command": "submit_multisigned",
2172 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2173 "Amount": "1000000000",
2174 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2179 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2180 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2181 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2185 "SigningPubKey": "",
2186 "TransactionType": "Payment"
2200 "Non-numeric Fee in submit_multisigned.",
2203 "command": "submit_multisigned",
2205 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2206 "Amount": "1000000000",
2207 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2213 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2214 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2215 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2219 "SigningPubKey": "",
2220 "TransactionType": "Payment"
2228 {
"invalidParams",
RpcInvalidParams,
"Field 'tx_json.Fee' has invalid data."},
2234 "Missing Amount in submit_multisigned Payment.",
2237 "command": "submit_multisigned",
2239 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2240 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2246 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2247 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2248 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2252 "SigningPubKey": "",
2253 "TransactionType": "Payment"
2267 "Invalid Amount in submit_multisigned Payment.",
2270 "command": "submit_multisigned",
2272 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2273 "Amount": "NotANumber",
2274 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2280 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2281 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2282 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2286 "SigningPubKey": "",
2287 "TransactionType": "Payment"
2301 "Invalid DeliverMax in submit_multisigned Payment.",
2304 "command": "submit_multisigned",
2306 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2307 "DeliverMax": "NotANumber",
2308 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2314 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2315 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2316 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2320 "SigningPubKey": "",
2321 "TransactionType": "Payment"
2335 "No build_path in submit_multisigned.",
2338 "command": "submit_multisigned",
2341 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2342 "Amount": "1000000000",
2343 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2349 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2350 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2351 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2355 "SigningPubKey": "",
2356 "TransactionType": "Payment"
2367 "Field 'build_path' not allowed in this context.",
2374 "Missing Destination in submit_multisigned Payment.",
2377 "command": "submit_multisigned",
2379 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2380 "Amount": "1000000000",
2386 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2387 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2388 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2392 "SigningPubKey": "",
2393 "TransactionType": "Payment"
2401 {
"invalidParams",
RpcInvalidParams,
"Missing field 'tx_json.Destination'."},
2407 "Malformed Destination in submit_multisigned Payment.",
2410 "command": "submit_multisigned",
2412 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2413 "Amount": "1000000000",
2414 "Destination": "NotADestination",
2420 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2421 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2422 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2426 "SigningPubKey": "",
2427 "TransactionType": "Payment"
2435 {
"invalidParams",
RpcInvalidParams,
"Invalid field 'tx_json.Destination'."},
2441 "Missing Signers field in submit_multisigned.",
2444 "command": "submit_multisigned",
2446 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2447 "Amount": "1000000000",
2448 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2451 "SigningPubKey": "",
2452 "TransactionType": "Payment"
2466 "Signers not an array in submit_multisigned.",
2469 "command": "submit_multisigned",
2471 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2472 "Amount": "1000000000",
2473 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2477 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2478 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2479 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2481 "SigningPubKey": "",
2482 "TransactionType": "Payment"
2490 {
"invalidParams",
RpcInvalidParams,
"Field 'tx_json.Signers' is not a JSON array."},
2496 "Empty Signers array in submit_multisigned.",
2499 "command": "submit_multisigned",
2501 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2502 "Amount": "1000000000",
2503 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2508 "SigningPubKey": "",
2509 "TransactionType": "Payment"
2517 {
"invalidParams",
RpcInvalidParams,
"tx_json.Signers array may not be empty."},
2523 "Duplicate Signer in submit_multisigned.",
2526 "command": "submit_multisigned",
2528 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2529 "Amount": "1000000000",
2530 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2536 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2537 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2538 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2543 "Account": "rPcNzota6B8YBokhYtcTNqQVCngtbnWfux",
2544 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2545 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2549 "SigningPubKey": "",
2550 "TransactionType": "Payment"
2561 "Duplicate Signers:Signer:Account entries "
2562 "(rPcNzota6B8YBokhYtcTNqQVCngtbnWfux) are not allowed.",
2569 "Signer is tx_json Account in submit_multisigned.",
2572 "command": "submit_multisigned",
2574 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2575 "Amount": "1000000000",
2576 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2582 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2583 "TxnSignature": "3045022100F9ED357606932697A4FAB2BE7F222C21DD93CA4CFDD90357AADD07465E8457D6022038173193E3DFFFB5D78DD738CC0905395F885DA65B98FDB9793901FE3FD26ECE",
2584 "SigningPubKey": "02FE36A690D6973D55F88553F5D2C4202DE75F2CF8A6D0E17C70AC223F044501F8"
2588 "SigningPubKey": "",
2589 "TransactionType": "Payment"
2600 "A Signer may not be the transaction's Account "
2601 "(rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh).",
2608 "Empty Signers array in submit_multisigned, use DeliverMax",
2611 "command": "submit_multisigned",
2613 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2614 "DeliverMax": "10000000",
2615 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2620 "SigningPubKey": "",
2621 "TransactionType": "Payment"
2629 {
"invalidParams",
RpcInvalidParams,
"tx_json.Signers array may not be empty."},
2635 "Empty Signers array in submit_multisigned, use DeliverMax and Amount",
2638 "command": "submit_multisigned",
2640 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2641 "Amount": "10000000",
2642 "DeliverMax": "10000000",
2643 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2648 "SigningPubKey": "",
2649 "TransactionType": "Payment"
2657 {
"invalidParams",
RpcInvalidParams,
"tx_json.Signers array may not be empty."},
2663 "Payment cannot specify different DeliverMax and Amount.",
2666 "command": "dummy_command",
2667 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2668 "secret": "masterpassphrase",
2671 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2672 "Amount": "1000000000",
2673 "DeliverMax": "1000000020",
2674 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2677 "SigningPubKey": "",
2678 "TransactionType": "Payment"
2686 "Cannot specify differing 'Amount' and 'DeliverMax'",
2691 "Cannot specify differing 'Amount' and 'DeliverMax'",
2696 "Cannot specify differing 'Amount' and 'DeliverMax'",
2701 "Cannot specify differing 'Amount' and 'DeliverMax'",
2707 "Payment cannot specify bad DomainID.",
2710 "command": "dummy_command",
2711 "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2712 "secret": "masterpassphrase",
2715 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2716 "Amount": "1000000000",
2717 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2720 "SigningPubKey": "",
2721 "TransactionType": "Payment",
2722 "DomainID": "invalid",
2736 "Minimal delegated transaction.",
2739 "command": "dummy_command",
2742 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2743 "Amount": "1000000000",
2744 "Destination": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
2745 "TransactionType": "Payment",
2746 "Delegate": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
2760 "Delegate not well formed.",
2763 "command": "dummy_command",
2766 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2767 "Amount": "1000000000",
2768 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
2769 "TransactionType": "Payment",
2770 "Delegate": "NotAnAccount"
2784 "Delegate not in ledger.",
2787 "command": "dummy_command",
2790 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2791 "Amount": "1000000000",
2792 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
2793 "TransactionType": "Payment",
2794 "Delegate": "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd"
2808 "Delegate and secret not match.",
2811 "command": "dummy_command",
2814 "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
2815 "Amount": "1000000000",
2816 "Destination": "rJrxi4Wxev4bnAGVNP9YCdKPdAoKfAmcsi",
2817 "TransactionType": "Payment",
2818 "Delegate": "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
2823 {"badSecret",
RpcBadSecret,
"Secret does not match account."},
2824 {
"badSecret",
RpcBadSecret,
"Secret does not match account."},
2841 json::Value const result{env.
rpc(
"bad_command", R
"({"MakingThisUp": 0})")};
2843 BEAST_EXPECT(result[jss::result][jss::error] == "unknownCmd");
2845 BEAST_EXPECT(result[jss::result][jss::error_message] ==
"Unknown method.");
2846 BEAST_EXPECT(result[jss::result][jss::request][jss::command] ==
"bad_command");
2858 auto const ledger = env.current();
2859 auto const& feeTrack = env.app().getFeeTrack();
2863 env.fund(XRP(100000), alice);
2866 auto const batchFee = batch::calcBatchFee(env, 0, 2);
2867 auto const seq = env.seq(alice);
2868 auto jt = env.jtnofill(
2869 batch::outer(alice, env.seq(alice), batchFee, tfAllOrNothing),
2870 batch::Inner(pay(alice, bob, XRP(1)), seq + 1),
2871 batch::Inner(pay(alice, bob, XRP(2)), seq + 2),
2872 batch::Inner(pay(alice, bob, XRP(3)), seq + 3),
2873 batch::Inner(pay(alice, bob, XRP(4)), seq + 4),
2874 batch::Inner(pay(alice, bob, XRP(5)), seq + 5),
2875 batch::Inner(pay(alice, bob, XRP(6)), seq + 6),
2876 batch::Inner(pay(alice, bob, XRP(7)), seq + 7),
2877 batch::Inner(pay(alice, bob, XRP(8)), seq + 8),
2878 batch::Inner(pay(alice, bob, XRP(9)), seq + 9));
2880 jt.jv.removeMember(jss::Fee);
2881 jt.jv.removeMember(jss::TxnSignature);
2882 req[jss::tx_json] = jt.jv;
2891 BEAST_EXPECT(result.
size() == 0);
2893 req[jss::tx_json].isMember(jss::Fee) &&
2894 req[jss::tx_json][jss::Fee] == env.current()->fees().base.jsonClipped());
2900 auto const ledger = env.current();
2901 auto const& feeTrack = env.app().getFeeTrack();
2905 env.fund(XRP(100000), alice, bob);
2908 auto const jt = env.jtnofill(
2952 req[jss::tx_json] = jt.jv;
2961 BEAST_EXPECT(result.
size() == 0);
2963 req[jss::tx_json].isMember(jss::Fee) &&
2964 req[jss::tx_json][jss::Fee] == env.current()->fees().base.jsonClipped());
2975 cfg->fees.referenceFee = 10;
2978 auto const baseFee =
static_cast<int>(env.current()->fees().base.drops());
2979 auto const ledger = env.
current();
2980 auto const& feeTrack = env.app().getFeeTrack();
2996 req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == baseFee);
3002 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 2, "
3003 "\"tx_json\" : { } } ",
3016 req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == baseFee);
3031 BEAST_EXPECT(result[jss::error] ==
"highFee");
3032 BEAST_EXPECT(result[jss::error_code] ==
RpcHighFee);
3034 result[jss::error_message] ==
"Fee of 10 exceeds the requested tx limit of 0");
3035 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3043 "{ \"fee_mult_max\" : 3, \"fee_div_max\" : 6, "
3044 "\"tx_json\" : { } } ",
3055 BEAST_EXPECT(result[jss::error] ==
"highFee");
3056 BEAST_EXPECT(result[jss::error_code] ==
RpcHighFee);
3058 result[jss::error_message] ==
"Fee of 10 exceeds the requested tx limit of 5");
3059 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3065 "{ \"fee_mult_max\" : 0, \"fee_div_max\" : 2, "
3066 "\"tx_json\" : { } } ",
3077 BEAST_EXPECT(result[jss::error] ==
"highFee");
3078 BEAST_EXPECT(result[jss::error_code] ==
RpcHighFee);
3080 result[jss::error_message] ==
"Fee of 10 exceeds the requested tx limit of 0");
3081 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3087 "{ \"fee_mult_max\" : 10, \"fee_div_max\" : 0, "
3088 "\"tx_json\" : { } } ",
3099 BEAST_EXPECT(result[jss::error] ==
"invalidParams");
3102 result[jss::error_message] ==
3103 "Invalid field 'fee_div_max', not a positive integer.");
3104 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3121 BEAST_EXPECT(result.
size() == 0);
3123 req[jss::tx_json].isMember(jss::Fee) &&
3124 req[jss::tx_json][jss::Fee] == env.current()->fees().increment.jsonClipped());
3131 testcase(
"autofill escalated fees");
3139 LoadFeeTrack const& feeTrackOuter = env.app().getFeeTrack();
3146 "fee_mult_max" : 1000,
3160 BEAST_EXPECT(req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == 10);
3182 BEAST_EXPECT(req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == 10);
3186 for (
auto i = 0; i < 4; ++i)
3188 env(noop(env.master));
3196 "fee_mult_max" : 1000,
3211 req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == 8889);
3232 BEAST_EXPECT(result[jss::error] ==
"highFee");
3233 BEAST_EXPECT(result[jss::error_code] ==
RpcHighFee);
3235 result[jss::error_message] ==
"Fee of 8889 exceeds the requested tx limit of 50");
3236 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3244 "fee_mult_max" : 1000,
3258 BEAST_EXPECT(result[jss::error] ==
"highFee");
3259 BEAST_EXPECT(result[jss::error_code] ==
RpcHighFee);
3261 result[jss::error_message] ==
"Fee of 8889 exceeds the requested tx limit of 3333");
3262 BEAST_EXPECT(!req[jss::tx_json].isMember(jss::Fee));
3270 "fee_mult_max" : 8000,
3286 req[jss::tx_json].isMember(jss::Fee) && req[jss::tx_json][jss::Fee] == 8889);
3294 "fee_mult_max" : -5,
3307 BEAST_EXPECT(result[jss::error] ==
"invalidParams");
3310 result[jss::error_message] ==
3311 "Invalid field 'fee_mult_max', not a positive integer.");
3332 BEAST_EXPECT(result[jss::error] ==
"invalidParams");
3335 result[jss::error_message] ==
3336 "Invalid field 'fee_div_max', not a positive integer.");
3344 "fee_mult_max" : -2,
3358 BEAST_EXPECT(result[jss::error] ==
"invalidParams");
3361 result[jss::error_message] ==
3362 "Invalid field 'fee_mult_max', not a positive integer.");
3370 toSign[jss::tx_json] = noop(env.master);
3371 toSign[jss::secret] =
"masterpassphrase";
3372 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
3373 auto result = rpcResult[jss::result];
3377 result[jss::tx_json].isMember(jss::Fee) && result[jss::tx_json][jss::Fee] ==
"10");
3379 result[jss::tx_json].isMember(jss::Sequence) &&
3388 auto const metrics = env.app().getTxQ().getMetrics(*env.current());
3391 env(noop(env.master));
3395 toSign[jss::tx_json] = noop(env.master);
3396 toSign[jss::secret] =
"masterpassphrase";
3397 toSign[jss::fee_mult_max] = 900;
3398 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
3399 auto result = rpcResult[jss::result];
3403 result[jss::tx_json].isMember(jss::Fee) &&
3404 result[jss::tx_json][jss::Fee] ==
"7813");
3406 result[jss::tx_json].isMember(jss::Sequence) &&
3415 auto& feeTrack = env.app().getFeeTrack();
3416 BEAST_EXPECT(feeTrack.getLoadFactor() == 256);
3417 for (
int i = 0; i < 8; ++i)
3418 feeTrack.raiseLocalFee();
3419 BEAST_EXPECT(feeTrack.getLoadFactor() == 1220);
3423 toSign[jss::tx_json] = noop(env.master);
3424 toSign[jss::secret] =
"masterpassphrase";
3425 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
3426 auto result = rpcResult[jss::result];
3430 result[jss::tx_json].isMember(jss::Fee) && result[jss::tx_json][jss::Fee] ==
"47");
3432 result[jss::tx_json].isMember(jss::Sequence) &&
3443 auto const metrics = env.app().getTxQ().getMetrics(*env.current());
3446 env(noop(env.master), Fee(47));
3449 EnvSs
const envs(env);
3452 toSign[jss::tx_json] = noop(env.master);
3453 toSign[jss::secret] =
"masterpassphrase";
3455 toSign[jss::fee_mult_max] = 700;
3456 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
3457 auto result = rpcResult[jss::result];
3461 result[jss::tx_json].isMember(jss::Fee) &&
3462 result[jss::tx_json][jss::Fee] ==
"6806");
3464 result[jss::tx_json].isMember(jss::Sequence) &&
3475 cfg->networkId = 1025;
3481 toSign[jss::tx_json] = noop(env.master);
3483 BEAST_EXPECT(!toSign[jss::tx_json].isMember(jss::NetworkID));
3484 toSign[jss::secret] =
"masterpassphrase";
3485 auto rpcResult = env.rpc(
"json",
"sign",
to_string(toSign));
3486 auto result = rpcResult[jss::result];
3490 result[jss::tx_json].isMember(jss::NetworkID) &&
3491 result[jss::tx_json][jss::NetworkID] == 1025);
3506 using namespace std::chrono_literals;
3507 using namespace test::jtx;
3511 auto const usd = g[
"USD"];
3520 Env env(*
this,
envconfig([](std::unique_ptr<Config> cfg) {
3521 cfg->fees.referenceFee = 10;
3524 env.fund(
XRP(100000), a, ed, g);
3527 env(
trust(a, usd(1000)));
3528 env(
trust(env.master, usd(1000)));
3529 env(
pay(g, a, usd(50)));
3530 env(
pay(g, env.master, usd(50)));
3536 using SignFunc = json::Value (*)(
3538 unsigned int apiVersion,
3541 std::chrono::seconds validatedLedgerAge,
3544 using SubmitFunc = json::Value (*)(
3546 unsigned int apiVersion,
3549 std::chrono::seconds validatedLedgerAge,
3553 using TestStuff = std::tuple<SignFunc, SubmitFunc, char const*, unsigned int>;
3555 static TestStuff
const kTestFuncs[] = {
3562 for (
auto testFunc : kTestFuncs)
3568 json::Reader().parse(txnTest.json, req);
3572 static Role const kTestedRoles[] = {
3579 for (
Role const testRole : kTestedRoles)
3582 auto const signFn =
get<0>(testFunc);
3583 if (signFn !=
nullptr)
3585 assert(
get<1>(testFunc) ==
nullptr);
3590 auto const submitFn =
get<1>(testFunc);
3591 assert(submitFn !=
nullptr);
3601 errToken = result[jss::error].
asString();
3602 errCode = result[jss::error_code].
asInt();
3603 errStr = result[
"error_message"].
asString();
3606 auto const& expected = txnTest.expected[
get<3>(testFunc)];
3607 if (errToken == expected.token && errCode == expected.code &&
3608 errStr == expected.message)
3615 description << txnTest.description <<
" Called " <<
get<2>(testFunc)
3616 <<
"(). Got \'" << errToken <<
"\' (" << errCode <<
") \'"
3618 fail(description.
str(), __FILE__, txnTest.line);
void pass()
Record a successful test condition.
void fail(String const &reason, char const *file, int line)
Record a failure.
TestcaseT testcase
Memberspace for declaring test cases.
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.
Manages the current fee schedule.
std::uint32_t getLoadFactor() const
void run() override
Runs the suite.
void testTransactionRPC()
static void fakeProcessTransaction(std::shared_ptr< Transaction > &, bool, bool, NetworkOPs::FailHard)
void testAutoFillEscalatedFees()
void testAutoFillNetworkID()
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
JSON (JavaScript Object Notation).
@ UInt
unsigned integer value
The api_version numbers this server serves.
bool containsError(json::Value const &json)
Returns true if the json contains an rpc error specification.
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::ValueType::Object.
std::function< void( std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)> ProcessTransactionFn
json::Value transactionSignFor(json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a json::ValueType::Object.
BEAST_DEFINE_TESTSUITE(AccountLines, rpc, xrpl)
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::ValueType::Object.
static constexpr TxnTestData kTxnTestArray[]
json::Value transactionSign(json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a json::ValueType::Object.
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 pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
XrpT const XRP
Converts to XRP Issue or STAmount.
json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
std::string to_string(BaseUInt< Bits, Tag > const &a)
Role
Indicates the level of administrative permission to grant.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
static constexpr auto kMinimumTxnInLedgerStandalone
static constexpr auto kSigningSupport
static constexpr auto kTransactionQueue
constexpr ExpectedResult(char const *token, ErrorCodeI code, char const *message)
constexpr ExpectedResult()=default
char const *const description
TxnTestData & operator=(TxnTestData &&)=delete
TxnTestData(TxnTestData const &)=delete
TxnTestData & operator=(TxnTestData const &)=delete
std::array< ExpectedResult, 4 > const expected
constexpr TxnTestData(char const *description, int line, char const *json, std::array< ExpectedResult, 4 > const &expected)
TxnTestData(TxnTestData &&)=delete