mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
removes unused code
This commit is contained in:
@@ -6145,15 +6145,16 @@ protected:
|
|||||||
// Accrued + prepayment-penalty interest based on current periodic
|
// Accrued + prepayment-penalty interest based on current periodic
|
||||||
// schedule
|
// schedule
|
||||||
auto const fullPaymentInterest = computeFullPaymentInterest(
|
auto const fullPaymentInterest = computeFullPaymentInterest(
|
||||||
after.periodicPayment,
|
detail::loanPrincipalFromPeriodicPayment(
|
||||||
|
after.periodicPayment, periodicRate2, after.paymentRemaining),
|
||||||
periodicRate2,
|
periodicRate2,
|
||||||
after.paymentRemaining,
|
|
||||||
env.current()->parentCloseTime(),
|
env.current()->parentCloseTime(),
|
||||||
after.paymentInterval,
|
after.paymentInterval,
|
||||||
after.previousPaymentDate,
|
after.previousPaymentDate,
|
||||||
static_cast<std::uint32_t>(
|
static_cast<std::uint32_t>(
|
||||||
after.startDate.time_since_epoch().count()),
|
after.startDate.time_since_epoch().count()),
|
||||||
closeInterestRate);
|
closeInterestRate);
|
||||||
|
|
||||||
// Round to asset scale and split interest/fee parts
|
// Round to asset scale and split interest/fee parts
|
||||||
auto const roundedInterest =
|
auto const roundedInterest =
|
||||||
roundToAsset(asset.raw(), fullPaymentInterest, after.loanScale);
|
roundToAsset(asset.raw(), fullPaymentInterest, after.loanScale);
|
||||||
@@ -6181,9 +6182,9 @@ protected:
|
|||||||
// window by clamping prevPaymentDate to 'now' for the full-pay path.
|
// window by clamping prevPaymentDate to 'now' for the full-pay path.
|
||||||
auto const prevClamped = std::min(after.previousPaymentDate, nowSecs);
|
auto const prevClamped = std::min(after.previousPaymentDate, nowSecs);
|
||||||
auto const fullPaymentInterestClamped = computeFullPaymentInterest(
|
auto const fullPaymentInterestClamped = computeFullPaymentInterest(
|
||||||
after.periodicPayment,
|
detail::loanPrincipalFromPeriodicPayment(
|
||||||
|
after.periodicPayment, periodicRate2, after.paymentRemaining),
|
||||||
periodicRate2,
|
periodicRate2,
|
||||||
after.paymentRemaining,
|
|
||||||
env.current()->parentCloseTime(),
|
env.current()->parentCloseTime(),
|
||||||
after.paymentInterval,
|
after.paymentInterval,
|
||||||
prevClamped,
|
prevClamped,
|
||||||
|
|||||||
@@ -202,14 +202,6 @@ computeRawLoanState(
|
|||||||
std::uint32_t const paymentRemaining,
|
std::uint32_t const paymentRemaining,
|
||||||
TenthBips32 const managementFeeRate);
|
TenthBips32 const managementFeeRate);
|
||||||
|
|
||||||
LoanState
|
|
||||||
computeRawLoanState(
|
|
||||||
Number const& periodicPayment,
|
|
||||||
TenthBips32 interestRate,
|
|
||||||
std::uint32_t paymentInterval,
|
|
||||||
std::uint32_t const paymentRemaining,
|
|
||||||
TenthBips32 const managementFeeRate);
|
|
||||||
|
|
||||||
// Constructs a valid LoanState object from arbitrary inputs
|
// Constructs a valid LoanState object from arbitrary inputs
|
||||||
LoanState
|
LoanState
|
||||||
constructLoanState(
|
constructLoanState(
|
||||||
@@ -239,17 +231,6 @@ computeFullPaymentInterest(
|
|||||||
std::uint32_t startDate,
|
std::uint32_t startDate,
|
||||||
TenthBips32 closeInterestRate);
|
TenthBips32 closeInterestRate);
|
||||||
|
|
||||||
Number
|
|
||||||
computeFullPaymentInterest(
|
|
||||||
Number const& periodicPayment,
|
|
||||||
Number const& periodicRate,
|
|
||||||
std::uint32_t paymentRemaining,
|
|
||||||
NetClock::time_point parentCloseTime,
|
|
||||||
std::uint32_t paymentInterval,
|
|
||||||
std::uint32_t prevPaymentDate,
|
|
||||||
std::uint32_t startDate,
|
|
||||||
TenthBips32 closeInterestRate);
|
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
// These classes and functions should only be accessed by LendingHelper
|
// These classes and functions should only be accessed by LendingHelper
|
||||||
// functions and unit tests
|
// functions and unit tests
|
||||||
|
|||||||
@@ -1403,30 +1403,6 @@ computeFullPaymentInterest(
|
|||||||
return accruedInterest + prepaymentPenalty;
|
return accruedInterest + prepaymentPenalty;
|
||||||
}
|
}
|
||||||
|
|
||||||
Number
|
|
||||||
computeFullPaymentInterest(
|
|
||||||
Number const& periodicPayment,
|
|
||||||
Number const& periodicRate,
|
|
||||||
std::uint32_t paymentRemaining,
|
|
||||||
NetClock::time_point parentCloseTime,
|
|
||||||
std::uint32_t paymentInterval,
|
|
||||||
std::uint32_t prevPaymentDate,
|
|
||||||
std::uint32_t startDate,
|
|
||||||
TenthBips32 closeInterestRate)
|
|
||||||
{
|
|
||||||
Number const rawPrincipalOutstanding =
|
|
||||||
detail::loanPrincipalFromPeriodicPayment(
|
|
||||||
periodicPayment, periodicRate, paymentRemaining);
|
|
||||||
|
|
||||||
return computeFullPaymentInterest(
|
|
||||||
rawPrincipalOutstanding,
|
|
||||||
periodicRate,
|
|
||||||
parentCloseTime,
|
|
||||||
paymentInterval,
|
|
||||||
prevPaymentDate,
|
|
||||||
startDate,
|
|
||||||
closeInterestRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Calculates the theoretical loan state at maximum precision for a given point
|
/* Calculates the theoretical loan state at maximum precision for a given point
|
||||||
* in the amortization schedule.
|
* in the amortization schedule.
|
||||||
@@ -1489,21 +1465,6 @@ computeRawLoanState(
|
|||||||
.managementFeeDue = rawManagementFeeOutstanding};
|
.managementFeeDue = rawManagementFeeOutstanding};
|
||||||
};
|
};
|
||||||
|
|
||||||
LoanState
|
|
||||||
computeRawLoanState(
|
|
||||||
Number const& periodicPayment,
|
|
||||||
TenthBips32 interestRate,
|
|
||||||
std::uint32_t paymentInterval,
|
|
||||||
std::uint32_t const paymentRemaining,
|
|
||||||
TenthBips32 const managementFeeRate)
|
|
||||||
{
|
|
||||||
return computeRawLoanState(
|
|
||||||
periodicPayment,
|
|
||||||
loanPeriodicRate(interestRate, paymentInterval),
|
|
||||||
paymentRemaining,
|
|
||||||
managementFeeRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Constructs a LoanState from rounded Loan ledger object values.
|
/* Constructs a LoanState from rounded Loan ledger object values.
|
||||||
*
|
*
|
||||||
* This function creates a LoanState structure from the three tracked values
|
* This function creates a LoanState structure from the three tracked values
|
||||||
|
|||||||
Reference in New Issue
Block a user