Fix clang-tidy issues, and more AI complaints

This commit is contained in:
Ed Hennis
2026-05-06 23:26:11 -04:00
parent a2b21d75ce
commit b050c151f8
5 changed files with 79 additions and 61 deletions

View File

@@ -38,12 +38,20 @@ setCurrentTransactionRules(std::optional<Rules> r)
// Make global changes associated with the rules before the value is moved.
// Push the appropriate setting, instead of having the class pull every time
// the value is needed. That could get expensive fast.
// The improved accuracy that will come from enabling large
// mantissas is a goal separate from SAV and LP. It was originally
// only tied to those two amendments to avoid needing a new
// amendment of it's own, and because they require that behavior.
// Because fixCleanup3_2_0 fixes a separate bug related to the large
// mantissas, that can take precedence and activate the large
// mantissas even in the absence of the other two amendments.
bool const enableCuspRoundingFix = !r || r->enabled(fixCleanup3_2_0);
bool const enableLargeNumbers = enableCuspRoundingFix ||
bool const enableVaultNumbers = enableCuspRoundingFix ||
(r->enabled(featureSingleAssetVault) || r->enabled(featureLendingProtocol));
Number::setMantissaScale(
enableCuspRoundingFix ? MantissaRange::MantissaScale::Large
: enableLargeNumbers ? MantissaRange::MantissaScale::LargeLegacy
: enableVaultNumbers ? MantissaRange::MantissaScale::LargeLegacy
: MantissaRange::MantissaScale::Small);
*getCurrentTransactionRulesRef() = std::move(r);