mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 23:38:08 +00:00
docs: Trim PreflightHelpers pointer to just the reference
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user