Ed Hennis
d6353e593f
Get arithmetic operators working for typed-values
2025-05-07 12:11:55 -04:00
Ed Hennis
c3fef1b9ad
Get that strong Bips field type working (mostly)
2025-05-07 12:11:54 -04:00
Ed Hennis
a5376c7d76
[WIP] Turns out that adding a new serialized type is harder than it looks
2025-05-07 12:11:54 -04:00
Ed Hennis
939d3d4446
Fix formatting
2025-05-07 12:11:54 -04:00
Ed Hennis
89f0b3b9e4
[WIP] Continue implementing LoanSet Transactor
...
- Needs tests
- Started trying to add strong typing to the fields used as bips or 1/10
bips.
2025-05-07 12:11:54 -04:00
Ed Hennis
cbb14627ea
Generalize the check*Sign functions to support CounterParty
...
- checkSign, checkSingleSign, and checkMultiSign in STTx and Transactor
2025-05-07 12:11:54 -04:00
Ed Hennis
5bed1d94e6
[WIP] Start implementing LoanSet transactor
...
- Add some more values and functions to make it easier to work with
basis point values / bips.
- Fix several earlier mistakes.
2025-05-07 12:11:54 -04:00
Ed Hennis
a01ce0ad00
Fix a couple of cross-platform build errors
2025-05-07 12:11:54 -04:00
Ed Hennis
327d576d7e
Move inclusion of Transactor headers to transactions.macro
...
- Only need to update in one place when adding a new transaction.
2025-05-07 12:11:53 -04:00
Ed Hennis
4326b5941c
Finish up the Loan Broker tests
2025-05-07 12:11:53 -04:00
Ed Hennis
1798be0ba9
Ensure that an account is not deleted with an XRP balance
...
- Updates the AccountRootsDeletedClean invariant
2025-05-07 12:11:53 -04:00
Ed Hennis
56ff345a99
Add Asset and MPTIssue support to more jtx objects / functions
...
- Unfortunately, to work around some ambiguous symbol compilation
errors, I had to change the implicit conversion from IOU to Asset to
a conversion from IOU to PrettyAsset, and add a more explicit
`asset()` function. This workaround only required changing two
existing tests, so seems acceptable.
2025-05-07 12:11:53 -04:00
Ed Hennis
79a1a8a9c6
Finish(?) unit tests for Loan Broker Cover amounts. Untested.
...
- Add support for `Asset` and `MPTIssue` to some `jtx` helper classes
and functions (`balance`, `expectLine`)
- Add support for pseudo-accounts to `jtx::Account` by allowing directly
setting the AccountID without a matching key.
2025-05-07 12:11:53 -04:00
Ed Hennis
2bcc8cedfd
Start writing tests for LoanBrokerCover*
2025-05-07 12:11:53 -04:00
Ed Hennis
1bb1992cf0
Add LoanBrokerCoverWithdraw transaction
...
- Untested
2025-05-07 12:11:52 -04:00
Ed Hennis
ffbc068dc8
Add LoanBrokerCoverDeposit transaction
...
- Untested. Will need Withdraw to do a good test.
2025-05-07 12:11:52 -04:00
Ed Hennis
fc66227f69
Move all detail namespaces to be under ripple
...
- Avoids problems with namespace collisions / ambiguous symbol issues
with unity builds, especially when adding or removing files.
2025-05-07 12:11:52 -04:00
Ed Hennis
27fbf2db8e
Start writing Loan Broker invariants and tests
...
- Specifically those mentioned for LoanBrokerDelete
2025-05-07 12:11:52 -04:00
Ed Hennis
7ab5bdbf3d
Refactor ApplyView::dirAdd to give access to low-level operations
...
- Takes a page from #5362 , which may turn out to be useful!
2025-05-07 12:11:52 -04:00
Ed Hennis
7d6155cc99
Clean ups
2025-05-07 12:11:52 -04:00
Ed Hennis
17a970d80c
Continue updating LoanBroker tests
...
- It builds now
2025-05-07 12:11:51 -04:00
Ed Hennis
da10ba6fd0
Start adding tests for LoanBrokerDelete
...
- Start fixing the inevitable problems found along the way
- Generalize the LoanBroker lifecycle test
2025-05-07 12:11:51 -04:00
Ed Hennis
853c42fb9e
Initial implementation of LoanBrokerDelete
...
- Completely untested
2025-05-07 12:11:51 -04:00
Ed Hennis
cc0fe0db07
LoanBrokerSet will charge a reserve increment when creating
...
- Refactor: Add a Transactor base function to make it easier to get the
owner reserve increment as a fee.
- Refactor: Add an overload jtx::fee(increment) to pay an owner reserve.
2025-05-07 12:11:51 -04:00
Ed Hennis
781136ed2e
Clang wants an explicit ctor to emplace in a vector
2025-05-07 12:11:51 -04:00
Ed Hennis
5db3c5e023
Fix a few build errors
2025-05-07 12:11:51 -04:00
Ed Hennis
a8118ff582
Add unit tests for new invariants:
...
- NoModifiedUnmodifiableFields and ValidPseudoAccounts
- Move the Invariants_test class into the test namespace
2025-05-07 12:11:51 -04:00
Ed Hennis
e3241dc143
Clean up more Invariant privilege checking
...
- Change more "failed" messages. The goal here is to be able to search
the log for "failed" and ONLY get test failures.
2025-05-07 12:11:50 -04:00
Ed Hennis
c63cc88dc6
Fix a couple more build errors
2025-05-07 12:11:50 -04:00
Ed Hennis
ed27377435
Add a validity range for sfDebtMaximum
...
- Fix several test and build errors
2025-05-07 12:11:50 -04:00
Ed Hennis
41d83a4b24
Fix account creation to check both amendments
2025-05-07 12:11:50 -04:00
Ed Hennis
b7152496c1
Add LoanBroker update tests
...
- Move some helper functions.
- Check the regular key in the pseudo-transaction invariant check.
- Transactor::checkSign will always fail for a pseudo-account, so even
if someone figures out how to get a good signature, it won't work.
2025-05-07 12:11:50 -04:00
Ed Hennis
1db5e9b4d3
Pseudo-account improvements
...
- Define pseudo-account fields with an sfield flag
- Pseudo-account invariant checks rules whenever a pseudo-account is
created or modified.
2025-05-07 12:11:50 -04:00
Ed Hennis
33e666bfff
Enumerate transaction privileges for invariants
...
- Allows them to be defined in transactions.macro instead of needing to
scrutinize every existing Invariant class.
- List is not necessarily comprehensive, but does cover every check
where more than one transaction type is involved.
2025-05-07 12:11:49 -04:00
Ed Hennis
3b59817952
Generalize some of the Invariant checks using macro files
...
- Valid ledger entry type
- Valid new account root and pseudo account check
2025-05-07 12:11:49 -04:00
Ed Hennis
d4c2d46984
Update tests, update pseudo-account checking
2025-05-07 12:11:49 -04:00
Ed Hennis
47fa8ff59f
Fix formatting
2025-05-07 12:11:49 -04:00
Ed Hennis
0d26065321
Start writing LoanBrokerSet tests
2025-05-07 12:11:49 -04:00
Ed Hennis
943a52cf2e
Fix some build errors and typos
2025-05-07 12:11:48 -04:00
Ed Hennis
301a64be10
Add more fields
2025-05-07 12:11:48 -04:00
Ed Hennis
95e7cf4fc6
Fix formatting
2025-05-07 12:11:48 -04:00
Ed Hennis
19900bb87e
Finish creating helper classes for JTx fields
...
- Also change the pseudo account field lookup to a function that uses
a switch
2025-05-07 12:11:48 -04:00
Ed Hennis
536af58316
Fix formatting
2025-05-07 12:11:48 -04:00
Ed Hennis
f77d435fdc
Create some helper classes for transaction fields
...
- Test that they work by converting some of the existing classes
2025-05-07 12:11:48 -04:00
Ed Hennis
6489d73766
Rename LoanBroker.* files to LoanBrokerSet.*
2025-05-07 12:11:47 -04:00
Ed Hennis
f8c708f20c
Finish LoanBrokerSet
...
- Update changed field name.
- Modify modifiable fields in an update. Note there are only two.
- Add a node field to dirLink, defaulting sfOwnerNode, so other
relationships can be updated.
2025-05-07 12:11:47 -04:00
Ed Hennis
a04c07c5c4
Fix a couple of build errors
2025-05-07 12:11:47 -04:00
Ed Hennis
24374c548b
[WIP] Define remaining transactions, start implementing LoanBrokerSet
...
- Does not build
- Transactions: LoanDelete, LoanManage, LoanDraw, LoanPay
- LoanBrokerSet creation mostly done. Need update.
- Also added a lookup table for pseudo account fields.
2025-05-07 12:11:47 -04:00
Ed Hennis
009ae8183f
refactor: Generalize Transactor preflight:
...
- Derived classes no longer need to explicitly check amendments, nor
call into preflight1 or preflight2.
- Untested.
2025-05-07 12:11:47 -04:00
Ed Hennis
145215d4ab
Fix bug in new invariant
2025-05-07 12:11:47 -04:00