* XRPLF/develop:
chore: Set version 3.1.0-b0 (5986)
ci: Clean workspace on Windows self-hosted runners (6024)
docs: fix spelling in comments (6002)
fix: floating point representation errors in vault (5997)
ci: Specify bash as the default shell in workflows (6021)
refactor: Add `XRPL_RETIRE_FIX` and `XRPL_RETIRE_FEATURE` macros (6014)
refactor: Retire DepositPreAuth and DepositAuth amendments (5978)
chore: Move running of unit tests out of coverage target (6018)
refactor: Retire PayChanRecipientOwnerDir amendment (5946)
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`.
- 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.
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.
* mywork/ximinez/lending-number:
Add a distinction between a "valid" and a "representable" Number
chore: Point xrpld symlink to rippled (6012)
Catch up the consequences of Number changes
Fix build error - avoid copy
Add integer enforcement when converting to XRP/MPTAmount to Number
Make all STNumber fields "soeDEFAULT"
Add optional enforcement of valid integer range to Number
- "valid" means the value is <= Number::maxIntValue, which has been
changed to maxMantissa / 100. A valid number could get bigger and be
ok - such as when paying late interest on a loan.
- "representable" means the value is <= Number::maxMantissa. An
unrepresentable number WILL be rounded or truncated.
- Adds a fourth level of enforcement: "compatible". It is used for
converting XRP to Number (for AMM), and when doing explicit checks.
- "weak" will now throw if the number is unrepresentable.
- 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.
- Change the Number::maxIntValue to all 9's.
- Add integral() to Asset (copied from Lending)
- Add toNumber() functions to STAmount, MPTAmount, XRPAmount to allow
explicit conversions with enforcement options.
- Add optional Number::EnforceInteger options to STAmount and STNumber
ctors, conversions, etc. IOUs are never checked.
- Update Vault transactors, and helper functions, to check restrictions.
- Fix and add Vault tests.
- 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!
* mywork/ximinez/lending-number:
Catch up the consequences of Number changes
Fix build error - avoid copy
Add integer enforcement when converting to XRP/MPTAmount to Number
Make all STNumber fields "soeDEFAULT"
Add optional enforcement of valid integer range to Number
fix: domain order book insertion #5998
refactor: Retire fixTrustLinesToSelf amendment (#5989)
- Change the Number::maxIntValue to all 9's.
- Add integral() to Asset (copied from Lending)
- Add toNumber() functions to STAmount, MPTAmount, XRPAmount to allow
explicit conversions with enforcement options.
- Add optional Number::EnforceInteger options to STAmount and STNumber
ctors, conversions, etc. IOUs are never checked.
- Update Vault transactors, and helper functions, to check restrictions.
- Fix and add Vault tests.
- 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.
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d).
This change updates the CMake files and definitions therein, plus a handful of related modifications. Specifically, the compiler files are renamed from `RippleXXX.cmake` or `RippledXXX.cmake` to `XrplXXX.cmake`, and any references to `ripple` and `rippled` (with or without capital letters) are renamed to `xrpl` and `xrpld`, respectively. The name of the binary, currently `rippled`, remains unchanged and will be updated in a separate PR. This change is purely cosmetic and does not affect the functioning of the binary.
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d).
This change specifically removes all copyright notices referencing Ripple, XRPLF, and certain affiliated contributors upon mutual agreement, so the notice in the LICENSE.md file applies throughout. Copyright notices referencing external contributions remain as-is. Duplicate verbiage is also removed.
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d).
C++ include guards are used to prevent the contents of a header file from being included multiple times in a single compilation unit. This change renames all `RIPPLE_` and `RIPPLED_` definitions, primarily include guards, to `XRPL_`. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts.
Amendments activated for more than 2 years can be retired, and obsolete retirements that were never activated can also be removed after 2 years. This change retires the NonFungibleTokensV1_1, fixNonFungibleTokensV1_2, and fixNFTokenRemint amendments, and removes the NonFungibleTokensV1, fixNFTokenNegOffer, and fixNFTokenDirV1 amendments.