xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
ledger
helpers
ProposalHelpers.h
1
#pragma once
2
3
#include <xrpl/beast/utility/Journal.h>
4
#include <xrpl/ledger/ApplyView.h>
5
#include <xrpl/ledger/ReadView.h>
6
#include <xrpl/protocol/SField.h>
7
#include <xrpl/protocol/STLedgerEntry.h>
8
#include <xrpl/protocol/STObject.h>
9
#include <xrpl/protocol/STTx.h>
10
#include <xrpl/protocol/TER.h>
11
#include <xrpl/protocol/TxFormats.h>
12
13
#include <
cstdint
>
14
#include <
optional
>
15
16
namespace
xrpl::proposal
{
17
21
constexpr
std::uint32_t
kProposalOwnerCount
= 5;
22
28
constexpr
std::uint32_t
kBatchProposalOwnerCount
= 10;
29
33
inline
std::uint32_t
34
proposalOwnerCount
(
STObject
const
& proposedTx)
35
{
36
return
proposedTx.
getFieldU16
(sfTransactionType) == ttBATCH ?
kBatchProposalOwnerCount
37
:
kProposalOwnerCount
;
38
}
39
54
bool
55
isValidProposalTxnType
(
STObject
const
& proposedTx);
56
64
inline
bool
65
hasSignatureField
(
STObject
const
& proposedTx)
66
{
67
return
proposedTx.
isFieldPresent
(sfTxnSignature) || proposedTx.
isFieldPresent
(sfSigners) ||
68
proposedTx.
isFieldPresent
(sfBatchSigners) ||
69
proposedTx.
isFieldPresent
(sfCounterpartySignature) ||
70
proposedTx.
isFieldPresent
(sfSponsorSignature);
71
}
72
78
inline
bool
79
hasEmptySigningPubKey
(
STObject
const
& proposedTx)
80
{
81
return
proposedTx.
isFieldPresent
(sfSigningPubKey) &&
82
proposedTx.
getFieldVL
(sfSigningPubKey).
empty
();
83
}
84
103
bool
104
isTerminal
(
105
ReadView
const
& view,
106
std::optional<std::uint32_t>
expiration,
107
STObject
const
& proposedTx);
108
129
TER
130
deleteProposal
(
ApplyView
& view,
SLE::pointer
const
& sleProposal,
beast::Journal
j);
131
155
bool
156
payloadMatches
(
STObject
const
& proposedTx,
STObject
const
& tx);
157
171
bool
172
canConsumeTicket
(
ReadView
const
& view,
STTx
const
& tx);
173
174
}
// namespace xrpl::proposal
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::ApplyView
Writeable view to a ledger, for applying a transaction.
Definition
ApplyView.h:141
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:41
xrpl::STLedgerEntry::pointer
std::shared_ptr< STLedgerEntry > pointer
Definition
STLedgerEntry.h:34
xrpl::STObject
Definition
STObject.h:50
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
xrpl::STTx
Definition
STTx.h:43
cstdint
std::vector::empty
T empty(T... args)
std::uint32_t
xrpl::proposal
Definition
ProposalHelpers.h:16
xrpl::proposal::isTerminal
bool isTerminal(ReadView const &view, std::optional< std::uint32_t > expiration, STObject const &proposedTx)
Whether the proposal is terminal (On-Chain Cosigner spec ยง4.5).
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:87
xrpl::proposal::proposalOwnerCount
std::uint32_t proposalOwnerCount(STObject const &proposedTx)
Owner-reserve increments held by a proposal of the given transaction.
Definition
ProposalHelpers.h:34
xrpl::proposal::hasSignatureField
bool hasSignatureField(STObject const &proposedTx)
Whether the proposed transaction carries any signature field.
Definition
ProposalHelpers.h:65
xrpl::proposal::payloadMatches
bool payloadMatches(STObject const &proposedTx, STObject const &tx)
Whether tx carries the same payload as a proposal's stored ProposedTransaction (On-Chain Cosigner spe...
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:148
xrpl::proposal::canConsumeTicket
bool canConsumeTicket(ReadView const &view, STTx const &tx)
Whether tx may consume its Ticket.
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:174
xrpl::proposal::kBatchProposalOwnerCount
constexpr std::uint32_t kBatchProposalOwnerCount
Owner-reserve increments held by a proposal of a Batch transaction.
Definition
ProposalHelpers.h:28
xrpl::proposal::isValidProposalTxnType
bool isValidProposalTxnType(STObject const &proposedTx)
Whether the proposed transaction is independently submittable through the ordinary multi-sign path: n...
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:44
xrpl::proposal::kProposalOwnerCount
constexpr std::uint32_t kProposalOwnerCount
Owner-reserve increments held by a proposal of an ordinary transaction.
Definition
ProposalHelpers.h:21
xrpl::proposal::deleteProposal
TER deleteProposal(ApplyView &view, SLE::pointer const &sleProposal, beast::Journal j)
Delete a TransactionProposal ledger entry.
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:103
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:79
xrpl::TER
TERSubset< CanCvtToTER > TER
Definition
TER.h:657
optional
Generated by
1.17.0