From 2ed1a45ef1427dcdc335499ac6f7718034cca99f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:45:47 +0100 Subject: [PATCH 01/10] style: clang-tidy auto fixes (#2688) Co-authored-by: godexsoft <385326+godexsoft@users.noreply.github.com> --- tests/common/util/LoggerFixtures.cpp | 1 + tests/unit/util/log/LoggerTests.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common/util/LoggerFixtures.cpp b/tests/common/util/LoggerFixtures.cpp index 50cd3b12..e935f092 100644 --- a/tests/common/util/LoggerFixtures.cpp +++ b/tests/common/util/LoggerFixtures.cpp @@ -29,6 +29,7 @@ #include #include +#include void LoggerFixture::init() diff --git a/tests/unit/util/log/LoggerTests.cpp b/tests/unit/util/log/LoggerTests.cpp index 754e774b..8e21528d 100644 --- a/tests/unit/util/log/LoggerTests.cpp +++ b/tests/unit/util/log/LoggerTests.cpp @@ -25,6 +25,7 @@ #include #include +#include #include using namespace util; @@ -93,11 +94,11 @@ TEST_F(LoggerTest, ManyDynamicLoggers) for (size_t i = 0; i < kNUM_LOGGERS; ++i) { std::string const loggerName = "DynamicLogger" + std::to_string(i); - Logger log{loggerName}; + Logger const log{loggerName}; log.info() << "Logger number " << i; ASSERT_EQ(getLoggerString(), "inf:" + loggerName + " - Logger number " + std::to_string(i) + "\n"); - Logger copy = log; + Logger const copy = log; copy.info() << "Copy of logger number " << i; ASSERT_EQ(getLoggerString(), "inf:" + loggerName + " - Copy of logger number " + std::to_string(i) + "\n"); } From a4b47da57a339e3282340eb42b930fd2293e8e2c Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 13 Oct 2025 18:55:21 +0100 Subject: [PATCH 02/10] docs: Update doxygen-awesome-css to 2.4.1 (#2690) --- docs/doxygen-awesome-theme/doxygen-awesome.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doxygen-awesome-theme/doxygen-awesome.css b/docs/doxygen-awesome-theme/doxygen-awesome.css index 8300dc47..f992c232 100644 --- a/docs/doxygen-awesome-theme/doxygen-awesome.css +++ b/docs/doxygen-awesome-theme/doxygen-awesome.css @@ -951,7 +951,7 @@ span.arrowhead { border-color: var(--primary-color); } -#nav-tree ul li:first-child > div > a { +#nav-tree-contents > ul > li:first-child > div > a { opacity: 0; pointer-events: none; } From b361e3a1087d79852d86ea27f6fd58b7a0be68b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?emrear=C4=B1y=C3=BCrek?= Date: Tue, 14 Oct 2025 18:37:14 +0200 Subject: [PATCH 03/10] feat: Support new types in ledger_entry (#2654) Co-authored-by: Ayaz Salikhov --- src/rpc/handlers/LedgerEntry.cpp | 8 +++++++- src/rpc/handlers/LedgerEntry.hpp | 6 ++++++ tests/unit/rpc/handlers/LedgerEntryTests.cpp | 16 ++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/rpc/handlers/LedgerEntry.cpp b/src/rpc/handlers/LedgerEntry.cpp index d5fd252d..2caf85ff 100644 --- a/src/rpc/handlers/LedgerEntry.cpp +++ b/src/rpc/handlers/LedgerEntry.cpp @@ -333,7 +333,13 @@ tag_invoke(boost::json::value_to_tag, boost::json::va {JS(mptoken), ripple::ltMPTOKEN}, {JS(permissioned_domain), ripple::ltPERMISSIONED_DOMAIN}, {JS(vault), ripple::ltVAULT}, - {JS(delegate), ripple::ltDELEGATE} + {JS(delegate), ripple::ltDELEGATE}, + {JS(amendments), ripple::ltAMENDMENTS}, + {JS(fee), ripple::ltFEE_SETTINGS}, + {JS(hashes), ripple::ltLEDGER_HASHES}, + {JS(nft_offer), ripple::ltNFTOKEN_OFFER}, + {JS(nunl), ripple::ltNEGATIVE_UNL}, + {JS(signer_list), ripple::ltSIGNER_LIST} }; auto const parseBridgeFromJson = [](boost::json::value const& bridgeJson) { diff --git a/src/rpc/handlers/LedgerEntry.hpp b/src/rpc/handlers/LedgerEntry.hpp index 3859cc15..4280d569 100644 --- a/src/rpc/handlers/LedgerEntry.hpp +++ b/src/rpc/handlers/LedgerEntry.hpp @@ -428,6 +428,12 @@ public: validation::CustomValidators::accountBase58Validator, Status(ClioError::RpcMalformedAddress) }} }}}, + {JS(amendments), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, + {JS(fee), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, + {JS(hashes), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, + {JS(nft_offer), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, + {JS(nunl), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, + {JS(signer_list), kMALFORMED_REQUEST_HEX_STRING_VALIDATOR}, {JS(ledger), check::Deprecated{}}, {"include_deleted", validation::Type{}}, }; diff --git a/tests/unit/rpc/handlers/LedgerEntryTests.cpp b/tests/unit/rpc/handlers/LedgerEntryTests.cpp index 8bae5d38..6f2c7b3f 100644 --- a/tests/unit/rpc/handlers/LedgerEntryTests.cpp +++ b/tests/unit/rpc/handlers/LedgerEntryTests.cpp @@ -2311,11 +2311,23 @@ struct IndexTest : public HandlerBaseTest, public WithParamInterface Date: Wed, 15 Oct 2025 17:15:12 +0100 Subject: [PATCH 04/10] fix: Address AmendmentBlockHandler flakiness in old ETL tests (#2694) Co-authored-by: Ayaz Salikhov --- tests/unit/etl/AmendmentBlockHandlerTests.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/unit/etl/AmendmentBlockHandlerTests.cpp b/tests/unit/etl/AmendmentBlockHandlerTests.cpp index 85a2b8f8..8eecd9f9 100644 --- a/tests/unit/etl/AmendmentBlockHandlerTests.cpp +++ b/tests/unit/etl/AmendmentBlockHandlerTests.cpp @@ -36,6 +36,9 @@ struct AmendmentBlockHandlerTest : util::prometheus::WithPrometheus, SyncAsioCon etl::SystemState state; }; +// Note: This test can be flaky due to the way it was written (depends on time) +// Since the old ETL is going to be replaced by ETLng all tests including this one will be deleted anyway so the fix for +// flakiness is to increase the context runtime to 50ms until then (to not waste time). TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction) { AmendmentBlockHandler handler{ctx_, state, std::chrono::nanoseconds{1}, actionMock.AsStdFunction()}; @@ -45,12 +48,7 @@ TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeat handler.notifyAmendmentBlocked(); EXPECT_TRUE(state.isAmendmentBlocked); -// Code runs significantly slower when assertions are enabled -#ifdef _GLIBCXX_ASSERTIONS - runContextFor(std::chrono::milliseconds{10}); -#else - runContextFor(std::chrono::milliseconds{1}); -#endif + runContextFor(std::chrono::milliseconds{50}); } struct DefaultAmendmentBlockActionTest : LoggerFixture {}; From b2be4b51d1d81548ca48e2f2b8f67356b880c96d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 16 Oct 2025 12:02:14 +0100 Subject: [PATCH 05/10] ci: Add libatomic as dependency for pre-commit image (#2697) --- docker/pre-commit/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/pre-commit/Dockerfile b/docker/pre-commit/Dockerfile index 19ce8cca..1d012bf0 100644 --- a/docker/pre-commit/Dockerfile +++ b/docker/pre-commit/Dockerfile @@ -17,6 +17,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends --no-install-suggests \ curl \ git \ + libatomic1 \ software-properties-common \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From 2528dee6b65c43f8864b398430261cc8f158bd18 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 16 Oct 2025 13:03:52 +0100 Subject: [PATCH 06/10] chore: Use pre-commit image with libatomic (#2698) --- .github/scripts/conan/generate_matrix.py | 2 +- .github/workflows/build.yml | 8 ++++---- .github/workflows/check-libxrpl.yml | 4 ++-- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/nightly.yml | 8 ++++---- .github/workflows/pre-commit.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reusable-release.yml | 2 +- .github/workflows/sanitizers.yml | 2 +- docker/develop/compose.yaml | 2 +- docs/build-clio.md | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/scripts/conan/generate_matrix.py b/.github/scripts/conan/generate_matrix.py index 699b9d29..25404373 100755 --- a/.github/scripts/conan/generate_matrix.py +++ b/.github/scripts/conan/generate_matrix.py @@ -4,7 +4,7 @@ import json LINUX_OS = ["heavy", "heavy-arm64"] LINUX_CONTAINERS = [ - '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' ] LINUX_COMPILERS = ["gcc", "clang"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 604c965c..7c17bba2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: build_type: [Release, Debug] container: [ - '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }', + '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }', ] static: [true] @@ -75,7 +75,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' conan_profile: gcc build_type: Debug download_ccache: true @@ -94,7 +94,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' conan_profile: gcc build_type: Release download_ccache: true @@ -111,7 +111,7 @@ jobs: needs: build-and-test runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check-libxrpl.yml b/.github/workflows/check-libxrpl.yml index fe5c5b6b..5a9cfb20 100644 --- a/.github/workflows/check-libxrpl.yml +++ b/.github/workflows/check-libxrpl.yml @@ -17,7 +17,7 @@ jobs: name: Build Clio / `libXRPL ${{ github.event.client_payload.version }}` runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d steps: - uses: actions/checkout@v4 @@ -67,7 +67,7 @@ jobs: needs: build runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d steps: - uses: actions/download-artifact@v5 diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index fb336703..faeadcd1 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -27,7 +27,7 @@ jobs: if: github.event_name != 'push' || contains(github.event.head_commit.message, 'clang-tidy auto fixes') runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d permissions: contents: write diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9d2bf4d1..17bee836 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d steps: - name: Checkout diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fb2beceb..cce587f9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -39,17 +39,17 @@ jobs: conan_profile: gcc build_type: Release static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' - os: heavy conan_profile: gcc build_type: Debug static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' - os: heavy conan_profile: gcc.ubsan build_type: Release static: false - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' uses: ./.github/workflows/reusable-build-test.yml with: @@ -73,7 +73,7 @@ jobs: include: - os: heavy conan_profile: clang - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' static: true - os: macos15 conan_profile: apple-clang diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 69cfeefe..e8fbb55e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,4 +11,4 @@ jobs: uses: XRPLF/actions/.github/workflows/pre-commit.yml@afbcbdafbe0ce5439492fb87eda6441371086386 with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-pre-commit:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-pre-commit:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42bc9108..18f5cb75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: conan_profile: gcc build_type: Release static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' uses: ./.github/workflows/reusable-build-test.yml with: diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index e4cd3da8..3720cdac 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -42,7 +42,7 @@ jobs: release: runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 068c971e..7f7feb34 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -44,7 +44,7 @@ jobs: uses: ./.github/workflows/reusable-build-test.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' download_ccache: false upload_ccache: false conan_profile: ${{ matrix.compiler }}${{ matrix.sanitizer_ext }} diff --git a/docker/develop/compose.yaml b/docker/develop/compose.yaml index 0c02af1c..610e938d 100644 --- a/docker/develop/compose.yaml +++ b/docker/develop/compose.yaml @@ -1,6 +1,6 @@ services: clio_develop: - image: ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e + image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d volumes: - clio_develop_conan_data:/root/.conan2/p - clio_develop_ccache:/root/.ccache diff --git a/docs/build-clio.md b/docs/build-clio.md index bb5ebbed..18cd876a 100644 --- a/docs/build-clio.md +++ b/docs/build-clio.md @@ -191,7 +191,7 @@ Open the `index.html` file in your browser to see the documentation pages. It is also possible to build Clio using [Docker](https://www.docker.com/) if you don't want to install all the dependencies on your machine. ```sh -docker run -it ghcr.io/xrplf/clio-ci:213752862ca95ecadeb59a6176c3db91a7864b3e +docker run -it ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d git clone https://github.com/XRPLF/clio cd clio ``` From 685f6114342ce8370a21296cd56b9e2464daaf3a Mon Sep 17 00:00:00 2001 From: Alex Kremer Date: Thu, 16 Oct 2025 18:55:58 +0100 Subject: [PATCH 07/10] chore: Disable flaky DisconnectClientOnInactivity (#2699) --- tests/unit/web/ng/impl/WsConnectionTests.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/web/ng/impl/WsConnectionTests.cpp b/tests/unit/web/ng/impl/WsConnectionTests.cpp index 5660066e..5d605a71 100644 --- a/tests/unit/web/ng/impl/WsConnectionTests.cpp +++ b/tests/unit/web/ng/impl/WsConnectionTests.cpp @@ -108,7 +108,9 @@ TEST_F(WebWsConnectionTests, WasUpgraded) }); } -TEST_F(WebWsConnectionTests, DisconnectClientOnInactivity) +// This test is either flaky or incorrect +// see https://github.com/XRPLF/clio/issues/2700 +TEST_F(WebWsConnectionTests, DISABLED_DisconnectClientOnInactivity) { boost::asio::io_context clientCtx; auto work = boost::asio::make_work_guard(clientCtx); From 7538efb01e85d00f7ae42ebf0e8e95b92b3cca87 Mon Sep 17 00:00:00 2001 From: Peter Chen <34582813+PeterChen13579@users.noreply.github.com> Date: Fri, 17 Oct 2025 09:58:38 -0400 Subject: [PATCH 08/10] fix: Add mpt_issuance_id to meta of MPTIssuanceCreate (#2701) fixes #2332 --- src/feed/impl/TransactionFeed.cpp | 3 +- src/rpc/RPCHelpers.cpp | 39 ++++++++++++---------- src/rpc/RPCHelpers.hpp | 16 ++++++--- tests/unit/feed/TransactionFeedTests.cpp | 3 +- tests/unit/rpc/handlers/AccountTxTests.cpp | 3 +- 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/feed/impl/TransactionFeed.cpp b/src/feed/impl/TransactionFeed.cpp index 0b2b9207..be79956b 100644 --- a/src/feed/impl/TransactionFeed.cpp +++ b/src/feed/impl/TransactionFeed.cpp @@ -209,8 +209,9 @@ TransactionFeed::pub( rpc::insertDeliveredAmount(pubObj[JS(meta)].as_object(), tx, meta, txMeta.date); auto& txnPubobj = pubObj[txKey].as_object(); + auto& metaPubobj = pubObj[JS(meta)].as_object(); rpc::insertDeliverMaxAlias(txnPubobj, version); - rpc::insertMPTIssuanceID(txnPubobj, meta); + rpc::insertMPTIssuanceID(txnPubobj, tx, metaPubobj, meta); Json::Value nftJson; ripple::RPC::insertNFTSyntheticInJson(nftJson, tx, *meta); diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index eea6c9ea..08e16798 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -258,7 +258,7 @@ toExpandedJson( auto metaJson = toJson(*meta); insertDeliveredAmount(metaJson, txn, meta, blobs.date); insertDeliverMaxAlias(txnJson, apiVersion); - insertMPTIssuanceID(txnJson, meta); + insertMPTIssuanceID(txnJson, txn, metaJson, meta); if (nftEnabled == NFTokenjson::ENABLE) { Json::Value nftJson; @@ -343,36 +343,41 @@ getMPTIssuanceID(std::shared_ptr const& meta) /** * @brief Check if transaction has a new MPToken created * - * @param txnJson The transaction Json - * @param meta The metadata + * @param txn The transaction object + * @param meta The metadata object * @return true if the transaction can have a mpt_issuance_id */ static bool -canHaveMPTIssuanceID(boost::json::object const& txnJson, std::shared_ptr const& meta) +canHaveMPTIssuanceID(std::shared_ptr const& txn, std::shared_ptr const& meta) { - if (txnJson.at(JS(TransactionType)).is_string() and - not boost::iequals(txnJson.at(JS(TransactionType)).as_string(), JS(MPTokenIssuanceCreate))) + if (txn->getTxnType() != ripple::ttMPTOKEN_ISSUANCE_CREATE) return false; - if (meta->getResultTER() != ripple::tesSUCCESS) - return false; - - return true; + return (meta->getResultTER() == ripple::tesSUCCESS); } bool -insertMPTIssuanceID(boost::json::object& txnJson, std::shared_ptr const& meta) +insertMPTIssuanceID( + boost::json::object& txnJson, + std::shared_ptr const& txn, + boost::json::object& metaJson, + std::shared_ptr const& meta +) { - if (!canHaveMPTIssuanceID(txnJson, meta)) - return false; - - if (txnJson.contains(JS(TransactionType)) && txnJson.at(JS(TransactionType)).is_string() and - txnJson.at(JS(TransactionType)).as_string() == JS(MPTokenIssuanceCreate)) + if (!canHaveMPTIssuanceID(txn, meta)) return false; auto const id = getMPTIssuanceID(meta); ASSERT(id.has_value(), "MPTIssuanceID must have value"); - txnJson[JS(mpt_issuance_id)] = ripple::to_string(*id); + + // For mpttokenissuance create, add mpt_issuance_id to metajson + // Otherwise, add it to txn json + if (txnJson.contains(JS(TransactionType)) && txnJson.at(JS(TransactionType)).is_string() and + txnJson.at(JS(TransactionType)).as_string() == JS(MPTokenIssuanceCreate)) { + metaJson[JS(mpt_issuance_id)] = ripple::to_string(*id); + } else { + txnJson[JS(mpt_issuance_id)] = ripple::to_string(*id); + } return true; } diff --git a/src/rpc/RPCHelpers.hpp b/src/rpc/RPCHelpers.hpp index 9dfe4e55..5d3f9bb9 100644 --- a/src/rpc/RPCHelpers.hpp +++ b/src/rpc/RPCHelpers.hpp @@ -201,15 +201,23 @@ insertDeliveredAmount( /** * @brief Add "mpt_issuance_id" into various MPTToken transaction json. - * @note We exclude "mpt_issuance_id" for MPTokenIssuanceCreate only. The reason is because the mpt_issuance_id - * is generated only after one submits MPTokenIssuanceCreate, so there’s no way to know what the id is. (rippled) + * @note We add "mpt_issuance_id" into the meta part of MPTokenIssuanceCreate only. The reason is because the + * mpt_issuance_id is generated only after one submits MPTokenIssuanceCreate, so there’s no way to know what the id is. + * (rippled) * * @param txnJson The transaction Json object + * @param txn The txn object + * @param metaJson The metadata Json object * @param meta The metadata object - * @return true if the "mpt_issuance_id" is added to the txnJson JSON object + * @return true if the "mpt_issuance_id" is added to either txnJson or metaJson object */ bool -insertMPTIssuanceID(boost::json::object& txnJson, std::shared_ptr const& meta); +insertMPTIssuanceID( + boost::json::object& txnJson, + std::shared_ptr const& txn, + boost::json::object& metaJson, + std::shared_ptr const& meta +); /** * @brief Convert STBase object to JSON diff --git a/tests/unit/feed/TransactionFeedTests.cpp b/tests/unit/feed/TransactionFeedTests.cpp index 3002c572..673f6632 100644 --- a/tests/unit/feed/TransactionFeedTests.cpp +++ b/tests/unit/feed/TransactionFeedTests.cpp @@ -1282,7 +1282,8 @@ TEST_F(FeedTransactionTest, PublishesMPTokenIssuanceCreateTx) } ], "TransactionIndex": 0, - "TransactionResult": "tesSUCCESS" + "TransactionResult": "tesSUCCESS", + "mpt_issuance_id": "000000014B4E9C06F24296074F7BC48F92A97916C6DC5EA9" }, "ctid": "C000002100000000", "type": "transaction", diff --git a/tests/unit/rpc/handlers/AccountTxTests.cpp b/tests/unit/rpc/handlers/AccountTxTests.cpp index 6e9acdbe..20c6d983 100644 --- a/tests/unit/rpc/handlers/AccountTxTests.cpp +++ b/tests/unit/rpc/handlers/AccountTxTests.cpp @@ -1625,7 +1625,8 @@ TEST_F(RPCAccountTxHandlerTest, MPTTxs_API_v2) }} ], "TransactionIndex": 0, - "TransactionResult": "tesSUCCESS" + "TransactionResult": "tesSUCCESS", + "mpt_issuance_id": "000000014B4E9C06F24296074F7BC48F92A97916C6DC5EA9" }}, "hash": "A52221F4003C281D3C83F501F418B55A1F9DC1C6A129EF13E1A8F0E5C008DAE3", "ledger_index": 11, From 3de2bf2910210bcb950d211bd76d7ba4740195ed Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sat, 18 Oct 2025 07:55:14 +0100 Subject: [PATCH 09/10] ci: Update pre-commit workflow to latest version (#2702) --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e8fbb55e..a9e919d9 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,7 +8,7 @@ on: jobs: run-hooks: - uses: XRPLF/actions/.github/workflows/pre-commit.yml@afbcbdafbe0ce5439492fb87eda6441371086386 + uses: XRPLF/actions/.github/workflows/pre-commit.yml@a8d7472b450eb53a1e5228f64552e5974457a21a with: runs_on: heavy container: '{ "image": "ghcr.io/xrplf/clio-pre-commit:b2be4b51d1d81548ca48e2f2b8f67356b880c96d" }' From 2de49b4d33aef5cad93f28c862fd0d4886fa959c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:41:59 +0100 Subject: [PATCH 10/10] style: clang-tidy auto fixes (#2706) --- src/rpc/RPCHelpers.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 08e16798..72a6555f 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -34,7 +34,6 @@ #include "web/Context.hpp" #include -#include #include #include #include