From 780500bc35753dd876997aea5d09faaa599afe52 Mon Sep 17 00:00:00 2001 From: Shawn Xie <35279399+shawnxie999@users.noreply.github.com> Date: Fri, 20 Feb 2026 02:21:26 +0900 Subject: [PATCH] Replace Uint192 with Hash192 in server_definitions response (#5177) --- src/test/rpc/ServerInfo_test.cpp | 9 +++++++++ src/xrpld/rpc/handlers/ServerDefinitions.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/rpc/ServerInfo_test.cpp b/src/test/rpc/ServerInfo_test.cpp index a2eaa63eb..fbeb4220d 100644 --- a/src/test/rpc/ServerInfo_test.cpp +++ b/src/test/rpc/ServerInfo_test.cpp @@ -197,6 +197,15 @@ admin = 127.0.0.1 .asUInt() == 0); BEAST_EXPECT( result[jss::result][jss::TYPES]["AccountID"].asUInt() == 8); + + // test that base_uint types are replaced with "Hash" prefix + { + auto const types = result[jss::result][jss::TYPES]; + BEAST_EXPECT(types["Hash128"].asUInt() == 4); + BEAST_EXPECT(types["Hash160"].asUInt() == 17); + BEAST_EXPECT(types["Hash192"].asUInt() == 21); + BEAST_EXPECT(types["Hash256"].asUInt() == 5); + } } // test providing the same hash diff --git a/src/xrpld/rpc/handlers/ServerDefinitions.cpp b/src/xrpld/rpc/handlers/ServerDefinitions.cpp index b8cf81df7..29020c72d 100644 --- a/src/xrpld/rpc/handlers/ServerDefinitions.cpp +++ b/src/xrpld/rpc/handlers/ServerDefinitions.cpp @@ -121,7 +121,7 @@ private: if (find("UINT")) { - if (find("256") || find("160") || find("128")) + if (find("256") || find("192") || find("160") || find("128")) return replace("UINT", "Hash"); else return replace("UINT", "UInt");