xrpld
Loading...
Searching...
No Matches
proposal.h
1#pragma once
2
3#include <test/jtx/Account.h>
4#include <test/jtx/Env.h>
5#include <test/jtx/JTx.h>
6
7#include <xrpl/basics/chrono.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/ledger/helpers/ProposalHelpers.h>
10#include <xrpl/protocol/AccountID.h>
11#include <xrpl/protocol/STLedgerEntry.h>
12
13#include <cstdint>
14#include <optional>
15#include <vector>
16
21
22// The owner-reserve increments a proposal holds against its proposer. Tests
23// spend these rather than repeating their values, so they follow the transactor
24// instead of checking it; TransactionProposalCreate_test pins the values
25// themselves, so a change to them has to be a deliberate one.
28
40json::Value
41create(Account const& proposer, json::Value const& proposedTx, std::uint32_t expiration);
42
50namespace verify {
51
55class Create
56{
57public:
61 void
62 operator()(Env&, JTx&) const;
63};
64
75[[nodiscard]] inline Create
77{
78 return Create{};
79}
80
81} // namespace verify
82
106unsignedPayload(Env const& env, json::Value tx, std::uint32_t ticketSeq);
107
118
137 Env const& env,
138 Account const& target,
139 std::uint32_t ticketSeq,
140 std::uint32_t flags,
141 std::vector<json::Value> const& inners,
142 std::optional<std::uint32_t> numSigners = std::nullopt);
143
158void
159authorizeProposer(Env& env, Account const& target, Account const& proposer);
160
172createTicket(Env& env, Account const& account, std::uint32_t count = 1);
173
181
186[[nodiscard]] SLE::const_pointer
187entry(Env const& env, AccountID const& target, std::uint32_t ticketSeq);
188[[nodiscard]] SLE::const_pointer
189entry(Env const& env, Account const& target, std::uint32_t ticketSeq);
190
191} // namespace xrpl::test::jtx::proposal
Represents a JSON value.
Definition json_value.h:117
std::chrono::duration< rep, period > duration
Definition chrono.h:47
std::shared_ptr< STLedgerEntry const > const_pointer
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
A transaction testing environment.
Definition Env.h:161
The condition returned by create(); see it for what is checked.
Definition proposal.h:56
void operator()(Env &, JTx &) const
Definition proposal.cpp:198
constexpr std::uint32_t kBatchProposalOwnerCount
Owner-reserve increments held by a proposal of a Batch transaction.
constexpr std::uint32_t kProposalOwnerCount
Owner-reserve increments held by a proposal of an ordinary transaction.
Conditions that check what a proposal transaction did to the ledger.
Definition proposal.h:50
Create create()
Check the ledger effects a TransactionProposalCreate must have, whatever its outcome: on tesSUCCESS a...
Definition proposal.h:76
Helpers for constructing TransactionProposal test transactions.
Definition proposal.cpp:37
json::Value innerTx(json::Value tx, std::uint32_t seq)
Put a transaction into the form an inner transaction of a proposed Batch takes, as batch::Inner does ...
Definition proposal.cpp:70
std::uint32_t createTicket(Env &env, Account const &account, std::uint32_t count)
Create tickets for a proposal to be built against, and close the ledger.
Definition proposal.cpp:118
json::Value unsignedPayload(Env const &env, json::Value tx, std::uint32_t ticketSeq)
Put a transaction of any type into the form a proposal stores it in: unsigned and ticket-based,...
Definition proposal.cpp:51
SLE::const_pointer entry(Env const &env, AccountID const &target, std::uint32_t ticketSeq)
The proposal stored against a target account's ticket.
Definition proposal.cpp:135
json::Value create(Account const &proposer, json::Value const &proposedTx, std::uint32_t expiration)
Build a TransactionProposalCreate carrying an unsigned proposed transaction.
Definition proposal.cpp:40
void authorizeProposer(Env &env, Account const &target, Account const &proposer)
Give proposer a place on target's SignerList, so it may create proposals against target.
Definition proposal.cpp:111
json::Value unsignedBatch(Env const &env, Account const &target, std::uint32_t ticketSeq, std::uint32_t flags, std::vector< json::Value > const &inners, std::optional< std::uint32_t > numSigners)
An unsigned outer Batch payload holding inners.
Definition proposal.cpp:76
std::uint32_t expiration(Env &env, NetClock::duration delta)
An absolute expiration delta past the environment's current time.
Definition proposal.cpp:129
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
Execution context for applying a JSON transaction.
Definition JTx.h:27