From 2b8a7b95e478a6a374b2509d8f1226e02da8a39c Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 9 Mar 2026 17:17:09 +0000 Subject: [PATCH] chore: Remove explicit accountNotFound message (#2978) I searched rippled code, and there is no `accountNotFound` anywhere. So, we should probably stick to the default, it looks reasonable --- src/rpc/handlers/AccountChannels.cpp | 2 +- src/rpc/handlers/AccountCurrencies.cpp | 2 +- src/rpc/handlers/AccountLines.cpp | 2 +- src/rpc/handlers/AccountNFTs.cpp | 2 +- src/rpc/handlers/AccountObjects.cpp | 2 +- src/rpc/handlers/AccountOffers.cpp | 2 +- src/rpc/handlers/GatewayBalances.cpp | 2 +- src/rpc/handlers/NFTsByIssuer.cpp | 2 +- src/rpc/handlers/NoRippleCheck.cpp | 2 +- tests/unit/rpc/handlers/AccountChannelsTests.cpp | 2 +- tests/unit/rpc/handlers/AccountCurrenciesTests.cpp | 2 +- tests/unit/rpc/handlers/AccountLinesTests.cpp | 2 +- tests/unit/rpc/handlers/AccountNFTsTests.cpp | 2 +- tests/unit/rpc/handlers/AccountObjectsTests.cpp | 2 +- tests/unit/rpc/handlers/AccountOffersTests.cpp | 2 +- tests/unit/rpc/handlers/GatewayBalancesTests.cpp | 2 +- tests/unit/rpc/handlers/NFTsByIssuerTest.cpp | 2 +- tests/unit/rpc/handlers/NoRippleCheckTests.cpp | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/rpc/handlers/AccountChannels.cpp b/src/rpc/handlers/AccountChannels.cpp index 80dd945c4..000c33a4d 100644 --- a/src/rpc/handlers/AccountChannels.cpp +++ b/src/rpc/handlers/AccountChannels.cpp @@ -107,7 +107,7 @@ AccountChannelsHandler::process( ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto const destAccountID = input.destinationAccount ? accountFromStringStrict(input.destinationAccount.value()) diff --git a/src/rpc/handlers/AccountCurrencies.cpp b/src/rpc/handlers/AccountCurrencies.cpp index 12a05da07..aad6185f6 100644 --- a/src/rpc/handlers/AccountCurrencies.cpp +++ b/src/rpc/handlers/AccountCurrencies.cpp @@ -65,7 +65,7 @@ AccountCurrenciesHandler::process( ripple::keylet::account(*accountID).key, lgrInfo.seq, ctx.yield ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; Output response; auto const addToResponse = [&](ripple::SLE const sle) { diff --git a/src/rpc/handlers/AccountLines.cpp b/src/rpc/handlers/AccountLines.cpp index b35ea267f..f4823f43e 100644 --- a/src/rpc/handlers/AccountLines.cpp +++ b/src/rpc/handlers/AccountLines.cpp @@ -156,7 +156,7 @@ AccountLinesHandler::process(AccountLinesHandler::Input const& input, Context co ); if (not accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto const peerAccountID = input.peer ? accountFromStringStrict(*(input.peer)) : std::optional{}; diff --git a/src/rpc/handlers/AccountNFTs.cpp b/src/rpc/handlers/AccountNFTs.cpp index 5c5c33551..b1bb46d12 100644 --- a/src/rpc/handlers/AccountNFTs.cpp +++ b/src/rpc/handlers/AccountNFTs.cpp @@ -68,7 +68,7 @@ AccountNFTsHandler::process(AccountNFTsHandler::Input const& input, Context cons ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto response = Output{}; response.account = input.account; diff --git a/src/rpc/handlers/AccountObjects.cpp b/src/rpc/handlers/AccountObjects.cpp index 4ff2be946..80293dae6 100644 --- a/src/rpc/handlers/AccountObjects.cpp +++ b/src/rpc/handlers/AccountObjects.cpp @@ -69,7 +69,7 @@ AccountObjectsHandler::process(AccountObjectsHandler::Input const& input, Contex ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto typeFilter = std::optional>{}; diff --git a/src/rpc/handlers/AccountOffers.cpp b/src/rpc/handlers/AccountOffers.cpp index e9884ede8..5bc1c01b0 100644 --- a/src/rpc/handlers/AccountOffers.cpp +++ b/src/rpc/handlers/AccountOffers.cpp @@ -85,7 +85,7 @@ AccountOffersHandler::process(AccountOffersHandler::Input const& input, Context ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; Output response; response.account = ripple::to_string(*accountID); diff --git a/src/rpc/handlers/GatewayBalances.cpp b/src/rpc/handlers/GatewayBalances.cpp index 5b4c82f22..5e5b0f5c3 100644 --- a/src/rpc/handlers/GatewayBalances.cpp +++ b/src/rpc/handlers/GatewayBalances.cpp @@ -80,7 +80,7 @@ GatewayBalancesHandler::process( ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto output = GatewayBalancesHandler::Output{}; diff --git a/src/rpc/handlers/NFTsByIssuer.cpp b/src/rpc/handlers/NFTsByIssuer.cpp index 43329f4e7..39201e0c8 100644 --- a/src/rpc/handlers/NFTsByIssuer.cpp +++ b/src/rpc/handlers/NFTsByIssuer.cpp @@ -68,7 +68,7 @@ NFTsByIssuerHandler::process(NFTsByIssuerHandler::Input const& input, Context co ); if (!accountLedgerObject) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; std::optional cursor; if (input.marker) diff --git a/src/rpc/handlers/NoRippleCheck.cpp b/src/rpc/handlers/NoRippleCheck.cpp index 6068cf122..81b2e3686 100644 --- a/src/rpc/handlers/NoRippleCheck.cpp +++ b/src/rpc/handlers/NoRippleCheck.cpp @@ -74,7 +74,7 @@ NoRippleCheckHandler::process(NoRippleCheckHandler::Input const& input, Context auto const accountObj = sharedPtrBackend_->fetchLedgerObject(keylet, lgrInfo.seq, ctx.yield); if (!accountObj) - return Error{Status{RippledError::rpcACT_NOT_FOUND, "accountNotFound"}}; + return Error{Status{RippledError::rpcACT_NOT_FOUND}}; auto it = ripple::SerialIter{accountObj->data(), accountObj->size()}; auto sle = ripple::SLE{it, keylet}; diff --git a/tests/unit/rpc/handlers/AccountChannelsTests.cpp b/tests/unit/rpc/handlers/AccountChannelsTests.cpp index a8f299bdf..58644f8d2 100644 --- a/tests/unit/rpc/handlers/AccountChannelsTests.cpp +++ b/tests/unit/rpc/handlers/AccountChannelsTests.cpp @@ -453,7 +453,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonExistAccount) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/AccountCurrenciesTests.cpp b/tests/unit/rpc/handlers/AccountCurrenciesTests.cpp index 21284419f..989014980 100644 --- a/tests/unit/rpc/handlers/AccountCurrenciesTests.cpp +++ b/tests/unit/rpc/handlers/AccountCurrenciesTests.cpp @@ -87,7 +87,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, AccountNotExist) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/AccountLinesTests.cpp b/tests/unit/rpc/handlers/AccountLinesTests.cpp index 6e78e10e7..bdea8344d 100644 --- a/tests/unit/rpc/handlers/AccountLinesTests.cpp +++ b/tests/unit/rpc/handlers/AccountLinesTests.cpp @@ -493,7 +493,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonExistAccount) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/AccountNFTsTests.cpp b/tests/unit/rpc/handlers/AccountNFTsTests.cpp index caab838a8..e7184a7a3 100644 --- a/tests/unit/rpc/handlers/AccountNFTsTests.cpp +++ b/tests/unit/rpc/handlers/AccountNFTsTests.cpp @@ -288,7 +288,7 @@ TEST_F(RPCAccountNFTsHandlerTest, AccountNotFound) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/AccountObjectsTests.cpp b/tests/unit/rpc/handlers/AccountObjectsTests.cpp index 9d5b21e01..407899d96 100644 --- a/tests/unit/rpc/handlers/AccountObjectsTests.cpp +++ b/tests/unit/rpc/handlers/AccountObjectsTests.cpp @@ -323,7 +323,7 @@ TEST_F(RPCAccountObjectsHandlerTest, AccountNotExist) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/AccountOffersTests.cpp b/tests/unit/rpc/handlers/AccountOffersTests.cpp index ab9bf4897..ddb699dfc 100644 --- a/tests/unit/rpc/handlers/AccountOffersTests.cpp +++ b/tests/unit/rpc/handlers/AccountOffersTests.cpp @@ -283,7 +283,7 @@ TEST_F(RPCAccountOffersHandlerTest, AccountNotFound) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/GatewayBalancesTests.cpp b/tests/unit/rpc/handlers/GatewayBalancesTests.cpp index fae456533..8c4cfeab3 100644 --- a/tests/unit/rpc/handlers/GatewayBalancesTests.cpp +++ b/tests/unit/rpc/handlers/GatewayBalancesTests.cpp @@ -380,7 +380,7 @@ TEST_F(RPCGatewayBalancesHandlerTest, AccountNotFound) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/NFTsByIssuerTest.cpp b/tests/unit/rpc/handlers/NFTsByIssuerTest.cpp index 6ac240e55..5d61c4d27 100644 --- a/tests/unit/rpc/handlers/NFTsByIssuerTest.cpp +++ b/tests/unit/rpc/handlers/NFTsByIssuerTest.cpp @@ -375,7 +375,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, AccountNotFound) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); } diff --git a/tests/unit/rpc/handlers/NoRippleCheckTests.cpp b/tests/unit/rpc/handlers/NoRippleCheckTests.cpp index 3390e1019..7c0aaa8d0 100644 --- a/tests/unit/rpc/handlers/NoRippleCheckTests.cpp +++ b/tests/unit/rpc/handlers/NoRippleCheckTests.cpp @@ -320,7 +320,7 @@ TEST_F(RPCNoRippleCheckTest, AccountNotExist) ASSERT_FALSE(output); auto const err = rpc::makeError(output.result.error()); EXPECT_EQ(err.at("error").as_string(), "actNotFound"); - EXPECT_EQ(err.at("error_message").as_string(), "accountNotFound"); + EXPECT_EQ(err.at("error_message").as_string(), "Account not found."); }); }