Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add comments to SignerEntries.h #5059

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading