From c2aad445c170ca4d17dad4066456569d40817559 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Mon, 27 Jul 2026 19:14:19 +0100 Subject: [PATCH] fix(tx): satisfy clang-tidy in the tx apply stage span helper clang-tidy had been skipped on this branch while CMake configure was failing, so these findings in makeStageSpan surfaced only now: - brace the three single-statement if bodies (readability-braces-around-statements) - compare the pointer parameter explicitly against nullptr (readability-implicit-bool-conversion) - include xrpl/protocol/Protocol.h for LedgerIndex (misc-include-cleaner) --- src/libxrpl/tx/applySteps.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libxrpl/tx/applySteps.cpp b/src/libxrpl/tx/applySteps.cpp index f2f99e9536..0a7197c20c 100644 --- a/src/libxrpl/tx/applySteps.cpp +++ b/src/libxrpl/tx/applySteps.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -102,18 +103,24 @@ makeStageSpan( { span.setAttribute(telemetry::tx_apply_span::attr::stage, stage); if (char const* typeName = txTypeName(tx.getTxnType())) + { span.setAttribute(telemetry::tx_apply_span::attr::txType, typeName); + } // The ledger being worked on — set only by the view-bearing stages // (preclaim/transactor). Preflight is stateless and passes nullopt, so // it carries no ledger attribute (documented exception). if (curLedgerSeq) + { span.setAttribute( telemetry::tx_apply_span::attr::currentLedgerSeq, static_cast(*curLedgerSeq)); - if (curLedgerParentHash) + } + if (curLedgerParentHash != nullptr) + { span.setAttribute( telemetry::tx_apply_span::attr::currentLedgerHash, to_string(*curLedgerParentHash).c_str()); + } } return span; }