rippled
Loading...
Searching...
No Matches
TER.cpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#include <xrpl/protocol/TER.h>
21
22#include <boost/range/adaptor/transformed.hpp>
23#include <boost/range/iterator_range_core.hpp>
24
25#include <optional>
26#include <string>
27#include <unordered_map>
28#include <utility>
29
30namespace ripple {
31
36{
37 // clang-format off
38
39 // Macros are generally ugly, but they can help make code readable to
40 // humans without affecting the compiler.
41#define MAKE_ERROR(code, desc) { code, { #code, desc } }
42
43 static
47 {
48 MAKE_ERROR(tecAMM_BALANCE, "AMM has invalid balance."),
49 MAKE_ERROR(tecAMM_INVALID_TOKENS, "AMM invalid LP tokens."),
50 MAKE_ERROR(tecAMM_FAILED, "AMM transaction failed."),
51 MAKE_ERROR(tecAMM_EMPTY, "AMM is in empty state."),
52 MAKE_ERROR(tecAMM_NOT_EMPTY, "AMM is not in empty state."),
53 MAKE_ERROR(tecAMM_ACCOUNT, "This operation is not allowed on an AMM Account."),
54 MAKE_ERROR(tecCLAIM, "Fee claimed. Sequence used. No action."),
55 MAKE_ERROR(tecDIR_FULL, "Can not add entry to full directory."),
56 MAKE_ERROR(tecFAILED_PROCESSING, "Failed to correctly process transaction."),
57 MAKE_ERROR(tecINSUF_RESERVE_LINE, "Insufficient reserve to add trust line."),
58 MAKE_ERROR(tecINSUF_RESERVE_OFFER, "Insufficient reserve to create offer."),
59 MAKE_ERROR(tecNO_DST, "Destination does not exist. Send XRP to create it."),
60 MAKE_ERROR(tecNO_DST_INSUF_XRP, "Destination does not exist. Too little XRP sent to create it."),
61 MAKE_ERROR(tecNO_LINE_INSUF_RESERVE, "No such line. Too little reserve to create it."),
62 MAKE_ERROR(tecNO_LINE_REDUNDANT, "Can't set non-existent line to default."),
63 MAKE_ERROR(tecPATH_DRY, "Path could not send partial amount."),
64 MAKE_ERROR(tecPATH_PARTIAL, "Path could not send full amount."),
65 MAKE_ERROR(tecNO_ALTERNATIVE_KEY, "The operation would remove the ability to sign transactions with the account."),
66 MAKE_ERROR(tecNO_REGULAR_KEY, "Regular key is not set."),
67 MAKE_ERROR(tecOVERSIZE, "Object exceeded serialization limits."),
68 MAKE_ERROR(tecUNFUNDED, "Not enough XRP to satisfy the reserve requirement."),
69 MAKE_ERROR(tecUNFUNDED_ADD, "DEPRECATED."),
70 MAKE_ERROR(tecUNFUNDED_AMM, "Insufficient balance to fund AMM."),
71 MAKE_ERROR(tecUNFUNDED_OFFER, "Insufficient balance to fund created offer."),
72 MAKE_ERROR(tecUNFUNDED_PAYMENT, "Insufficient XRP balance to send."),
73 MAKE_ERROR(tecOWNERS, "Non-zero owner count."),
74 MAKE_ERROR(tecNO_ISSUER, "Issuer account does not exist."),
75 MAKE_ERROR(tecNO_AUTH, "Not authorized to hold asset."),
76 MAKE_ERROR(tecNO_LINE, "No such line."),
77 MAKE_ERROR(tecINSUFF_FEE, "Insufficient balance to pay fee."),
78 MAKE_ERROR(tecFROZEN, "Asset is frozen."),
79 MAKE_ERROR(tecNO_TARGET, "Target account does not exist."),
80 MAKE_ERROR(tecNO_PERMISSION, "No permission to perform requested operation."),
81 MAKE_ERROR(tecNO_ENTRY, "No matching entry found."),
82 MAKE_ERROR(tecINSUFFICIENT_RESERVE, "Insufficient reserve to complete requested operation."),
83 MAKE_ERROR(tecNEED_MASTER_KEY, "The operation requires the use of the Master Key."),
84 MAKE_ERROR(tecDST_TAG_NEEDED, "A destination tag is required."),
85 MAKE_ERROR(tecINTERNAL, "An internal error has occurred during processing."),
86 MAKE_ERROR(tecCRYPTOCONDITION_ERROR, "Malformed, invalid, or mismatched conditional or fulfillment."),
87 MAKE_ERROR(tecINVARIANT_FAILED, "One or more invariants for the transaction were not satisfied."),
88 MAKE_ERROR(tecEXPIRED, "Expiration time is passed."),
89 MAKE_ERROR(tecDUPLICATE, "Ledger object already exists."),
90 MAKE_ERROR(tecKILLED, "No funds transferred and no offer created."),
91 MAKE_ERROR(tecHAS_OBLIGATIONS, "The account cannot be deleted since it has obligations."),
92 MAKE_ERROR(tecTOO_SOON, "It is too early to attempt the requested operation. Please wait."),
93 MAKE_ERROR(tecMAX_SEQUENCE_REACHED, "The maximum sequence number was reached."),
94 MAKE_ERROR(tecNO_SUITABLE_NFTOKEN_PAGE, "A suitable NFToken page could not be located."),
95 MAKE_ERROR(tecNFTOKEN_BUY_SELL_MISMATCH, "The 'Buy' and 'Sell' NFToken offers are mismatched."),
96 MAKE_ERROR(tecNFTOKEN_OFFER_TYPE_MISMATCH, "The type of NFToken offer is incorrect."),
97 MAKE_ERROR(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER, "An NFToken offer cannot be claimed by its owner."),
98 MAKE_ERROR(tecINSUFFICIENT_FUNDS, "Not enough funds available to complete requested transaction."),
99 MAKE_ERROR(tecOBJECT_NOT_FOUND, "A requested object could not be located."),
100 MAKE_ERROR(tecINSUFFICIENT_PAYMENT, "The payment is not sufficient."),
101 MAKE_ERROR(tecINCOMPLETE, "Some work was completed, but more submissions required to finish."),
102 MAKE_ERROR(tecXCHAIN_BAD_TRANSFER_ISSUE, "Bad xchain transfer issue."),
103 MAKE_ERROR(tecXCHAIN_NO_CLAIM_ID, "No such xchain claim id."),
104 MAKE_ERROR(tecXCHAIN_BAD_CLAIM_ID, "Bad xchain claim id."),
105 MAKE_ERROR(tecXCHAIN_CLAIM_NO_QUORUM, "Quorum was not reached on the xchain claim."),
106 MAKE_ERROR(tecXCHAIN_PROOF_UNKNOWN_KEY, "Unknown key for the xchain proof."),
107 MAKE_ERROR(tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE, "Only XRP may be used for xchain create account."),
108 MAKE_ERROR(tecXCHAIN_WRONG_CHAIN, "XChain Transaction was submitted to the wrong chain."),
109 MAKE_ERROR(tecXCHAIN_REWARD_MISMATCH, "The reward amount must match the reward specified in the xchain bridge."),
110 MAKE_ERROR(tecXCHAIN_NO_SIGNERS_LIST, "The account did not have a signers list."),
111 MAKE_ERROR(tecXCHAIN_SENDING_ACCOUNT_MISMATCH,"The sending account did not match the expected sending account."),
112 MAKE_ERROR(tecXCHAIN_INSUFF_CREATE_AMOUNT, "Insufficient amount to create an account."),
113 MAKE_ERROR(tecXCHAIN_ACCOUNT_CREATE_PAST, "The account create count has already passed."),
114 MAKE_ERROR(tecXCHAIN_ACCOUNT_CREATE_TOO_MANY, "There are too many pending account create transactions to submit a new one."),
115 MAKE_ERROR(tecXCHAIN_PAYMENT_FAILED, "Failed to transfer funds in a xchain transaction."),
116 MAKE_ERROR(tecXCHAIN_SELF_COMMIT, "Account cannot commit funds to itself."),
117 MAKE_ERROR(tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR, "Bad public key account pair in an xchain transaction."),
118 MAKE_ERROR(tecXCHAIN_CREATE_ACCOUNT_DISABLED, "This bridge does not support account creation."),
119 MAKE_ERROR(tecEMPTY_DID, "The DID object did not have a URI or DIDDocument field."),
120 MAKE_ERROR(tecINVALID_UPDATE_TIME, "The Oracle object has invalid LastUpdateTime field."),
121 MAKE_ERROR(tecTOKEN_PAIR_NOT_FOUND, "Token pair is not found in Oracle object."),
122 MAKE_ERROR(tecARRAY_EMPTY, "Array is empty."),
123 MAKE_ERROR(tecARRAY_TOO_LARGE, "Array is too large."),
124 MAKE_ERROR(tecLOCKED, "Fund is locked."),
125 MAKE_ERROR(tecBAD_CREDENTIALS, "Bad credentials."),
126 MAKE_ERROR(tecWRONG_ASSET, "Wrong asset given."),
127 MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
128 MAKE_ERROR(tecPSEUDO_ACCOUNT, "This operation is not allowed against a pseudo-account."),
129
130 MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
131 MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
132 MAKE_ERROR(tefBAD_AUTH, "Transaction's public key is not authorized."),
133 MAKE_ERROR(tefBAD_LEDGER, "Ledger in unexpected state."),
134 MAKE_ERROR(tefBAD_QUORUM, "Signatures provided do not meet the quorum."),
135 MAKE_ERROR(tefBAD_SIGNATURE, "A signature is provided for a non-signer."),
136 MAKE_ERROR(tefCREATED, "Can't add an already created account."),
137 MAKE_ERROR(tefEXCEPTION, "Unexpected program state."),
138 MAKE_ERROR(tefFAILURE, "Failed to apply."),
139 MAKE_ERROR(tefINTERNAL, "Internal error."),
140 MAKE_ERROR(tefMASTER_DISABLED, "Master key is disabled."),
141 MAKE_ERROR(tefMAX_LEDGER, "Ledger sequence too high."),
142 MAKE_ERROR(tefNO_AUTH_REQUIRED, "Auth is not required."),
143 MAKE_ERROR(tefNOT_MULTI_SIGNING, "Account has no appropriate list of multi-signers."),
144 MAKE_ERROR(tefPAST_SEQ, "This sequence number has already passed."),
145 MAKE_ERROR(tefWRONG_PRIOR, "This previous transaction does not match."),
146 MAKE_ERROR(tefBAD_AUTH_MASTER, "Auth for unclaimed account needs correct master key."),
147 MAKE_ERROR(tefINVARIANT_FAILED, "Fee claim violated invariants for the transaction."),
148 MAKE_ERROR(tefTOO_BIG, "Transaction affects too many items."),
149 MAKE_ERROR(tefNO_TICKET, "Ticket is not in ledger."),
150 MAKE_ERROR(tefNFTOKEN_IS_NOT_TRANSFERABLE, "The specified NFToken is not transferable."),
151 MAKE_ERROR(tefINVALID_LEDGER_FIX_TYPE, "The LedgerFixType field has an invalid value."),
152
153 MAKE_ERROR(telLOCAL_ERROR, "Local failure."),
154 MAKE_ERROR(telBAD_DOMAIN, "Domain too long."),
155 MAKE_ERROR(telBAD_PATH_COUNT, "Malformed: Too many paths."),
156 MAKE_ERROR(telBAD_PUBLIC_KEY, "Public key is not valid."),
157 MAKE_ERROR(telFAILED_PROCESSING, "Failed to correctly process transaction."),
158 MAKE_ERROR(telINSUF_FEE_P, "Fee insufficient."),
159 MAKE_ERROR(telNO_DST_PARTIAL, "Partial payment to create account not allowed."),
160 MAKE_ERROR(telCAN_NOT_QUEUE, "Can not queue at this time."),
161 MAKE_ERROR(telCAN_NOT_QUEUE_BALANCE, "Can not queue at this time: insufficient balance to pay all queued fees."),
162 MAKE_ERROR(telCAN_NOT_QUEUE_BLOCKS, "Can not queue at this time: would block later queued transaction(s)."),
163 MAKE_ERROR(telCAN_NOT_QUEUE_BLOCKED, "Can not queue at this time: blocking transaction in queue."),
164 MAKE_ERROR(telCAN_NOT_QUEUE_FEE, "Can not queue at this time: fee insufficient to replace queued transaction."),
165 MAKE_ERROR(telCAN_NOT_QUEUE_FULL, "Can not queue at this time: queue is full."),
166 MAKE_ERROR(telWRONG_NETWORK, "Transaction specifies a Network ID that differs from that of the local node."),
167 MAKE_ERROR(telREQUIRES_NETWORK_ID, "Transactions submitted to this node/network must include a correct NetworkID field."),
168 MAKE_ERROR(telNETWORK_ID_MAKES_TX_NON_CANONICAL, "Transactions submitted to this node/network must NOT include a NetworkID field."),
169 MAKE_ERROR(telENV_RPC_FAILED, "Unit test RPC failure."),
170
171 MAKE_ERROR(temMALFORMED, "Malformed transaction."),
172 MAKE_ERROR(temBAD_AMM_TOKENS, "Malformed: Invalid LPTokens."),
173 MAKE_ERROR(temBAD_AMOUNT, "Malformed: Bad amount."),
174 MAKE_ERROR(temBAD_CURRENCY, "Malformed: Bad currency."),
175 MAKE_ERROR(temBAD_EXPIRATION, "Malformed: Bad expiration."),
176 MAKE_ERROR(temBAD_FEE, "Invalid fee, negative or not XRP."),
177 MAKE_ERROR(temBAD_ISSUER, "Malformed: Bad issuer."),
178 MAKE_ERROR(temBAD_LIMIT, "Limits must be non-negative."),
179 MAKE_ERROR(temBAD_OFFER, "Malformed: Bad offer."),
180 MAKE_ERROR(temBAD_PATH, "Malformed: Bad path."),
181 MAKE_ERROR(temBAD_PATH_LOOP, "Malformed: Loop in path."),
182 MAKE_ERROR(temBAD_QUORUM, "Malformed: Quorum is unreachable."),
183 MAKE_ERROR(temBAD_REGKEY, "Malformed: Regular key cannot be same as master key."),
184 MAKE_ERROR(temBAD_SEND_XRP_LIMIT, "Malformed: Limit quality is not allowed for XRP to XRP."),
185 MAKE_ERROR(temBAD_SEND_XRP_MAX, "Malformed: Send max is not allowed for XRP to XRP."),
186 MAKE_ERROR(temBAD_SEND_XRP_NO_DIRECT, "Malformed: No Ripple direct is not allowed for XRP to XRP."),
187 MAKE_ERROR(temBAD_SEND_XRP_PARTIAL, "Malformed: Partial payment is not allowed for XRP to XRP."),
188 MAKE_ERROR(temBAD_SEND_XRP_PATHS, "Malformed: Paths are not allowed for XRP to XRP."),
189 MAKE_ERROR(temBAD_SEQUENCE, "Malformed: Sequence is not in the past."),
190 MAKE_ERROR(temBAD_SIGNATURE, "Malformed: Bad signature."),
191 MAKE_ERROR(temBAD_SIGNER, "Malformed: No signer may duplicate account or other signers."),
192 MAKE_ERROR(temBAD_SRC_ACCOUNT, "Malformed: Bad source account."),
193 MAKE_ERROR(temBAD_TRANSFER_RATE, "Malformed: Transfer rate must be >= 1.0 and <= 2.0"),
194 MAKE_ERROR(temBAD_WEIGHT, "Malformed: Weight must be a positive value."),
195 MAKE_ERROR(temDST_IS_SRC, "Destination may not be source."),
196 MAKE_ERROR(temDST_NEEDED, "Destination not specified."),
197 MAKE_ERROR(temEMPTY_DID, "Malformed: No DID data provided."),
198 MAKE_ERROR(temINVALID, "The transaction is ill-formed."),
199 MAKE_ERROR(temINVALID_FLAG, "The transaction has an invalid flag."),
200 MAKE_ERROR(temREDUNDANT, "The transaction is redundant."),
201 MAKE_ERROR(temRIPPLE_EMPTY, "PathSet with no paths."),
202 MAKE_ERROR(temUNCERTAIN, "In process of determining result. Never returned."),
203 MAKE_ERROR(temUNKNOWN, "The transaction requires logic that is not implemented yet."),
204 MAKE_ERROR(temDISABLED, "The transaction requires logic that is currently disabled."),
205 MAKE_ERROR(temBAD_TICK_SIZE, "Malformed: Tick size out of range."),
206 MAKE_ERROR(temINVALID_ACCOUNT_ID, "Malformed: A field contains an invalid account ID."),
207 MAKE_ERROR(temCANNOT_PREAUTH_SELF, "Malformed: An account may not preauthorize itself."),
208 MAKE_ERROR(temINVALID_COUNT, "Malformed: Count field outside valid range."),
209 MAKE_ERROR(temSEQ_AND_TICKET, "Transaction contains a TicketSequence and a non-zero Sequence."),
210 MAKE_ERROR(temBAD_NFTOKEN_TRANSFER_FEE, "Malformed: The NFToken transfer fee must be between 1 and 5000, inclusive."),
211 MAKE_ERROR(temXCHAIN_EQUAL_DOOR_ACCOUNTS, "Malformed: Bridge must have unique door accounts."),
212 MAKE_ERROR(temXCHAIN_BAD_PROOF, "Malformed: Bad cross-chain claim proof."),
213 MAKE_ERROR(temXCHAIN_BRIDGE_BAD_ISSUES, "Malformed: Bad bridge issues."),
214 MAKE_ERROR(temXCHAIN_BRIDGE_NONDOOR_OWNER, "Malformed: Bridge owner must be one of the door accounts."),
215 MAKE_ERROR(temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT, "Malformed: Bad min account create amount."),
216 MAKE_ERROR(temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT, "Malformed: Bad reward amount."),
217 MAKE_ERROR(temARRAY_EMPTY, "Malformed: Array is empty."),
218 MAKE_ERROR(temARRAY_TOO_LARGE, "Malformed: Array is too large."),
219 MAKE_ERROR(temBAD_TRANSFER_FEE, "Malformed: Transfer fee is outside valid range."),
220
221 MAKE_ERROR(terRETRY, "Retry transaction."),
222 MAKE_ERROR(terFUNDS_SPENT, "DEPRECATED."),
223 MAKE_ERROR(terINSUF_FEE_B, "Account balance can't pay fee."),
224 MAKE_ERROR(terLAST, "DEPRECATED."),
225 MAKE_ERROR(terNO_RIPPLE, "Path does not permit rippling."),
226 MAKE_ERROR(terNO_ACCOUNT, "The source account does not exist."),
227 MAKE_ERROR(terNO_AUTH, "Not authorized to hold IOUs."),
228 MAKE_ERROR(terNO_LINE, "No such line."),
229 MAKE_ERROR(terPRE_SEQ, "Missing/inapplicable prior transaction."),
230 MAKE_ERROR(terOWNERS, "Non-zero owner count."),
231 MAKE_ERROR(terQUEUED, "Held until escalated fee drops."),
232 MAKE_ERROR(terPRE_TICKET, "Ticket is not yet in ledger."),
233 MAKE_ERROR(terNO_AMM, "AMM doesn't exist for the asset pair."),
234 MAKE_ERROR(terADDRESS_COLLISION, "Failed to allocate an unique account address."),
235
236 MAKE_ERROR(tesSUCCESS, "The transaction was applied. Only final in a validated ledger."),
237 };
238 // clang-format on
239
240#undef MAKE_ERROR
241
242 return results;
243}
244
245bool
247{
248 auto& results = transResults();
249
250 auto const r = results.find(TERtoInt(code));
251
252 if (r == results.end())
253 return false;
254
255 token = r->second.first;
256 text = r->second.second;
257 return true;
258}
259
262{
263 std::string token;
264 std::string text;
265
266 return transResultInfo(code, token, text) ? token : "-";
267}
268
271{
272 std::string token;
273 std::string text;
274
275 return transResultInfo(code, token, text) ? text : "-";
276}
277
280{
281 static auto const results = [] {
282 auto& byTer = transResults();
283 auto range = boost::make_iterator_range(byTer.begin(), byTer.end());
284 auto tRange = boost::adaptors::transform(range, [](auto const& r) {
285 return std::make_pair(r.second.first, r.first);
286 });
288 tRange.begin(), tRange.end());
289 return byToken;
290 }();
291
292 auto const r = results.find(token);
293
294 if (r == results.end())
295 return std::nullopt;
296
297 return TER::fromInt(r->second);
298}
299
300} // namespace ripple
static constexpr TERSubset fromInt(int from)
Definition: TER.h:427
T make_pair(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
std::string transHuman(TER code)
Definition: TER.cpp:270
@ telWRONG_NETWORK
Definition: TER.h:65
@ telLOCAL_ERROR
Definition: TER.h:52
@ telCAN_NOT_QUEUE_BLOCKED
Definition: TER.h:62
@ telBAD_PUBLIC_KEY
Definition: TER.h:55
@ telBAD_PATH_COUNT
Definition: TER.h:54
@ telFAILED_PROCESSING
Definition: TER.h:56
@ telINSUF_FEE_P
Definition: TER.h:57
@ telNO_DST_PARTIAL
Definition: TER.h:58
@ telREQUIRES_NETWORK_ID
Definition: TER.h:66
@ telCAN_NOT_QUEUE_FULL
Definition: TER.h:64
@ telBAD_DOMAIN
Definition: TER.h:53
@ telNETWORK_ID_MAKES_TX_NON_CANONICAL
Definition: TER.h:67
@ telCAN_NOT_QUEUE
Definition: TER.h:59
@ telCAN_NOT_QUEUE_BALANCE
Definition: TER.h:60
@ telCAN_NOT_QUEUE_FEE
Definition: TER.h:63
@ telCAN_NOT_QUEUE_BLOCKS
Definition: TER.h:61
@ telENV_RPC_FAILED
Definition: TER.h:68
@ tefNOT_MULTI_SIGNING
Definition: TER.h:181
@ tefNO_AUTH_REQUIRED
Definition: TER.h:174
@ tefPAST_SEQ
Definition: TER.h:175
@ tefNO_TICKET
Definition: TER.h:185
@ tefBAD_AUTH_MASTER
Definition: TER.h:182
@ tefMAX_LEDGER
Definition: TER.h:178
@ tefINVARIANT_FAILED
Definition: TER.h:183
@ tefNFTOKEN_IS_NOT_TRANSFERABLE
Definition: TER.h:186
@ tefFAILURE
Definition: TER.h:166
@ tefINVALID_LEDGER_FIX_TYPE
Definition: TER.h:187
@ tefEXCEPTION
Definition: TER.h:172
@ tefWRONG_PRIOR
Definition: TER.h:176
@ tefBAD_AUTH
Definition: TER.h:169
@ tefBAD_QUORUM
Definition: TER.h:180
@ tefBAD_SIGNATURE
Definition: TER.h:179
@ tefBAD_LEDGER
Definition: TER.h:170
@ tefBAD_ADD_AUTH
Definition: TER.h:168
@ tefALREADY
Definition: TER.h:167
@ tefMASTER_DISABLED
Definition: TER.h:177
@ tefTOO_BIG
Definition: TER.h:184
@ tefCREATED
Definition: TER.h:171
@ tefINTERNAL
Definition: TER.h:173
int TERUnderlyingType
Definition: TER.h:38
std::string transToken(TER code)
Definition: TER.cpp:261
@ tecNO_LINE_REDUNDANT
Definition: TER.h:293
@ tecNO_ENTRY
Definition: TER.h:306
@ tecCRYPTOCONDITION_ERROR
Definition: TER.h:312
@ tecPSEUDO_ACCOUNT
Definition: TER.h:362
@ tecNO_SUITABLE_NFTOKEN_PAGE
Definition: TER.h:321
@ tecNO_DST
Definition: TER.h:290
@ tecNO_LINE_INSUF_RESERVE
Definition: TER.h:292
@ tecNEED_MASTER_KEY
Definition: TER.h:308
@ tecINSUFF_FEE
Definition: TER.h:302
@ tecXCHAIN_SELF_COMMIT
Definition: TER.h:350
@ tecXCHAIN_WRONG_CHAIN
Definition: TER.h:342
@ tecLIMIT_EXCEEDED
Definition: TER.h:361
@ tecXCHAIN_INSUFF_CREATE_AMOUNT
Definition: TER.h:346
@ tecXCHAIN_CREATE_ACCOUNT_DISABLED
Definition: TER.h:352
@ tecINSUF_RESERVE_LINE
Definition: TER.h:288
@ tecOBJECT_NOT_FOUND
Definition: TER.h:326
@ tecINSUF_RESERVE_OFFER
Definition: TER.h:289
@ tecNO_ISSUER
Definition: TER.h:299
@ tecUNFUNDED
Definition: TER.h:295
@ tecXCHAIN_NO_CLAIM_ID
Definition: TER.h:337
@ tecTOO_SOON
Definition: TER.h:318
@ tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE
Definition: TER.h:341
@ tecNO_TARGET
Definition: TER.h:304
@ tecDIR_FULL
Definition: TER.h:287
@ tecNO_REGULAR_KEY
Definition: TER.h:297
@ tecINCOMPLETE
Definition: TER.h:335
@ tecNFTOKEN_OFFER_TYPE_MISMATCH
Definition: TER.h:323
@ tecXCHAIN_PAYMENT_FAILED
Definition: TER.h:349
@ tecUNFUNDED_OFFER
Definition: TER.h:284
@ tecFROZEN
Definition: TER.h:303
@ tecXCHAIN_CLAIM_NO_QUORUM
Definition: TER.h:339
@ tecAMM_EMPTY
Definition: TER.h:332
@ tecUNFUNDED_ADD
Definition: TER.h:283
@ tecOWNERS
Definition: TER.h:298
@ tecKILLED
Definition: TER.h:316
@ tecXCHAIN_BAD_CLAIM_ID
Definition: TER.h:338
@ tecXCHAIN_PROOF_UNKNOWN_KEY
Definition: TER.h:340
@ tecDUPLICATE
Definition: TER.h:315
@ tecINSUFFICIENT_FUNDS
Definition: TER.h:325
@ tecNFTOKEN_BUY_SELL_MISMATCH
Definition: TER.h:322
@ tecXCHAIN_ACCOUNT_CREATE_PAST
Definition: TER.h:347
@ tecINTERNAL
Definition: TER.h:310
@ tecBAD_CREDENTIALS
Definition: TER.h:359
@ tecXCHAIN_BAD_TRANSFER_ISSUE
Definition: TER.h:336
@ tecNO_PERMISSION
Definition: TER.h:305
@ tecDST_TAG_NEEDED
Definition: TER.h:309
@ tecHAS_OBLIGATIONS
Definition: TER.h:317
@ tecINVARIANT_FAILED
Definition: TER.h:313
@ tecAMM_NOT_EMPTY
Definition: TER.h:333
@ tecOVERSIZE
Definition: TER.h:311
@ tecARRAY_TOO_LARGE
Definition: TER.h:357
@ tecWRONG_ASSET
Definition: TER.h:360
@ tecXCHAIN_REWARD_MISMATCH
Definition: TER.h:343
@ tecCLAIM
Definition: TER.h:281
@ tecINVALID_UPDATE_TIME
Definition: TER.h:354
@ tecPATH_PARTIAL
Definition: TER.h:282
@ tecUNFUNDED_AMM
Definition: TER.h:328
@ tecAMM_ACCOUNT
Definition: TER.h:334
@ tecAMM_FAILED
Definition: TER.h:330
@ tecNO_LINE
Definition: TER.h:301
@ tecMAX_SEQUENCE_REACHED
Definition: TER.h:320
@ tecXCHAIN_SENDING_ACCOUNT_MISMATCH
Definition: TER.h:345
@ tecINSUFFICIENT_PAYMENT
Definition: TER.h:327
@ tecEMPTY_DID
Definition: TER.h:353
@ tecNO_ALTERNATIVE_KEY
Definition: TER.h:296
@ tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR
Definition: TER.h:351
@ tecUNFUNDED_PAYMENT
Definition: TER.h:285
@ tecPATH_DRY
Definition: TER.h:294
@ tecXCHAIN_NO_SIGNERS_LIST
Definition: TER.h:344
@ tecAMM_INVALID_TOKENS
Definition: TER.h:331
@ tecAMM_BALANCE
Definition: TER.h:329
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:307
@ tecARRAY_EMPTY
Definition: TER.h:356
@ tecXCHAIN_ACCOUNT_CREATE_TOO_MANY
Definition: TER.h:348
@ tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
Definition: TER.h:324
@ tecFAILED_PROCESSING
Definition: TER.h:286
@ tecEXPIRED
Definition: TER.h:314
@ tecTOKEN_PAIR_NOT_FOUND
Definition: TER.h:355
@ tecNO_DST_INSUF_XRP
Definition: TER.h:291
@ tecNO_AUTH
Definition: TER.h:300
@ tecLOCKED
Definition: TER.h:358
@ tesSUCCESS
Definition: TER.h:244
constexpr TERUnderlyingType TERtoInt(TELcodes v)
Definition: TER.h:369
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition: RangeSet.h:54
std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & transResults()
Definition: TER.cpp:35
@ terADDRESS_COLLISION
Definition: TER.h:228
@ terINSUF_FEE_B
Definition: TER.h:216
@ terOWNERS
Definition: TER.h:220
@ terRETRY
Definition: TER.h:214
@ terFUNDS_SPENT
Definition: TER.h:215
@ terNO_ACCOUNT
Definition: TER.h:217
@ terLAST
Definition: TER.h:223
@ terNO_RIPPLE
Definition: TER.h:224
@ terNO_AMM
Definition: TER.h:227
@ terPRE_SEQ
Definition: TER.h:221
@ terQUEUED
Definition: TER.h:225
@ terNO_AUTH
Definition: TER.h:218
@ terPRE_TICKET
Definition: TER.h:226
@ terNO_LINE
Definition: TER.h:219
bool transResultInfo(TER code, std::string &token, std::string &text)
Definition: TER.cpp:246
std::optional< TER > transCode(std::string const &token)
Definition: TER.cpp:279
@ temBAD_ISSUER
Definition: TER.h:93
@ temBAD_SEND_XRP_PARTIAL
Definition: TER.h:102
@ temBAD_AMOUNT
Definition: TER.h:89
@ temBAD_SRC_ACCOUNT
Definition: TER.h:106
@ temREDUNDANT
Definition: TER.h:112
@ temBAD_LIMIT
Definition: TER.h:94
@ temBAD_PATH_LOOP
Definition: TER.h:97
@ temUNKNOWN
Definition: TER.h:124
@ temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT
Definition: TER.h:135
@ temBAD_PATH
Definition: TER.h:96
@ temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT
Definition: TER.h:136
@ temBAD_FEE
Definition: TER.h:92
@ temBAD_SIGNER
Definition: TER.h:115
@ temSEQ_AND_TICKET
Definition: TER.h:126
@ temXCHAIN_EQUAL_DOOR_ACCOUNTS
Definition: TER.h:131
@ temDST_NEEDED
Definition: TER.h:109
@ temUNCERTAIN
Definition: TER.h:123
@ temBAD_REGKEY
Definition: TER.h:98
@ temBAD_CURRENCY
Definition: TER.h:90
@ temBAD_TRANSFER_FEE
Definition: TER.h:143
@ temBAD_SEND_XRP_LIMIT
Definition: TER.h:99
@ temBAD_SEQUENCE
Definition: TER.h:104
@ temINVALID_COUNT
Definition: TER.h:121
@ temXCHAIN_BRIDGE_NONDOOR_OWNER
Definition: TER.h:134
@ temMALFORMED
Definition: TER.h:87
@ temINVALID
Definition: TER.h:110
@ temBAD_SEND_XRP_PATHS
Definition: TER.h:103
@ temBAD_EXPIRATION
Definition: TER.h:91
@ temBAD_AMM_TOKENS
Definition: TER.h:129
@ temBAD_OFFER
Definition: TER.h:95
@ temINVALID_FLAG
Definition: TER.h:111
@ temXCHAIN_BRIDGE_BAD_ISSUES
Definition: TER.h:133
@ temARRAY_EMPTY
Definition: TER.h:140
@ temBAD_SEND_XRP_NO_DIRECT
Definition: TER.h:101
@ temBAD_QUORUM
Definition: TER.h:116
@ temARRAY_TOO_LARGE
Definition: TER.h:141
@ temBAD_TICK_SIZE
Definition: TER.h:118
@ temBAD_WEIGHT
Definition: TER.h:117
@ temDISABLED
Definition: TER.h:114
@ temDST_IS_SRC
Definition: TER.h:108
@ temBAD_TRANSFER_RATE
Definition: TER.h:107
@ temXCHAIN_BAD_PROOF
Definition: TER.h:132
@ temEMPTY_DID
Definition: TER.h:138
@ temRIPPLE_EMPTY
Definition: TER.h:113
@ temCANNOT_PREAUTH_SELF
Definition: TER.h:120
@ temBAD_SEND_XRP_MAX
Definition: TER.h:100
@ temINVALID_ACCOUNT_ID
Definition: TER.h:119
@ temBAD_SIGNATURE
Definition: TER.h:105
@ temBAD_NFTOKEN_TRANSFER_FEE
Definition: TER.h:127