chore: Add comments to SignerEntries.h (#5059)

This commit is contained in:
Scott Schurr
2024-07-25 14:12:59 -07:00
committed by tequ
parent d8d55c2397
commit b0c8296dc0
2 changed files with 17 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ Expected<std::vector<SignerEntries::SignerEntry>, NotTEC>
SignerEntries::deserialize(
STObject const& obj,
beast::Journal journal,
std::string const& annotation)
std::string_view annotation)
{
std::pair<std::vector<SignerEntry>, NotTEC> s;

View File

@@ -27,7 +27,9 @@
#include <xrpl/protocol/STTx.h> // STTx::maxMultiSigners
#include <xrpl/protocol/TER.h> // temMALFORMED
#include <xrpl/protocol/UintTypes.h> // AccountID
#include <optional>
#include <string_view>
#include <vector>
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<SignerEntries::SignerEntry>.
// There is no direct constructor for SignerEntries.
//
// o A std::vector<SignerEntries::SignerEntry> 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<std::vector<SignerEntry>, NotTEC>
deserialize(
STObject const& obj,
beast::Journal journal,
std::string const& annotation);
std::string_view annotation);
static std::tuple<
NotTEC,