rippled
rippled copied to clipboard
Remove deprecated `ledger` fields
The JSON format for ledger objects (as returned by the ledger
method among others) could probably stand to be better-unified a la transactions but for starters, we could at least remove some of the redundant fields that have been deprecated for years:
The following fields are deprecated and may be removed without further notice:
accepted
,hash
(useledger_hash
instead),seqNum
(useledger_index
instead),totalCoins
(usetotal_coins
instead).
Given that we've had that statement up since probably 2015 if not earlier, I think we'd be justified in removing the mentioned fields even without having full "API versioning" in place. Anyone who's still using them at this point is almost certainly doing something highly inadvisable if whatever they're doing even still works with all the amendments to the protocol since then.
Hello,
I'm a beginner to XRPL and I have a question. After removal of the deprecated fields, this seems to be the output of the command ./rippled ledger validated
:
Loading: "/Users/keshava/.config/ripple/rippled.cfg"
2022-Jul-20 17:39:49.765444 UTC HTTPClient:NFO Connecting to 127.0.0.1:5005
{
"result" : {
"ledger" : {
"account_hash" : "725DB4D108D882CEC03FCCFABDEB969A6DB9626E3F2CF1425E61F394A95C631E",
"close_flags" : 0,
"close_time" : 711653980,
"close_time_human" : "2022-Jul-20 17:39:40.000000 UTC",
"close_time_resolution" : 10,
"closed" : true,
"ledger_hash" : "5C0A53406F1AC9D479ACF8114072AF47ECBA2747E8CB409126379117BF8CDA6D",
"ledger_index" : "73137147",
"parent_close_time" : 711653972,
"parent_hash" : "199689B8B6545D92CB19F8A92386C9E23D7009733A1B7906E08D9411969AE8C1",
"total_coins" : "99989392350108618",
"transaction_hash" : "470B3CBAA9E3E88C1F98E85C97C736CC530929B62393D1C2E7B38F63F841EA12"
},
"ledger_hash" : "5C0A53406F1AC9D479ACF8114072AF47ECBA2747E8CB409126379117BF8CDA6D",
"ledger_index" : 73137147,
"status" : "success",
"validated" : true
}
}
Two fields ledger_hash
and ledger_index
seem to be repeated in result
and result::ledger
. Is the redundancy intended as a feature?
I don't know if it's intended, but if that's how it currently is, then I see no strong reason to change it.