|
xrpld
|
Helpers for constructing TransactionProposal test transactions. More...
Namespaces | |
| namespace | verify |
| Conditions that check what a proposal transaction did to the ledger. | |
Functions | |
| json::Value | create (Account const &proposer, json::Value const &proposedTx, std::uint32_t expiration) |
| Build a TransactionProposalCreate carrying an unsigned proposed transaction. | |
| 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, with the fee the target account will pay fixed now. | |
| 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 for an ordinary Batch. | |
| 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=std::nullopt) |
An unsigned outer Batch payload holding inners. | |
| 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. | |
| std::uint32_t | createTicket (Env &env, Account const &account, std::uint32_t count=1) |
| Create tickets for a proposal to be built against, and close the ledger. | |
| std::uint32_t | expiration (Env &env, NetClock::duration delta) |
An absolute expiration delta past the environment's current time. | |
| SLE::const_pointer | entry (Env const &env, AccountID const &target, std::uint32_t ticketSeq) |
| The proposal stored against a target account's ticket. | |
| SLE::const_pointer | entry (Env const &env, Account const &target, std::uint32_t ticketSeq) |
Variables | |
| 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. | |
Helpers for constructing TransactionProposal test transactions.
| json::Value xrpl::test::jtx::proposal::create | ( | Account const & | proposer, |
| json::Value const & | proposedTx, | ||
| std::uint32_t | expiration ) |
Build a TransactionProposalCreate carrying an unsigned proposed transaction.
| proposer | The account creating and paying the reserve for the proposal. |
| proposedTx | The proposed transaction, in unsigned canonical form; see unsignedPayload(). |
| expiration | Absolute time after which the proposal may no longer be completed. |
Definition at line 40 of file proposal.cpp.
| json::Value xrpl::test::jtx::proposal::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, with the fee the target account will pay fixed now.
This takes whatever any jtx generator produces — pay(), loan::set(), sponsor::transfer(), an outer Batch — and applies only what the proposal itself demands of the payload, so a test never hand-rolls those fields. It leaves the rest of tx untouched, which is what lets a test build one valid payload and then break exactly one rule of it.
The payload is ticket-based so unrelated activity on the target account cannot invalidate it while signatures are collected. A Fee already set on tx is left alone, so a payload whose fee is not the base fee — a Batch, say — can carry its own; otherwise the fee is filled in the same way as for an ordinary submission.
| env | The test environment providing ledger fee settings. |
| tx | The transaction to propose. |
| ticketSeq | A ticket sequence owned by tx's account. |
Definition at line 51 of file proposal.cpp.
| json::Value xrpl::test::jtx::proposal::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 for an ordinary Batch.
| tx | The transaction to nest. |
| seq | The sequence number of tx's own account. |
Definition at line 70 of file proposal.cpp.
| json::Value xrpl::test::jtx::proposal::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 = std::nullopt ) |
An unsigned outer Batch payload holding inners.
A proposed Batch stores no BatchSigners — the participants' signatures are collected on-ledger afterwards — but its fee is fixed now and must already cover them. By default one signer is assumed for each inner account other than target, which is what those participants will contribute.
| env | The test environment providing ledger fee settings. |
| target | The outer account of the Batch, and the proposal's target. |
| ticketSeq | A ticket sequence owned by target. |
| flags | The Batch mode flags, e.g. tfAllOrNothing. |
| inners | The inner transactions; see innerTx(). |
| numSigners | Overrides the number of signatures the fee accounts for. |
Definition at line 76 of file proposal.cpp.
| void xrpl::test::jtx::proposal::authorizeProposer | ( | Env & | env, |
| Account const & | target, | ||
| Account const & | proposer ) |
Give proposer a place on target's SignerList, so it may create proposals against target.
Only the target account itself, or an account on its SignerList, may create a TransactionProposalCreate against it (On-Chain Cosigner V1 authorization). Sets a minimal one-signer, quorum-1 list; the quorum itself is irrelevant here since it only governs the proposed transaction's own completion, not who may propose it.
| env | The test environment. |
| target | The account whose SignerList is set. |
| proposer | The account to add to it. |
Definition at line 111 of file proposal.cpp.
| std::uint32_t xrpl::test::jtx::proposal::createTicket | ( | Env & | env, |
| Account const & | account, | ||
| std::uint32_t | count = 1 ) |
Create tickets for a proposal to be built against, and close the ledger.
| env | The test environment. |
| account | The account that will own the tickets, i.e. the target of the proposals to come. |
| count | How many tickets to create. |
Definition at line 118 of file proposal.cpp.
| std::uint32_t xrpl::test::jtx::proposal::expiration | ( | Env & | env, |
| NetClock::duration | delta ) |
An absolute expiration delta past the environment's current time.
expiration(env, 0s) is an expiration that has already passed.
Definition at line 129 of file proposal.cpp.
|
nodiscard |
The proposal stored against a target account's ticket.
Definition at line 135 of file proposal.cpp.
|
nodiscard |
Definition at line 141 of file proposal.cpp.
Owner-reserve increments held by a proposal of a Batch transaction.
A proposed Batch stores up to eight inner transactions plus multi-account signatures, so it reserves more than an ordinary proposed transaction.
Definition at line 21 of file ProposalHelpers.h.
Owner-reserve increments held by a proposal of an ordinary transaction.
Definition at line 14 of file ProposalHelpers.h.