xrpld
Loading...
Searching...
No Matches
mpt.h
1#pragma once
2
3#include <test/jtx/Account.h>
4#include <test/jtx/Env.h>
5#include <test/jtx/delegate.h>
6#include <test/jtx/owners.h>
7#include <test/jtx/tag.h>
8#include <test/jtx/ter.h>
9#include <test/jtx/ticket.h>
10#include <test/jtx/txflags.h>
11
12#include <xrpl/protocol/ConfidentialTransfer.h>
13#include <xrpl/protocol/TxFlags.h>
14#include <xrpl/protocol/UintTypes.h>
15#include <xrpl/protocol/XRPAmount.h>
16
17#include <cstddef>
18#include <cstdint>
19#include <cstring>
20
21namespace xrpl::test::jtx {
22
23class MPTTester;
24
25auto const kMptDexFlags = tfMPTCanTrade | tfMPTCanTransfer;
26
39[[nodiscard]] inline Buffer
41{
42 Buffer b(size);
43 if (size > 0)
44 std::memset(b.data(), 0, size);
45 return b;
46}
47
50{
51private:
55
56public:
58 MPTTester& tester,
59 std::uint32_t flags,
60 std::optional<Account> const& holder = std::nullopt)
61 : tester_(tester), flags_(flags), holder_(holder)
62 {
63 }
64
65 void
66 operator()(Env& env) const;
67};
68
71{
72private:
76
77public:
78 MptBalance(MPTTester& tester, Account const& account, std::int64_t amount)
79 : tester_(tester), account_(account), amount_(amount)
80 {
81 }
82
83 void
84 operator()(Env& env) const;
85};
86
89{
90private:
92
93public:
94 RequireAny(std::function<bool()> const& cb) : cb_(cb)
95 {
96 }
97
98 void
99 operator()(Env& env) const;
100};
101
103
106{
115 // authorize if seated.
116 // if empty vector then authorize all holders
118 // pay if seated. if authorize is not seated then authorize.
119 // if empty vector then pay to either authorize or all holders.
123 bool authHolder = false;
125 std::optional<TER> err = std::nullopt;
126};
127
130{
131 // Default-initialized so designated-initializer call sites that omit
132 // `holders` don't trip GCC's -Werror=missing-field-initializers.
133 Holders holders = {}; // NOLINT(readability-redundant-member-init)
135 PrettyAmount const xrp = XRP(10'000);
136 PrettyAmount const xrpHolders = XRP(10'000);
137 bool fund = true;
138 bool close = true;
139 // create MPTIssuanceID if seated and follow rules for MPTCreate args
141};
142static MPTInit const kMptInitNoFund{.fund = false};
143
146{
149 Holders holders = {}; // NOLINT(readability-redundant-member-init)
155 bool authHolder = false;
156 bool fund = false;
157 bool close = true;
159 std::optional<TER> err = std::nullopt;
160};
161
172
184
204
207{
209 std::optional<MPTID> id = std::nullopt;
213 // indicates whether to autofill schnorr proof.
214 // default : auto generate proof if holderPubKey is present.
215 // true: force proof generation.
216 // false: force proof omission.
222
230 std::optional<TER> err = std::nullopt;
231};
232
246
275
298
315
321{
324
326 uint64_t const amt;
327
330
333};
334
357
374 std::uint64_t currentSpending,
375 Slice const& currentEncSpending,
376 std::uint32_t currentVersion,
377 std::uint64_t sendAmt,
378 Slice const& senderEncAmt);
379
385{
391 bool close_;
394
395public:
402
407
408 MPTTester(Env& env, Account issuer, MPTInit const& constr = {});
409 MPTTester(MPTInitDef const& constr);
410 MPTTester(
411 Env& env,
413 MPTID const& id,
414 std::vector<Account> const& holders = {},
415 bool close = true);
416 operator MPT() const;
417
418 void
419 create(MPTCreate const& arg = MPTCreate{});
420
421 static json::Value
422 createJV(MPTCreate const& arg = MPTCreate{});
423
424 void
425 destroy(MPTDestroy const& arg = MPTDestroy{});
426
427 static json::Value
428 destroyJV(MPTDestroy const& arg = MPTDestroy{});
429
430 void
431 authorize(MPTAuthorize const& arg = MPTAuthorize{});
432
433 static json::Value
434 authorizeJV(MPTAuthorize const& arg = MPTAuthorize{});
435
436 void
437 authorizeHolders(Holders const& holders);
438
439 void
440 set(MPTSet const& set = {});
441
442 static json::Value
443 setJV(MPTSet const& set = {});
444
445 void
446 convert(MPTConvert const& arg = MPTConvert{});
447
456 json::Value
457 convertJV(MPTConvert const& arg, std::uint32_t seq);
458
459 void
460 mergeInbox(MPTMergeInbox const& arg = MPTMergeInbox{});
461
462 [[nodiscard]] json::Value
463 mergeInboxJV(MPTMergeInbox const& arg = MPTMergeInbox{}) const;
464
465 void
466 send(MPTConfidentialSend const& arg = MPTConfidentialSend{});
467
481 json::Value
482 sendJV(
483 MPTConfidentialSend const& arg,
484 std::uint32_t seq,
485 std::optional<ConfidentialSendChainState> chain = std::nullopt);
486
500 [[nodiscard]] ConfidentialSendChainState
501 chainAfterSend(Account const& sender, std::uint64_t sendAmt, json::Value const& jv) const;
502
503 void
504 convertBack(MPTConvertBack const& arg = MPTConvertBack{});
505
516 json::Value
517 convertBackJV(MPTConvertBack const& arg, std::uint32_t seq);
518
519 void
520 confidentialClaw(MPTConfidentialClawback const& arg = MPTConfidentialClawback{});
521
522 [[nodiscard]] bool
523 checkDomainID(std::optional<uint256> expected) const;
524
525 [[nodiscard]] bool
526 checkMPTokenAmount(Account const& holder, std::int64_t expectedAmount) const;
527
528 [[nodiscard]] bool
529 checkMPTokenOutstandingAmount(std::int64_t expectedAmount) const;
530
531 [[nodiscard]] bool
532 checkIssuanceConfidentialBalance(std::int64_t expectedAmount) const;
533
534 [[nodiscard]] bool
535 checkFlags(uint32_t const expectedFlags, std::optional<Account> const& holder = std::nullopt)
536 const;
537
538 [[nodiscard]] bool
539 checkMetadata(std::string const& metadata) const;
540
541 [[nodiscard]] bool
542 isMetadataPresent() const;
543
544 [[nodiscard]] bool
545 checkTransferFee(std::uint16_t transferFee) const;
546
547 [[nodiscard]] bool
548 isTransferFeePresent() const;
549
550 [[nodiscard]] Account const&
551 issuer() const
552 {
553 return issuer_;
554 }
555 [[nodiscard]] Account const&
556 holder(std::string const& h) const;
557
558 void
559 pay(Account const& src,
560 Account const& dest,
561 std::int64_t amount,
562 std::optional<TER> err = std::nullopt,
564
565 void
566 claw(
567 Account const& issuer,
568 Account const& holder,
569 std::int64_t amount,
570 std::optional<TER> err = std::nullopt);
571
572 [[nodiscard]] PrettyAmount
573 mpt(std::int64_t amount) const;
574
575 [[nodiscard]] MPTID const&
577 {
578 if (!env_.test.BEAST_EXPECT(id_))
579 Throw<std::logic_error>("Uninitialized issuanceID");
580 return *id_; // NOLINT(bugprone-unchecked-optional-access)
581 }
582
583 [[nodiscard]] std::int64_t
584 getBalance(Account const& account) const;
585
586 [[nodiscard]] std::int64_t
588
589 [[nodiscard]] std::optional<Buffer>
591 const;
592
593 MPT
594 operator[](std::string const& name) const;
595
597 operator()(std::int64_t amount) const;
598
599 operator Asset() const;
600
601 void
602 generateKeyPair(Account const& account);
603
604 [[nodiscard]] std::optional<Buffer>
605 getPubKey(Account const& account) const;
606
607 [[nodiscard]] std::optional<Buffer>
608 getPrivKey(Account const& account) const;
609
610 [[nodiscard]] Buffer
611 encryptAmount(Account const& account, uint64_t const amt, Buffer const& blindingFactor) const;
612
613 [[nodiscard]] std::optional<uint64_t>
614 decryptAmount(Account const& account, Buffer const& amt) const;
615
616 [[nodiscard]] std::optional<uint64_t>
617 getDecryptedBalance(Account const& account, EncryptedBalanceType balanceType) const;
618
619 [[nodiscard]] std::optional<std::int64_t>
621
622 [[nodiscard]] std::optional<Buffer>
624 Account const& holder,
625 std::uint64_t amount,
626 Buffer const& privateKey,
627 uint256 const& txHash) const;
628
629 [[nodiscard]] std::optional<Buffer>
630 getSchnorrProof(Account const& account, uint256 const& ctxHash) const;
631
632 [[nodiscard]] std::optional<Buffer>
634 Account const& sender,
635 std::uint64_t const amount,
636 std::vector<ConfidentialRecipient> const& recipients,
637 Slice const& blindingFactor,
638 uint256 const& contextHash,
639 PedersenProofParams const& amountParams,
640 PedersenProofParams const& balanceParams) const;
641
642 [[nodiscard]] Buffer
644 Account const& holder,
645 std::uint64_t const amount,
646 uint256 const& contextHash,
647 PedersenProofParams const& pcParams) const;
648
649 [[nodiscard]] std::uint32_t
650 getMPTokenVersion(Account const account) const;
651
652 static Buffer
653 getPedersenCommitment(std::uint64_t const amount, Buffer const& pedersenBlindingFactor);
654
655 friend BookSpec
657 {
658 return ~static_cast<MPT>(mpt);
659 }
660
661private:
663 bool
664 forObject(
665 std::function<bool(SLEP const& sle)> const& cb,
666 std::optional<Account> const& holder = std::nullopt) const;
667
668 template <typename A>
669 TER
670 submit(A const& arg, json::Value jv)
671 {
672 auto const expectedFlags = Txflags(arg.flags.value_or(0));
673 auto const expectedTer = Ter(arg.err.value_or(tesSUCCESS));
674
675 if constexpr (requires { arg.fee; })
676 {
677 if (arg.fee)
678 jv[jss::Fee] = to_string(*arg.fee);
679 }
680
682 if constexpr (requires { arg.ticketSeq; })
683 ticketSeq = arg.ticketSeq;
684
685 std::optional<Account> delegateAcct;
686 if constexpr (requires { arg.delegate; })
687 delegateAcct = arg.delegate;
688
690 if constexpr (requires { arg.destinationTag; })
691 dstTag = arg.destinationTag;
692
693 if (ticketSeq && delegateAcct)
694 {
695 env_(
696 jv,
697 expectedFlags,
698 expectedTer,
699 ticket::Use(*ticketSeq),
700 delegate::As(*delegateAcct));
701 }
702 else if (ticketSeq)
703 {
704 env_(jv, expectedFlags, expectedTer, ticket::Use(*ticketSeq));
705 }
706 else if (delegateAcct)
707 {
708 env_(jv, expectedFlags, expectedTer, delegate::As(*delegateAcct));
709 }
710 else if (dstTag)
711 {
712 env_(jv, expectedFlags, expectedTer, Dtag(*dstTag));
713 }
714 else
715 {
716 env_(jv, expectedFlags, expectedTer);
717 }
718 auto const err = env_.ter();
719 if (close_)
720 env_.close();
721 if (arg.ownerCount)
722 env_.require(Owners(issuer_, *arg.ownerCount));
723 if (arg.holderCount)
724 {
725 for (auto const& it : holders_)
726 env_.require(Owners(it.second, *arg.holderCount));
727 }
728 return err;
729 }
730
732 makeHolders(std::vector<Account> const& holders);
733
734 [[nodiscard]] std::uint32_t
736
737 template <typename T>
738 void
740 T const& arg,
741 json::Value& jv,
742 Buffer& holderCiphertext,
743 Buffer& issuerCiphertext,
744 std::optional<Buffer>& auditorCiphertext,
745 Buffer& blindingFactor) const;
746};
747
748} // namespace xrpl::test::jtx
Represents a JSON value.
Definition json_value.h:130
Like std::vector<char> but better.
Definition Buffer.h:16
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
Definition Buffer.h:129
std::shared_ptr< STLedgerEntry const > const_pointer
An immutable linear range of bytes.
Definition Slice.h:26
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
A transaction testing environment.
Definition Env.h:143
Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state.
Definition mpt.h:385
void fillConversionCiphertexts(T const &arg, json::Value &jv, Buffer &holderCiphertext, Buffer &issuerCiphertext, std::optional< Buffer > &auditorCiphertext, Buffer &blindingFactor) const
Definition mpt.cpp:1034
static constexpr auto holderEncryptedInbox
Definition mpt.h:404
std::optional< uint64_t > decryptAmount(Account const &account, Buffer const &amt) const
Definition mpt.cpp:2082
std::unordered_map< std::string, Account > const holders_
Definition mpt.h:388
Buffer getConvertBackProof(Account const &holder, std::uint64_t const amount, uint256 const &contextHash, PedersenProofParams const &pcParams) const
Definition mpt.cpp:937
void send(MPTConfidentialSend const &arg=MPTConfidentialSend{})
Definition mpt.cpp:1321
Buffer encryptAmount(Account const &account, uint64_t const amt, Buffer const &blindingFactor) const
Definition mpt.cpp:2067
bool forObject(std::function< bool(SLEP const &sle)> const &cb, std::optional< Account > const &holder=std::nullopt) const
Definition mpt.cpp:584
void set(MPTSet const &set={})
Definition mpt.cpp:482
bool checkMPTokenAmount(Account const &holder, std::int64_t expectedAmount) const
Definition mpt.cpp:607
std::optional< MPTID > id_
Definition mpt.h:390
json::Value convertJV(MPTConvert const &arg, std::uint32_t seq)
Build a confidential convert JV without submitting it.
Definition mpt.cpp:1259
static Buffer getPedersenCommitment(std::uint64_t const amount, Buffer const &pedersenBlindingFactor)
Definition mpt.cpp:911
static json::Value destroyJV(MPTDestroy const &arg=MPTDestroy{})
Definition mpt.cpp:321
std::optional< Buffer > getEncryptedBalance(Account const &account, EncryptedBalanceType option=holderEncryptedInbox) const
Definition mpt.cpp:972
void convertBack(MPTConvertBack const &arg=MPTConvertBack{})
Definition mpt.cpp:2286
void pay(Account const &src, Account const &dest, std::int64_t amount, std::optional< TER > err=std::nullopt, std::optional< std::vector< std::string > > credentials=std::nullopt)
Definition mpt.cpp:668
std::optional< uint64_t > getDecryptedBalance(Account const &account, EncryptedBalanceType balanceType) const
Definition mpt.cpp:2112
Account const & holder(std::string const &h) const
Definition mpt.cpp:344
static json::Value authorizeJV(MPTAuthorize const &arg=MPTAuthorize{})
Definition mpt.cpp:353
void create(MPTCreate const &arg=MPTCreate{})
Definition mpt.cpp:256
bool isTransferFeePresent() const
Definition mpt.cpp:662
std::optional< Buffer > getPrivKey(Account const &account) const
Definition mpt.cpp:2058
friend BookSpec operator~(MPTTester const &mpt)
Definition mpt.h:656
bool checkMetadata(std::string const &metadata) const
Definition mpt.cpp:635
void confidentialClaw(MPTConfidentialClawback const &arg=MPTConfidentialClawback{})
Definition mpt.cpp:1925
bool checkFlags(uint32_t const expectedFlags, std::optional< Account > const &holder=std::nullopt) const
Definition mpt.cpp:629
bool isMetadataPresent() const
Definition mpt.cpp:645
MPT operator[](std::string const &name) const
Definition mpt.cpp:1021
static constexpr auto issuerEncryptedBalance
Definition mpt.h:403
void authorizeHolders(Holders const &holders)
Definition mpt.cpp:430
std::uint32_t getMPTokenVersion(Account const account) const
Definition mpt.cpp:2270
Account const & issuer() const
Definition mpt.h:551
std::optional< std::int64_t > getIssuanceOutstandingBalance() const
Definition mpt.cpp:2256
static json::Value createJV(MPTCreate const &arg=MPTCreate{})
Definition mpt.cpp:232
void authorize(MPTAuthorize const &arg=MPTAuthorize{})
Definition mpt.cpp:368
std::optional< Buffer > getSchnorrProof(Account const &account, uint256 const &ctxHash) const
Definition mpt.cpp:827
json::Value sendJV(MPTConfidentialSend const &arg, std::uint32_t seq, std::optional< ConfidentialSendChainState > chain=std::nullopt)
Build a confidential send JV.
Definition mpt.cpp:1659
ConfidentialSendChainState chainAfterSend(Account const &sender, std::uint64_t sendAmt, json::Value const &jv) const
Compute the projected sender state after a confidential send in a batch.
Definition mpt.cpp:1885
static json::Value setJV(MPTSet const &set={})
Definition mpt.cpp:439
MPTID const & issuanceID() const
Definition mpt.h:576
static constexpr auto holderEncryptedSpending
Definition mpt.h:405
std::unordered_map< AccountID, Buffer > pubKeys_
Definition mpt.h:392
std::unordered_map< AccountID, Buffer > privKeys_
Definition mpt.h:393
std::optional< Buffer > getClawbackProof(Account const &holder, std::uint64_t amount, Buffer const &privateKey, uint256 const &txHash) const
Definition mpt.cpp:787
std::int64_t getBalance(Account const &account) const
Definition mpt.cpp:757
std::optional< Buffer > getConfidentialSendProof(Account const &sender, std::uint64_t const amount, std::vector< ConfidentialRecipient > const &recipients, Slice const &blindingFactor, uint256 const &contextHash, PedersenProofParams const &amountParams, PedersenProofParams const &balanceParams) const
Definition mpt.cpp:850
std::optional< Account > const auditor_
Definition mpt.h:389
Account const issuer_
Definition mpt.h:387
json::Value mergeInboxJV(MPTMergeInbox const &arg=MPTMergeInbox{}) const
Definition mpt.cpp:2138
void claw(Account const &issuer, Account const &holder, std::int64_t amount, std::optional< TER > err=std::nullopt)
Definition mpt.cpp:720
SLE::const_pointer SLEP
Definition mpt.h:662
static constexpr auto auditorEncryptedBalance
Definition mpt.h:406
MPTTester(Env &env, Account issuer, MPTInit const &constr={})
Definition mpt.cpp:143
void generateKeyPair(Account const &account)
Definition mpt.cpp:2027
PrettyAmount mpt(std::int64_t amount) const
Definition mpt.cpp:741
void destroy(MPTDestroy const &arg=MPTDestroy{})
Definition mpt.cpp:334
std::int64_t getIssuanceConfidentialBalance() const
Definition mpt.cpp:775
bool checkTransferFee(std::uint16_t transferFee) const
Definition mpt.cpp:652
bool checkIssuanceConfidentialBalance(std::int64_t expectedAmount) const
Definition mpt.cpp:621
bool checkDomainID(std::optional< uint256 > expected) const
Definition mpt.cpp:597
void mergeInbox(MPTMergeInbox const &arg=MPTMergeInbox{})
Definition mpt.cpp:2164
PrettyAmount operator()(std::int64_t amount) const
Definition mpt.cpp:1027
void convert(MPTConvert const &arg=MPTConvert{})
Definition mpt.cpp:1086
std::uint32_t getFlags(std::optional< Account > const &holder) const
Definition mpt.cpp:1007
static std::unordered_map< std::string, Account > makeHolders(std::vector< Account > const &holders)
Definition mpt.cpp:131
std::optional< Buffer > getPubKey(Account const &account) const
Definition mpt.cpp:2049
bool checkMPTokenOutstandingAmount(std::int64_t expectedAmount) const
Definition mpt.cpp:614
TER submit(A const &arg, json::Value jv)
Definition mpt.h:670
json::Value convertBackJV(MPTConvertBack const &arg, std::uint32_t seq)
Build a confidential convertBack JV without submitting it.
Definition mpt.cpp:2453
Converts to MPT Issue or STAmount.
MptBalance(MPTTester &tester, Account const &account, std::int64_t amount)
Definition mpt.h:78
MPTTester const & tester_
Definition mpt.h:73
std::int64_t const amount_
Definition mpt.h:75
Account const & account_
Definition mpt.h:74
void operator()(Env &env) const
Definition mpt.cpp:119
std::uint32_t flags_
Definition mpt.h:53
MptFlags(MPTTester &tester, std::uint32_t flags, std::optional< Account > const &holder=std::nullopt)
Definition mpt.h:57
void operator()(Env &env) const
Definition mpt.cpp:113
std::optional< Account > holder_
Definition mpt.h:54
MPTTester & tester_
Definition mpt.h:52
Match the number of items in the account's owner directory.
Definition owners.h:52
std::function< bool()> cb_
Definition mpt.h:91
RequireAny(std::function< bool()> const &cb)
Definition mpt.h:94
void operator()(Env &env) const
Definition mpt.cpp:125
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition ter.h:13
Set the flags on a JTx.
Definition txflags.h:9
Set a ticket sequence on a JTx.
Definition ticket.h:26
T memset(T... args)
auto const kMptDexFlags
Definition mpt.h:25
Buffer gMakeZeroBuffer(std::size_t size)
Create a zero-initialized buffer for malformed cryptography test inputs.
Definition mpt.h:40
XrpT const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
std::vector< Account > Holders
Definition mpt.h:102
std::optional< ConfidentialSendChainState > computeNextSendChainState(std::uint64_t currentSpending, Slice const &currentEncSpending, std::uint32_t currentVersion, std::uint64_t sendAmt, Slice const &senderEncAmt)
Use this when building a second (or later) confidential send from the same account in the same batch.
Definition mpt.cpp:1903
static MPTInit const kMptInitNoFund
Definition mpt.h:142
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:633
BaseUInt< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
Definition UintTypes.h:44
TERSubset< CanCvtToTER > TER
Definition TER.h:634
BaseUInt< 256 > uint256
Definition base_uint.h:562
@ tesSUCCESS
Definition TER.h:240
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Definition contract.h:49
When building multiple confidential sends from the same account inside a single batch transaction,...
Definition mpt.h:347
std::uint32_t version
sfConfidentialBalanceVersion after the previous send.
Definition mpt.h:355
std::uint64_t spending
Decrypted spending balance after the previous send.
Definition mpt.h:349
Buffer encSpending
Encrypted spending balance after the previous send.
Definition mpt.h:352
Set the destination tag on a JTx.
Definition tag.h:9
Arguments for building an MPTokenAuthorize test transaction.
Definition mpt.h:175
std::optional< std::uint32_t > ownerCount
Definition mpt.h:179
std::optional< std::uint32_t > holderCount
Definition mpt.h:180
std::optional< Account > holder
Definition mpt.h:177
std::optional< Account > account
Definition mpt.h:176
std::optional< TER > err
Definition mpt.h:182
std::optional< std::uint32_t > flags
Definition mpt.h:181
Arguments for building a ConfidentialMPTClawback test transaction.
Definition mpt.h:301
std::optional< std::uint32_t > holderCount
Definition mpt.h:310
std::optional< std::uint32_t > ownerCount
Definition mpt.h:309
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:308
std::optional< std::string > proof
Definition mpt.h:306
std::optional< std::uint64_t > amt
Definition mpt.h:305
std::optional< XRPAmount > fee
Definition mpt.h:312
std::optional< Account > delegate
Definition mpt.h:307
std::optional< std::uint32_t > flags
Definition mpt.h:311
std::optional< Account > account
Definition mpt.h:302
std::optional< Account > holder
Definition mpt.h:303
Arguments for building a ConfidentialMPTSend test transaction.
Definition mpt.h:249
std::optional< XRPAmount > fee
Definition mpt.h:272
std::optional< std::vector< std::string > > credentials
Definition mpt.h:261
std::optional< TER > err
Definition mpt.h:273
std::optional< Buffer > balanceCommitment
Definition mpt.h:265
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:268
std::optional< std::uint32_t > holderCount
Definition mpt.h:270
std::optional< std::uint64_t > amt
Definition mpt.h:254
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:260
std::optional< std::uint32_t > destinationTag
Definition mpt.h:267
std::optional< Account > account
Definition mpt.h:250
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:259
std::optional< Account > dest
Definition mpt.h:251
std::optional< std::uint32_t > flags
Definition mpt.h:271
std::optional< Buffer > blindingFactor
Definition mpt.h:263
std::optional< Buffer > amountCommitment
Definition mpt.h:264
std::optional< Account > delegate
Definition mpt.h:266
std::optional< std::string > proof
Definition mpt.h:255
std::optional< Buffer > senderEncryptedAmt
Definition mpt.h:256
std::optional< Buffer > destEncryptedAmt
Definition mpt.h:257
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:258
std::optional< std::uint32_t > ownerCount
Definition mpt.h:269
Arguments for building a ConfidentialMPTConvertBack test transaction.
Definition mpt.h:278
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:285
std::optional< Account > delegate
Definition mpt.h:290
std::optional< std::uint32_t > holderCount
Definition mpt.h:293
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:284
std::optional< std::uint32_t > ownerCount
Definition mpt.h:292
std::optional< std::uint64_t > amt
Definition mpt.h:281
std::optional< Account > account
Definition mpt.h:279
std::optional< XRPAmount > fee
Definition mpt.h:295
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:291
std::optional< std::uint32_t > flags
Definition mpt.h:294
std::optional< Buffer > holderEncryptedAmt
Definition mpt.h:283
std::optional< Buffer > proof
Definition mpt.h:282
std::optional< TER > err
Definition mpt.h:296
std::optional< Buffer > blindingFactor
Definition mpt.h:288
std::optional< Buffer > pedersenCommitment
Definition mpt.h:289
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:286
Arguments for building a ConfidentialMPTConvert test transaction.
Definition mpt.h:207
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:212
std::optional< std::uint32_t > ownerCount
Definition mpt.h:226
std::optional< std::uint64_t > amt
Definition mpt.h:210
std::optional< Buffer > holderEncryptedAmt
Definition mpt.h:219
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:221
std::optional< bool > fillSchnorrProof
Definition mpt.h:217
std::optional< std::uint32_t > holderCount
Definition mpt.h:227
std::optional< Buffer > holderPubKey
Definition mpt.h:218
std::optional< TER > err
Definition mpt.h:230
std::optional< std::uint32_t > flags
Definition mpt.h:228
std::optional< Account > account
Definition mpt.h:208
std::optional< Buffer > blindingFactor
Definition mpt.h:223
std::optional< XRPAmount > fee
Definition mpt.h:229
std::optional< std::string > proof
Definition mpt.h:211
std::optional< Account > delegate
Definition mpt.h:224
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:220
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:225
Arguments for building an MPTokenIssuanceCreate test transaction.
Definition mpt.h:106
std::optional< std::uint8_t > assetScale
Definition mpt.h:110
static std::vector< Account > allHolders
Definition mpt.h:107
std::optional< std::uint32_t > mutableFlags
Definition mpt.h:122
std::optional< std::uint32_t > holderCount
Definition mpt.h:114
std::optional< std::string > metadata
Definition mpt.h:112
std::optional< std::uint32_t > flags
Definition mpt.h:121
std::optional< uint256 > domainID
Definition mpt.h:124
std::optional< TER > err
Definition mpt.h:125
std::optional< std::uint64_t > maxAmt
Definition mpt.h:109
std::optional< std::uint32_t > ownerCount
Definition mpt.h:113
std::optional< Account > issuer
Definition mpt.h:108
std::optional< std::pair< std::vector< Account >, std::uint64_t > > pay
Definition mpt.h:120
std::optional< std::uint16_t > transferFee
Definition mpt.h:111
std::optional< std::vector< Account > > authorize
Definition mpt.h:117
Arguments for building an MPTokenIssuanceDestroy test transaction.
Definition mpt.h:164
std::optional< Account > issuer
Definition mpt.h:165
std::optional< std::uint32_t > flags
Definition mpt.h:169
std::optional< std::uint32_t > holderCount
Definition mpt.h:168
std::optional< std::uint32_t > ownerCount
Definition mpt.h:167
std::optional< TER > err
Definition mpt.h:170
Full constructor arguments for MPTTester initialization.
Definition mpt.h:146
std::optional< std::uint32_t > mutableFlags
Definition mpt.h:154
std::uint16_t transferFee
Definition mpt.h:151
std::optional< TER > err
Definition mpt.h:159
std::uint32_t flags
Definition mpt.h:153
std::optional< std::uint64_t > maxAmt
Definition mpt.h:158
std::optional< Account > auditor
Definition mpt.h:150
std::optional< std::uint64_t > pay
Definition mpt.h:152
Arguments for initializing funded MPT test accounts and issuance.
Definition mpt.h:130
std::optional< MPTCreate > create
Definition mpt.h:140
std::optional< Account > auditor
Definition mpt.h:134
PrettyAmount const xrp
Definition mpt.h:135
PrettyAmount const xrpHolders
Definition mpt.h:136
Arguments for building a ConfidentialMPTMergeInbox test transaction.
Definition mpt.h:235
std::optional< TER > err
Definition mpt.h:244
std::optional< std::uint32_t > ownerCount
Definition mpt.h:240
std::optional< std::uint32_t > holderCount
Definition mpt.h:241
std::optional< std::uint32_t > flags
Definition mpt.h:242
std::optional< XRPAmount > fee
Definition mpt.h:243
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:239
std::optional< Account > account
Definition mpt.h:236
std::optional< Account > delegate
Definition mpt.h:238
Arguments for building an MPTokenIssuanceSet test transaction.
Definition mpt.h:187
std::optional< uint256 > domainID
Definition mpt.h:198
std::optional< Account > account
Definition mpt.h:188
std::optional< std::uint32_t > holderCount
Definition mpt.h:192
std::optional< Buffer > auditorPubKey
Definition mpt.h:200
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:201
std::optional< TER > err
Definition mpt.h:202
std::optional< std::uint16_t > transferFee
Definition mpt.h:195
std::optional< std::uint32_t > flags
Definition mpt.h:193
std::optional< std::variant< Account, AccountID > > holder
Definition mpt.h:189
std::optional< std::uint32_t > mutableFlags
Definition mpt.h:194
std::optional< std::string > metadata
Definition mpt.h:196
std::optional< std::uint32_t > ownerCount
Definition mpt.h:191
std::optional< Buffer > issuerPubKey
Definition mpt.h:199
std::optional< Account > delegate
Definition mpt.h:197
Stores the parameters that are exclusively used to generate a Pedersen linkage proof.
Definition mpt.h:321
Buffer const pedersenCommitment
The Pedersen commitment used by the proof.
Definition mpt.h:323
Buffer const blindingFactor
The blinding factor used to create the Pedersen commitment.
Definition mpt.h:332
Buffer const encryptedAmt
The encrypted amount linked to the Pedersen commitment.
Definition mpt.h:329
uint64_t const amt
Either the spending balance or the value being transferred.
Definition mpt.h:326
Represents an XRP, IOU, or MPT quantity This customizes the string conversion and supports XRP conver...