From a1f16d1e78a22e1e5672b2d0423292ed50e3b3f6 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sun, 27 Sep 2026 15:15:54 +0000 Subject: [PATCH] refactor: name the agree guard validateAgreeTolerances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `agreeValidateTolerances` read as "agree validate tolerances". Its siblings — `agreeSpread`, `agreeAnchor`, `agreeLimit` — are noun phrases naming what they return, so the prefix carries the association and the rest of the name says what the value is. A verb belongs at the front: `validateAgreeTolerances` reads as English and still says which function's tolerances it validates. Private, so nothing outside the library refers to it. No behaviour change; 33 agree tests pass unchanged, lint and fmt clean. Co-Authored-By: Claude Opus 5 (1M context) --- src/lib/LibDecimalFloat.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/LibDecimalFloat.sol b/src/lib/LibDecimalFloat.sol index fd7cc77..e27bf0d 100644 --- a/src/lib/LibDecimalFloat.sol +++ b/src/lib/LibDecimalFloat.sol @@ -926,7 +926,7 @@ library LibDecimalFloat { /// @param highest The highest value in the set. /// @return Whether the spread is within the limit. function agree(Float absolute, Float proportional, Float lowest, Float highest) internal pure returns (bool) { - agreeValidateTolerances(absolute, proportional); + validateAgreeTolerances(absolute, proportional); (int256 spreadCoefficient, int256 spreadExponent) = agreeSpread(lowest, highest); (int256 limitCoefficient, int256 limitExponent) = agreeLimit(absolute, proportional, lowest, highest); return LibDecimalFloatImplementation.lte(spreadCoefficient, spreadExponent, limitCoefficient, limitExponent); @@ -955,7 +955,7 @@ library LibDecimalFloat { /// the negative check is ever changed. /// @param absolute The absolute tolerance. /// @param proportional The proportional tolerance. - function agreeValidateTolerances(Float absolute, Float proportional) private pure { + function validateAgreeTolerances(Float absolute, Float proportional) private pure { Float zero = packLossless(0, 0); if (lt(absolute, zero) || lt(proportional, zero)) { revert AgreeToleranceNegative(absolute, proportional);