mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 14:50:54 +00:00
test: Fix LoanBatch broker cover rates and schedule overflow (#7967)
This commit is contained in:
@@ -473,14 +473,21 @@ protected:
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user