Remove some unused variables, increase rounding tolerance

This commit is contained in:
Ed Hennis
2025-10-15 20:51:11 -04:00
parent d7196a8e56
commit f9bd9f390a
3 changed files with 4 additions and 5 deletions

View File

@@ -1739,7 +1739,7 @@ class Loan_test : public beast::unit_test::suite
roundedPeriodicPayment -
(paymentComponents.roundedPrincipal +
paymentComponents.roundedInterest) <
2);
3);
auto const borrowerBalanceBeforePayment =
env.balance(borrower, broker.asset);

View File

@@ -178,7 +178,7 @@ computePaymentComponents(
Number const rawPrincipalOutstanding = loanPrincipalFromPeriodicPayment(
periodicPayment, periodicRate, paymentRemaining);
Number const rawInterestOutstanding =
rawValueOutstanding - rawInterestOutstanding;
rawValueOutstanding - rawPrincipalOutstanding;
/*
* From the spec, once the periodicPayment is computed:
@@ -514,8 +514,10 @@ doOverpayment(
"nextDueDate is unchanged");
nextDueDateProxy = nextDueDate;
/*
auto const totalInterestOutstandingAfter =
totalValueOutstanding - principalOutstanding;
*/
return paymentParts;
}
@@ -623,7 +625,6 @@ handleFullPayment(
// If this is the last payment, it has to be a regular payment
return Unexpected(tesSUCCESS);
Number const rawValueOutstanding = periodicPayment * paymentRemaining;
Number const rawPrincipalOutstanding = loanPrincipalFromPeriodicPayment(
periodicPayment, periodicRate, paymentRemaining);

View File

@@ -162,8 +162,6 @@ LoanPay::preclaim(PreclaimContext const& ctx)
return tefBAD_LEDGER;
// LCOV_EXCL_STOP
}
auto const brokerPseudoAccount = loanBrokerSle->at(sfAccount);
auto const brokerOwner = loanBrokerSle->at(sfOwner);
auto const vaultID = loanBrokerSle->at(sfVaultID);
auto const vaultSle = ctx.view.read(keylet::vault(vaultID));
if (!vaultSle)