mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 22:30:57 +00:00
Adds testMultiLoanDefaultDriftFixVsLegacy which runs the same drift-inducing scenario (3 loans, different scales, partial payments, impairment, then default) under both !fixCleanup3_4_0 and fixCleanup3_4_0 and confirms both paths leave the vault invariant-safe. Empirically the two branches produce identical post-default state because computeLoanProperties clamps loanScale >= vaultScale (via std::max(minimumScale, amount.exponent())), so the pre-amendment roundToAsset(vaultDefaultAmount, vaultScale, Down) is a no-op for well-formed loans. The dust-reconciliation branch this test guards against is doubly-defensive code — reachable only from a corrupted ledger, not a valid transaction sequence. The test acts as a regression sensor: any future change that breaks the invariant on either branch (or lets them diverge) will surface here.