diff --git a/src/libxrpl/tx/AGENTS.md b/src/libxrpl/tx/AGENTS.md index e73537aeb6..bf919f446a 100644 --- a/src/libxrpl/tx/AGENTS.md +++ b/src/libxrpl/tx/AGENTS.md @@ -6,14 +6,4 @@ Any change to transaction-processing behavior must be gated behind an amendment. ## Preflight helpers -Prefer the helpers in [`include/xrpl/tx/helpers/PreflightHelpers.h`](../../../include/xrpl/tx/helpers/PreflightHelpers.h) over ad-hoc checks in transactor preflight code: - -- `checkBounds(value, min, max)` — inclusive range check. -- `checkSize(container, max)` — container size is at most `max`. -- `checkSizeAndNonEmpty(container, max)` — container is non-empty and size is at most `max`. -- `isZeroId(id)` — hash-like ID (e.g. a `uint256` object ID) is unset (compares against `beast::kZero`). -- `isPositiveXRPAmount(amount)` — amount is XRP and strictly positive. -- `isPositiveAmount(amount)` — amount of any asset is strictly positive. -- `isBadCurrency(currency)` — currency equals the reserved `badCurrency()` sentinel. - -Use them to keep preflight logic uniform and to make the intent of each check explicit. If the same pattern appears in more than one transactor, add a new helper here rather than inlining the check. +When writing transactor preflight logic, prefer the helpers in [`include/xrpl/tx/helpers/PreflightHelpers.h`](../../../include/xrpl/tx/helpers/PreflightHelpers.h) over ad-hoc checks. If the same check pattern shows up in more than one transactor, add a new helper there rather than inlining it.