diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index b21d4f9..bc3d59b 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6708,3 +6708,9 @@ axis clamp, where mixed signed and unsigned conditional expressions selected their common unsigned type. The clamp now applies signed deltas in explicit branches and converts only their nonnegative magnitudes. Full run243 checks are still in progress; the client job failed at this diagnostic before tests ran. + +During run 244, clang-tidy 19 found an unchecked access to the nested optional +in `ActionLedger::find_record`. The function now moves the inner optional to a +local, checks its state, and unwraps only after that check. This is an existing +network-ledger warning exposed by the full network target; full CI is pending +for the combined repairs. diff --git a/src/network/protocol/intent_admission.cpp b/src/network/protocol/intent_admission.cpp index f9d31b8..46e8f9c 100644 --- a/src/network/protocol/intent_admission.cpp +++ b/src/network/protocol/intent_admission.cpp @@ -1,5 +1,6 @@ #include "evo/network/intent_admission.hpp" #include +#include namespace evo::network { namespace { @@ -521,9 +522,10 @@ ActionLedger::find_record(const AccountId& account, std::uint64_t action_id) { auto found = find(account, action_id); if (!found.has_value()) return std::unexpected(found.error()); - if (!found.value()) + auto action = std::move(found).value(); + if (!action.has_value()) return std::optional{}; - return std::optional{DurableActionRecord{*found.value(), std::nullopt}}; + return std::optional{DurableActionRecord{action.value(), std::nullopt}}; } std::expected>, ActionLedgerError>