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

remove deprecated fields in ledger command, fix for #3214 #4244

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/ripple/app/ledger/impl/LedgerToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ fillJson(Object& json, bool closed, LedgerInfo const& info, bool bFull)
{
json[jss::parent_hash] = to_string(info.parentHash);
json[jss::ledger_index] = to_string(info.seq);
json[jss::seqNum] = to_string(info.seq); // DEPRECATED

if (closed)
{
Expand All @@ -70,10 +69,6 @@ fillJson(Object& json, bool closed, LedgerInfo const& info, bool bFull)
json[jss::account_hash] = to_string(info.accountHash);
json[jss::total_coins] = to_string(info.drops);

// These next three are DEPRECATED.
json[jss::hash] = to_string(info.hash);
json[jss::totalCoins] = to_string(info.drops);
json[jss::accepted] = closed;
json[jss::close_flags] = info.closeFlags;

// Always show fields that contribute to the ledger hash
Expand Down
2 changes: 0 additions & 2 deletions src/ripple/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ JSS(send_max); // in: PathRequest, RipplePathFind
JSS(seq); // in: LedgerEntry;
// out: NetworkOPs, RPCSub, AccountOffers,
// ValidatorList, ValidatorInfo, Manifest
JSS(seqNum); // out: LedgerToJson
JSS(sequence); // in: UNL
JSS(sequence_count); // out: AccountInfo
JSS(server_domain); // out: NetworkOPs
Expand Down Expand Up @@ -574,7 +573,6 @@ JSS(timeouts); // out: InboundLedger
JSS(track); // out: PeerImp
JSS(traffic); // out: Overlay
JSS(total); // out: counters
JSS(totalCoins); // out: LedgerToJson
JSS(total_bytes_recv); // out: Peers
JSS(total_bytes_sent); // out: Peers
JSS(total_coins); // out: LedgerToJson
Expand Down
9 changes: 5 additions & 4 deletions src/test/app/SHAMapStore_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class SHAMapStore_test : public beast::unit_test::suite
const std::string outTxHash = to_string(info.txHash);

auto const& ledger = json[jss::result][jss::ledger];
return outHash == ledger[jss::hash].asString() && outSeq == seq &&
return outHash == ledger[jss::ledger_hash].asString() &&
outSeq == seq &&
outParentHash == ledger[jss::parent_hash].asString() &&
outDrops == ledger[jss::total_coins].asString() &&
outCloseTime == ledger[jss::close_time].asUInt() &&
Expand All @@ -111,9 +112,9 @@ class SHAMapStore_test : public beast::unit_test::suite
BEAST_EXPECT(
json.isMember(jss::result) &&
json[jss::result].isMember(jss::ledger) &&
json[jss::result][jss::ledger].isMember(jss::hash) &&
json[jss::result][jss::ledger][jss::hash].isString());
return json[jss::result][jss::ledger][jss::hash].asString();
json[jss::result][jss::ledger].isMember(jss::ledger_hash) &&
json[jss::result][jss::ledger][jss::ledger_hash].isString());
return json[jss::result][jss::ledger][jss::ledger_hash].asString();
}

void
Expand Down
8 changes: 0 additions & 8 deletions src/test/rpc/LedgerRPC_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ class LedgerRPC_test : public beast::unit_test::suite
env.rpc("json", "ledger", to_string(jvParams))[jss::result];
BEAST_EXPECT(jrr[jss::ledger][jss::closed] == true);
BEAST_EXPECT(jrr[jss::ledger][jss::ledger_index] == "1");
BEAST_EXPECT(jrr[jss::ledger][jss::accepted] == true);
BEAST_EXPECT(
jrr[jss::ledger][jss::totalCoins] ==
env.balance(env.master).value().getText());
}

{
Expand All @@ -91,10 +87,6 @@ class LedgerRPC_test : public beast::unit_test::suite
env.rpc("json", "ledger", to_string(jvParams))[jss::result];
BEAST_EXPECT(jrr[jss::ledger][jss::closed] == true);
BEAST_EXPECT(jrr[jss::ledger][jss::ledger_index] == "1");
BEAST_EXPECT(jrr[jss::ledger][jss::accepted] == true);
BEAST_EXPECT(
jrr[jss::ledger][jss::totalCoins] ==
env.balance(env.master).value().getText());
}

{
Expand Down