-
Notifications
You must be signed in to change notification settings - Fork 71
Added account permission delegation #689
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
base: main
Are you sure you want to change the base?
Changes from 26 commits
474eb81
ba48f46
7304367
fc834c7
a9d902b
bfc033d
ab0045c
be9d4f7
d9ff2f1
9868950
408efff
af2fc8f
d5ce28f
be26ff3
a270901
4844bc4
38c887c
26c6a98
f3ca876
bd1b597
ea3dcea
e32e21d
30cf686
35c6694
198668f
9f3b13a
bfdaafc
5bd0628
2b357cc
7cc6652
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ | |
| import org.xrpl.xrpl4j.model.transactions.CredentialAccept; | ||
| import org.xrpl.xrpl4j.model.transactions.CredentialCreate; | ||
| import org.xrpl.xrpl4j.model.transactions.CredentialDelete; | ||
| import org.xrpl.xrpl4j.model.transactions.DelegateSet; | ||
| import org.xrpl.xrpl4j.model.transactions.DepositPreAuth; | ||
| import org.xrpl.xrpl4j.model.transactions.DidDelete; | ||
| import org.xrpl.xrpl4j.model.transactions.DidSet; | ||
|
|
@@ -481,6 +482,10 @@ public <T extends Transaction> SingleSignedTransaction<T> addSignatureToTransact | |
| transactionWithSignature = CredentialDelete.builder().from((CredentialDelete) transaction) | ||
| .transactionSignature(signature) | ||
| .build(); | ||
| } else if (DelegateSet.class.isAssignableFrom(transaction.getClass())) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Since we are adding tests in
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see this comment as resolved, but when I run
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added coverage for this line and reran tests with coverage to confirm |
||
| transactionWithSignature = DelegateSet.builder().from((DelegateSet) transaction) | ||
| .transactionSignature(signature) | ||
| .build(); | ||
| } else if (PermissionedDomainSet.class.isAssignableFrom(transaction.getClass())) { | ||
| transactionWithSignature = PermissionedDomainSet.builder().from((PermissionedDomainSet) transaction) | ||
| .transactionSignature(signature) | ||
|
|
@@ -736,6 +741,10 @@ public <T extends Transaction> T addMultiSignaturesToTransaction(T transaction, | |
| transactionWithSignatures = CredentialDelete.builder().from((CredentialDelete) transaction) | ||
| .signers(signers) | ||
| .build(); | ||
| } else if (DelegateSet.class.isAssignableFrom(transaction.getClass())) { | ||
| transactionWithSignatures = DelegateSet.builder().from((DelegateSet) transaction) | ||
| .signers(signers) | ||
| .build(); | ||
| } else if (PermissionedDomainSet.class.isAssignableFrom(transaction.getClass())) { | ||
| transactionWithSignatures = PermissionedDomainSet.builder().from((PermissionedDomainSet) transaction) | ||
| .signers(signers) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package org.xrpl.xrpl4j.model.client.ledger; | ||
|
|
||
| import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
| import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| import com.google.common.annotations.Beta; | ||
| import org.immutables.value.Value.Immutable; | ||
| import org.xrpl.xrpl4j.model.transactions.Address; | ||
|
|
||
| /** | ||
| * Parameters that uniquely identify a {@link org.xrpl.xrpl4j.model.ledger.DelegateObject} on ledger that can be | ||
| * used in a {@link LedgerEntryRequestParams} to request a {@link org.xrpl.xrpl4j.model.ledger.DelegateObject}. | ||
| * | ||
| * <p>This class will be marked {@link Beta} until the featurePermissionDelegation amendment is enabled on mainnet. | ||
| * Its API is subject to change.</p> | ||
| */ | ||
| @Immutable | ||
| @JsonSerialize(as = ImmutableDelegateLedgerEntryParams.class) | ||
| @JsonDeserialize(as = ImmutableDelegateLedgerEntryParams.class) | ||
| @Beta | ||
| public interface DelegateLedgerEntryParams { | ||
|
|
||
| /** | ||
| * Construct a {@code DelegateLedgerEntryParams} builder. | ||
| * | ||
| * @return An {@link ImmutableDelegateLedgerEntryParams.Builder}. | ||
| */ | ||
| static ImmutableDelegateLedgerEntryParams.Builder builder() { | ||
| return ImmutableDelegateLedgerEntryParams.builder(); | ||
| } | ||
|
|
||
| /** | ||
| * The account that wants to authorize another account (the delegating account). | ||
| * | ||
| * @return An {@link Address}. | ||
| */ | ||
| Address account(); | ||
|
|
||
| /** | ||
| * The authorized account (the delegate). | ||
| * | ||
| * @return An {@link Address}. | ||
| */ | ||
| Address authorize(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a typo.