Skip to content
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

Ledger command requires ledger_index key to be an int #234

Closed
miracle2k opened this issue Dec 24, 2013 · 1 comment
Closed

Ledger command requires ledger_index key to be an int #234

miracle2k opened this issue Dec 24, 2013 · 1 comment
Assignees

Comments

@miracle2k
Copy link

It took a while until I figured out why the following doesn't work right (it simply returns some default current ledger response):

{"command": "ledger", "transactions" : true,"ledger_index": "4044952", "expand": true} 

It's because ledger_index is a string. I'm only reporting this because in responses, ledger_index is also given as a string, which is if nothing else inconsistent.

@HowardHinnant
Copy link
Contributor

The ledger_index, if specified as a numerical sequence number, is now well specified to be a 32-bit unsigned integer: https://ripple.com/build/rippled-apis/#ledger-index

The response now has a top-level ledger_index field containing the ledger index as an unsigned integral type.

However it remains true that the response also contains a ledger object which itself has a duplicate ledger_index containing the numeric value as a string type. This can not be changed for the current rippled API for backwards compatibility reasons. However a future ("versioned") API may change this aspect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants