Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/test/app/lending/LoanMisc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,21 @@ class LoanBatch_test : public LoanTestBase
TenthBips16 const managementFeeRate{managementFeeRateDist_(engine_)};
auto const serviceFee = serviceFeeDist_(engine_);
TenthBips32 interest{interestRateDist_(engine_)};
auto const payTotal = paymentTotalDist_(engine_);
auto payTotal = paymentTotalDist_(engine_);
auto const payInterval = paymentIntervalDist_(engine_);
// The end of the last payment's grace period must fit in a 32-bit
// ripple-epoch timestamp, or LoanSet fails with tecKILLED. Cap the
// schedule well below that horizon (2e9 seconds is roughly 63 years,
// leaving ample headroom over the ledger start date).
constexpr std::uint32_t kMaxScheduleSeconds = 2'000'000'000;
payTotal = std::min(payTotal, static_cast<int>(kMaxScheduleSeconds / payInterval));

BrokerParameters const brokerParams{
.vaultDeposit = principalRequest * 10,
.debtMax = 0,
.coverRateMin = TenthBips32{0},
.managementFeeRate = managementFeeRate};
.managementFeeRate = managementFeeRate,
.coverRateLiquidation = TenthBips32{0}};
LoanParameters const loanParams{
.account = lender,
.counter = borrower,
Expand Down
Loading