1const RESULTS: &[(&str, i32, &str)] = &[
8 (
9 "tecAMM_ACCOUNT",
10 168,
11 "This operation is not allowed on an AMM Account.",
12 ),
13 ("tecAMM_BALANCE", 163, "AMM has invalid balance."),
14 ("tecAMM_EMPTY", 166, "AMM is in empty state."),
15 ("tecAMM_FAILED", 164, "AMM transaction failed."),
16 ("tecAMM_INVALID_TOKENS", 165, "AMM invalid LP tokens."),
17 ("tecAMM_NOT_EMPTY", 167, "AMM is not in empty state."),
18 ("tecARRAY_EMPTY", 190, "Array is empty."),
19 ("tecARRAY_TOO_LARGE", 191, "Array is too large."),
20 ("tecBAD_CREDENTIALS", 193, "Bad credentials."),
21 ("tecBAD_PROOF", 199, "Proof cannot be verified"),
22 (
23 "tecCANT_ACCEPT_OWN_NFTOKEN_OFFER",
24 158,
25 "An NFToken offer cannot be claimed by its owner.",
26 ),
27 ("tecCLAIM", 100, "Fee claimed. Sequence used. No action."),
28 (
29 "tecCRYPTOCONDITION_ERROR",
30 146,
31 "Malformed, invalid, or mismatched conditional or fulfillment.",
32 ),
33 ("tecDIR_FULL", 121, "Can not add entry to full directory."),
34 ("tecDST_TAG_NEEDED", 143, "A destination tag is required."),
35 ("tecDUPLICATE", 149, "Ledger object already exists."),
36 (
37 "tecEMPTY_DID",
38 187,
39 "The DID object did not have a URI or DIDDocument field.",
40 ),
41 ("tecEXPIRED", 148, "Expiration time is passed."),
42 (
43 "tecFAILED_PROCESSING",
44 105,
45 "Failed to correctly process transaction.",
46 ),
47 ("tecFROZEN", 137, "Asset is frozen."),
48 (
49 "tecHAS_OBLIGATIONS",
50 151,
51 "The account cannot be deleted since it has obligations.",
52 ),
53 (
54 "tecINCOMPLETE",
55 169,
56 "Some work was completed, but more submissions required to finish.",
57 ),
58 (
59 "tecINSUFFICIENT_FUNDS",
60 159,
61 "Not enough funds available to complete requested transaction.",
62 ),
63 (
64 "tecINSUFFICIENT_PAYMENT",
65 161,
66 "The payment is not sufficient.",
67 ),
68 (
69 "tecINSUFFICIENT_RESERVE",
70 141,
71 "Insufficient reserve to complete requested operation.",
72 ),
73 ("tecINSUFF_FEE", 136, "Insufficient balance to pay fee."),
74 (
75 "tecINSUF_RESERVE_LINE",
76 122,
77 "Insufficient reserve to add trust line.",
78 ),
79 (
80 "tecINSUF_RESERVE_OFFER",
81 123,
82 "Insufficient reserve to create offer.",
83 ),
84 (
85 "tecINTERNAL",
86 144,
87 "An internal error has occurred during processing.",
88 ),
89 (
90 "tecINVALID_UPDATE_TIME",
91 188,
92 "The Oracle object has invalid LastUpdateTime field.",
93 ),
94 (
95 "tecINVARIANT_FAILED",
96 147,
97 "One or more invariants for the transaction were not satisfied.",
98 ),
99 (
100 "tecKILLED",
101 150,
102 "No funds transferred and no offer created.",
103 ),
104 ("tecLIMIT_EXCEEDED", 195, "Limit exceeded."),
105 ("tecLOCKED", 192, "Fund is locked."),
106 (
107 "tecMAX_SEQUENCE_REACHED",
108 154,
109 "The maximum sequence number was reached.",
110 ),
111 (
112 "tecNEED_MASTER_KEY",
113 142,
114 "The operation requires the use of the Master Key.",
115 ),
116 (
117 "tecNFTOKEN_BUY_SELL_MISMATCH",
118 156,
119 "The 'Buy' and 'Sell' NFToken offers are mismatched.",
120 ),
121 (
122 "tecNFTOKEN_OFFER_TYPE_MISMATCH",
123 157,
124 "The type of NFToken offer is incorrect.",
125 ),
126 (
127 "tecNO_ALTERNATIVE_KEY",
128 130,
129 "The operation would remove the ability to sign transactions with the account.",
130 ),
131 ("tecNO_AUTH", 134, "Not authorized to hold asset."),
132 (
133 "tecNO_DST",
134 124,
135 "Destination does not exist. Send XRP to create it.",
136 ),
137 (
138 "tecNO_DST_INSUF_XRP",
139 125,
140 "Destination does not exist. Too little XRP sent to create it.",
141 ),
142 ("tecNO_ENTRY", 140, "No matching entry found."),
143 ("tecNO_ISSUER", 133, "Issuer account does not exist."),
144 ("tecNO_LINE", 135, "No such line."),
145 (
146 "tecNO_LINE_INSUF_RESERVE",
147 126,
148 "No such line. Too little reserve to create it.",
149 ),
150 (
151 "tecNO_LINE_REDUNDANT",
152 127,
153 "Can't set non-existent line to default.",
154 ),
155 (
156 "tecNO_PERMISSION",
157 139,
158 "No permission to perform requested operation.",
159 ),
160 ("tecNO_REGULAR_KEY", 131, "Regular key is not set."),
161 (
162 "tecNO_SPONSOR_PERMISSION",
163 200,
164 "Sponsor has not authorized this transaction.",
165 ),
166 (
167 "tecNO_SUITABLE_NFTOKEN_PAGE",
168 155,
169 "A suitable NFToken page could not be located.",
170 ),
171 ("tecNO_TARGET", 138, "Target account does not exist."),
172 (
173 "tecOBJECT_NOT_FOUND",
174 160,
175 "A requested object could not be located.",
176 ),
177 ("tecOVERSIZE", 145, "Object exceeded serialization limits."),
178 ("tecOWNERS", 132, "Non-zero owner count."),
179 ("tecPATH_DRY", 128, "Path could not send partial amount."),
180 ("tecPATH_PARTIAL", 101, "Path could not send full amount."),
181 (
182 "tecPRECISION_LOSS",
183 197,
184 "The amounts used by the transaction cannot interact.",
185 ),
186 (
187 "tecPSEUDO_ACCOUNT",
188 196,
189 "This operation is not allowed against a pseudo-account.",
190 ),
191 (
192 "tecTOKEN_PAIR_NOT_FOUND",
193 189,
194 "Token pair is not found in Oracle object.",
195 ),
196 (
197 "tecTOO_SOON",
198 152,
199 "It is too early to attempt the requested operation. Please wait.",
200 ),
201 (
202 "tecUNFUNDED",
203 129,
204 "Not enough XRP to satisfy the reserve requirement.",
205 ),
206 ("tecUNFUNDED_ADD", 102, "DEPRECATED."),
207 ("tecUNFUNDED_AMM", 162, "Insufficient balance to fund AMM."),
208 (
209 "tecUNFUNDED_OFFER",
210 103,
211 "Insufficient balance to fund created offer.",
212 ),
213 (
214 "tecUNFUNDED_PAYMENT",
215 104,
216 "Insufficient XRP balance to send.",
217 ),
218 ("tecWRONG_ASSET", 194, "Wrong asset given."),
219 (
220 "tecXCHAIN_ACCOUNT_CREATE_PAST",
221 181,
222 "The account create count has already passed.",
223 ),
224 (
225 "tecXCHAIN_ACCOUNT_CREATE_TOO_MANY",
226 182,
227 "There are too many pending account create transactions to submit a new one.",
228 ),
229 ("tecXCHAIN_BAD_CLAIM_ID", 172, "Bad xchain claim id."),
230 (
231 "tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR",
232 185,
233 "Bad public key account pair in an xchain transaction.",
234 ),
235 (
236 "tecXCHAIN_BAD_TRANSFER_ISSUE",
237 170,
238 "Bad xchain transfer issue.",
239 ),
240 (
241 "tecXCHAIN_CLAIM_NO_QUORUM",
242 173,
243 "Quorum was not reached on the xchain claim.",
244 ),
245 (
246 "tecXCHAIN_CREATE_ACCOUNT_DISABLED",
247 186,
248 "This bridge does not support account creation.",
249 ),
250 (
251 "tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE",
252 175,
253 "Only XRP may be used for xchain create account.",
254 ),
255 (
256 "tecXCHAIN_INSUFF_CREATE_AMOUNT",
257 180,
258 "Insufficient amount to create an account.",
259 ),
260 ("tecXCHAIN_NO_CLAIM_ID", 171, "No such xchain claim id."),
261 (
262 "tecXCHAIN_NO_SIGNERS_LIST",
263 178,
264 "The account did not have a signers list.",
265 ),
266 (
267 "tecXCHAIN_PAYMENT_FAILED",
268 183,
269 "Failed to transfer funds in a xchain transaction.",
270 ),
271 (
272 "tecXCHAIN_PROOF_UNKNOWN_KEY",
273 174,
274 "Unknown key for the xchain proof.",
275 ),
276 (
277 "tecXCHAIN_REWARD_MISMATCH",
278 177,
279 "The reward amount must match the reward specified in the xchain bridge.",
280 ),
281 (
282 "tecXCHAIN_SELF_COMMIT",
283 184,
284 "Account cannot commit funds to itself.",
285 ),
286 (
287 "tecXCHAIN_SENDING_ACCOUNT_MISMATCH",
288 179,
289 "The sending account did not match the expected sending account.",
290 ),
291 (
292 "tecXCHAIN_WRONG_CHAIN",
293 176,
294 "XChain Transaction was submitted to the wrong chain.",
295 ),
296 (
297 "tefALREADY",
298 -198,
299 "The exact transaction was already in this ledger.",
300 ),
301 ("tefBAD_ADD_AUTH", -197, "Not authorized to add account."),
302 (
303 "tefBAD_AUTH",
304 -196,
305 "Transaction's public key is not authorized.",
306 ),
307 (
308 "tefBAD_AUTH_MASTER",
309 -183,
310 "Auth for unclaimed account needs correct master key.",
311 ),
312 ("tefBAD_LEDGER", -195, "Ledger in unexpected state."),
313 ("tefBAD_PATH_COUNT", -176, "Malformed: Too many paths."),
314 (
315 "tefBAD_QUORUM",
316 -185,
317 "Signatures provided do not meet the quorum.",
318 ),
319 (
320 "tefBAD_SIGNATURE",
321 -186,
322 "A signature is provided for a non-signer.",
323 ),
324 ("tefCREATED", -194, "Can't add an already created account."),
325 ("tefEXCEPTION", -193, "Unexpected program state."),
326 ("tefFAILURE", -199, "Failed to apply."),
327 ("tefINTERNAL", -192, "Internal error."),
328 (
329 "tefINVALID_LEDGER_FIX_TYPE",
330 -178,
331 "The LedgerFixType field has an invalid value.",
332 ),
333 (
334 "tefINVARIANT_FAILED",
335 -182,
336 "Fee claim violated invariants for the transaction.",
337 ),
338 ("tefMASTER_DISABLED", -188, "Master key is disabled."),
339 ("tefMAX_LEDGER", -187, "Ledger sequence too high."),
340 (
341 "tefNFTOKEN_IS_NOT_TRANSFERABLE",
342 -179,
343 "The specified NFToken is not transferable.",
344 ),
345 (
346 "tefNOT_MULTI_SIGNING",
347 -184,
348 "Account has no appropriate list of multi-signers.",
349 ),
350 ("tefNO_AUTH_REQUIRED", -191, "Auth is not required."),
351 (
352 "tefNO_DST_PARTIAL",
353 -177,
354 "Partial payment to create account not allowed.",
355 ),
356 ("tefNO_TICKET", -180, "Ticket is not in ledger."),
357 (
358 "tefPAST_SEQ",
359 -190,
360 "This sequence number has already passed.",
361 ),
362 ("tefTOO_BIG", -181, "Transaction affects too many items."),
363 (
364 "tefWRONG_PRIOR",
365 -189,
366 "This previous transaction does not match.",
367 ),
368 ("telBAD_DOMAIN", -398, "Domain too long."),
369 ("telBAD_PATH_COUNT", -397, "Malformed: Too many paths."),
370 ("telBAD_PUBLIC_KEY", -396, "Public key is not valid."),
371 ("telCAN_NOT_QUEUE", -392, "Can not queue at this time."),
372 (
373 "telCAN_NOT_QUEUE_BALANCE",
374 -391,
375 "Can not queue at this time: insufficient balance to pay all queued fees.",
376 ),
377 (
378 "telCAN_NOT_QUEUE_BLOCKED",
379 -389,
380 "Can not queue at this time: blocking transaction in queue.",
381 ),
382 (
383 "telCAN_NOT_QUEUE_BLOCKS",
384 -390,
385 "Can not queue at this time: would block later queued transaction(s).",
386 ),
387 (
388 "telCAN_NOT_QUEUE_FEE",
389 -388,
390 "Can not queue at this time: fee insufficient to replace queued transaction.",
391 ),
392 (
393 "telCAN_NOT_QUEUE_FULL",
394 -387,
395 "Can not queue at this time: queue is full.",
396 ),
397 ("telENV_RPC_FAILED", -383, "Unit test RPC failure."),
398 (
399 "telFAILED_PROCESSING",
400 -395,
401 "Failed to correctly process transaction.",
402 ),
403 ("telINSUF_FEE_P", -394, "Fee insufficient."),
404 ("telLOCAL_ERROR", -399, "Local failure."),
405 (
406 "telNETWORK_ID_MAKES_TX_NON_CANONICAL",
407 -384,
408 "Transactions submitted to this node/network must NOT include a NetworkID field.",
409 ),
410 (
411 "telNO_DST_PARTIAL",
412 -393,
413 "Partial payment to create account not allowed.",
414 ),
415 (
416 "telREQUIRES_NETWORK_ID",
417 -385,
418 "Transactions submitted to this node/network must include a correct NetworkID field.",
419 ),
420 (
421 "telWRONG_NETWORK",
422 -386,
423 "Transaction specifies a Network ID that differs from that of the local node.",
424 ),
425 ("temARRAY_EMPTY", -253, "Malformed: Array is empty."),
426 ("temARRAY_TOO_LARGE", -252, "Malformed: Array is too large."),
427 ("temBAD_AMM_TOKENS", -261, "Malformed: Invalid LPTokens."),
428 ("temBAD_AMOUNT", -298, "Malformed: Bad amount."),
429 ("temBAD_CIPHERTEXT", -248, "Malformed: Invalid ciphertext."),
430 ("temBAD_CURRENCY", -297, "Malformed: Bad currency."),
431 ("temBAD_EXPIRATION", -296, "Malformed: Bad expiration."),
432 ("temBAD_FEE", -295, "Invalid fee, negative or not XRP."),
433 ("temBAD_ISSUER", -294, "Malformed: Bad issuer."),
434 ("temBAD_LIMIT", -293, "Limits must be non-negative."),
435 ("temBAD_MPT", -249, "Malformed: Bad MPT."),
436 (
437 "temBAD_NFTOKEN_TRANSFER_FEE",
438 -262,
439 "Malformed: The NFToken transfer fee must be between 1 and 5000, inclusive.",
440 ),
441 ("temBAD_OFFER", -292, "Malformed: Bad offer."),
442 ("temBAD_PATH", -291, "Malformed: Bad path."),
443 ("temBAD_PATH_LOOP", -290, "Malformed: Loop in path."),
444 ("temBAD_QUORUM", -271, "Malformed: Quorum is unreachable."),
445 (
446 "temBAD_REGKEY",
447 -289,
448 "Malformed: Regular key cannot be same as master key.",
449 ),
450 (
451 "temBAD_SEND_XRP_LIMIT",
452 -288,
453 "Malformed: Limit quality is not allowed for XRP to XRP.",
454 ),
455 (
456 "temBAD_SEND_XRP_MAX",
457 -287,
458 "Malformed: Send max is not allowed for XRP to XRP.",
459 ),
460 (
461 "temBAD_SEND_XRP_NO_DIRECT",
462 -286,
463 "Malformed: No Ripple direct is not allowed for XRP to XRP.",
464 ),
465 (
466 "temBAD_SEND_XRP_PARTIAL",
467 -285,
468 "Malformed: Partial payment is not allowed for XRP to XRP.",
469 ),
470 (
471 "temBAD_SEND_XRP_PATHS",
472 -284,
473 "Malformed: Paths are not allowed for XRP to XRP.",
474 ),
475 (
476 "temBAD_SEQUENCE",
477 -283,
478 "Malformed: Sequence is not in the past.",
479 ),
480 ("temBAD_SIGNATURE", -282, "Malformed: Bad signature."),
481 (
482 "temBAD_SIGNER",
483 -272,
484 "Malformed: No signer may duplicate account or other signers.",
485 ),
486 ("temBAD_SRC_ACCOUNT", -281, "Malformed: Bad source account."),
487 (
488 "temBAD_TICK_SIZE",
489 -269,
490 "Malformed: Tick size out of range.",
491 ),
492 (
493 "temBAD_TRANSFER_FEE",
494 -251,
495 "Malformed: Transfer fee is outside valid range.",
496 ),
497 (
498 "temBAD_TRANSFER_RATE",
499 -280,
500 "Malformed: Transfer rate must be >= 1.0 and <= 2.0",
501 ),
502 (
503 "temBAD_WEIGHT",
504 -270,
505 "Malformed: Weight must be a positive value.",
506 ),
507 (
508 "temCANNOT_PREAUTH_SELF",
509 -267,
510 "Malformed: An account may not preauthorize itself.",
511 ),
512 (
513 "temDISABLED",
514 -273,
515 "The transaction requires logic that is currently disabled.",
516 ),
517 ("temDST_IS_SRC", -279, "Destination may not be source."),
518 ("temDST_NEEDED", -278, "Destination not specified."),
519 ("temEMPTY_DID", -254, "Malformed: No DID data provided."),
520 ("temINVALID", -277, "The transaction is ill-formed."),
521 (
522 "temINVALID_ACCOUNT_ID",
523 -268,
524 "Malformed: A field contains an invalid account ID.",
525 ),
526 (
527 "temINVALID_COUNT",
528 -266,
529 "Malformed: Count field outside valid range.",
530 ),
531 (
532 "temINVALID_FLAG",
533 -276,
534 "The transaction has an invalid flag.",
535 ),
536 (
537 "temINVALID_INNER_BATCH",
538 -250,
539 "Malformed: Invalid inner batch transaction.",
540 ),
541 ("temMALFORMED", -299, "Malformed transaction."),
542 ("temREDUNDANT", -275, "The transaction is redundant."),
543 ("temRIPPLE_EMPTY", -274, "PathSet with no paths."),
544 (
545 "temSEQ_AND_TICKET",
546 -263,
547 "Transaction contains a TicketSequence and a non-zero Sequence.",
548 ),
549 (
550 "temUNCERTAIN",
551 -265,
552 "In process of determining result. Never returned.",
553 ),
554 (
555 "temUNKNOWN",
556 -264,
557 "The transaction requires logic that is not implemented yet.",
558 ),
559 (
560 "temXCHAIN_BAD_PROOF",
561 -259,
562 "Malformed: Bad cross-chain claim proof.",
563 ),
564 (
565 "temXCHAIN_BRIDGE_BAD_ISSUES",
566 -258,
567 "Malformed: Bad bridge issues.",
568 ),
569 (
570 "temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT",
571 -256,
572 "Malformed: Bad min account create amount.",
573 ),
574 (
575 "temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT",
576 -255,
577 "Malformed: Bad reward amount.",
578 ),
579 (
580 "temXCHAIN_BRIDGE_NONDOOR_OWNER",
581 -257,
582 "Malformed: Bridge owner must be one of the door accounts.",
583 ),
584 (
585 "temXCHAIN_EQUAL_DOOR_ACCOUNTS",
586 -260,
587 "Malformed: Bridge must have unique door accounts.",
588 ),
589 (
590 "terADDRESS_COLLISION",
591 -86,
592 "Failed to allocate an unique account address.",
593 ),
594 ("terFUNDS_SPENT", -98, "DEPRECATED."),
595 ("terINSUF_FEE_B", -97, "Account balance can't pay fee."),
596 ("terLAST", -91, "DEPRECATED."),
597 ("terLOCKED", -84, "Fund is locked."),
598 ("terNO_ACCOUNT", -96, "The source account does not exist."),
599 ("terNO_AMM", -87, "AMM doesn't exist for the asset pair."),
600 ("terNO_AUTH", -95, "Not authorized to hold IOUs."),
601 (
602 "terNO_DELEGATE_PERMISSION",
603 -85,
604 "Delegated account lacks permission to perform this transaction.",
605 ),
606 ("terNO_LINE", -94, "No such line."),
607 (
608 "terNO_PERMISSION",
609 -83,
610 "No permission to perform requested operation.",
611 ),
612 ("terNO_RIPPLE", -90, "Path does not permit rippling."),
613 ("terOWNERS", -93, "Non-zero owner count."),
614 ("terPRE_SEQ", -92, "Missing/inapplicable prior transaction."),
615 ("terPRE_TICKET", -88, "Ticket is not yet in ledger."),
616 ("terQUEUED", -89, "Held until escalated fee drops."),
617 ("terRETRY", -99, "Retry transaction."),
618 (
619 "tesSUCCESS",
620 0,
621 "The transaction was applied. Only final in a validated ledger.",
622 ),
623];
624
625pub fn result(name: &str) -> Option<(i32, &'static str)> {
627 RESULTS
628 .binary_search_by(|r| r.0.cmp(name))
629 .ok()
630 .map(|i| (RESULTS[i].1, RESULTS[i].2))
631}
632
633#[cfg(test)]
634mod tests {
635 use super::*;
636
637 #[test]
638 fn known_results() {
639 assert!(RESULTS.windows(2).all(|w| w[0].0 < w[1].0));
640 assert_eq!(
641 result("tesSUCCESS"),
642 Some((
643 0,
644 "The transaction was applied. Only final in a validated ledger."
645 ))
646 );
647 assert_eq!(
648 result("tecPATH_DRY"),
649 Some((128, "Path could not send partial amount."))
650 );
651 assert_eq!(result("tecNOPE"), None);
652 }
653}