xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
ledger
helpers
ProposalHelpers.h
1
#pragma once
2
3
#include <xrpl/protocol/SField.h>
4
#include <xrpl/protocol/STObject.h>
5
#include <xrpl/protocol/TxFormats.h>
6
7
#include <
cstdint
>
8
9
namespace
xrpl::proposal
{
10
14
constexpr
std::uint32_t
kProposalOwnerCount
= 5;
15
21
constexpr
std::uint32_t
kBatchProposalOwnerCount
= 10;
22
26
inline
std::uint32_t
27
proposalOwnerCount
(
STObject
const
& proposedTx)
28
{
29
return
proposedTx.
getFieldU16
(sfTransactionType) == ttBATCH ?
kBatchProposalOwnerCount
30
:
kProposalOwnerCount
;
31
}
32
40
inline
bool
41
isProposalTx
(
STObject
const
& proposedTx)
42
{
43
return
proposedTx.
getFieldU16
(sfTransactionType) == ttTRANSACTION_PROPOSAL_CREATE;
44
}
45
56
bool
57
isValidProposal
(
STObject
const
& proposedTx);
58
66
inline
bool
67
hasSignatureField
(
STObject
const
& proposedTx)
68
{
69
return
proposedTx.
isFieldPresent
(sfTxnSignature) || proposedTx.
isFieldPresent
(sfSigners) ||
70
proposedTx.
isFieldPresent
(sfBatchSigners) ||
71
proposedTx.
isFieldPresent
(sfCounterpartySignature) ||
72
proposedTx.
isFieldPresent
(sfSponsorSignature);
73
}
74
80
inline
bool
81
hasEmptySigningPubKey
(
STObject
const
& proposedTx)
82
{
83
return
proposedTx.
isFieldPresent
(sfSigningPubKey) &&
84
proposedTx.
getFieldVL
(sfSigningPubKey).
empty
();
85
}
86
87
}
// namespace xrpl::proposal
xrpl::STObject
Definition
STObject.h:49
xrpl::STObject::getFieldVL
Blob getFieldVL(SField const &field) const
Definition
STObject.cpp:649
xrpl::STObject::isFieldPresent
bool isFieldPresent(SField const &field) const
Definition
STObject.cpp:464
xrpl::STObject::getFieldU16
std::uint16_t getFieldU16(SField const &field) const
Definition
STObject.cpp:595
cstdint
std::vector::empty
T empty(T... args)
std::uint32_t
xrpl::proposal
Definition
ProposalHelpers.h:9
xrpl::proposal::proposalOwnerCount
std::uint32_t proposalOwnerCount(STObject const &proposedTx)
Owner-reserve increments held by a proposal of the given transaction.
Definition
ProposalHelpers.h:27
xrpl::proposal::hasSignatureField
bool hasSignatureField(STObject const &proposedTx)
Whether the proposed transaction carries any signature field.
Definition
ProposalHelpers.h:67
xrpl::proposal::kBatchProposalOwnerCount
constexpr std::uint32_t kBatchProposalOwnerCount
Owner-reserve increments held by a proposal of a Batch transaction.
Definition
ProposalHelpers.h:21
xrpl::proposal::kProposalOwnerCount
constexpr std::uint32_t kProposalOwnerCount
Owner-reserve increments held by a proposal of an ordinary transaction.
Definition
ProposalHelpers.h:14
xrpl::proposal::isValidProposal
bool isValidProposal(STObject const &proposedTx)
Whether the proposed transaction is independently submittable through the ordinary multi-sign path: n...
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:13
xrpl::proposal::isProposalTx
bool isProposalTx(STObject const &proposedTx)
Whether the proposed transaction is itself a proposal transaction, which would nest one proposal insi...
Definition
ProposalHelpers.h:41
xrpl::proposal::hasEmptySigningPubKey
bool hasEmptySigningPubKey(STObject const &proposedTx)
Whether the proposed transaction's SigningPubKey is present and empty, as unsigned canonical form req...
Definition
ProposalHelpers.h:81
Generated by
1.17.0