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

This commit is contained in:
Scott Schurr
2024-07-25 14:12:59 -07:00
committed by GitHub
parent 20707fac4a
commit 21a0a64648
2 changed files with 17 additions and 4 deletions

View File

@@ -30,7 +30,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,18 +27,27 @@
#include <xrpl/protocol/STTx.h> // STTx::maxMultiSigners
#include <xrpl/protocol/TER.h> // temMALFORMED
#include <xrpl/protocol/UintTypes.h> // AccountID
#include <optional>
#include <string_view>
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;
struct SignerEntry
{
@@ -69,11 +78,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);
};
} // namespace ripple