Files
rippled/include
Vito 1583772faf fix: Guard clamp for zero-payout withdrawals; address review feedback
The clamp block added in VaultWithdraw::doApply unconditionally returned
tecPRECISION_LOSS when the clamped payout was zero. That undid the
develop-side guard that deliberately permits fixed-share zero-asset
withdrawals in a fully-impaired vault (assetsTotalForWithdrawal == 0),
causing xrpl.tx.LoanRounding to fail on all three build-test configs
(linux-clang, linux-gcc-coverage, windows). Skip the clamp when
assetsWithdrawn is already zero, and also on the final-withdrawal path
where the value is overwritten with sfAssetsAvailable a few lines later.

Also addresses review feedback:
- Correct clampToAssetsTotalScale docstring to reflect that it returns a
  non-negative magnitude; the caller applies the sign.
- Add XRPL_ASSERT precondition matching sibling helpers, and canonicalize
  totalBefore/totalAfter under a single NumberRoundModeGuard so the
  returned delta reflects only `delta`, not a rounding difference between
  the two endpoints.
- Move VaultPrecisionFixture.h and VaultTransactorPrecision_test.cpp
  from src/test/app/lending/ to src/test/app/vault/ so vault tests live
  alongside the other vault-specific suites.
- Simplify inline commentary across VaultDeposit/VaultWithdraw/
  VaultClawback.
2026-08-20 12:12:25 +02:00
..