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/amount.h>
6#include <test/jtx/delegate.h>
7#include <test/jtx/owners.h>
8#include <test/jtx/tag.h>
9#include <test/jtx/ter.h>
10#include <test/jtx/ticket.h>
11#include <test/jtx/txflags.h>
12
13#include <xrpl/basics/Buffer.h>
14#include <xrpl/basics/Slice.h>
15#include <xrpl/basics/base_uint.h>
16#include <xrpl/basics/contract.h>
17#include <xrpl/beast/unit_test/suite.h>
18#include <xrpl/core/ServiceRegistry.h>
19#include <xrpl/json/json_value.h>
20#include <xrpl/protocol/AccountID.h>
21#include <xrpl/protocol/Asset.h>
22#include <xrpl/protocol/ConfidentialTransfer.h>
23#include <xrpl/protocol/TER.h>
24#include <xrpl/protocol/TxFlags.h>
25#include <xrpl/protocol/UintTypes.h>
26#include <xrpl/protocol/XRPAmount.h>
27#include <xrpl/protocol/jss.h>
28
29#include <cstddef>
30#include <cstdint>
31#include <cstring>
32#include <functional>
33#include <optional>
34#include <stdexcept>
35#include <string>
36#include <unordered_map>
37#include <utility>
38#include <variant>
39#include <vector>
40
41namespace xrpl::test::jtx {
42
43class MPTTester;
44
45auto const kMptDexFlags = tfMPTCanTrade | tfMPTCanTransfer;
46
59[[nodiscard]] inline Buffer
61{
62 Buffer b(size);
63 if (size > 0)
64 std::memset(b.data(), 0, size);
65 return b;
66}
67
72{
73private:
77
78public:
80 MPTTester& tester,
81 std::uint32_t flags,
82 std::optional<Account> const& holder = std::nullopt)
83 : tester_(tester), flags_(flags), holder_(holder)
84 {
85 }
86
87 void
88 operator()(Env& env) const;
89};
90
95{
96private:
100
101public:
102 MptBalance(MPTTester& tester, Account const& account, std::int64_t amount)
103 : tester_(tester), account_(account), amount_(amount)
104 {
105 }
106
107 void
108 operator()(Env& env) const;
109};
110
115{
116private:
118
119public:
120 RequireAny(std::function<bool()> const& cb) : cb_(cb)
121 {
122 }
123
124 void
125 operator()(Env& env) const;
126};
127
129
134{
143 // authorize if seated.
144 // if empty vector then authorize all holders
146 // pay if seated. if authorize is not seated then authorize.
147 // if empty vector then pay to either authorize or all holders.
151 bool authHolder = false;
153 std::optional<TER> err = std::nullopt;
154};
155
160{
161 // Default-initialized so designated-initializer call sites that omit
162 // `holders` don't trip GCC's -Werror=missing-field-initializers.
163 Holders holders = {}; // NOLINT(readability-redundant-member-init)
165 PrettyAmount const xrp = XRP(10'000);
166 PrettyAmount const xrpHolders = XRP(10'000);
167 bool fund = true;
168 bool close = true;
169 // create MPTIssuanceID if seated and follow rules for MPTCreate args
171};
172static MPTInit const kMptInitNoFund{.fund = false};
173
178{
181 Holders holders = {}; // NOLINT(readability-redundant-member-init)
187 bool authHolder = false;
188 bool fund = false;
189 bool close = true;
191 std::optional<TER> err = std::nullopt;
192};
193
206
220
242
247{
249 std::optional<MPTID> id = std::nullopt;
253 // indicates whether to autofill schnorr proof.
254 // default : auto generate proof if holderPubKey is present.
255 // true: force proof generation.
256 // false: force proof omission.
262
270 std::optional<TER> err = std::nullopt;
271};
272
288
319
344
363
369{
374
378 uint64_t const amt;
379
384
389};
390
419
436 std::uint64_t currentSpending,
437 Slice const& currentEncSpending,
438 std::uint32_t currentVersion,
439 std::uint64_t sendAmt,
440 Slice const& senderEncAmt);
441
447{
453 bool close_;
456
457public:
464
469
470 MPTTester(Env& env, Account issuer, MPTInit const& constr = {});
471 MPTTester(MPTInitDef const& constr);
472 MPTTester(
473 Env& env,
475 MPTID const& id,
476 std::vector<Account> const& holders = {},
477 bool close = true);
478 operator MPT() const;
479
480 void
481 create(MPTCreate const& arg = MPTCreate{});
482
483 static json::Value
484 createJV(MPTCreate const& arg = MPTCreate{});
485
486 void
487 destroy(MPTDestroy const& arg = MPTDestroy{});
488
489 static json::Value
490 destroyJV(MPTDestroy const& arg = MPTDestroy{});
491
492 void
493 authorize(MPTAuthorize const& arg = MPTAuthorize{});
494
495 static json::Value
496 authorizeJV(MPTAuthorize const& arg = MPTAuthorize{});
497
498 void
499 authorizeHolders(Holders const& holders);
500
501 void
502 set(MPTSet const& set = {});
503
504 static json::Value
505 setJV(MPTSet const& set = {});
506
507 void
508 convert(MPTConvert const& arg = MPTConvert{});
509
518 json::Value
519 convertJV(MPTConvert const& arg, std::uint32_t seq);
520
521 void
522 mergeInbox(MPTMergeInbox const& arg = MPTMergeInbox{});
523
524 [[nodiscard]] json::Value
525 mergeInboxJV(MPTMergeInbox const& arg = MPTMergeInbox{}) const;
526
527 void
528 send(MPTConfidentialSend const& arg = MPTConfidentialSend{});
529
543 json::Value
544 sendJV(
545 MPTConfidentialSend const& arg,
546 std::uint32_t seq,
547 std::optional<ConfidentialSendChainState> chain = std::nullopt);
548
562 [[nodiscard]] ConfidentialSendChainState
563 chainAfterSend(Account const& sender, std::uint64_t sendAmt, json::Value const& jv) const;
564
565 void
566 convertBack(MPTConvertBack const& arg = MPTConvertBack{});
567
578 json::Value
579 convertBackJV(MPTConvertBack const& arg, std::uint32_t seq);
580
581 void
582 confidentialClaw(MPTConfidentialClawback const& arg = MPTConfidentialClawback{});
583
584 [[nodiscard]] bool
585 checkDomainID(std::optional<uint256> expected) const;
586
587 [[nodiscard]] bool
588 checkMPTokenAmount(Account const& holder, std::int64_t expectedAmount) const;
589
590 [[nodiscard]] bool
591 checkMPTokenOutstandingAmount(std::int64_t expectedAmount) const;
592
593 [[nodiscard]] bool
594 checkIssuanceConfidentialBalance(std::int64_t expectedAmount) const;
595
596 [[nodiscard]] bool
597 checkFlags(uint32_t const expectedFlags, std::optional<Account> const& holder = std::nullopt)
598 const;
599
600 [[nodiscard]] bool
601 checkMetadata(std::string const& metadata) const;
602
603 [[nodiscard]] bool
604 isMetadataPresent() const;
605
606 [[nodiscard]] bool
607 checkTransferFee(std::uint16_t transferFee) const;
608
609 [[nodiscard]] bool
610 isTransferFeePresent() const;
611
612 [[nodiscard]] bool
613 checkImmutableFlags(std::uint32_t expectedFlags) const;
614
615 [[nodiscard]] Account const&
616 issuer() const
617 {
618 return issuer_;
619 }
620 [[nodiscard]] Account const&
621 holder(std::string const& h) const;
622
623 void
624 pay(Account const& src,
625 Account const& dest,
626 std::int64_t amount,
627 std::optional<TER> err = std::nullopt,
629
630 void
631 claw(
632 Account const& issuer,
633 Account const& holder,
634 std::int64_t amount,
635 std::optional<TER> err = std::nullopt);
636
637 [[nodiscard]] PrettyAmount
638 mpt(std::int64_t amount) const;
639
640 [[nodiscard]] MPTID const&
642 {
643 if (!env_.test.BEAST_EXPECT(id_))
644 Throw<std::logic_error>("Uninitialized issuanceID");
645 return *id_; // NOLINT(bugprone-unchecked-optional-access)
646 }
647
648 [[nodiscard]] std::int64_t
649 getBalance(Account const& account) const;
650
651 [[nodiscard]] std::int64_t
653
654 [[nodiscard]] std::optional<Buffer>
656 const;
657
658 MPT
659 operator[](std::string const& name) const;
660
662 operator()(std::int64_t amount) const;
663
664 operator Asset() const;
665
666 void
667 generateKeyPair(Account const& account);
668
669 [[nodiscard]] std::optional<Buffer>
670 getPubKey(Account const& account) const;
671
672 [[nodiscard]] std::optional<Buffer>
673 getPrivKey(Account const& account) const;
674
675 [[nodiscard]] Buffer
676 encryptAmount(Account const& account, uint64_t const amt, Buffer const& blindingFactor) const;
677
678 [[nodiscard]] std::optional<uint64_t>
679 decryptAmount(Account const& account, Buffer const& amt) const;
680
681 [[nodiscard]] std::optional<uint64_t>
682 getDecryptedBalance(Account const& account, EncryptedBalanceType balanceType) const;
683
684 [[nodiscard]] std::optional<std::int64_t>
686
687 [[nodiscard]] std::optional<Buffer>
689 Account const& holder,
690 std::uint64_t amount,
691 Buffer const& privateKey,
692 uint256 const& txHash) const;
693
694 [[nodiscard]] std::optional<Buffer>
695 getSchnorrProof(Account const& account, uint256 const& ctxHash) const;
696
697 [[nodiscard]] std::optional<Buffer>
699 Account const& sender,
700 std::uint64_t const amount,
701 std::vector<ConfidentialRecipient> const& recipients,
702 Slice const& blindingFactor,
703 uint256 const& contextHash,
704 PedersenProofParams const& amountParams,
705 PedersenProofParams const& balanceParams) const;
706
707 [[nodiscard]] Buffer
709 Account const& holder,
710 std::uint64_t const amount,
711 uint256 const& contextHash,
712 PedersenProofParams const& pcParams) const;
713
714 [[nodiscard]] std::uint32_t
715 getMPTokenVersion(Account const account) const;
716
717 static Buffer
718 getPedersenCommitment(std::uint64_t const amount, Buffer const& pedersenBlindingFactor);
719
720 friend BookSpec
722 {
723 return ~static_cast<MPT>(mpt);
724 }
725
726private:
728 bool
729 forObject(
730 std::function<bool(SLEP const& sle)> const& cb,
731 std::optional<Account> const& holder = std::nullopt) const;
732
733 template <typename A>
734 TER
735 submit(A const& arg, json::Value jv)
736 {
737 auto const expectedFlags = Txflags(arg.flags.value_or(0));
738 auto const expectedTer = Ter(arg.err.value_or(tesSUCCESS));
739
740 if constexpr (requires { arg.fee; })
741 {
742 if (arg.fee)
743 jv[jss::Fee] = to_string(*arg.fee);
744 }
745
747 if constexpr (requires { arg.ticketSeq; })
748 ticketSeq = arg.ticketSeq;
749
750 std::optional<Account> delegateAcct;
751 if constexpr (requires { arg.delegate; })
752 delegateAcct = arg.delegate;
753
755 if constexpr (requires { arg.destinationTag; })
756 dstTag = arg.destinationTag;
757
758 if (ticketSeq && delegateAcct)
759 {
760 env_(
761 jv,
762 expectedFlags,
763 expectedTer,
764 ticket::Use(*ticketSeq),
765 delegate::As(*delegateAcct));
766 }
767 else if (ticketSeq)
768 {
769 env_(jv, expectedFlags, expectedTer, ticket::Use(*ticketSeq));
770 }
771 else if (delegateAcct)
772 {
773 env_(jv, expectedFlags, expectedTer, delegate::As(*delegateAcct));
774 }
775 else if (dstTag)
776 {
777 env_(jv, expectedFlags, expectedTer, Dtag(*dstTag));
778 }
779 else
780 {
781 env_(jv, expectedFlags, expectedTer);
782 }
783 auto const err = env_.ter();
784 if (close_)
785 env_.close();
786 if (arg.ownerCount)
787 env_.require(Owners(issuer_, *arg.ownerCount));
788 if (arg.holderCount)
789 {
790 for (auto const& it : holders_)
791 env_.require(Owners(it.second, *arg.holderCount));
792 }
793 return err;
794 }
795
797 makeHolders(std::vector<Account> const& holders);
798
799 [[nodiscard]] std::uint32_t
801
802 template <typename T>
803 void
805 T const& arg,
806 json::Value& jv,
807 Buffer& holderCiphertext,
808 Buffer& issuerCiphertext,
809 std::optional<Buffer>& auditorCiphertext,
810 Buffer& blindingFactor) const;
811};
812
813} // namespace xrpl::test::jtx
Represents a JSON value.
Definition json_value.h:117
Like std::vector<char> but better.
Definition Buffer.h:19
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
Definition Buffer.h:148
std::shared_ptr< STLedgerEntry const > const_pointer
An immutable linear range of bytes.
Definition Slice.h:28
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
A transaction testing environment.
Definition Env.h:161
Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state.
Definition mpt.h:447
void fillConversionCiphertexts(T const &arg, json::Value &jv, Buffer &holderCiphertext, Buffer &issuerCiphertext, std::optional< Buffer > &auditorCiphertext, Buffer &blindingFactor) const
Definition mpt.cpp:1018
static constexpr auto holderEncryptedInbox
Definition mpt.h:466
std::optional< uint64_t > decryptAmount(Account const &account, Buffer const &amt) const
Definition mpt.cpp:2066
std::unordered_map< std::string, Account > const holders_
Definition mpt.h:450
Buffer getConvertBackProof(Account const &holder, std::uint64_t const amount, uint256 const &contextHash, PedersenProofParams const &pcParams) const
Definition mpt.cpp:921
void send(MPTConfidentialSend const &arg=MPTConfidentialSend{})
Definition mpt.cpp:1305
Buffer encryptAmount(Account const &account, uint64_t const amt, Buffer const &blindingFactor) const
Definition mpt.cpp:2051
bool forObject(std::function< bool(SLEP const &sle)> const &cb, std::optional< Account > const &holder=std::nullopt) const
Definition mpt.cpp:559
void set(MPTSet const &set={})
Definition mpt.cpp:467
bool checkMPTokenAmount(Account const &holder, std::int64_t expectedAmount) const
Definition mpt.cpp:582
std::optional< MPTID > id_
Definition mpt.h:452
json::Value convertJV(MPTConvert const &arg, std::uint32_t seq)
Build a confidential convert JV without submitting it.
Definition mpt.cpp:1243
static Buffer getPedersenCommitment(std::uint64_t const amount, Buffer const &pedersenBlindingFactor)
Definition mpt.cpp:895
static json::Value destroyJV(MPTDestroy const &arg=MPTDestroy{})
Definition mpt.cpp:306
std::optional< Buffer > getEncryptedBalance(Account const &account, EncryptedBalanceType option=holderEncryptedInbox) const
Definition mpt.cpp:956
void convertBack(MPTConvertBack const &arg=MPTConvertBack{})
Definition mpt.cpp:2270
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:652
std::optional< uint64_t > getDecryptedBalance(Account const &account, EncryptedBalanceType balanceType) const
Definition mpt.cpp:2096
Account const & holder(std::string const &h) const
Definition mpt.cpp:329
static json::Value authorizeJV(MPTAuthorize const &arg=MPTAuthorize{})
Definition mpt.cpp:338
void create(MPTCreate const &arg=MPTCreate{})
Definition mpt.cpp:241
bool isTransferFeePresent() const
Definition mpt.cpp:637
std::optional< Buffer > getPrivKey(Account const &account) const
Definition mpt.cpp:2042
friend BookSpec operator~(MPTTester const &mpt)
Definition mpt.h:721
bool checkMetadata(std::string const &metadata) const
Definition mpt.cpp:610
void confidentialClaw(MPTConfidentialClawback const &arg=MPTConfidentialClawback{})
Definition mpt.cpp:1909
bool checkFlags(uint32_t const expectedFlags, std::optional< Account > const &holder=std::nullopt) const
Definition mpt.cpp:604
bool isMetadataPresent() const
Definition mpt.cpp:620
MPT operator[](std::string const &name) const
Definition mpt.cpp:1005
static constexpr auto issuerEncryptedBalance
Definition mpt.h:465
void authorizeHolders(Holders const &holders)
Definition mpt.cpp:415
std::uint32_t getMPTokenVersion(Account const account) const
Definition mpt.cpp:2254
Account const & issuer() const
Definition mpt.h:616
std::optional< std::int64_t > getIssuanceOutstandingBalance() const
Definition mpt.cpp:2240
static json::Value createJV(MPTCreate const &arg=MPTCreate{})
Definition mpt.cpp:217
void authorize(MPTAuthorize const &arg=MPTAuthorize{})
Definition mpt.cpp:353
std::optional< Buffer > getSchnorrProof(Account const &account, uint256 const &ctxHash) const
Definition mpt.cpp:811
json::Value sendJV(MPTConfidentialSend const &arg, std::uint32_t seq, std::optional< ConfidentialSendChainState > chain=std::nullopt)
Build a confidential send JV.
Definition mpt.cpp:1643
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:1869
static json::Value setJV(MPTSet const &set={})
Definition mpt.cpp:424
MPTID const & issuanceID() const
Definition mpt.h:641
static constexpr auto holderEncryptedSpending
Definition mpt.h:467
std::unordered_map< AccountID, Buffer > pubKeys_
Definition mpt.h:454
bool checkImmutableFlags(std::uint32_t expectedFlags) const
Definition mpt.cpp:643
std::unordered_map< AccountID, Buffer > privKeys_
Definition mpt.h:455
std::optional< Buffer > getClawbackProof(Account const &holder, std::uint64_t amount, Buffer const &privateKey, uint256 const &txHash) const
Definition mpt.cpp:771
std::int64_t getBalance(Account const &account) const
Definition mpt.cpp:741
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:834
std::optional< Account > const auditor_
Definition mpt.h:451
Account const issuer_
Definition mpt.h:449
json::Value mergeInboxJV(MPTMergeInbox const &arg=MPTMergeInbox{}) const
Definition mpt.cpp:2122
void claw(Account const &issuer, Account const &holder, std::int64_t amount, std::optional< TER > err=std::nullopt)
Definition mpt.cpp:704
SLE::const_pointer SLEP
Definition mpt.h:727
static constexpr auto auditorEncryptedBalance
Definition mpt.h:468
MPTTester(Env &env, Account issuer, MPTInit const &constr={})
Definition mpt.cpp:128
void generateKeyPair(Account const &account)
Definition mpt.cpp:2011
PrettyAmount mpt(std::int64_t amount) const
Definition mpt.cpp:725
void destroy(MPTDestroy const &arg=MPTDestroy{})
Definition mpt.cpp:319
std::int64_t getIssuanceConfidentialBalance() const
Definition mpt.cpp:759
bool checkTransferFee(std::uint16_t transferFee) const
Definition mpt.cpp:627
bool checkIssuanceConfidentialBalance(std::int64_t expectedAmount) const
Definition mpt.cpp:596
bool checkDomainID(std::optional< uint256 > expected) const
Definition mpt.cpp:572
void mergeInbox(MPTMergeInbox const &arg=MPTMergeInbox{})
Definition mpt.cpp:2148
PrettyAmount operator()(std::int64_t amount) const
Definition mpt.cpp:1011
void convert(MPTConvert const &arg=MPTConvert{})
Definition mpt.cpp:1070
std::uint32_t getFlags(std::optional< Account > const &holder) const
Definition mpt.cpp:991
static std::unordered_map< std::string, Account > makeHolders(std::vector< Account > const &holders)
Definition mpt.cpp:116
std::optional< Buffer > getPubKey(Account const &account) const
Definition mpt.cpp:2033
bool checkMPTokenOutstandingAmount(std::int64_t expectedAmount) const
Definition mpt.cpp:589
TER submit(A const &arg, json::Value jv)
Definition mpt.h:735
json::Value convertBackJV(MPTConvertBack const &arg, std::uint32_t seq)
Build a confidential convertBack JV without submitting it.
Definition mpt.cpp:2437
Converts to MPT Issue or STAmount.
MptBalance(MPTTester &tester, Account const &account, std::int64_t amount)
Definition mpt.h:102
MPTTester const & tester_
Definition mpt.h:97
std::int64_t const amount_
Definition mpt.h:99
Account const & account_
Definition mpt.h:98
void operator()(Env &env) const
Definition mpt.cpp:104
std::uint32_t flags_
Definition mpt.h:75
MptFlags(MPTTester &tester, std::uint32_t flags, std::optional< Account > const &holder=std::nullopt)
Definition mpt.h:79
void operator()(Env &env) const
Definition mpt.cpp:98
std::optional< Account > holder_
Definition mpt.h:76
MPTTester & tester_
Definition mpt.h:74
Match the number of items in the account's owner directory.
Definition owners.h:55
std::function< bool()> cb_
Definition mpt.h:117
RequireAny(std::function< bool()> const &cb)
Definition mpt.h:120
void operator()(Env &env) const
Definition mpt.cpp:110
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition ter.h:18
Set the flags on a JTx.
Definition txflags.h:14
Set a ticket sequence on a JTx.
Definition ticket.h:36
T memset(T... args)
auto const kMptDexFlags
Definition mpt.h:45
Buffer gMakeZeroBuffer(std::size_t size)
Create a zero-initialized buffer for malformed cryptography test inputs.
Definition mpt.h:60
XrpT const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
std::vector< Account > Holders
Definition mpt.h:128
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:1887
static MPTInit const kMptInitNoFund
Definition mpt.h:172
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:651
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:54
TERSubset< CanCvtToTER > TER
Definition TER.h:647
BaseUInt< 256 > uint256
Definition base_uint.h:580
@ tesSUCCESS
Definition TER.h:245
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Definition contract.h:52
When building multiple confidential sends from the same account inside a single batch transaction,...
Definition mpt.h:403
std::uint32_t version
sfConfidentialBalanceVersion after the previous send.
Definition mpt.h:417
std::uint64_t spending
Decrypted spending balance after the previous send.
Definition mpt.h:407
Buffer encSpending
Encrypted spending balance after the previous send.
Definition mpt.h:412
Set the destination tag on a JTx.
Definition tag.h:14
Arguments for building an MPTokenAuthorize test transaction.
Definition mpt.h:211
std::optional< std::uint32_t > ownerCount
Definition mpt.h:215
std::optional< std::uint32_t > holderCount
Definition mpt.h:216
std::optional< Account > holder
Definition mpt.h:213
std::optional< Account > account
Definition mpt.h:212
std::optional< TER > err
Definition mpt.h:218
std::optional< std::uint32_t > flags
Definition mpt.h:217
Arguments for building a ConfidentialMPTClawback test transaction.
Definition mpt.h:349
std::optional< std::uint32_t > holderCount
Definition mpt.h:358
std::optional< std::uint32_t > ownerCount
Definition mpt.h:357
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:356
std::optional< std::string > proof
Definition mpt.h:354
std::optional< std::uint64_t > amt
Definition mpt.h:353
std::optional< XRPAmount > fee
Definition mpt.h:360
std::optional< Account > delegate
Definition mpt.h:355
std::optional< std::uint32_t > flags
Definition mpt.h:359
std::optional< Account > account
Definition mpt.h:350
std::optional< Account > holder
Definition mpt.h:351
Arguments for building a ConfidentialMPTSend test transaction.
Definition mpt.h:293
std::optional< XRPAmount > fee
Definition mpt.h:316
std::optional< std::vector< std::string > > credentials
Definition mpt.h:305
std::optional< TER > err
Definition mpt.h:317
std::optional< Buffer > balanceCommitment
Definition mpt.h:309
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:312
std::optional< std::uint32_t > holderCount
Definition mpt.h:314
std::optional< std::uint64_t > amt
Definition mpt.h:298
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:304
std::optional< std::uint32_t > destinationTag
Definition mpt.h:311
std::optional< Account > account
Definition mpt.h:294
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:303
std::optional< Account > dest
Definition mpt.h:295
std::optional< std::uint32_t > flags
Definition mpt.h:315
std::optional< Buffer > blindingFactor
Definition mpt.h:307
std::optional< Buffer > amountCommitment
Definition mpt.h:308
std::optional< Account > delegate
Definition mpt.h:310
std::optional< std::string > proof
Definition mpt.h:299
std::optional< Buffer > senderEncryptedAmt
Definition mpt.h:300
std::optional< Buffer > destEncryptedAmt
Definition mpt.h:301
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:302
std::optional< std::uint32_t > ownerCount
Definition mpt.h:313
Arguments for building a ConfidentialMPTConvertBack test transaction.
Definition mpt.h:324
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:331
std::optional< Account > delegate
Definition mpt.h:336
std::optional< std::uint32_t > holderCount
Definition mpt.h:339
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:330
std::optional< std::uint32_t > ownerCount
Definition mpt.h:338
std::optional< std::uint64_t > amt
Definition mpt.h:327
std::optional< Account > account
Definition mpt.h:325
std::optional< XRPAmount > fee
Definition mpt.h:341
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:337
std::optional< std::uint32_t > flags
Definition mpt.h:340
std::optional< Buffer > holderEncryptedAmt
Definition mpt.h:329
std::optional< Buffer > proof
Definition mpt.h:328
std::optional< TER > err
Definition mpt.h:342
std::optional< Buffer > blindingFactor
Definition mpt.h:334
std::optional< Buffer > pedersenCommitment
Definition mpt.h:335
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:332
Arguments for building a ConfidentialMPTConvert test transaction.
Definition mpt.h:247
std::optional< bool > fillAuditorEncryptedAmt
Definition mpt.h:252
std::optional< std::uint32_t > ownerCount
Definition mpt.h:266
std::optional< std::uint64_t > amt
Definition mpt.h:250
std::optional< Buffer > holderEncryptedAmt
Definition mpt.h:259
std::optional< Buffer > auditorEncryptedAmt
Definition mpt.h:261
std::optional< bool > fillSchnorrProof
Definition mpt.h:257
std::optional< std::uint32_t > holderCount
Definition mpt.h:267
std::optional< Buffer > holderPubKey
Definition mpt.h:258
std::optional< TER > err
Definition mpt.h:270
std::optional< std::uint32_t > flags
Definition mpt.h:268
std::optional< Account > account
Definition mpt.h:248
std::optional< Buffer > blindingFactor
Definition mpt.h:263
std::optional< XRPAmount > fee
Definition mpt.h:269
std::optional< std::string > proof
Definition mpt.h:251
std::optional< Account > delegate
Definition mpt.h:264
std::optional< Buffer > issuerEncryptedAmt
Definition mpt.h:260
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:265
Arguments for building an MPTokenIssuanceCreate test transaction.
Definition mpt.h:134
std::optional< std::uint8_t > assetScale
Definition mpt.h:138
static std::vector< Account > allHolders
Definition mpt.h:135
std::optional< std::uint32_t > immutableFlags
Definition mpt.h:150
std::optional< std::uint32_t > holderCount
Definition mpt.h:142
std::optional< std::string > metadata
Definition mpt.h:140
std::optional< std::uint32_t > flags
Definition mpt.h:149
std::optional< uint256 > domainID
Definition mpt.h:152
std::optional< TER > err
Definition mpt.h:153
std::optional< std::uint64_t > maxAmt
Definition mpt.h:137
std::optional< std::uint32_t > ownerCount
Definition mpt.h:141
std::optional< Account > issuer
Definition mpt.h:136
std::optional< std::pair< std::vector< Account >, std::uint64_t > > pay
Definition mpt.h:148
std::optional< std::uint16_t > transferFee
Definition mpt.h:139
std::optional< std::vector< Account > > authorize
Definition mpt.h:145
Arguments for building an MPTokenIssuanceDestroy test transaction.
Definition mpt.h:198
std::optional< Account > issuer
Definition mpt.h:199
std::optional< std::uint32_t > flags
Definition mpt.h:203
std::optional< std::uint32_t > holderCount
Definition mpt.h:202
std::optional< std::uint32_t > ownerCount
Definition mpt.h:201
std::optional< TER > err
Definition mpt.h:204
Full constructor arguments for MPTTester initialization.
Definition mpt.h:178
std::uint16_t transferFee
Definition mpt.h:183
std::optional< TER > err
Definition mpt.h:191
std::uint32_t flags
Definition mpt.h:185
std::optional< std::uint64_t > maxAmt
Definition mpt.h:190
std::optional< Account > auditor
Definition mpt.h:182
std::optional< std::uint32_t > immutableFlags
Definition mpt.h:186
std::optional< std::uint64_t > pay
Definition mpt.h:184
Arguments for initializing funded MPT test accounts and issuance.
Definition mpt.h:160
std::optional< MPTCreate > create
Definition mpt.h:170
std::optional< Account > auditor
Definition mpt.h:164
PrettyAmount const xrp
Definition mpt.h:165
PrettyAmount const xrpHolders
Definition mpt.h:166
Arguments for building a ConfidentialMPTMergeInbox test transaction.
Definition mpt.h:277
std::optional< TER > err
Definition mpt.h:286
std::optional< std::uint32_t > ownerCount
Definition mpt.h:282
std::optional< std::uint32_t > holderCount
Definition mpt.h:283
std::optional< std::uint32_t > flags
Definition mpt.h:284
std::optional< XRPAmount > fee
Definition mpt.h:285
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:281
std::optional< Account > account
Definition mpt.h:278
std::optional< Account > delegate
Definition mpt.h:280
Arguments for building an MPTokenIssuanceSet test transaction.
Definition mpt.h:225
std::optional< uint256 > domainID
Definition mpt.h:236
std::optional< Account > account
Definition mpt.h:226
std::optional< std::uint32_t > holderCount
Definition mpt.h:230
std::optional< Buffer > auditorPubKey
Definition mpt.h:238
std::optional< std::uint32_t > ticketSeq
Definition mpt.h:239
std::optional< TER > err
Definition mpt.h:240
std::optional< std::uint32_t > immutableFlags
Definition mpt.h:232
std::optional< std::uint16_t > transferFee
Definition mpt.h:233
std::optional< std::uint32_t > flags
Definition mpt.h:231
std::optional< std::variant< Account, AccountID > > holder
Definition mpt.h:227
std::optional< std::string > metadata
Definition mpt.h:234
std::optional< std::uint32_t > ownerCount
Definition mpt.h:229
std::optional< Buffer > issuerPubKey
Definition mpt.h:237
std::optional< Account > delegate
Definition mpt.h:235
Stores the parameters that are exclusively used to generate a Pedersen linkage proof.
Definition mpt.h:369
Buffer const pedersenCommitment
The Pedersen commitment used by the proof.
Definition mpt.h:373
Buffer const blindingFactor
The blinding factor used to create the Pedersen commitment.
Definition mpt.h:388
Buffer const encryptedAmt
The encrypted amount linked to the Pedersen commitment.
Definition mpt.h:383
uint64_t const amt
Either the spending balance or the value being transferred.
Definition mpt.h:378
Represents an XRP, IOU, or MPT quantity This customizes the string conversion and supports XRP conver...