xrpld
Loading...
Searching...
No Matches
InvariantsTransactionProposal_test.cpp
1#include <test/app/invariants/InvariantsBase.h>
2#include <test/jtx/Account.h>
3#include <test/jtx/Env.h>
4#include <test/jtx/amount.h>
5#include <test/jtx/pay.h>
6#include <test/jtx/proposal.h>
7#include <test/jtx/utility.h>
8
9#include <xrpl/beast/unit_test/suite.h>
10#include <xrpl/beast/utility/Zero.h>
11#include <xrpl/ledger/ApplyView.h>
12#include <xrpl/ledger/helpers/ProposalHelpers.h>
13#include <xrpl/protocol/AccountID.h>
14#include <xrpl/protocol/Indexes.h>
15#include <xrpl/protocol/Keylet.h>
16#include <xrpl/protocol/Protocol.h>
17#include <xrpl/protocol/SField.h>
18#include <xrpl/protocol/STArray.h>
19#include <xrpl/protocol/STLedgerEntry.h>
20#include <xrpl/protocol/STObject.h>
21#include <xrpl/protocol/STTx.h>
22#include <xrpl/protocol/SeqProxy.h>
23#include <xrpl/protocol/TER.h>
24#include <xrpl/protocol/TxFormats.h>
25#include <xrpl/protocol/XRPAmount.h>
26#include <xrpl/tx/ApplyContext.h>
27
28#include <algorithm>
29#include <array>
30#include <cstddef>
31#include <cstdint>
32#include <initializer_list>
33#include <memory>
34#include <optional>
35#include <source_location>
36#include <string>
37#include <utility>
38#include <vector>
39
40namespace xrpl::test {
41
43{
44 void
46 {
47 using namespace jtx;
48 using namespace std::chrono_literals;
49
50 // Submits a real proposal, so the entry is in the closed ledger before
51 // the precheck runs and the precheck can modify it.
52 std::optional<Keylet> liveProposalKeylet;
53 std::optional<std::uint32_t> liveTicketSeq;
54 Preclose const precloseLiveProposal =
55 [&](Account const& owner, Account const& destination, Env& env) {
56 auto const ticketSeq = proposal::createTicket(env, owner);
57 auto const proposedTx =
58 proposal::unsignedPayload(env, pay(owner, destination, XRP(1)), ticketSeq);
59 liveProposalKeylet = keylet::txProposal(owner.id(), ticketSeq);
60 liveTicketSeq = ticketSeq;
61 env(proposal::create(owner, proposedTx, proposal::expiration(env, 100s)));
62 return BEAST_EXPECT(env.le(*liveProposalKeylet));
63 };
64
65 auto peekLiveProposal = [&](ApplyContext& ac) -> SLE::pointer {
66 if (!liveProposalKeylet)
67 return nullptr;
68 return ac.view().peek(*liveProposalKeylet);
69 };
70
71 // Deletes the live proposal as deleteProposal would: out of the
72 // owner's directory, with the owner's reserve released.
73 auto deleteLiveProposal = [&](Account const& owner, ApplyContext& ac) {
74 auto const sle = peekLiveProposal(ac);
75 if (!sle)
76 return false;
77 auto const account = ac.view().peek(keylet::account(owner.id()));
78 if (!account)
79 return false;
80 account->at(sfOwnerCount) -=
81 xrpl::proposal::proposalOwnerCount(sle->getFieldObject(sfProposedTransaction));
82 ac.view().update(account);
83 if (!ac.view().dirRemove(
84 keylet::ownerDir(owner.id()), sle->getFieldU64(sfOwnerNode), sle->key(), false))
85 return false;
86 ac.view().erase(sle);
87 return true;
88 };
89
90 // Consumes one of the owner's Tickets as ticketDelete would.
91 auto deleteTicket = [&](Account const& owner, std::uint32_t ticketSeq, ApplyContext& ac) {
92 auto const ticket =
93 ac.view().peek(keylet::ticket(owner.id(), SeqProxy::rawTicket(ticketSeq)));
94 auto const account = ac.view().peek(keylet::account(owner.id()));
95 if (!ticket || !account)
96 return false;
97 if (!ac.view().dirRemove(
98 keylet::ownerDir(owner.id()),
99 ticket->getFieldU64(sfOwnerNode),
100 ticket->key(),
101 false))
102 return false;
103 if (auto const ticketCount = account->getFieldU32(sfTicketCount); ticketCount > 1)
104 {
105 account->setFieldU32(sfTicketCount, ticketCount - 1);
106 }
107 else
108 {
109 account->makeFieldAbsent(sfTicketCount);
110 }
111 account->at(sfOwnerCount) -= 1;
112 ac.view().update(account);
113 ac.view().erase(ticket);
114 return true;
115 };
116
117 // A transaction outside the whitelist may not modify a proposal at
118 // all; the invariant rejects it on the count, whatever field changed.
119 testcase("TransactionProposal modified outside the whitelist");
121 {{"TransactionProposal changes do not match transaction result"}},
122 [&](Account const&, Account const&, ApplyContext& ac) {
123 auto const sle = peekLiveProposal(ac);
124 if (!sle)
125 return false;
126 auto proposedTx = sle->getFieldObject(sfProposedTransaction);
127 proposedTx.setFieldU32(
128 sfTicketSequence, proposedTx.getFieldU32(sfTicketSequence) + 1);
129 sle->setFieldObject(sfProposedTransaction, proposedTx);
130 ac.view().update(sle);
131 return true;
132 },
133 XRPAmount{},
134 STTx{ttACCOUNT_SET, [](STObject&) {}},
136 precloseLiveProposal);
137
138 // Only stages the payload and the key it would live under; nothing
139 // reaches the ledger, so a precheck that inserts the entry by hand
140 // presents the invariant with a creation.
141 std::optional<STObject> stagedPayload;
142 std::optional<Keylet> stagedProposalKeylet;
143 Preclose const precloseStagedPayload =
144 [&](Account const& owner, Account const& destination, Env& env) {
145 auto const ticketSeq = proposal::createTicket(env, owner);
146 auto const proposedJson =
147 proposal::unsignedPayload(env, pay(owner, destination, XRP(1)), ticketSeq);
148 stagedPayload.emplace(parse(proposedJson));
149 stagedProposalKeylet = keylet::txProposal(owner.id(), ticketSeq);
150 return true;
151 };
152
153 // Inserts the staged proposal as doApply would, with the owner's
154 // reserve charged.
155 auto insertStagedProposal = [&](Account const& owner, ApplyContext& ac) {
156 if (!stagedPayload || !stagedProposalKeylet)
157 return false;
158
159 auto const sle = std::make_shared<SLE>(*stagedProposalKeylet);
160 sle->setAccountID(sfOwner, owner.id());
161 sle->setFieldObject(sfProposedTransaction, *stagedPayload);
162 sle->setFieldU32(sfExpiration, 1);
163 sle->setFieldU64(sfOwnerNode, 0);
164 ac.view().insert(sle);
165
166 auto const account = ac.view().peek(keylet::account(owner.id()));
167 if (!account)
168 return false;
169 account->at(sfOwnerCount) += xrpl::proposal::proposalOwnerCount(*stagedPayload);
170 ac.view().update(account);
171 return true;
172 };
173
174 testcase("TransactionProposal effect whitelist");
176 {{"TransactionProposal changes do not match transaction result"}},
177 [&](Account const& owner, Account const&, ApplyContext& ac) {
178 return insertStagedProposal(owner, ac);
179 },
180 XRPAmount{},
181 STTx{ttACCOUNT_SET, [](STObject&) {}},
183 precloseStagedPayload);
184
185 // The harness runs no transactor, so a failed result has to be fed in
186 // directly. A failed create must leave no trace.
187 testcase("TransactionProposal failed create still inserts");
189 {{"TransactionProposal changes do not match transaction result"}},
190 [&](Account const& owner, Account const&, ApplyContext& ac) {
191 return insertStagedProposal(owner, ac);
192 },
193 XRPAmount{},
194 STTx{ttTRANSACTION_PROPOSAL_CREATE, [](STObject&) {}},
196 precloseStagedPayload,
200
201 // Reassigns the live proposal's reserve to a sponsor as a
202 // SponsorshipTransfer would. The sponsored and sponsoring counts move
203 // with it so that SponsorshipOwnerCountsMatch stays quiet.
204 auto const reassignLiveProposal =
205 [&](Account const& owner, Account const& sponsor, ApplyContext& ac) {
206 auto const sle = peekLiveProposal(ac);
207 if (!sle)
208 return false;
209 auto const reserve =
210 xrpl::proposal::proposalOwnerCount(sle->getFieldObject(sfProposedTransaction));
211 sle->setAccountID(sfSponsor, sponsor.id());
212 ac.view().update(sle);
213
214 auto const account = ac.view().peek(keylet::account(owner.id()));
215 auto const sponsorRoot = ac.view().peek(keylet::account(sponsor.id()));
216 if (!account || !sponsorRoot)
217 return false;
218 account->at(sfSponsoredOwnerCount) += reserve;
219 ac.view().update(account);
220 sponsorRoot->at(sfSponsoringOwnerCount) += reserve;
221 ac.view().update(sponsorRoot);
222 return true;
223 };
224
225 // A failed transfer must not have reassigned anything. The counters are
226 // kept consistent so only the result mismatch is left to catch.
227 testcase("TransactionProposal failed sponsorship transfer still reassigns");
229 {{"TransactionProposal changes do not match transaction result"}},
230 reassignLiveProposal,
231 XRPAmount{},
232 STTx{ttSPONSORSHIP_TRANSFER, [](STObject&) {}},
234 precloseLiveProposal,
238
239 // A proposal leaves the ledger only through TransactionProposalCancel
240 // or together with the Ticket it is keyed to. The harness runs no
241 // transactor, so each deletion below is staged by hand, releasing the
242 // reserve as a real one would, to leave the deletion itself as the
243 // only possible violation.
244 testcase("TransactionProposal deletion outside the whitelist");
246 {{"TransactionProposal changes do not match transaction result"}},
247 [&](Account const& owner, Account const&, ApplyContext& ac) {
248 return deleteLiveProposal(owner, ac);
249 },
250 XRPAmount{},
251 STTx{ttACCOUNT_SET, [](STObject&) {}},
253 precloseLiveProposal);
254
255 // The owner holds a second Ticket, one no proposal is keyed to.
256 std::optional<std::uint32_t> spareTicketSeq;
257 Preclose const precloseLiveProposalAndSpareTicket =
258 [&](Account const& owner, Account const& destination, Env& env) {
259 spareTicketSeq = proposal::createTicket(env, owner);
260 return precloseLiveProposal(owner, destination, env);
261 };
262
263 // Consuming some other Ticket of the owner's is no reason for the
264 // proposal to go.
265 testcase("TransactionProposal deleted with an unrelated ticket");
267 {{"TransactionProposal changes do not match transaction result"}},
268 [&](Account const& owner, Account const&, ApplyContext& ac) {
269 return spareTicketSeq && deleteTicket(owner, *spareTicketSeq, ac) &&
270 deleteLiveProposal(owner, ac);
271 },
272 XRPAmount{},
273 STTx{ttACCOUNT_SET, [](STObject&) {}},
275 precloseLiveProposalAndSpareTicket);
276
277 // And a deleted Ticket takes the proposal keyed to it along: here the
278 // Ticket went and the proposal stayed behind.
279 testcase("TransactionProposal outlives its ticket");
281 {{"TransactionProposal outlived the Ticket it is keyed to"}},
282 [&](Account const& owner, Account const&, ApplyContext& ac) {
283 return liveTicketSeq && deleteTicket(owner, *liveTicketSeq, ac);
284 },
285 XRPAmount{},
286 STTx{ttACCOUNT_SET, [](STObject&) {}},
288 precloseLiveProposal);
289
290 // A Cancel names the live proposal and may pay with the owner's spare
291 // Ticket. Both exist only once the preclose has run, so the Env is
292 // built here rather than by the harness.
293 struct CancelOptions
294 {
295 // The Cancel pays with A1's spare Ticket.
296 bool paySpareTicket = false;
297 TER initialResult = tesSUCCESS;
298 };
299 auto const checkCancel = [&](std::vector<std::string> const& expectLogs,
300 Precheck const& precheck,
302 Preclose const& preclose,
303 CancelOptions const& options = CancelOptions(),
304 std::source_location const& loc =
306 Account const a1{"A1"};
307 Account const a2{"A2"};
309 env.fund(XRP(1000), a1, a2);
310 if (!BEAST_EXPECT(preclose(a1, a2, env)) || !BEAST_EXPECT(liveProposalKeylet))
311 return;
312 env.close();
313
314 STTx const tx{ttTRANSACTION_PROPOSAL_CANCEL, [&](STObject& obj) {
315 obj.setAccountID(sfAccount, a1.id());
316 obj.setFieldH256(sfProposalID, liveProposalKeylet->key);
317 if (options.paySpareTicket && spareTicketSeq)
318 {
319 obj.setFieldU32(sfSequence, 0);
320 obj.setFieldU32(sfTicketSequence, *spareTicketSeq);
321 }
322 }};
324 std::move(env),
325 a1,
326 a2,
327 expectLogs,
328 precheck,
329 XRPAmount{},
330 tx,
331 ters,
332 loc,
333 options.initialResult);
334 };
335
336 auto const cancelDeletesLiveProposal =
337 [&](Account const& owner, Account const&, ApplyContext& ac) {
338 return deleteLiveProposal(owner, ac);
339 };
340
341 // A Cancel that did not succeed deleted nothing.
342 testcase("TransactionProposal failed cancel still deletes");
343 {
344 CancelOptions options;
345 options.initialResult = tecNO_PERMISSION;
346 checkCancel(
347 {{"TransactionProposal changes do not match transaction result"}},
348 cancelDeletesLiveProposal,
350 precloseLiveProposal,
351 options);
352 }
353
354 // A Cancel cannot spend a reserved Ticket, so the proposal it deletes
355 // never goes with its Ticket.
356 testcase("TransactionProposal cancel consumes the reserved ticket");
357 checkCancel(
358 {{"TransactionProposal changes do not match transaction result"}},
359 [&](Account const& owner, Account const&, ApplyContext& ac) {
360 return liveTicketSeq && deleteTicket(owner, *liveTicketSeq, ac) &&
361 deleteLiveProposal(owner, ac);
362 },
364 precloseLiveProposal);
365
366 // Distinct AccountIDs in ascending order, so an array built from them
367 // violates only the bound on its length.
368 auto ascendingAccounts = [](std::size_t count) {
369 std::vector<AccountID> accounts;
370 accounts.reserve(count);
371 for (std::size_t i = 0; i < count; ++i)
372 {
373 AccountID account{beast::kZero};
374 account.data()[0] = static_cast<std::uint8_t>(i + 1);
375 accounts.push_back(account);
376 }
377 return accounts;
378 };
379
380 auto signerArray = [](std::vector<AccountID> const& accounts) {
381 STArray signers{sfSigners};
382 for (auto const& account : accounts)
383 {
384 STObject signer{sfSigner};
385 signer.setAccountID(sfAccount, account);
386 signers.pushBack(signer);
387 }
388 return signers;
389 };
390
391 // No transaction type on this amendment branch collects signatures yet,
392 // so every rejection below has to be provoked by editing the stored
393 // payload directly.
394 auto const testBrokenSignerArray = [&](std::string const& name, auto const& breakPayload) {
395 testcase("TransactionProposal canonical signer arrays: " + name);
397 {{"TransactionProposal signer arrays are not canonical"}},
398 [&](Account const&, Account const& signerAccount, ApplyContext& ac) {
399 auto const sle = peekLiveProposal(ac);
400 if (!sle)
401 return false;
402 auto proposedTx = sle->getFieldObject(sfProposedTransaction);
403 breakPayload(proposedTx, signerAccount);
404 sle->setFieldObject(sfProposedTransaction, proposedTx);
405 ac.view().update(sle);
406 return true;
407 },
408 XRPAmount{},
409 STTx{ttACCOUNT_SET, [](STObject&) {}},
411 precloseLiveProposal);
412 };
413
414 testBrokenSignerArray("duplicate entries", [&](STObject& tx, Account const& signer) {
415 tx.setFieldArray(sfSigners, signerArray({signer.id(), signer.id()}));
416 });
417
418 testBrokenSignerArray("descending order", [&](STObject& tx, Account const&) {
419 auto accounts = ascendingAccounts(2);
420 std::ranges::reverse(accounts);
421 tx.setFieldArray(sfSigners, signerArray(accounts));
422 });
423
424 testBrokenSignerArray("past the multi-sign limit", [&](STObject& tx, Account const&) {
425 tx.setFieldArray(sfSigners, signerArray(ascendingAccounts(STTx::kMaxMultiSigners + 1)));
426 });
427
428 testBrokenSignerArray("entry without an Account", [](STObject& tx, Account const&) {
429 STArray signers{sfSigners};
430 signers.pushBack(STObject{sfSigner});
431 tx.setFieldArray(sfSigners, signers);
432 });
433
434 for (auto const* field :
435 std::array<SField const*, 2>{&sfCounterpartySignature, &sfSponsorSignature})
436 {
437 testBrokenSignerArray(
438 "duplicates under " + field->getName(), [&](STObject& tx, Account const& signer) {
439 STObject signature{*field};
440 signature.setFieldArray(sfSigners, signerArray({signer.id(), signer.id()}));
441 tx.setFieldObject(*field, signature);
442 });
443 }
444
445 testBrokenSignerArray("past the batch-signer limit", [&](STObject& tx, Account const&) {
446 STArray batchSigners{sfBatchSigners};
447 for (auto const& account : ascendingAccounts(kMaxBatchSigners + 1))
448 {
449 STObject batchSigner{sfBatchSigner};
450 batchSigner.setAccountID(sfAccount, account);
451 batchSigners.pushBack(batchSigner);
452 }
453 tx.setFieldArray(sfBatchSigners, batchSigners);
454 });
455
456 testBrokenSignerArray(
457 "duplicates under a BatchSigner", [&](STObject& tx, Account const& signer) {
458 STObject batchSigner{sfBatchSigner};
459 batchSigner.setAccountID(sfAccount, signer.id());
460 batchSigner.setFieldArray(sfSigners, signerArray({signer.id(), signer.id()}));
461
462 STArray batchSigners{sfBatchSigners};
463 batchSigners.pushBack(batchSigner);
464 tx.setFieldArray(sfBatchSigners, batchSigners);
465 });
466
467 // Negative controls. These share the setup of the failure cases above,
468 // so they confirm each of those failures came from the defect it names
469 // rather than from the hand-built ledger state.
470 std::initializer_list<TER> const passTers = {tesSUCCESS, tesSUCCESS};
471
472 testcase("TransactionProposal well-formed create");
474 {},
475 [&](Account const& owner, Account const&, ApplyContext& ac) {
476 return insertStagedProposal(owner, ac);
477 },
478 XRPAmount{},
479 STTx{ttTRANSACTION_PROPOSAL_CREATE, [](STObject&) {}},
480 passTers,
481 precloseStagedPayload);
482
483 testcase("TransactionProposal left untouched");
485 {},
486 [&](Account const&, Account const&, ApplyContext& ac) {
487 return liveProposalKeylet && ac.view().read(*liveProposalKeylet) != nullptr;
488 },
489 XRPAmount{},
490 STTx{ttACCOUNT_SET, [](STObject&) {}},
491 passTers,
492 precloseLiveProposal);
493
494 // A Cancel deletes the proposal it names.
495 testcase("TransactionProposal cancelled");
496 checkCancel({}, cancelDeletesLiveProposal, passTers, precloseLiveProposal);
497
498 // The Ticket a Cancel pays with is not the one its proposal is keyed
499 // to, so the proposal did not go with its Ticket.
500 testcase("TransactionProposal cancel paid with the canceller's own ticket");
501 {
502 CancelOptions options;
503 options.paySpareTicket = true;
504 checkCancel(
505 {},
506 [&](Account const& owner, Account const&, ApplyContext& ac) {
507 return spareTicketSeq && deleteTicket(owner, *spareTicketSeq, ac) &&
508 deleteLiveProposal(owner, ac);
509 },
510 passTers,
511 precloseLiveProposalAndSpareTicket,
512 options);
513 }
514
515 // A SponsorshipTransfer reassigns the Sponsor.
516 testcase("TransactionProposal sponsor reassigned");
518 {},
519 reassignLiveProposal,
520 XRPAmount{},
521 STTx{ttSPONSORSHIP_TRANSFER, [](STObject&) {}},
522 passTers,
523 precloseLiveProposal);
524
525 // The proposed transaction executing spends the proposal's Ticket and
526 // takes the proposal with it.
527 testcase("TransactionProposal deleted with its ticket");
529 {},
530 [&](Account const& owner, Account const&, ApplyContext& ac) {
531 return liveTicketSeq && deleteTicket(owner, *liveTicketSeq, ac) &&
532 deleteLiveProposal(owner, ac);
533 },
534 XRPAmount{},
535 STTx{ttACCOUNT_SET, [](STObject&) {}},
536 passTers,
537 precloseLiveProposal);
538 }
539
540 void
541 run() override
542 {
544 }
545};
546
547BEAST_DEFINE_TESTSUITE(InvariantsTransactionProposal, app, xrpl);
548
549} // namespace xrpl::test
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
State information when applying a tx.
void pushBack(STObject const &object)
Definition STArray.h:212
std::shared_ptr< STLedgerEntry > pointer
void setFieldArray(SField const &field, STArray const &v)
Definition STObject.cpp:833
void setFieldObject(SField const &field, STObject const &v)
Definition STObject.cpp:839
void setAccountID(SField const &field, AccountID const &)
Definition STObject.cpp:785
static constexpr std::size_t kMaxMultiSigners
Definition STTx.h:49
static constexpr SeqProxy rawTicket(std::uint32_t v)
Factory function to return a ticket-based SeqProxy.
Definition SeqProxy.h:74
std::function< bool(test::jtx::Account const &a, test::jtx::Account const &b, ApplyContext &ac)> Precheck
test::jtx::Env makeEnv(FeatureBitset features)
void doInvariantCheck(std::vector< std::string > const &expectLogs, Precheck const &precheck, XRPAmount fee=XRPAmount{}, STTx tx=STTx{ttACCOUNT_SET, [](STObject &) {}}, std::initializer_list< TER > ters={tecINVARIANT_FAILED, tefINVARIANT_FAILED}, Preclose const &preclose={}, TxAccount setTxAccount=TxAccount::None, std::source_location const &loc=std::source_location::current(), TER initialResult=tesSUCCESS)
Run a specific test case to put the ledger into a state that will be detected by an invariant.
std::function< bool(test::jtx::Account const &a, test::jtx::Account const &b, test::jtx::Env &env)> Preclose
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
AccountID id() const
Returns the Account ID.
A transaction testing environment.
Definition Env.h:161
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition Env.cpp:133
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition Env.cpp:323
T current(T... args)
T make_shared(T... args)
constexpr Zero kZero
Definition Zero.h:30
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:415
Keylet txProposal(AccountID const &target, std::uint32_t ticketSequence) noexcept
A TransactionProposal.
Definition Indexes.cpp:378
Keylet ticket(AccountID const &id, SeqProxy const &ticketSeq)
A ticket belonging to an account.
Definition Indexes.cpp:344
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:233
std::uint32_t proposalOwnerCount(STObject const &proposedTx)
Owner-reserve increments held by a proposal of the given transaction.
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:128
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:61
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
std::uint32_t expiration(Env &env, NetClock::duration delta)
An absolute expiration delta past the environment's current time.
Definition proposal.cpp:139
Ticket operations.
Definition ticket.cpp:13
json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:14
XrpT const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
FeatureBitset testableAmendments()
Definition Env.h:92
json::Value signers(Account const &account, std::uint32_t quorum, std::vector< Signer > const &v)
Definition multisign.cpp:31
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
constexpr XRPAmount
Convert XRP to drops (integral types).
Definition TxTest.h:53
static XRPAmount reserve(jtx::Env const &env, std::uint32_t count)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
constexpr std::size_t kMaxBatchSigners
The maximum number of batch signers.
Definition Protocol.h:487
@ tefINVARIANT_FAILED
Definition TER.h:177
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
TERSubset< CanCvtToTER > TER
Definition TER.h:657
@ tecINVARIANT_FAILED
Definition TER.h:324
@ tecNO_PERMISSION
Definition TER.h:316
@ tesSUCCESS
Definition TER.h:253
T parse(T... args)
T push_back(T... args)
T reserve(T... args)
T reverse(T... args)