From 6e606cb7d8f531dc26638673e86234bb18c5bad1 Mon Sep 17 00:00:00 2001 From: cyan317 <120398799+cindyyan317@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:47:02 +0100 Subject: [PATCH] fix: Change the field name from "close_time_iso" to "closed (#1531) --- src/rpc/handlers/LedgerIndex.cpp | 2 +- tests/unit/rpc/handlers/LedgerIndexTests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/handlers/LedgerIndex.cpp b/src/rpc/handlers/LedgerIndex.cpp index 8cd5ff31..9796f079 100644 --- a/src/rpc/handlers/LedgerIndex.cpp +++ b/src/rpc/handlers/LedgerIndex.cpp @@ -104,7 +104,7 @@ tag_invoke(boost::json::value_from_tag, boost::json::value& jv, LedgerIndexHandl jv = boost::json::object{ {JS(ledger_index), output.ledgerIndex}, {JS(ledger_hash), output.ledgerHash}, - {JS(close_time_iso), output.closeTimeIso}, + {JS(closed), output.closeTimeIso}, {JS(validated), true}, }; } diff --git a/tests/unit/rpc/handlers/LedgerIndexTests.cpp b/tests/unit/rpc/handlers/LedgerIndexTests.cpp index 465dd48b..68c579d9 100644 --- a/tests/unit/rpc/handlers/LedgerIndexTests.cpp +++ b/tests/unit/rpc/handlers/LedgerIndexTests.cpp @@ -71,7 +71,7 @@ TEST_F(RPCLedgerIndexTest, NoDateGiven) ASSERT_TRUE(output); EXPECT_EQ(output.result->at("ledger_index").as_uint64(), RANGEMAX); EXPECT_EQ(output.result->at("ledger_hash").as_string(), LEDGERHASH); - EXPECT_TRUE(output.result->as_object().contains("close_time_iso")); + EXPECT_TRUE(output.result->as_object().contains("closed")); }); } @@ -163,6 +163,6 @@ TEST_P(LedgerIndexTests, SearchFromLedgerRange) ASSERT_TRUE(output); EXPECT_EQ(output.result->at("ledger_index").as_uint64(), testBundle.expectedLedgerIndex); EXPECT_EQ(output.result->at("ledger_hash").as_string(), LEDGERHASH); - EXPECT_EQ(output.result->at("close_time_iso").as_string(), testBundle.closeTimeIso); + EXPECT_EQ(output.result->at("closed").as_string(), testBundle.closeTimeIso); }); }