-
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
Support canonical ledger entry names in ledger/ledger_data/account_objects "type" field. #4393
Comments
Consider adding to table: |
Given that Clio is intended to be a full replacement of the rippled API (for clients), this issue likely makes more sense for Clio to consider. With the lack of developer demand, the rippled behavior will be left alone. |
@bthomee - is there any appetite for someone on the team to pick this up? It is a To reiterate - the ask is for |
IMO these should not be case insensitive, but should just be converting the canonical name from |
We should satisfy the original request by OP: Support canonical ledger entry names in ledger/ledger_data/account_objects "type" field. So when I want MPTokenIssuance, let me just request MPTokenIssuance. In addition to that, if the APIs accept case-insensitive and/or snake_case names, that is fine. |
Am I'm new to the team I figured this would be a Good First Issue for me. I took a stab at it in #5271 using case-insensitive filtering by canonical name, and marking the use of the RPC name as deprecated, both in a comment and in the API changelog. |
Summary
The ledger, ledger_data , and account_objects methods accept a
type
field to filter the results to specific types of ledger entries. The values you pass in aren't always possible to determine from the entries' canonical JSON names so it's kind of a guessing game.Since all of these methods are returning raw/canonical ledger entries anyway it would make more sense if the
type
field of these requests matched the canonical names as they appear in theLedgerEntryType
field. Maybe for convenience they could be case-insensitive.Motivation
Would you be able to guess all of the short names in this table?
AccountRoot
account
😉Amendments
amendments
Check
check
DepositPreauth
deposit_preauth
DirectoryNode
directory
😩Escrow
escrow
FeeSettings
fee
😮LedgerHashes
hashes
😑NegativeUNL
NFTokenOffer
nft_offer
🤔NFTokenPage
nft_page
🆕Offer
offer
PayChannel
payment_channel
😅RippleState
state
😓SignerList
signer_list
Ticket
ticket
(Emoji are not part of the names, I just added them as reactions to point out the less obvious ones.)
These short names also have to be manually added to the API methods whenever new types of ledger objects are implemented.
Solution
Modify these APIs (and any others that have a similar field, though I can't think of them offhand) so that
type
accepts the canonical name, case-insensitive. For backwards compatibility, continue to also support the existing short names (but mark them deprecated in the documentation).Preferably, also do it in such a way that when someone develops a new ledger entry type, these methods support filtering on the new type using the canonical name with no new/additional code to the methods.
Relevant Source Code
rippled/src/ripple/rpc/impl/RPCHelpers.cpp
Line 894 in ebbf4b6
The text was updated successfully, but these errors were encountered: