-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Transaction results and error codes (tec, tem, et al.)
Your WASM code can modify/update data but not release the escrow. To do this, return 0 or a negative number (i.e., <= 0
).
https://github.com/XRPLF/xrpl-dev-portal/pull/3078
To avoid confusion, I recommend not saying that the transaction "failed". The f
in tef
is failed. We can say that the transaction was tecWASM_REJECTED
, so the escrow did not finish, but the code was still executed, and any side effects (i.e., modifications to state) were made.
-
tec_ENTRY
: "cannot find the primary ledger object on which the transaction is being attempted" -
tec_OBJECT_NOT_FOUND
: "cannot find the other object needed to complete the transaction"
Other error codes which need documentation, explanation, and differentiation:
- temMALFORMED and temINVALID
- tefINTERNAL vs tecINTERNAL
Note, tec
codes are favored because we want to charge the tx sender a fee for the cost they imposed on the network by signing and submitting the tx. Other codes are used when the tx is invalid in a way that prevents a fee from being correctly/accurately assessed.
- It's usually because of time
- example transaction
- https://github.com/XRPLF/rippled/blob/0ce15e0e358996b5371d2adc83e911cc7a3a7225/src/ripple/app/tx/impl/Escrow.cpp#L169-L195
- If the transaction specifies a
CancelAfter
orFinishAfter
and the ledger is already past that time, then it fails withtecNO_PERMISSION
tecPATH_DRY
(path dry) means the transaction failed because the provided paths did not have enough liquidity. This could mean that the source and destination accounts are not linked by trust lines. In other words, the customer doesn't have the necessary trust line set up, or your issuer's rippling settings aren't configured correctly.
The path dry error may occur in one of the following scenarios:
- When you are trying to send a payment in a currency you presently do not own and there is not enough liquidity on the markets to execute a conversion.
- Solution: Manually exchange funds to the destination currency.
- When the destination address does not have the correct trust line.
- Solution: Send another currency or enable the correct trust line at the destination address.
For more information, see: https://support.xumm.app/hc/en-us/articles/4405655710482-Trustline-Troubleshooting-tecPATH-DRY-
The process of converting the transaction from json (or serialized) to an STTx
runs it through the template validation. By the time a transaction hits calculateBaseFee
, it has already gone through basic validation. Thus, you can assume that soeREQUIRED
fields are included.