Skip to content

Commit

Permalink
Remove deprecated fields (#814)
Browse files Browse the repository at this point in the history
Fix #801
  • Loading branch information
cindyyan317 authored Aug 7, 2023
1 parent d61d702 commit e3ada6c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/rpc/handlers/Ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ LedgerHandler::process(LedgerHandler::Input input, Context const& ctx) const
}
else
{
output.header[JS(accepted)] = true;
output.header[JS(account_hash)] = ripple::strHex(lgrInfo.accountHash);
output.header[JS(close_flags)] = lgrInfo.closeFlags;
output.header[JS(close_time)] = lgrInfo.closeTime.time_since_epoch().count();
output.header[JS(close_time_human)] = ripple::to_string(lgrInfo.closeTime);
output.header[JS(close_time_resolution)] = lgrInfo.closeTimeResolution.count();
output.header[JS(closed)] = true;
output.header[JS(hash)] = ripple::strHex(lgrInfo.hash);
output.header[JS(ledger_hash)] = ripple::strHex(lgrInfo.hash);
output.header[JS(ledger_index)] = std::to_string(lgrInfo.seq);
output.header[JS(parent_close_time)] = lgrInfo.parentCloseTime.time_since_epoch().count();
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/handlers/LedgerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ LedgerDataHandler::process(Input input, Context const& ctx) const
}
else
{
header[JS(accepted)] = true;
header[JS(account_hash)] = ripple::strHex(lgrInfo.accountHash);
header[JS(close_flags)] = lgrInfo.closeFlags;
header[JS(close_time)] = lgrInfo.closeTime.time_since_epoch().count();
header[JS(close_time_human)] = ripple::to_string(lgrInfo.closeTime);
header[JS(close_time_resolution)] = lgrInfo.closeTimeResolution.count();
header[JS(hash)] = ripple::strHex(lgrInfo.hash);
header[JS(ledger_hash)] = ripple::strHex(lgrInfo.hash);
header[JS(ledger_index)] = std::to_string(lgrInfo.seq);
header[JS(parent_close_time)] = lgrInfo.parentCloseTime.time_since_epoch().count();
Expand Down
6 changes: 0 additions & 6 deletions unittests/rpc/handlers/LedgerDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,10 @@ TEST_F(RPCLedgerDataHandlerTest, MarkerNotExist)
TEST_F(RPCLedgerDataHandlerTest, NoMarker)
{
static auto const ledgerExpected = R"({
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down Expand Up @@ -287,12 +285,10 @@ TEST_F(RPCLedgerDataHandlerTest, NoMarker)
TEST_F(RPCLedgerDataHandlerTest, TypeFilter)
{
static auto const ledgerExpected = R"({
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down Expand Up @@ -356,12 +352,10 @@ TEST_F(RPCLedgerDataHandlerTest, TypeFilter)
TEST_F(RPCLedgerDataHandlerTest, OutOfOrder)
{
static auto const ledgerExpected = R"({
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down
8 changes: 0 additions & 8 deletions unittests/rpc/handlers/LedgerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,11 @@ TEST_F(RPCLedgerHandlerTest, Default)
"ledger_index":30,
"validated":true,
"ledger":{
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"closed":true,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down Expand Up @@ -444,13 +442,11 @@ TEST_F(RPCLedgerHandlerTest, TransactionsExpandNotBinary)
"ledger_index":30,
"validated":true,
"ledger":{
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"closed":true,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down Expand Up @@ -664,13 +660,11 @@ TEST_F(RPCLedgerHandlerTest, OwnerFundsEmtpy)
"ledger_index":30,
"validated":true,
"ledger":{
"accepted":true,
"account_hash":"0000000000000000000000000000000000000000000000000000000000000000",
"close_flags":0,
"close_time":0,
"close_time_resolution":0,
"closed":true,
"hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index":"30",
"parent_close_time":0,
Expand Down Expand Up @@ -754,13 +748,11 @@ TEST_F(RPCLedgerHandlerTest, OwnerFundsTrueBinaryFalse)
static auto constexpr expectedOut =
R"({
"ledger": {
"accepted": true,
"account_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"close_flags": 0,
"close_time": 0,
"close_time_resolution": 0,
"closed": true,
"hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"ledger_index": "30",
"parent_close_time": 0,
Expand Down

0 comments on commit e3ada6c

Please sign in to comment.