Repository navigation
Changes to single asset vault #832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a1dd179
Upcoming changes to Single Asset Vault (DGE-7974)
cybele-ripple d44e8f9
Address review of Single Asset Vault changes (DGE-7974)
cybele-ripple 0504c81
Add missing @Override annotation to tfInnerBatchTxn() in Vault flags …
cybele-ripple 53d66bd
Address PR review feedback for Vault flags (DGE-7974)
cybele-ripple 5f48277
Add VaultKind, SubscriptionDate, RedemptionDate to support closed-end…
cybele-ripple fe777cf
Enable LendingProtocolV1_1 amendment for local rippled test container…
cybele-ripple 96be695
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple 09691be
Add remaining LendingProtocolV1_1 protocol surface
cybele-ripple e37030e
Attribute the vault deposit-block and donate flags to LendingProtocol…
cybele-ripple 61b6380
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple aae84d3
Fix LendingProtocolIT tecNO_PERMISSION failures on LoanSet/LoanBrokerSet
cybele-ripple 2336840
Widen LendingProtocolIT's Vault SubscriptionDate buffer for real netw…
cybele-ripple e1e1285
Fix scanForResult timeout mismatch after widening SubscriptionDate bu…
cybele-ripple e933650
Widen awaitLoanPaymentLate's timeout for real-network ledger close pa…
cybele-ripple 73b0bf3
Omit VaultKind.OPEN_ENDED from serialized Vault JSON
cybele-ripple 96efb58
Address remaining PR 832 review feedback: hashCode, unread locals
cybele-ripple cff3ebd
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple efd6fdb
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple 41c8cb4
Remove LendingProtocolV1_2-gated Vault flags from this LP1.1 branch
cybele-ripple 3b4caf3
Restore VaultFlagsTest.java instead of deleting it
cybele-ripple 2cfdbd0
Address PR review feedback for single-asset-vault
cybele-ripple 994e7ff
Add IT coverage for VaultWithdraw CredentialIDs and VaultDelete MemoData
cybele-ripple aabded6
fix: remove unread local variable in LendingProtocolIT
cybele-ripple e4fb977
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple 1b0fd62
fix: enforce investment-period bounds in VaultCreate.check()
cybele-ripple 16c1398
Merge remote-tracking branch 'origin/main' into single-asset-vault
cybele-ripple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/VaultKind.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| package org.xrpl.xrpl4j.model.transactions; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
| import com.google.common.annotations.Beta; | ||
|
|
||
| /** | ||
| * Distinguishes a closed-ended {@code Vault} from the default open-ended kind. Only a closed-ended vault may | ||
| * have a {@code LoanBroker} attached to it once the {@code LendingProtocolV1_1} amendment is enabled. | ||
| */ | ||
| @Beta | ||
| public enum VaultKind { | ||
|
|
||
| /** | ||
| * The default vault kind. Deposits and withdrawals are allowed at any time, and the vault has no defined | ||
| * lifecycle. An open-ended vault cannot have a {@code LoanBroker} attached once {@code LendingProtocolV1_1} | ||
| * is enabled. | ||
| */ | ||
| OPEN_ENDED(0), | ||
|
|
||
| /** | ||
| * A vault with a defined {@link VaultCreate#subscriptionDate()} and {@link VaultCreate#redemptionDate()}, | ||
| * required in order to attach a {@code LoanBroker} once {@code LendingProtocolV1_1} is enabled. | ||
| */ | ||
| CLOSED_ENDED(1); | ||
|
|
||
| private final int value; | ||
|
|
||
| VaultKind(int value) { | ||
| this.value = value; | ||
| } | ||
|
|
||
| /** | ||
| * Get the integer value of this {@link VaultKind}. | ||
| * | ||
| * @return The integer value. | ||
| */ | ||
| @JsonValue | ||
| public int getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| /** | ||
| * Construct a {@link VaultKind} from an integer value. | ||
| * | ||
| * @param value The integer value. | ||
| * | ||
| * @return The {@link VaultKind} for the given value. | ||
| */ | ||
| @JsonCreator | ||
| public static VaultKind forValue(int value) { | ||
| for (VaultKind kind : VaultKind.values()) { | ||
| if (kind.value == value) { | ||
| return kind; | ||
| } | ||
| } | ||
| throw new IllegalArgumentException("No matching VaultKind for value " + value); | ||
| } | ||
|
|
||
| /** | ||
| * Used with {@link com.fasterxml.jackson.annotation.JsonInclude.Include#CUSTOM} to omit {@link #OPEN_ENDED} from | ||
| * serialized JSON, matching how rippled omits {@code VaultKind} for open-ended vaults. | ||
| */ | ||
| public static class OpenEndedFilter { | ||
|
github-code-quality[bot] marked this conversation as resolved.
Fixed
|
||
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| return obj == VaultKind.OPEN_ENDED; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return VaultKind.OPEN_ENDED.hashCode(); | ||
| } | ||
|
kuan121 marked this conversation as resolved.
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.