Skip to content

Commit

Permalink
chore: Add comments to SignerEntries.h (XRPLF#5059)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottschurr authored and vlntb committed Aug 23, 2024
1 parent 3d31879 commit 30e1223
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/xrpld/app/tx/detail/SignerEntries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 16 additions & 3 deletions src/xrpld/app/tx/detail/SignerEntries.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -69,11 +78,15 @@ class SignerEntries
};

// 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
Expand Down

0 comments on commit 30e1223

Please sign in to comment.