From 87f1c06b5b0db63b82c3e97b6c4c1fcfc66e7976 Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Wed, 25 Sep 2024 13:39:38 +0100 Subject: [PATCH] chore: Update libxrpl to 2.3.0-b4 (#1667) --- conanfile.py | 2 +- src/data/AmendmentCenter.hpp | 3 +++ src/rpc/common/Validators.cpp | 8 +++----- tests/unit/data/AmendmentCenterTests.cpp | 2 +- tests/unit/rpc/ErrorTests.cpp | 2 +- tests/unit/rpc/handlers/SubscribeTests.cpp | 15 +++------------ tests/unit/rpc/handlers/UnsubscribeTests.cpp | 15 +++------------ 7 files changed, 15 insertions(+), 32 deletions(-) diff --git a/conanfile.py b/conanfile.py index b5817b9a..22c58e77 100644 --- a/conanfile.py +++ b/conanfile.py @@ -28,7 +28,7 @@ class Clio(ConanFile): 'protobuf/3.21.9', 'grpc/1.50.1', 'openssl/1.1.1u', - 'xrpl/2.3.0-b1', + 'xrpl/2.3.0-b4', 'libbacktrace/cci.20210118' ] diff --git a/src/data/AmendmentCenter.hpp b/src/data/AmendmentCenter.hpp index edbe81c8..9b4c7c30 100644 --- a/src/data/AmendmentCenter.hpp +++ b/src/data/AmendmentCenter.hpp @@ -124,6 +124,9 @@ struct Amendments { REGISTER(NFTokenMintOffer); REGISTER(fixReducedOffersV2); REGISTER(fixEnforceNFTokenTrustline); + REGISTER(fixInnerObjTemplate2); + REGISTER(fixNFTokenPageLinks); + REGISTER(InvariantsV1_1); // Obsolete but supported by libxrpl REGISTER(CryptoConditionsSuite); diff --git a/src/rpc/common/Validators.cpp b/src/rpc/common/Validators.cpp index bfb70f04..71f41b41 100644 --- a/src/rpc/common/Validators.cpp +++ b/src/rpc/common/Validators.cpp @@ -200,15 +200,13 @@ CustomValidator CustomValidators::SubscribeStreamValidator = "ledger", "transactions", "transactions_proposed", "book_changes", "manifests", "validations" }; - static std::unordered_set const reportingNotSupportStreams = { - "peer_status", "consensus", "server" - }; + static std::unordered_set const notSupportStreams = {"peer_status", "consensus", "server"}; for (auto const& v : value.as_array()) { if (!v.is_string()) return Error{Status{RippledError::rpcINVALID_PARAMS, "streamNotString"}}; - if (reportingNotSupportStreams.contains(boost::json::value_to(v))) - return Error{Status{RippledError::rpcREPORTING_UNSUPPORTED}}; + if (notSupportStreams.contains(boost::json::value_to(v))) + return Error{Status{RippledError::rpcNOT_SUPPORTED}}; if (not validStreams.contains(boost::json::value_to(v))) return Error{Status{RippledError::rpcSTREAM_MALFORMED}}; diff --git a/tests/unit/data/AmendmentCenterTests.cpp b/tests/unit/data/AmendmentCenterTests.cpp index fe0545b9..4c96e5e6 100644 --- a/tests/unit/data/AmendmentCenterTests.cpp +++ b/tests/unit/data/AmendmentCenterTests.cpp @@ -49,7 +49,7 @@ struct AmendmentCenterTest : util::prometheus::WithPrometheus, MockBackendTest, TEST_F(AmendmentCenterTest, AllAmendmentsFromLibXRPLAreSupported) { for (auto const& [name, _] : ripple::allAmendments()) { - ASSERT_TRUE(amendmentCenter.isSupported(name)) << "XRPL amendment not supported by Clio: " << name; + EXPECT_TRUE(amendmentCenter.isSupported(name)) << "XRPL amendment not supported by Clio: " << name; } ASSERT_EQ(amendmentCenter.getSupported().size(), ripple::allAmendments().size()); diff --git a/tests/unit/rpc/ErrorTests.cpp b/tests/unit/rpc/ErrorTests.cpp index 7c0d569e..549f4b2c 100644 --- a/tests/unit/rpc/ErrorTests.cpp +++ b/tests/unit/rpc/ErrorTests.cpp @@ -79,7 +79,7 @@ TEST(RPCErrorsTest, StatusAsBool) TEST(RPCErrorsTest, StatusEquals) { EXPECT_EQ(Status{RippledError::rpcUNKNOWN}, Status{RippledError::rpcUNKNOWN}); - EXPECT_NE(Status{RippledError::rpcUNKNOWN}, Status{RippledError::rpcREPORTING_UNSUPPORTED}); + EXPECT_NE(Status{RippledError::rpcUNKNOWN}, Status{RippledError::rpcINTERNAL}); } TEST(RPCErrorsTest, SuccessToJSON) diff --git a/tests/unit/rpc/handlers/SubscribeTests.cpp b/tests/unit/rpc/handlers/SubscribeTests.cpp index 1f1f2a94..f3b66d3c 100644 --- a/tests/unit/rpc/handlers/SubscribeTests.cpp +++ b/tests/unit/rpc/handlers/SubscribeTests.cpp @@ -136,22 +136,13 @@ generateTestValuesForParametersTest() SubscribeParamTestCaseBundle{"StreamNotString", R"({"streams": [1]})", "invalidParams", "streamNotString"}, SubscribeParamTestCaseBundle{"StreamNotValid", R"({"streams": ["1"]})", "malformedStream", "Stream malformed."}, SubscribeParamTestCaseBundle{ - "StreamPeerStatusNotSupport", - R"({"streams": ["peer_status"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamPeerStatusNotSupport", R"({"streams": ["peer_status"]})", "notSupported", "Operation not supported." }, SubscribeParamTestCaseBundle{ - "StreamConsensusNotSupport", - R"({"streams": ["consensus"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamConsensusNotSupport", R"({"streams": ["consensus"]})", "notSupported", "Operation not supported." }, SubscribeParamTestCaseBundle{ - "StreamServerNotSupport", - R"({"streams": ["server"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamServerNotSupport", R"({"streams": ["server"]})", "notSupported", "Operation not supported." }, SubscribeParamTestCaseBundle{"BooksNotArray", R"({"books": "1"})", "invalidParams", "booksNotArray"}, SubscribeParamTestCaseBundle{ diff --git a/tests/unit/rpc/handlers/UnsubscribeTests.cpp b/tests/unit/rpc/handlers/UnsubscribeTests.cpp index ddc698e0..07c38b8a 100644 --- a/tests/unit/rpc/handlers/UnsubscribeTests.cpp +++ b/tests/unit/rpc/handlers/UnsubscribeTests.cpp @@ -486,22 +486,13 @@ generateTestValuesForParametersTest() "bothNotBool" }, UnsubscribeParamTestCaseBundle{ - "StreamPeerStatusNotSupport", - R"({"streams": ["peer_status"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamPeerStatusNotSupport", R"({"streams": ["peer_status"]})", "notSupported", "Operation not supported." }, UnsubscribeParamTestCaseBundle{ - "StreamConsensusNotSupport", - R"({"streams": ["consensus"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamConsensusNotSupport", R"({"streams": ["consensus"]})", "notSupported", "Operation not supported." }, UnsubscribeParamTestCaseBundle{ - "StreamServerNotSupport", - R"({"streams": ["server"]})", - "reportingUnsupported", - "Requested operation not supported by reporting mode server" + "StreamServerNotSupport", R"({"streams": ["server"]})", "notSupported", "Operation not supported." }, }; }