- Renamed canSendToAccount to canWithdraw, because the semantics are
a little different from a payment. Notably, if withdrawing to self,
you can still include a destination tag.
- Simplified the interface to canWithdraw to just pass in the
STTx.
- preflightDestinationAndTag is pretty pointless now, so removed it.
- canSendToAccount will check if a destination tag is required _before_
checking if the sender is the destination. This is the original
VaultWithdraw behavior, and I want to stay consistent.
- Fix LoanSet.calculateBaseFee with multisign.
- Cleanups.
- Add View helper functions for Loan and Vault transactions
- preflightDestinationAndTag
- checkDestinationAndTag
- canSendToAccount
- Used the helpers in appropriate Loan and Vault transactions.
- They could also be used in older transactions, I'll save that for
later.
Amendments activated for more than 2 years can be retired. This change retires the fix1515 amendment.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
- Implement a new helper accountCanSend, which is like accountHolds, but
returns a meaningful value for issuers, and will include the available
credit on the other side of a trust line. (The sfHighLimit or
sfLowLimit as appropriate.)
- Use this new helper when checking the available balance in LoanPay.
- Move management fee calculations out of transactors an into the
appropriate functions in LendingHelpers.h.
- Rewrite how overpayments are handled. May changed based on numerical
analysis.
- Update, fix, and clean up unit tests. Includes adding tolerances for
some checks where an exact match is unlikely.
- Add "integral()" function to Asset to simplify a common check.
Similarly to other transaction typed that can create a trust line or MPToken for the transaction submitter (e.g. CashCheck #5285, EscrowFinish #5185 ), VaultWithdraw should enforce reserve before creating a new object. Additionally, the lsfRequireDestTag account flag should be enforced for the transaction submitter.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
- Implement AccountSendMulti
- Document the derivations of loan components.
- Add "loanPrincipalFromPeriodicPayment" helper.
- Removed sfReferencePrincipal
- LoanSet and LoanPay can create MPTokens as a side effect
- LoanPay will send the fee to cover if the broker owner is deep frozen,
and fail if both of them are deep frozen.
- LoanPay will check auth for the receivers, or create holdings for the
submitting account if needed.
- LoanSet will fail if principal requested is not positive
- Handle overpayment in a separate function
- Add a test helper to check that balance changes went as expected
- Fix more tests
- Primarily updating tests, and fixing stuff that didn't work.
- Tests still not expected to pass.
- Add Json::Value::isMember(StaticString) so SFields can be used.
- Validate more fields in ValidLoan Invariant
* mywork/ximinez/lending-sttx-checksign:
Review feedback from @a1q123456
Add jtx, STObject, and RPC support for sig object fields
Add support for extra transaction signature validation
- Convert STTx::getSignature to be static.
- Make the STTx::checkSign that takes a signature object private, and
change it and all the other relevant functions to take the signature
object as a `const&`.
- Change `getBatchTransactionIDs` to return a `const&` to reduce the
number of vector copies. Rename `batchTxnIds_` to CamelCase. Update
the text of the internal comment.
** Vault Invariants for Loan txs need to be fleshed out. **
- Give the appropriate Loan transactions vault modification privileges.
- Give the appropriate Loan transactions the ability to authorize
(create in this case) MPTokens.
- Check that LoanManage does not leave Vault in an inconsistent state
(AssetsAvailable > AssetsTotal). For IOU vaults, if the difference is
dust, "round up".
- Restructures `STTx` signature checking code to be able to handle
a `sigObject`, which may be the full transaction, or may be an object
field containing a separate signature. Either way, the `sigObject` can
be a single- or multi-sign signature.
- This is distinct from 550f90a75e (#5594), which changed the check in
Transactor, which validates whether a given account is allowed to sign
for the given transaction. This cryptographically checks the signature
validity.
* Restructures `Transactor::preflight` to create several functions that will remove the need for error-prone boilerplate code in derived classes' implementations of `preflight`.
This change adds `STInt32` as a new `SType` under the `STInteger` umbrella, with `SType` value `12`. This is the first and only `STInteger` type that supports negative values.