-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Permissioned Domains (XLS-80d) #5149
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5149 +/- ##
========================================
Coverage 76.2% 76.2%
========================================
Files 760 764 +4
Lines 61568 61709 +141
Branches 8126 8126
========================================
+ Hits 46909 47033 +124
- Misses 14659 14676 +17
|
4ead1c5
to
9754309
Compare
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.
InnerObjectFormats.cpp should be updated with
add(sfCredential.jsonName.c_str(),
sfCredential.getCode(),
{
{sfIssuer, soeREQUIRED},
{sfCredentialType, soeREQUIRED},
});
to check sfAcceptedCredentials array during RPC parsing. This inner object already present in credentials PR(#5103) so I will not treat this as an issue
4e947c6
to
d638a48
Compare
Credentials should be merged before this one. There likely will be merge conflicts from some of the new field names having different values, but they should be simple to resolve. |
d638a48
to
61e785b
Compare
Also, test sorting of permissions.
674b858
to
70dfad9
Compare
failing the transaction. Conforms to Credentials spec.
49d1890
to
e08bef8
Compare
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.
Partial Review
@@ -222,7 +222,8 @@ doAccountObjects(RPC::JsonContext& context) | |||
{jss::xchain_owned_claim_id, ltXCHAIN_OWNED_CLAIM_ID}, | |||
{jss::xchain_owned_create_account_claim_id, | |||
ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID}, | |||
{jss::bridge, ltBRIDGE}}; | |||
{jss::bridge, ltBRIDGE}, | |||
{jss::permissioned_domain, ltPERMISSIONED_DOMAIN}}; |
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.
There are other rpc functions that need to be added for account_objects I believe. LedgerEntry
. Also you should write some tests to confirm the behavior.
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.
You should also be able to query the ledger entry from the account/seq so add that as well. And then add tests.
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.
I added a flag for account_objects to return type=permissioned_domain, and tested it. Also the ledger_entry call is already tested ok. Please specify what other RPC's you think are necessary. But i think what's there already is sufficient for people to find their PermissionedDomain objects.
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.
There are 2 ledger entry calls. The index and { permissioned_domain: { account: account, seq: seq }}
the other should be added and tested unless I'm just missing it.
You tested that the objects are empty, you then lower in the test would create the permissioned_domain and validate it. I'm not the main reviewer so if someone else is fine with you testing account_objects differently than the other objects then thats ok. (All the objects are not even tested there anyways so its prob not a big deal)
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.
I've checked documentation, it seems we also need to extend the RPCs:
ledger_data
- relies onchooseLedgerEntryType
which is already modified, so we only need to add it to unit testsledger_entry
- needs a custom section of code insidedoLedgerEntry
(and a unit test)
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.
Whenever you add a new type of ledger entry, the following methods need to be extended:
- account_objects -
type
field - ledger_data -
type
field - ledger_entry - new field for looking up the new entry type (typically this can accept either a string ledger entry ID or an object with nested sub-fields as appropriate for the type of entry)
I think the ledger_data
and account_objects
type filters use shared code as mentioned above.
I don't think there's anything else that always needs to be added/updated, but of course depending on what the amendment does there may always be more. In the case of Permissioned Domains I'm guessing nothing.
Also, I don't think adding a new type of transaction requires any similar work since AFAIK we don't have anything that filters on transaction type or retrieves specific types of transactions specifically.
7587f0e
to
edd696b
Compare
1f2af22
to
7070c56
Compare
BEAST_EXPECT(pd::ownerInfo(alice, env)["OwnerCount"].asUInt() == 1); | ||
|
||
/* | ||
env(did::setValid(alice), ter(tecINSUFFICIENT_RESERVE)); |
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.
is there any purpose to having this commented-out section here ?
env.close(); | ||
|
||
// Pay alice almost enough to make the reserve. | ||
env(pay(env.master, alice, incReserve + drops(19))); |
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.
Please avoid using fee 10 directly, this will break with any fee other than 10.
In this case, this could be written as
auto const baseFee = env.current()->fees().base.drops();
...
env(pay(env.master, alice, incReserve + 2 * baseFee - 1));
|
||
// Pay alice almost enough to make the reserve. | ||
env(pay(env.master, alice, incReserve + drops(19))); | ||
BEAST_EXPECT(env.balance(alice) == acctReserve + incReserve + drops(9)); |
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.
same here
BEAST_EXPECT(pd::ownerInfo(alice, env)["OwnerCount"].asUInt() == 0); | ||
|
||
// Pay alice enough to make the reserve. | ||
env(pay(env.master, alice, drops(11))); |
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.
same here
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.
please also fix for commented section if it's not going to be removed.
I'm taking ownership of the implementation. But I can't commit to this PR due to some permission issues. Everyone please move to XLS-80d_new. |
This PR is being superceded by: #5161 |
Spec: XRPLF/XRPL-Standards#228
High Level Overview of Change
Implements the object, transactions, and tests required by the spec:
XRPLF/XRPL-Standards#228
Context of Change
New feature. Follows existing patterns for adding a new ledger object and related transactions.
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
Requires an amendment.
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)