20 #include <ripple/protocol/TER.h>
21 #include <boost/range/adaptor/transformed.hpp>
41 {
tecCLAIM, {
"tecCLAIM",
"Fee claimed. Sequence used. No action." } },
42 {
tecDIR_FULL, {
"tecDIR_FULL",
"Can not add entry to full directory." } },
43 {
tecFAILED_PROCESSING, {
"tecFAILED_PROCESSING",
"Failed to correctly process transaction." } },
46 {
tecNO_DST, {
"tecNO_DST",
"Destination does not exist. Send XRP to create it." } },
47 {
tecNO_DST_INSUF_XRP, {
"tecNO_DST_INSUF_XRP",
"Destination does not exist. Too little XRP sent to create it." } },
50 {
tecPATH_DRY, {
"tecPATH_DRY",
"Path could not send partial amount." } },
51 {
tecPATH_PARTIAL, {
"tecPATH_PARTIAL",
"Path could not send full amount." } },
52 {
tecNO_ALTERNATIVE_KEY, {
"tecNO_ALTERNATIVE_KEY",
"The operation would remove the ability to sign transactions with the account." } },
54 {
tecOVERSIZE, {
"tecOVERSIZE",
"Object exceeded serialization limits." } },
55 {
tecUNFUNDED, {
"tecUNFUNDED",
"One of _ADD, _OFFER, or _SEND. Deprecated." } },
56 {
tecUNFUNDED_ADD, {
"tecUNFUNDED_ADD",
"Insufficient XRP balance for WalletAdd." } },
57 {
tecUNFUNDED_OFFER, {
"tecUNFUNDED_OFFER",
"Insufficient balance to fund created offer." } },
59 {
tecOWNERS, {
"tecOWNERS",
"Non-zero owner count." } },
60 {
tecNO_ISSUER, {
"tecNO_ISSUER",
"Issuer account does not exist." } },
61 {
tecNO_AUTH, {
"tecNO_AUTH",
"Not authorized to hold asset." } },
62 {
tecNO_LINE, {
"tecNO_LINE",
"No such line." } },
63 {
tecINSUFF_FEE, {
"tecINSUFF_FEE",
"Insufficient balance to pay fee." } },
64 {
tecFROZEN, {
"tecFROZEN",
"Asset is frozen." } },
65 {
tecNO_TARGET, {
"tecNO_TARGET",
"Target account does not exist." } },
66 {
tecNO_PERMISSION, {
"tecNO_PERMISSION",
"No permission to perform requested operation." } },
67 {
tecNO_ENTRY, {
"tecNO_ENTRY",
"No matching entry found." } },
68 {
tecINSUFFICIENT_RESERVE, {
"tecINSUFFICIENT_RESERVE",
"Insufficient reserve to complete requested operation." } },
69 {
tecNEED_MASTER_KEY, {
"tecNEED_MASTER_KEY",
"The operation requires the use of the Master Key." } },
71 {
tecINTERNAL, {
"tecINTERNAL",
"An internal error has occurred during processing." } },
72 {
tecCRYPTOCONDITION_ERROR, {
"tecCRYPTOCONDITION_ERROR",
"Malformed, invalid, or mismatched conditional or fulfillment." } },
73 {
tecINVARIANT_FAILED, {
"tecINVARIANT_FAILED",
"One or more invariants for the transaction were not satisfied." } },
74 {
tecEXPIRED, {
"tecEXPIRED",
"Expiration time is passed." } },
75 {
tecDUPLICATE, {
"tecDUPLICATE",
"Ledger object already exists." } },
76 {
tecKILLED, {
"tecKILLED",
"FillOrKill offer killed." } },
77 {
tecHAS_OBLIGATIONS, {
"tecHAS_OBLIGATIONS",
"The account cannot be deleted since it has obligations." } },
78 {
tecTOO_SOON, {
"tecTOO_SOON",
"It is too early to attempt the requested operation. Please wait." } },
80 {
tefALREADY, {
"tefALREADY",
"The exact transaction was already in this ledger." } },
81 {
tefBAD_ADD_AUTH, {
"tefBAD_ADD_AUTH",
"Not authorized to add account." } },
82 {
tefBAD_AUTH, {
"tefBAD_AUTH",
"Transaction's public key is not authorized." } },
83 {
tefBAD_LEDGER, {
"tefBAD_LEDGER",
"Ledger in unexpected state." } },
84 {
tefBAD_QUORUM, {
"tefBAD_QUORUM",
"Signatures provided do not meet the quorum." } },
85 {
tefBAD_SIGNATURE, {
"tefBAD_SIGNATURE",
"A signature is provided for a non-signer." } },
86 {
tefCREATED, {
"tefCREATED",
"Can't add an already created account." } },
87 {
tefEXCEPTION, {
"tefEXCEPTION",
"Unexpected program state." } },
88 {
tefFAILURE, {
"tefFAILURE",
"Failed to apply." } },
89 {
tefINTERNAL, {
"tefINTERNAL",
"Internal error." } },
91 {
tefMAX_LEDGER, {
"tefMAX_LEDGER",
"Ledger sequence too high." } },
93 {
tefNOT_MULTI_SIGNING, {
"tefNOT_MULTI_SIGNING",
"Account has no appropriate list of multi-signers." } },
94 {
tefPAST_SEQ, {
"tefPAST_SEQ",
"This sequence number has already passed." } },
95 {
tefWRONG_PRIOR, {
"tefWRONG_PRIOR",
"This previous transaction does not match." } },
96 {
tefBAD_AUTH_MASTER, {
"tefBAD_AUTH_MASTER",
"Auth for unclaimed account needs correct master key." } },
97 {
tefINVARIANT_FAILED, {
"tefINVARIANT_FAILED",
"Fee claim violated invariants for the transaction." } },
98 {
tefTOO_BIG, {
"tefTOO_BIG",
"Transaction affects too many items." } },
104 {
telFAILED_PROCESSING, {
"telFAILED_PROCESSING",
"Failed to correctly process transaction." } },
106 {
telNO_DST_PARTIAL, {
"telNO_DST_PARTIAL",
"Partial payment to create account not allowed." } },
107 {
telCAN_NOT_QUEUE, {
"telCAN_NOT_QUEUE",
"Can not queue at this time." } },
108 {
telCAN_NOT_QUEUE_BALANCE, {
"telCAN_NOT_QUEUE_BALANCE",
"Can not queue at this time: insufficient balance to pay all queued fees." } },
109 {
telCAN_NOT_QUEUE_BLOCKS, {
"telCAN_NOT_QUEUE_BLOCKS",
"Can not queue at this time: would block later queued transaction(s)." } },
110 {
telCAN_NOT_QUEUE_BLOCKED, {
"telCAN_NOT_QUEUE_BLOCKED",
"Can not queue at this time: blocking transaction in queue." } },
111 {
telCAN_NOT_QUEUE_FEE, {
"telCAN_NOT_QUEUE_FEE",
"Can not queue at this time: fee insufficient to replace queued transaction." } },
112 {
telCAN_NOT_QUEUE_FULL, {
"telCAN_NOT_QUEUE_FULL",
"Can not queue at this time: queue is full." } },
114 {
temMALFORMED, {
"temMALFORMED",
"Malformed transaction." } },
115 {
temBAD_AMOUNT, {
"temBAD_AMOUNT",
"Can only send positive amounts." } },
116 {
temBAD_CURRENCY, {
"temBAD_CURRENCY",
"Malformed: Bad currency." } },
118 {
temBAD_FEE, {
"temBAD_FEE",
"Invalid fee, negative or not XRP." } },
119 {
temBAD_ISSUER, {
"temBAD_ISSUER",
"Malformed: Bad issuer." } },
120 {
temBAD_LIMIT, {
"temBAD_LIMIT",
"Limits must be non-negative." } },
121 {
temBAD_OFFER, {
"temBAD_OFFER",
"Malformed: Bad offer." } },
122 {
temBAD_PATH, {
"temBAD_PATH",
"Malformed: Bad path." } },
124 {
temBAD_QUORUM, {
"temBAD_QUORUM",
"Malformed: Quorum is unreachable." } },
125 {
temBAD_REGKEY, {
"temBAD_REGKEY",
"Malformed: Regular key cannot be same as master key." } },
126 {
temBAD_SEND_XRP_LIMIT, {
"temBAD_SEND_XRP_LIMIT",
"Malformed: Limit quality is not allowed for XRP to XRP." } },
127 {
temBAD_SEND_XRP_MAX, {
"temBAD_SEND_XRP_MAX",
"Malformed: Send max is not allowed for XRP to XRP." } },
128 {
temBAD_SEND_XRP_NO_DIRECT, {
"temBAD_SEND_XRP_NO_DIRECT",
"Malformed: No Ripple direct is not allowed for XRP to XRP." } },
129 {
temBAD_SEND_XRP_PARTIAL, {
"temBAD_SEND_XRP_PARTIAL",
"Malformed: Partial payment is not allowed for XRP to XRP." } },
130 {
temBAD_SEND_XRP_PATHS, {
"temBAD_SEND_XRP_PATHS",
"Malformed: Paths are not allowed for XRP to XRP." } },
131 {
temBAD_SEQUENCE, {
"temBAD_SEQUENCE",
"Malformed: Sequence is not in the past." } },
133 {
temBAD_SIGNER, {
"temBAD_SIGNER",
"Malformed: No signer may duplicate account or other signers." } },
135 {
temBAD_TRANSFER_RATE, {
"temBAD_TRANSFER_RATE",
"Malformed: Transfer rate must be >= 1.0 and <= 2.0" } },
136 {
temBAD_WEIGHT, {
"temBAD_WEIGHT",
"Malformed: Weight must be a positive value." } },
137 {
temDST_IS_SRC, {
"temDST_IS_SRC",
"Destination may not be source." } },
138 {
temDST_NEEDED, {
"temDST_NEEDED",
"Destination not specified." } },
139 {
temINVALID, {
"temINVALID",
"The transaction is ill-formed." } },
140 {
temINVALID_FLAG, {
"temINVALID_FLAG",
"The transaction has an invalid flag." } },
141 {
temREDUNDANT, {
"temREDUNDANT",
"Sends same currency to self." } },
143 {
temUNCERTAIN, {
"temUNCERTAIN",
"In process of determining result. Never returned." } },
144 {
temUNKNOWN, {
"temUNKNOWN",
"The transaction requires logic that is not implemented yet." } },
145 {
temDISABLED, {
"temDISABLED",
"The transaction requires logic that is currently disabled." } },
146 {
temBAD_TICK_SIZE, {
"temBAD_TICK_SIZE",
"Malformed: Tick size out of range." } },
147 {
temINVALID_ACCOUNT_ID, {
"temINVALID_ACCOUNT_ID",
"Malformed: A field contains an invalid account ID." } },
148 {
temCANNOT_PREAUTH_SELF, {
"temCANNOT_PREAUTH_SELF",
"Malformed: An account may not preauthorize itself." } },
150 {
terRETRY, {
"terRETRY",
"Retry transaction." } },
151 {
terFUNDS_SPENT, {
"terFUNDS_SPENT",
"Can't set password, password set funds already spent." } },
152 {
terINSUF_FEE_B, {
"terINSUF_FEE_B",
"Account balance can't pay fee." } },
153 {
terLAST, {
"terLAST",
"Process last." } },
154 {
terNO_RIPPLE, {
"terNO_RIPPLE",
"Path does not permit rippling." } },
155 {
terNO_ACCOUNT, {
"terNO_ACCOUNT",
"The source account does not exist." } },
156 {
terNO_AUTH, {
"terNO_AUTH",
"Not authorized to hold IOUs." } },
157 {
terNO_LINE, {
"terNO_LINE",
"No such line." } },
158 {
terPRE_SEQ, {
"terPRE_SEQ",
"Missing/inapplicable prior transaction." } },
159 {
terOWNERS, {
"terOWNERS",
"Non-zero owner count." } },
160 {
terQUEUED, {
"terQUEUED",
"Held until escalated fee drops." } },
162 {
tesSUCCESS, {
"tesSUCCESS",
"The transaction was applied. Only final in a validated ledger." } },
173 auto const r = results.find (
TERtoInt (code));
175 if (r == results.end())
178 token = r->second.first;
179 text = r->second.second;
203 auto const results = []
206 auto range = boost::make_iterator_range(byTer.begin(),
208 auto tRange = boost::adaptors::transform(
218 byToken(tRange.begin(), tRange.end());
222 auto const r = results.find(token);
224 if (r == results.end())
std::string transToken(TER code)
constexpr TERUnderlyingType TERtoInt(TELcodes v)
static std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & transResults()
@ temBAD_SEND_XRP_PARTIAL
@ temBAD_SEND_XRP_NO_DIRECT
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
@ telCAN_NOT_QUEUE_BLOCKS
std::string transHuman(TER code)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool transResultInfo(TER code, std::string &token, std::string &text)
@ tecNO_LINE_INSUF_RESERVE
boost::optional< TER > transCode(std::string const &token)
static constexpr TERSubset fromInt(int from)
@ tecINSUFFICIENT_RESERVE
@ telCAN_NOT_QUEUE_BALANCE
@ telCAN_NOT_QUEUE_BLOCKED
@ tecCRYPTOCONDITION_ERROR