From b0c8296dc00d40d3d1cf4f4724785476fda0f2dc Mon Sep 17 00:00:00 2001 From: Scott Schurr Date: Thu, 25 Jul 2024 14:12:59 -0700 Subject: [PATCH] chore: Add comments to SignerEntries.h (#5059) --- src/xrpld/app/tx/detail/SignerEntries.cpp | 2 +- src/xrpld/app/tx/detail/SignerEntries.h | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/xrpld/app/tx/detail/SignerEntries.cpp b/src/xrpld/app/tx/detail/SignerEntries.cpp index f29dd77b1..3efaa1deb 100644 --- a/src/xrpld/app/tx/detail/SignerEntries.cpp +++ b/src/xrpld/app/tx/detail/SignerEntries.cpp @@ -32,7 +32,7 @@ Expected, NotTEC> SignerEntries::deserialize( STObject const& obj, beast::Journal journal, - std::string const& annotation) + std::string_view annotation) { std::pair, NotTEC> s; diff --git a/src/xrpld/app/tx/detail/SignerEntries.h b/src/xrpld/app/tx/detail/SignerEntries.h index e10579ad6..eb11cbaa2 100644 --- a/src/xrpld/app/tx/detail/SignerEntries.h +++ b/src/xrpld/app/tx/detail/SignerEntries.h @@ -27,7 +27,9 @@ #include // STTx::maxMultiSigners #include // temMALFORMED #include // AccountID + #include +#include #include namespace ripple { @@ -35,11 +37,18 @@ namespace ripple { // Forward declarations class STObject; -// Support for SignerEntries that is needed by a few Transactors +// Support for SignerEntries that is needed by a few Transactors. +// +// SignerEntries is represented as a std::vector. +// There is no direct constructor for SignerEntries. +// +// o A std::vector is a SignerEntries. +// o More commonly, SignerEntries are extracted from an STObject by +// calling SignerEntries::deserialize(). class SignerEntries { public: - explicit SignerEntries() = default; + explicit SignerEntries() = delete; // Values determined during preCompute for use later. enum Operation { unknown, set, destroy }; Operation do_{unknown}; @@ -73,11 +82,15 @@ public: }; // Deserialize a SignerEntries array from the network or from the ledger. + // + // obj Contains a SignerEntries field that is an STArray. + // journal For reporting error conditions. + // annotation Source of SignerEntries, like "ledger" or "transaction". static Expected, NotTEC> deserialize( STObject const& obj, beast::Journal journal, - std::string const& annotation); + std::string_view annotation); static std::tuple< NotTEC,