- Since all the special cases are now specified with flags, the order is
less important.
- Avoids computing the periodic payment parts that are not needed for
full payment computation.
- A late payment without the late payment flag will override everything
else, though.
- A regular payment that is late, or a tfLoanLatePayment that is not
late will fail.
- Flags are mutually exclusive.
- Add a few interest computation shortcuts and overflow prevention
checks that return 0 if there's no time to compute for.
- Assert requires that an overpayment reduces the value of a loan. If
the overall loan interest is low enough, it could leave it unchanged.
Update the assert to require that the overpayment does not increase
the value of the loan.
- Adds a unit test provided by @gregtatcam to demonstrate this issue.
- Vault and LoanBroker pseudo-accounts can hold MPTs, regardless of MPTRequireAuth setting.
- Add requireAuth check in LoanBrokerCoverDeposit and LoanPay.
- Fail attempts to unauthorize pseudo-accounts by MPT issuers.
- Turns out that "Proxy::operator->" is not a safe substitute for
"Proxy::value()." if the field is not required. The implementation
is different such that "operator->" will return a null ptr if the
field is not present. This includes default fields with a value of
zero!
- Scale the loan to the Vault, so that amounts moving to the vault are
less likely to have rounding errors.
- Similar to LoanPay, when LoanManage defaults a loan, round the amounts
to the Vault scale (because the Vault scale can change) before
applying them to the Vault.
Technically b0 is not a release, so no "release" prefix here. It marks the point at which we moved the preceding release (3.0.0 in this case) from Beta to Release Candidate.
This change fixes floating point errors in conversion of shares to assets and other way, used in `VaultDeposit`, `VaultWithdraw` and `VaultClawback`. In the floating point calculations the division introduces a larger error than multiplication. If we do division first, then the error introduced will be increased by the multiplication that follows, which is therefore the wrong order to perform these two operations. This change flips the order of arithmetic operations, which minimizes the error.
Rather than having a single `XRPL_RETIRE` macro that applies to both feature and fix amendments, this change replaces it by new `XRPL_RETIRE_FIX` and `XRPL_RETIRE_FEATURE` macros that avoids confusion between whether to prefix the amendment name with `feature` or `fix`.
This updates the CI image hashes after following change: https://github.com/XRPLF/ci/pull/81. And, since we use latest Conan, we can have `conan.lock` with a newline at the end, and we don't need to exclude it from `pre-commit` hooks any longer.
This change fixes JSON parsing of negative `int` input in `STNumber` and `STAmount`. The conversion of JSON to `STNumber` or `STAmount` may trigger a condition where we negate smallest possible `int` value, which is undefined behaviour. We use a temporary storage as `int64_t` to avoid this bug. Note that this only affects RPC, because we do not parse JSON in the protocol layer, and hence no amendment is needed.
This change removes unused definitions from the CMake files, moves variable definitions from `XrplSanity` to `XrplSettings` where they better belong, and updates the minimum GCC and Clang versions to match what we actually minimally support.
This change unifies the build and test jobs into a single job, and adds `ctest` to coverage reporting.
The mechanics of coverage reporting is slightly complex and most of it is encapsulated in the `coverage` target. The status quo way of preparing coverage reports involves running a single target `cmake --build . --target coverage`, which does three things:
* Build the `rippled` binary (via target dependency)
* Prepare coverage reports:
* Run `./rippled -u` unit tests.
* Gather test output and build reports.
This makes it awkward to add an additional `ctest` step between build and coverage reporting steps. The better solution is to split `coverage` target into separate build, followed by `ctest`, followed by test generation. Luckily, the `coverage` target has been designed specifically to support such case; it does not need to build `rippled`, it's just a dependency. Similarly it allows additional tests to be run before gathering test outputs; in principle we could even strip it from running tests and run them separately instead. This means we can keep build, `ctest` and generation of coverage reports as separate steps, as long as the state of build directory is fully (including file timestamps, additional coverage files etc.) preserved between the steps. This means that in order to run `ctest` for coverage reporting we need to integrate build and test into a single job, which this change does.
As part of renaming ripple(d) to xrpl(d), the xrpld symlink was made to point to itself instead of to the rippled binary. This change fixes the symlink.
- Ensures a consistent fixed payment amount for the entire life of the
loan, except the final payment, which is guaranteed to be the same or
smaller.
- Convert some Loan structs to compute values that had need manual
updates to stay consistent.
- Fail the transaction in `LoanPay` if it violates the Vault `assetsAvailable <=
assetsTotal` invariant.
- Use constexpr to check that min mantissa value for Number and STAmount
is a power of 10, and compute the max in terms of the min.
- Improve unit tests:
- Use BrokerParameters and Loan Parameters instead of semi-global
class values
- In tests, check that the expected number of loan payments are made.
- Add LoanBatch manual test to generate a set number of random loans,
set them up, and pay them off.
- Add LoanArbitrary manual test to run a single test with specific
(hard-coded for now) parameters.
- Add Number support to XRP_t.