From cb52c9af001316a906665a10283f6f5dd271ebb3 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 5 Sep 2025 14:08:17 +0100 Subject: [PATCH 1/2] fix: Remove extra @ in notify-clio.yml (#5771) --- .github/workflows/notify-clio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify-clio.yml b/.github/workflows/notify-clio.yml index b0e5f35787..0c85bc9302 100644 --- a/.github/workflows/notify-clio.yml +++ b/.github/workflows/notify-clio.yml @@ -53,7 +53,7 @@ jobs: - name: Calculate conan reference id: conan_ref run: | - echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/@${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}" + echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}" - name: Add Conan remote run: | echo "Adding Conan remote '${{ inputs.conan_remote_name }}' at ${{ inputs.conan_remote_url }}." From f0c96ccfe6f13e98c7558cec3e72cd4d5b82b10d Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Fri, 5 Sep 2025 17:41:06 -0400 Subject: [PATCH 2/2] Review feedback from @yinyiqian1 - Rewrite to_short_string to call strHex directly instead of building the whole hex string first. - Change PrettyAsset::scale_ back to a uint32 since the Number conversion elides any potential multiplication overflow. - Clean ups. --- include/xrpl/basics/base_uint.h | 7 ++++++- src/test/jtx/TestHelpers.h | 2 +- src/test/jtx/amount.h | 2 +- src/test/unit_test/FileDirGuard.h | 1 - 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 1eacb16385..ca83b8e220 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -636,7 +636,12 @@ template inline std::string to_short_string(base_uint const& a) { - return to_string(a).substr(0, 8) + "..."; + // LCOV_EXCL_START + if constexpr (a.bytes <= 4) + return to_string(a); + else + // LCOV_EXCL_STOP + return strHex(a.cbegin(), a.cbegin() + 4) + "..."; } template diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 3aea274e53..7d14f23c92 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -361,7 +361,7 @@ ownerCount(test::jtx::Env const& env, test::jtx::Account const& account); [[nodiscard]] inline bool -checkVL(Slice const& result, std::string expected) +checkVL(Slice const& result, std::string const& expected) { Serializer s; s.addRaw(result); diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index d0b21d31ce..fbe78bf3ec 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -181,7 +181,7 @@ struct PrettyAsset { private: Asset asset_; - std::uint64_t scale_; + std::uint32_t scale_; public: template diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index ea7efc49a7..d3cabc2092 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -29,7 +29,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include namespace ripple { - namespace detail { /**