Fix some build errors

This commit is contained in:
Ed Hennis
2025-10-15 23:28:00 -04:00
parent f9bd9f390a
commit baabf142e4
3 changed files with 9 additions and 29 deletions

View File

@@ -1733,13 +1733,13 @@ class Loan_test : public beast::unit_test::suite
state.periodicPayment);
BEAST_EXPECT(
paymentComponents.final ||
roundedPeriodicPayment >=
(paymentComponents.roundedPrincipal +
paymentComponents.roundedInterest) &&
roundedPeriodicPayment -
(paymentComponents.roundedPrincipal +
paymentComponents.roundedInterest) <
3);
((roundedPeriodicPayment >=
(paymentComponents.roundedPrincipal +
paymentComponents.roundedInterest)) &&
(roundedPeriodicPayment -
(paymentComponents.roundedPrincipal +
paymentComponents.roundedInterest) <
3)));
auto const borrowerBalanceBeforePayment =
env.balance(borrower, broker.asset);

View File

@@ -2495,27 +2495,7 @@ ValidLoan::finalize(
return false;
}
}
// Must not be negative - STUInt32
for (auto const field :
{&sfOverpaymentFee,
&sfInterestRate,
&sfLateInterestRate,
&sfCloseInterestRate,
&sfOverpaymentInterestRate,
&sfStartDate,
&sfPaymentInterval,
&sfGracePeriod,
&sfPreviousPaymentDate,
&sfPaymentRemaining})
{
if (after->at(*field) < 0)
{
JLOG(j.fatal()) << "Invariant failed: " << field->getName()
<< " is negative ";
return false;
}
}
// Must be positive
// Must be positive - STNumber
for (auto const field : {
&sfPeriodicPayment,
})

View File

@@ -75,7 +75,7 @@ LoanPay::calculateBaseFee(ReadView const& view, STTx const& tx)
// Let preclaim worry about the error for this
return normalCost;
auto const vaultSle = view.read(keylet::vault(loanSle->at(sfVaultID)));
if (vaultSle)
if (!vaultSle)
// Let preclaim worry about the error for this
return normalCost;