From a72a0936298de4d2aa8fb95b4a29d69202d59129 Mon Sep 17 00:00:00 2001 From: bthomee Date: Mon, 26 Jan 2026 10:57:51 -0800 Subject: [PATCH] deploy: 847e87563571ea88333f9440bba1df5cd9443110 --- AMMExtended__test_8cpp_source.html | 4 +- AMM_8cpp_source.html | 2 +- AMM_8h_source.html | 2 +- AMM__test_8cpp_source.html | 2 +- AccountDelete__test_8cpp_source.html | 4 +- AccountInfo__test_8cpp_source.html | 2 +- AccountObjects__test_8cpp_source.html | 2 +- AccountTx__test_8cpp_source.html | 4 +- Batch__test_8cpp_source.html | 18 +- Buffer__test_8cpp_source.html | 2 +- Credentials__test_8cpp_source.html | 2 +- DID__test_8cpp_source.html | 2 +- Delegate__test_8cpp_source.html | 2 +- Env_8cpp_source.html | 2 +- Env_8h_source.html | 2 +- EscrowToken__test_8cpp_source.html | 2 +- FeeVote__test_8cpp_source.html | 2 +- Handler__test_8cpp_source.html | 2 +- Invariants__test_8cpp_source.html | 2 +- LPTokenTransfer__test_8cpp_source.html | 2 +- LedgerEntry__test_8cpp_source.html | 6377 ++++++++--------- LedgerToJson_8cpp_source.html | 2 +- LoanBroker__test_8cpp_source.html | 10 +- Loan__test_8cpp_source.html | 26 +- NegativeUNL__test_8cpp_source.html | 2 +- Oracle_8cpp_source.html | 2 +- Path__test_8cpp_source.html | 4 +- Pathfinder_8cpp_source.html | 2 +- PerfLog__test_8cpp_source.html | 2 +- Quality_8cpp_source.html | 2 +- Quality_8h_source.html | 2 +- RocksDBFactory_8cpp_source.html | 2 +- STIssue__test_8cpp_source.html | 2 +- Slice_8cpp_source.html | 2 +- TMGetObjectByHash__test_8cpp_source.html | 2 +- TestHelpers_8cpp_source.html | 2 +- TestHelpers_8h_source.html | 1810 +++-- TrustedPublisherServer_8h_source.html | 2 +- TxQ__test_8cpp_source.html | 674 +- ValidatorList__test_8cpp_source.html | 2 +- XChain__test_8cpp_source.html | 2 +- amount_8cpp_source.html | 2 +- antithesis__sdk_8h_source.html | 2 +- balance_8cpp_source.html | 2 +- base58__test_8cpp_source.html | 2 +- check_8cpp_source.html | 2 +- check_8h_source.html | 2 +- ..._1_1test_1_1LedgerEntry__XChain__test.html | 12 +- ..._1_1test_1_1LedgerEntry__test-members.html | 10 +- classxrpl_1_1test_1_1LedgerEntry__test.html | 136 +- delivermin_8h_source.html | 2 +- escrow_8cpp_source.html | 2 +- escrow_8h_source.html | 4 +- fee_8h_source.html | 2 +- functions_c.html | 2 +- functions_func_c.html | 2 +- functions_func_r.html | 2 +- functions_func_t.html | 4 +- functions_r.html | 2 +- functions_t.html | 4 +- import__test_8cpp_source.html | 2 +- md__2____w_2rippled_2rippled_2BUILD.html | 4 +- memo_8h_source.html | 2 +- mpt_8cpp_source.html | 2 +- mpt_8h_source.html | 2 +- namespacemembers_c.html | 2 +- namespacemembers_func_c.html | 2 +- namespacexrpl_1_1test.html | 8 +- namespacexrpl_1_1test_1_1jtx.html | 52 +- namespacexrpl_1_1test_1_1jtx_1_1check.html | 4 +- namespacexrpl_1_1test_1_1jtx_1_1loan.html | 26 +- ...pacexrpl_1_1test_1_1jtx_1_1loanBroker.html | 12 +- namespacexrpl_1_1test_1_1jtx_1_1paychan.html | 4 +- paths_8cpp_source.html | 2 +- pay_8cpp_source.html | 2 +- pay_8h_source.html | 2 +- search/all_19.js | 2 +- search/all_1b.js | 4 +- search/all_a.js | 4 +- search/functions_12.js | 2 +- search/functions_14.js | 4 +- search/functions_3.js | 4 +- sendmax_8h_source.html | 2 +- src_2test_2csf_2Scheduler_8h_source.html | 2 +- src_2test_2jtx_2amount_8h_source.html | 2 +- ...test_1_1LedgerEntry__test_1_1Subfield.html | 8 +- structxrpl_1_1test_1_1jtx_1_1JTxField.html | 16 +- ...rpl_1_1test_1_1jtx_1_1JTxFieldWrapper.html | 14 +- ...1_1JTxFieldWrapper_3_01blobField_01_4.html | 18 +- ...0_01StoredValue_00_01StoredValue_01_4.html | 16 +- ...xrpl_1_1test_1_1jtx_1_1accountIDField.html | 20 +- structxrpl_1_1test_1_1jtx_1_1blobField.html | 22 +- ...txrpl_1_1test_1_1jtx_1_1stAmountField.html | 20 +- ...xrpl_1_1test_1_1jtx_1_1timePointField.html | 20 +- ...ctxrpl_1_1test_1_1jtx_1_1uint256Field.html | 20 +- ...xrpl_1_1test_1_1jtx_1_1valueUnitField.html | 18 +- trust_8cpp_source.html | 2 +- trust_8h_source.html | 2 +- 98 files changed, 4764 insertions(+), 4775 deletions(-) diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html index ee1b38f80e..c79dbbc508 100644 --- a/AMMExtended__test_8cpp_source.html +++ b/AMMExtended__test_8cpp_source.html @@ -4152,7 +4152,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:13
Json::Value ledgerEntryState(Env &env, Account const &acct_a, Account const &acct_b, std::string const &currency)
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
-
bool same(STPathSet const &st1, Args const &... args)
+
bool same(STPathSet const &st1, Args const &... args)
Json::Value rate(Account const &account, double multiplier)
Set a transfer rate.
Definition rate.cpp:13
XRPAmount txfee(Env const &env, std::uint16_t n)
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
@@ -4168,7 +4168,7 @@ $(document).ready(function() { init_codefold(0); });
owner_count< ltOFFER > offers
Match the number of offers in the account's owner directory.
Definition owners.h:73
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
bool checkArraySize(Json::Value const &val, unsigned int size)
-
STPath stpath(Args const &... args)
+
STPath stpath(Args const &... args)
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
void n_offers(Env &env, std::size_t n, Account const &account, STAmount const &in, STAmount const &out)
Json::Value getAccountLines(Env &env, AccountID const &acctId)
diff --git a/AMM_8cpp_source.html b/AMM_8cpp_source.html index f409a16cfe..fefbe3282d 100644 --- a/AMM_8cpp_source.html +++ b/AMM_8cpp_source.html @@ -1078,7 +1078,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value ammClawback(Account const &issuer, Account const &holder, Issue const &asset, Issue const &asset2, std::optional< STAmount > const &amount)
Definition AMM.cpp:814
Json::Value create(AccountID const &account, AccountID const &to, STAmount const &amount, NetClock::duration const &settleDelay, PublicKey const &pk, std::optional< NetClock::time_point > const &cancelAfter, std::optional< std::uint32_t > const &dstTag)
static Number number(STAmount const &a)
Definition AMM.cpp:17
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ fhZERO_IF_FROZEN
Definition View.h:59
@ fhIGNORE_FREEZE
Definition View.h:59
diff --git a/AMM_8h_source.html b/AMM_8h_source.html index ae29bf0f54..37eba52f69 100644 --- a/AMM_8h_source.html +++ b/AMM_8h_source.html @@ -633,7 +633,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
Definition AMM.cpp:791
Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
Definition AMM.cpp:803
Json::Value ammClawback(Account const &issuer, Account const &holder, Issue const &asset, Issue const &asset2, std::optional< STAmount > const &amount)
Definition AMM.cpp:814
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::uint32_t tfWithdrawAll
Definition TxFlags.h:226
constexpr std::uint32_t tfOneAssetWithdrawAll
Definition TxFlags.h:227
diff --git a/AMM__test_8cpp_source.html b/AMM__test_8cpp_source.html index d9d303cebb..d232d3372f 100644 --- a/AMM__test_8cpp_source.html +++ b/AMM__test_8cpp_source.html @@ -8242,7 +8242,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value accountBalance(Env &env, Account const &acct)
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition flags.h:102
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
diff --git a/AccountDelete__test_8cpp_source.html b/AccountDelete__test_8cpp_source.html index 2954333ccc..8b4ffa4f26 100644 --- a/AccountDelete__test_8cpp_source.html +++ b/AccountDelete__test_8cpp_source.html @@ -1275,7 +1275,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Definition Indexes.cpp:256
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
Keylet page(uint256 const &root, std::uint64_t index=0) noexcept
A page in a directory.
Definition Indexes.cpp:362
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value cancel(jtx::Account const &dest, uint256 const &checkId)
Cancel a check.
Definition check.cpp:41
Json::Value accept(jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:29
Json::Value ledgerEntry(jtx::Env &env, jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:59
@@ -1295,7 +1295,7 @@ $(document).ready(function() { init_codefold(0); });
void incLgrSeqForAccDel(jtx::Env &env, jtx::Account const &acc, std::uint32_t margin=0)
Json::Value offer_cancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition offer.cpp:27
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
Json::Value regkey(Account const &account, disabled_t)
Disable the regular key.
Definition regkey.cpp:10
owner_count< ltOFFER > offers
Match the number of offers in the account's owner directory.
Definition owners.h:73
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
diff --git a/AccountInfo__test_8cpp_source.html b/AccountInfo__test_8cpp_source.html index 8212758bc4..c6b5fdc403 100644 --- a/AccountInfo__test_8cpp_source.html +++ b/AccountInfo__test_8cpp_source.html @@ -829,7 +829,7 @@ $(document).ready(function() { init_codefold(0); });
@ nullValue
'null' value
Definition json_value.h:20
@ arrayValue
array value (ordered list)
Definition json_value.h:26
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:27
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition flags.h:102
diff --git a/AccountObjects__test_8cpp_source.html b/AccountObjects__test_8cpp_source.html index 1841e76767..c1e85cd47c 100644 --- a/AccountObjects__test_8cpp_source.html +++ b/AccountObjects__test_8cpp_source.html @@ -1582,7 +1582,7 @@ $(document).ready(function() { init_codefold(0); });
@ arrayValue
array value (ordered list)
Definition json_value.h:26
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:27
Taxon toTaxon(std::uint32_t i)
Definition nft.h:23
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value auth(Account const &account, Account const &auth)
Preauthorize for deposit.
Definition deposit.cpp:13
Json::Value setTx(AccountID const &account, Credentials const &credentials, std::optional< uint256 > domain)
Json::Value create(Account const &account, std::uint32_t count)
Create one of more tickets.
Definition ticket.cpp:12
diff --git a/AccountTx__test_8cpp_source.html b/AccountTx__test_8cpp_source.html index feb391e349..ca8af8b1d4 100644 --- a/AccountTx__test_8cpp_source.html +++ b/AccountTx__test_8cpp_source.html @@ -1089,7 +1089,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet check(AccountID const &id, std::uint32_t seq) noexcept
A Check.
Definition Indexes.cpp:318
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
Json::Value cash(jtx::Account const &dest, uint256 const &checkId, STAmount const &amount)
Cash a check requiring that a specific amount be delivered.
Definition check.cpp:14
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value cancel(jtx::Account const &dest, uint256 const &checkId)
Cancel a check.
Definition check.cpp:41
Json::Value auth(Account const &account, Account const &auth)
Preauthorize for deposit.
Definition deposit.cpp:13
Json::Value create(Account const &account, std::uint32_t count)
Create one of more tickets.
Definition ticket.cpp:12
@@ -1099,7 +1099,7 @@ $(document).ready(function() { init_codefold(0); });
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
Json::Value offer_cancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition offer.cpp:27
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Json::Value regkey(Account const &account, disabled_t)
Disable the regular key.
Definition regkey.cpp:10
Json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
diff --git a/Batch__test_8cpp_source.html b/Batch__test_8cpp_source.html index 2b4d96b655..c012ccdd1c 100644 --- a/Batch__test_8cpp_source.html +++ b/Batch__test_8cpp_source.html @@ -4014,10 +4014,10 @@ $(document).ready(function() { init_codefold(0); });
3857 env(noop(alice));
3858 env(noop(alice));
3859 env(noop(alice));
-
3860 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
3860 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
3861
3862 env(noop(carol), ter(terQUEUED));
-
3863 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
3863 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
3864
3865 auto const aliceSeq = env.seq(alice);
3866 auto const bobSeq = env.seq(bob);
@@ -4032,7 +4032,7 @@ $(document).ready(function() { init_codefold(0); });
3875 ter(terQUEUED));
3876 }
3877
-
3878 checkMetrics(*this, env, 2, std::nullopt, 3, 2);
+
3878 checkMetrics(*this, env, 2, std::nullopt, 3, 2);
3879
3880 // Replace Queued Batch
3881 {
@@ -4048,7 +4048,7 @@ $(document).ready(function() { init_codefold(0); });
3891 env.close();
3892 }
3893
-
3894 checkMetrics(*this, env, 0, 12, 1, 6);
+
3894 checkMetrics(*this, env, 0, 12, 1, 6);
3895 }
3896
3897 // inner batch transactions are counter towards the ledger tx count
@@ -4074,7 +4074,7 @@ $(document).ready(function() { init_codefold(0); });
3917 // Fill the ledger leaving room for 1 queued transaction
3918 env(noop(alice));
3919 env(noop(alice));
-
3920 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
+
3920 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
3921
3922 auto const aliceSeq = env.seq(alice);
3923 auto const bobSeq = env.seq(bob);
@@ -4089,10 +4089,10 @@ $(document).ready(function() { init_codefold(0); });
3932 ter(tesSUCCESS));
3933 }
3934
-
3935 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
3935 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
3936
3937 env(noop(carol), ter(terQUEUED));
-
3938 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
3938 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
3939 }
3940 }
@@ -4795,15 +4795,15 @@ $(document).ready(function() { init_codefold(0); });
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
+
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), std::source_location const location=std::source_location::current())
void incLgrSeqForAccDel(jtx::Env &env, jtx::Account const &acc, std::uint32_t margin=0)
std::array< Account, 1+sizeof...(Args)> noripple(Account const &account, Args const &... args)
Designate accounts as no-ripple in Env::fund.
Definition Env.h:49
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Json::Value regkey(Account const &account, disabled_t)
Disable the regular key.
Definition regkey.cpp:10
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
Json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
-
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), source_location const location=source_location::current())
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::uint32_t asfAllowTrustLineClawback
Definition TxFlags.h:75
@ telINSUF_FEE_P
Definition TER.h:38
diff --git a/Buffer__test_8cpp_source.html b/Buffer__test_8cpp_source.html index 4da522eee2..4866dea0d0 100644 --- a/Buffer__test_8cpp_source.html +++ b/Buffer__test_8cpp_source.html @@ -367,7 +367,7 @@ $(document).ready(function() { init_codefold(0); });
T memcmp(T... args)
T memcpy(T... args)
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
diff --git a/Credentials__test_8cpp_source.html b/Credentials__test_8cpp_source.html index 00b82981c9..e6064f2b21 100644 --- a/Credentials__test_8cpp_source.html +++ b/Credentials__test_8cpp_source.html @@ -1246,7 +1246,7 @@ $(document).ready(function() { init_codefold(0); });
FeatureBitset testable_amendments()
Definition Env.h:55
Json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
-
bool checkVL(Slice const &result, std::string const &expected)
+
bool checkVL(Slice const &result, std::string const &expected)
static XRPAmount reserve(jtx::Env &env, std::uint32_t count)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::uint32_t const tfTransferable
Definition TxFlags.h:123
diff --git a/DID__test_8cpp_source.html b/DID__test_8cpp_source.html index 2a165a5430..b1a117f439 100644 --- a/DID__test_8cpp_source.html +++ b/DID__test_8cpp_source.html @@ -504,7 +504,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
FeatureBitset testable_amendments()
Definition Env.h:55
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
-
bool checkVL(Slice const &result, std::string const &expected)
+
bool checkVL(Slice const &result, std::string const &expected)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ DID
@ all
diff --git a/Delegate__test_8cpp_source.html b/Delegate__test_8cpp_source.html index 7fd92300aa..28fa26e424 100644 --- a/Delegate__test_8cpp_source.html +++ b/Delegate__test_8cpp_source.html @@ -1990,7 +1990,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:356
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Definition Indexes.cpp:447
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value set(jtx::Account const &account, jtx::Account const &authorize, std::vector< std::string > const &permissions)
Definition delegate.cpp:12
Json::Value entry(jtx::Env &env, jtx::Account const &account, jtx::Account const &authorize)
Definition delegate.cpp:36
Json::Value set(jtx::Account const &account)
Definition dids.cpp:14
diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html index 505c0fa7a7..db86f0dd5c 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -937,7 +937,7 @@ $(document).ready(function() { init_codefold(0); });
static autofill_t const autofill
Definition tags.h:23
void sign(Json::Value &jv, Account const &account, Json::Value &sigObject)
Sign automatically into a specific Json field of the jv object.
Definition utility.cpp:27
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition utility.cpp:18
-
auto const amount
+
auto const amount
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition utility.cpp:44
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
diff --git a/Env_8h_source.html b/Env_8h_source.html index b419be57a0..68743767e6 100644 --- a/Env_8h_source.html +++ b/Env_8h_source.html @@ -862,7 +862,7 @@ $(document).ready(function() { init_codefold(0); });
require_t required(Args const &... args)
Compose many condition functors into one.
Definition require.h:30
static autofill_t const autofill
Definition tags.h:23
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
@ noripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
diff --git a/EscrowToken__test_8cpp_source.html b/EscrowToken__test_8cpp_source.html index 8888d08964..621c7675b8 100644 --- a/EscrowToken__test_8cpp_source.html +++ b/EscrowToken__test_8cpp_source.html @@ -4173,7 +4173,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition flags.h:102
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::uint32_t asfGlobalFreeze
Definition TxFlags.h:64
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html index 3251ea5319..b7c167e99d 100644 --- a/FeeVote__test_8cpp_source.html +++ b/FeeVote__test_8cpp_source.html @@ -944,7 +944,7 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Definition Indexes.cpp:204
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
FeatureBitset testable_amendments()
Definition Env.h:55
bool verifyFeeObject(std::shared_ptr< Ledger const > const &ledger, Rules const &rules, FeeSettingsFields const &expected)
STTx createInvalidFeeTx(Rules const &rules, std::uint32_t seq, bool missingRequiredFields=true, bool wrongFeatureFields=false, std::uint32_t uniqueValue=42)
diff --git a/Handler__test_8cpp_source.html b/Handler__test_8cpp_source.html index 974d4a6639..9163fe2927 100644 --- a/Handler__test_8cpp_source.html +++ b/Handler__test_8cpp_source.html @@ -226,7 +226,7 @@ $(document).ready(function() { init_codefold(0); });
T make_tuple(T... args)
std::set< char const * > getHandlerNames()
Return names of all methods.
Definition Handler.cpp:301
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
Definition Handler.cpp:295
-
auto make_vector(Input const &input)
+
auto make_vector(Input const &input)
std::ostream & operator<<(std::ostream &os, PrettyAmount const &amount)
Definition amount.cpp:54
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
diff --git a/Invariants__test_8cpp_source.html b/Invariants__test_8cpp_source.html index fbfea94559..e152d1bd0f 100644 --- a/Invariants__test_8cpp_source.html +++ b/Invariants__test_8cpp_source.html @@ -4146,7 +4146,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
static increment_t const increment
Definition tags.h:41
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
diff --git a/LPTokenTransfer__test_8cpp_source.html b/LPTokenTransfer__test_8cpp_source.html index 0adb4dd411..5dccf5a85d 100644 --- a/LPTokenTransfer__test_8cpp_source.html +++ b/LPTokenTransfer__test_8cpp_source.html @@ -597,7 +597,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
Definition Indexes.cpp:409
Keylet check(AccountID const &id, std::uint32_t seq) noexcept
A Check.
Definition Indexes.cpp:318
Json::Value cash(jtx::Account const &dest, uint256 const &checkId, STAmount const &amount)
Cash a check requiring that a specific amount be delivered.
Definition check.cpp:14
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value mint(jtx::Account const &account, std::uint32_t nfTokenTaxon)
Mint an NFToken.
Definition token.cpp:15
Json::Value acceptBuyOffer(jtx::Account const &account, uint256 const &offerIndex)
Accept an NFToken buy offer.
Definition token.cpp:160
Json::Value acceptSellOffer(jtx::Account const &account, uint256 const &offerIndex)
Accept an NFToken sell offer.
Definition token.cpp:170
diff --git a/LedgerEntry__test_8cpp_source.html b/LedgerEntry__test_8cpp_source.html index a0c7f57ec6..d8f3b0cb40 100644 --- a/LedgerEntry__test_8cpp_source.html +++ b/LedgerEntry__test_8cpp_source.html @@ -97,3225 +97,3219 @@ $(document).ready(function() { init_codefold(0); });
14#include <xrpl/protocol/STXChainBridge.h>
15#include <xrpl/protocol/jss.h>
16
-
17#if (defined(__clang_major__) && __clang_major__ < 15)
-
18#include <experimental/source_location>
-
19using source_location = std::experimental::source_location;
-
20#else
-
21#include <source_location>
-
22using std::source_location;
-
23#endif
-
24namespace xrpl {
-
25
-
26namespace test {
-
27
-
-
28enum class FieldType {
- - - - - - - - - - - - - -
42};
+
17#include <source_location>
+
18namespace xrpl {
+
19
+
20namespace test {
+
21
+
+
22enum class FieldType {
+ + + + + + + + + + + + + +
36};
-
43
-
- -
45 {jss::account, FieldType::AccountField},
-
46 {jss::accounts, FieldType::TwoAccountArrayField},
-
47 {jss::asset, FieldType::IssueField},
-
48 {jss::asset2, FieldType::IssueField},
-
49 {jss::authorize, FieldType::AccountField},
-
50 {jss::authorized, FieldType::AccountField},
-
51 {jss::credential_type, FieldType::BlobField},
-
52 {jss::currency, FieldType::CurrencyField},
-
53 {jss::issuer, FieldType::AccountField},
-
54 {jss::oracle_document_id, FieldType::UInt32Field},
-
55 {jss::owner, FieldType::AccountField},
-
56 {jss::seq, FieldType::UInt32Field},
-
57 {jss::subject, FieldType::AccountField},
-
58 {jss::ticket_seq, FieldType::UInt32Field},
-
59};
+
37
+
+ +
39 {jss::account, FieldType::AccountField},
+
40 {jss::accounts, FieldType::TwoAccountArrayField},
+
41 {jss::asset, FieldType::IssueField},
+
42 {jss::asset2, FieldType::IssueField},
+
43 {jss::authorize, FieldType::AccountField},
+
44 {jss::authorized, FieldType::AccountField},
+
45 {jss::credential_type, FieldType::BlobField},
+
46 {jss::currency, FieldType::CurrencyField},
+
47 {jss::issuer, FieldType::AccountField},
+
48 {jss::oracle_document_id, FieldType::UInt32Field},
+
49 {jss::owner, FieldType::AccountField},
+
50 {jss::seq, FieldType::UInt32Field},
+
51 {jss::subject, FieldType::AccountField},
+
52 {jss::ticket_seq, FieldType::UInt32Field},
+
53};
-
60
- -
- -
63{
-
64 auto it = std::ranges::find_if(mappings, [&fieldName](auto const& pair) {
-
65 return pair.first == fieldName;
-
66 });
-
67 if (it != mappings.end())
-
68 {
-
69 return it->second;
-
70 }
-
71 else
-
72 {
-
73 Throw<std::runtime_error>(
-
74 "`mappings` is missing field " + std::string(fieldName.c_str()));
-
75 }
-
76}
+
54
+ +
+ +
57{
+
58 auto it = std::ranges::find_if(mappings, [&fieldName](auto const& pair) {
+
59 return pair.first == fieldName;
+
60 });
+
61 if (it != mappings.end())
+
62 {
+
63 return it->second;
+
64 }
+
65 else
+
66 {
+
67 Throw<std::runtime_error>(
+
68 "`mappings` is missing field " + std::string(fieldName.c_str()));
+
69 }
+
70}
-
77
- -
- -
80{
-
81 switch (typeID)
-
82 {
- -
84 return "AccountID";
- -
86 return "array";
- -
88 return "hex string";
- -
90 return "Currency";
- - -
93 return "hex string";
- -
95 return "hex string or object";
- -
97 return "Issue";
- -
99 return "length-2 array of Accounts";
- -
101 return "number";
- -
103 return "number";
-
104 default:
-
105 Throw<std::runtime_error>(
-
106 "unknown type " + std::to_string(static_cast<uint8_t>(typeID)));
-
107 }
-
108}
+
71
+ +
+ +
74{
+
75 switch (typeID)
+
76 {
+ +
78 return "AccountID";
+ +
80 return "array";
+ +
82 return "hex string";
+ +
84 return "Currency";
+ + +
87 return "hex string";
+ +
89 return "hex string or object";
+ +
91 return "Issue";
+ +
93 return "length-2 array of Accounts";
+ +
95 return "number";
+ +
97 return "number";
+
98 default:
+
99 Throw<std::runtime_error>(
+
100 "unknown type " + std::to_string(static_cast<uint8_t>(typeID)));
+
101 }
+
102}
-
109
-
- -
111{
-
112 void
-
- -
114 Json::Value const& jv,
-
115 std::string const& err,
-
116 std::string const& msg,
-
117 source_location const location = source_location::current())
-
118 {
-
119 if (BEAST_EXPECT(jv.isMember(jss::status)))
-
120 BEAST_EXPECTS(
-
121 jv[jss::status] == "error", std::to_string(location.line()));
-
122 if (BEAST_EXPECT(jv.isMember(jss::error)))
-
123 BEAST_EXPECTS(
-
124 jv[jss::error] == err,
-
125 "Expected error " + err + ", received " +
-
126 jv[jss::error].asString() + ", at line " +
-
127 std::to_string(location.line()) + ", " +
-
128 jv.toStyledString());
-
129 if (msg.empty())
-
130 {
-
131 BEAST_EXPECTS(
-
132 jv[jss::error_message] == Json::nullValue ||
-
133 jv[jss::error_message] == "",
-
134 "Expected no error message, received \"" +
-
135 jv[jss::error_message].asString() + "\", at line " +
-
136 std::to_string(location.line()) + ", " +
-
137 jv.toStyledString());
-
138 }
-
139 else if (BEAST_EXPECT(jv.isMember(jss::error_message)))
-
140 BEAST_EXPECTS(
-
141 jv[jss::error_message] == msg,
-
142 "Expected error message \"" + msg + "\", received \"" +
-
143 jv[jss::error_message].asString() + "\", at line " +
-
144 std::to_string(location.line()) + ", " +
-
145 jv.toStyledString());
-
146 }
+
103
+
+ +
105{
+
106 void
+
+ +
108 Json::Value const& jv,
+
109 std::string const& err,
+
110 std::string const& msg,
+ +
112 {
+
113 if (BEAST_EXPECT(jv.isMember(jss::status)))
+
114 BEAST_EXPECTS(
+
115 jv[jss::status] == "error", std::to_string(location.line()));
+
116 if (BEAST_EXPECT(jv.isMember(jss::error)))
+
117 BEAST_EXPECTS(
+
118 jv[jss::error] == err,
+
119 "Expected error " + err + ", received " +
+
120 jv[jss::error].asString() + ", at line " +
+
121 std::to_string(location.line()) + ", " +
+
122 jv.toStyledString());
+
123 if (msg.empty())
+
124 {
+
125 BEAST_EXPECTS(
+
126 jv[jss::error_message] == Json::nullValue ||
+
127 jv[jss::error_message] == "",
+
128 "Expected no error message, received \"" +
+
129 jv[jss::error_message].asString() + "\", at line " +
+
130 std::to_string(location.line()) + ", " +
+
131 jv.toStyledString());
+
132 }
+
133 else if (BEAST_EXPECT(jv.isMember(jss::error_message)))
+
134 BEAST_EXPECTS(
+
135 jv[jss::error_message] == msg,
+
136 "Expected error message \"" + msg + "\", received \"" +
+
137 jv[jss::error_message].asString() + "\", at line " +
+
138 std::to_string(location.line()) + ", " +
+
139 jv.toStyledString());
+
140 }
-
147
- -
- -
150 {
-
151 static Json::Value const injectObject = []() {
- -
153 obj[jss::account] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
-
154 obj[jss::ledger_index] = "validated";
-
155 return obj;
+
141
+ +
+ +
144 {
+
145 static Json::Value const injectObject = []() {
+ +
147 obj[jss::account] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
+
148 obj[jss::ledger_index] = "validated";
+
149 return obj;
+
150 }();
+
151 static Json::Value const injectArray = []() {
+ +
153 arr[0u] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
+
154 arr[1u] = "validated";
+
155 return arr;
156 }();
-
157 static Json::Value const injectArray = []() {
- -
159 arr[0u] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
-
160 arr[1u] = "validated";
-
161 return arr;
-
162 }();
-
163 static std::array<Json::Value, 21> const allBadValues = {
-
164 "", // 0
-
165 true, // 1
-
166 1, // 2
-
167 "1", // 3
-
168 -1, // 4
-
169 1.1, // 5
-
170 "-1", // 6
-
171 "abcdef", // 7
-
172 "ABCDEF", // 8
-
173 "12KK", // 9
-
174 "0123456789ABCDEFGH", // 10
-
175 "rJxKV9e9p6wiPw!!!!xrJ4X1n98LosPL1sgcJW", // 11
-
176 "rPSTrR5yEr11uMkfsz1kHCp9jK4aoa3Avv", // 12
-
177 "n9K2isxwTxcSHJKxMkJznDoWXAUs7NNy49H9Fknz1pC7oHAH3kH9", // 13
-
178 "USD", // 14
-
179 "USDollars", // 15
-
180 "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6B01403D"
-
181 "6D", // 16
-
182 Json::arrayValue, // 17
-
183 Json::objectValue, // 18
-
184 injectObject, // 19
-
185 injectArray // 20
-
186 };
-
187
-
188 auto remove =
- - -
191 indices.begin(), indices.end());
- -
193 values.reserve(allBadValues.size() - indexSet.size());
-
194 for (std::size_t i = 0; i < allBadValues.size(); ++i)
-
195 {
-
196 if (indexSet.find(i) == indexSet.end())
-
197 {
-
198 values.push_back(allBadValues[i]);
-
199 }
-
200 }
-
201 return values;
-
202 };
-
203
-
204 static auto const& badAccountValues = remove({12});
-
205 static auto const& badArrayValues = remove({17, 20});
-
206 static auto const& badBlobValues = remove({3, 7, 8, 16});
-
207 static auto const& badCurrencyValues = remove({14});
-
208 static auto const& badHashValues = remove({2, 3, 7, 8, 16});
-
209 static auto const& badFixedHashValues = remove({1, 2, 3, 4, 7, 8, 16});
-
210 static auto const& badIndexValues = remove({12, 16, 18, 19});
-
211 static auto const& badUInt32Values = remove({2, 3});
-
212 static auto const& badUInt64Values = remove({2, 3});
-
213 static auto const& badIssueValues = remove({});
-
214
-
215 switch (fieldType)
-
216 {
- -
218 return badAccountValues;
- - -
221 return badArrayValues;
- -
223 return badBlobValues;
- -
225 return badCurrencyValues;
- -
227 return badHashValues;
- -
229 return badIndexValues;
- -
231 return badFixedHashValues;
- -
233 return badIssueValues;
- -
235 return badUInt32Values;
- -
237 return badUInt64Values;
-
238 default:
-
239 Throw<std::runtime_error>(
-
240 "unknown type " +
-
241 std::to_string(static_cast<uint8_t>(fieldType)));
-
242 }
-
243 }
+
157 static std::array<Json::Value, 21> const allBadValues = {
+
158 "", // 0
+
159 true, // 1
+
160 1, // 2
+
161 "1", // 3
+
162 -1, // 4
+
163 1.1, // 5
+
164 "-1", // 6
+
165 "abcdef", // 7
+
166 "ABCDEF", // 8
+
167 "12KK", // 9
+
168 "0123456789ABCDEFGH", // 10
+
169 "rJxKV9e9p6wiPw!!!!xrJ4X1n98LosPL1sgcJW", // 11
+
170 "rPSTrR5yEr11uMkfsz1kHCp9jK4aoa3Avv", // 12
+
171 "n9K2isxwTxcSHJKxMkJznDoWXAUs7NNy49H9Fknz1pC7oHAH3kH9", // 13
+
172 "USD", // 14
+
173 "USDollars", // 15
+
174 "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6B01403D"
+
175 "6D", // 16
+
176 Json::arrayValue, // 17
+
177 Json::objectValue, // 18
+
178 injectObject, // 19
+
179 injectArray // 20
+
180 };
+
181
+
182 auto remove =
+ + +
185 indices.begin(), indices.end());
+ +
187 values.reserve(allBadValues.size() - indexSet.size());
+
188 for (std::size_t i = 0; i < allBadValues.size(); ++i)
+
189 {
+
190 if (indexSet.find(i) == indexSet.end())
+
191 {
+
192 values.push_back(allBadValues[i]);
+
193 }
+
194 }
+
195 return values;
+
196 };
+
197
+
198 static auto const& badAccountValues = remove({12});
+
199 static auto const& badArrayValues = remove({17, 20});
+
200 static auto const& badBlobValues = remove({3, 7, 8, 16});
+
201 static auto const& badCurrencyValues = remove({14});
+
202 static auto const& badHashValues = remove({2, 3, 7, 8, 16});
+
203 static auto const& badFixedHashValues = remove({1, 2, 3, 4, 7, 8, 16});
+
204 static auto const& badIndexValues = remove({12, 16, 18, 19});
+
205 static auto const& badUInt32Values = remove({2, 3});
+
206 static auto const& badUInt64Values = remove({2, 3});
+
207 static auto const& badIssueValues = remove({});
+
208
+
209 switch (fieldType)
+
210 {
+ +
212 return badAccountValues;
+ + +
215 return badArrayValues;
+ +
217 return badBlobValues;
+ +
219 return badCurrencyValues;
+ +
221 return badHashValues;
+ +
223 return badIndexValues;
+ +
225 return badFixedHashValues;
+ +
227 return badIssueValues;
+ +
229 return badUInt32Values;
+ +
231 return badUInt64Values;
+
232 default:
+
233 Throw<std::runtime_error>(
+
234 "unknown type " +
+
235 std::to_string(static_cast<uint8_t>(fieldType)));
+
236 }
+
237 }
-
244
- -
- -
247 {
-
248 static Json::Value const twoAccountArray = []() {
- -
250 arr[0u] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
-
251 arr[1u] = "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5";
-
252 return arr;
-
253 }();
-
254 static Json::Value const issueObject = []() {
- -
256 arr[jss::currency] = "XRP";
-
257 return arr;
-
258 }();
-
259
-
260 auto const typeID = getFieldType(fieldName);
-
261 switch (typeID)
-
262 {
- -
264 return "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5";
- -
266 return Json::arrayValue;
- -
268 return "ABCDEF";
- -
270 return "USD";
- -
272 return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6"
-
273 "B01403D6D";
- -
275 return issueObject;
- -
277 return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6"
-
278 "B01403D6D";
- -
280 return twoAccountArray;
- -
282 return 1;
- -
284 return 1;
-
285 default:
-
286 Throw<std::runtime_error>(
-
287 "unknown type " +
-
288 std::to_string(static_cast<uint8_t>(typeID)));
-
289 }
-
290 }
+
238
+ +
+ +
241 {
+
242 static Json::Value const twoAccountArray = []() {
+ +
244 arr[0u] = "rhigTLJJyXXSRUyRCQtqi1NoAZZzZnS4KU";
+
245 arr[1u] = "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5";
+
246 return arr;
+
247 }();
+
248 static Json::Value const issueObject = []() {
+ +
250 arr[jss::currency] = "XRP";
+
251 return arr;
+
252 }();
+
253
+
254 auto const typeID = getFieldType(fieldName);
+
255 switch (typeID)
+
256 {
+ +
258 return "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5";
+ +
260 return Json::arrayValue;
+ +
262 return "ABCDEF";
+ +
264 return "USD";
+ +
266 return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6"
+
267 "B01403D6D";
+ +
269 return issueObject;
+ +
271 return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6"
+
272 "B01403D6D";
+ +
274 return twoAccountArray;
+ +
276 return 1;
+ +
278 return 1;
+
279 default:
+
280 Throw<std::runtime_error>(
+
281 "unknown type " +
+
282 std::to_string(static_cast<uint8_t>(typeID)));
+
283 }
+
284 }
-
291
-
292 void
-
- -
294 test::jtx::Env& env,
-
295 Json::Value correctRequest,
-
296 Json::StaticString const fieldName,
-
297 FieldType const typeID,
-
298 std::string const& expectedError,
-
299 bool required = true,
-
300 source_location const location = source_location::current())
-
301 {
-
302 forAllApiVersions([&, this](unsigned apiVersion) {
-
303 if (required)
-
304 {
-
305 correctRequest.removeMember(fieldName);
-
306 Json::Value const jrr = env.rpc(
-
307 apiVersion,
-
308 "json",
-
309 "ledger_entry",
-
310 to_string(correctRequest))[jss::result];
-
311 if (apiVersion < 2u)
-
312 checkErrorValue(jrr, "unknownOption", "", location);
-
313 else
- -
315 jrr,
-
316 "invalidParams",
-
317 "No ledger_entry params provided.",
-
318 location);
-
319 }
-
320 auto tryField = [&](Json::Value fieldValue) -> void {
-
321 correctRequest[fieldName] = fieldValue;
-
322 Json::Value const jrr = env.rpc(
-
323 apiVersion,
-
324 "json",
-
325 "ledger_entry",
-
326 to_string(correctRequest))[jss::result];
-
327 auto const expectedErrMsg =
-
328 RPC::expected_field_message(fieldName, getTypeName(typeID));
-
329 checkErrorValue(jrr, expectedError, expectedErrMsg, location);
-
330 };
-
331
-
332 auto const& badValues = getBadValues(typeID);
-
333 for (auto const& value : badValues)
-
334 {
-
335 tryField(value);
-
336 }
-
337 if (required)
-
338 {
-
339 tryField(Json::nullValue);
-
340 }
-
341 });
-
342 }
+
285
+
286 void
+
+ +
288 test::jtx::Env& env,
+
289 Json::Value correctRequest,
+
290 Json::StaticString const fieldName,
+
291 FieldType const typeID,
+
292 std::string const& expectedError,
+
293 bool required = true,
+ +
295 {
+
296 forAllApiVersions([&, this](unsigned apiVersion) {
+
297 if (required)
+
298 {
+
299 correctRequest.removeMember(fieldName);
+
300 Json::Value const jrr = env.rpc(
+
301 apiVersion,
+
302 "json",
+
303 "ledger_entry",
+
304 to_string(correctRequest))[jss::result];
+
305 if (apiVersion < 2u)
+
306 checkErrorValue(jrr, "unknownOption", "", location);
+
307 else
+ +
309 jrr,
+
310 "invalidParams",
+
311 "No ledger_entry params provided.",
+
312 location);
+
313 }
+
314 auto tryField = [&](Json::Value fieldValue) -> void {
+
315 correctRequest[fieldName] = fieldValue;
+
316 Json::Value const jrr = env.rpc(
+
317 apiVersion,
+
318 "json",
+
319 "ledger_entry",
+
320 to_string(correctRequest))[jss::result];
+
321 auto const expectedErrMsg =
+
322 RPC::expected_field_message(fieldName, getTypeName(typeID));
+
323 checkErrorValue(jrr, expectedError, expectedErrMsg, location);
+
324 };
+
325
+
326 auto const& badValues = getBadValues(typeID);
+
327 for (auto const& value : badValues)
+
328 {
+
329 tryField(value);
+
330 }
+
331 if (required)
+
332 {
+
333 tryField(Json::nullValue);
+
334 }
+
335 });
+
336 }
-
343
-
344 void
-
- -
346 test::jtx::Env& env,
-
347 Json::Value correctRequest,
-
348 Json::StaticString parentFieldName,
-
349 Json::StaticString fieldName,
-
350 FieldType typeID,
-
351 std::string const& expectedError,
-
352 bool required = true,
-
353 source_location const location = source_location::current())
-
354 {
-
355 forAllApiVersions([&, this](unsigned apiVersion) {
-
356 if (required)
-
357 {
-
358 correctRequest[parentFieldName].removeMember(fieldName);
-
359 Json::Value const jrr = env.rpc(
-
360 apiVersion,
-
361 "json",
-
362 "ledger_entry",
-
363 to_string(correctRequest))[jss::result];
- -
365 jrr,
-
366 "malformedRequest",
- -
368 location);
-
369
-
370 correctRequest[parentFieldName][fieldName] = Json::nullValue;
-
371 Json::Value const jrr2 = env.rpc(
-
372 apiVersion,
-
373 "json",
-
374 "ledger_entry",
-
375 to_string(correctRequest))[jss::result];
- -
377 jrr2,
-
378 "malformedRequest",
- -
380 location);
-
381 }
-
382 auto tryField = [&](Json::Value fieldValue) -> void {
-
383 correctRequest[parentFieldName][fieldName] = fieldValue;
-
384
-
385 Json::Value const jrr = env.rpc(
-
386 apiVersion,
-
387 "json",
-
388 "ledger_entry",
-
389 to_string(correctRequest))[jss::result];
- -
391 jrr,
-
392 expectedError,
-
393 RPC::expected_field_message(fieldName, getTypeName(typeID)),
-
394 location);
-
395 };
-
396
-
397 auto const& badValues = getBadValues(typeID);
-
398 for (auto const& value : badValues)
-
399 {
-
400 tryField(value);
-
401 }
-
402 });
-
403 }
+
337
+
338 void
+
+ +
340 test::jtx::Env& env,
+
341 Json::Value correctRequest,
+
342 Json::StaticString parentFieldName,
+
343 Json::StaticString fieldName,
+
344 FieldType typeID,
+
345 std::string const& expectedError,
+
346 bool required = true,
+ +
348 {
+
349 forAllApiVersions([&, this](unsigned apiVersion) {
+
350 if (required)
+
351 {
+
352 correctRequest[parentFieldName].removeMember(fieldName);
+
353 Json::Value const jrr = env.rpc(
+
354 apiVersion,
+
355 "json",
+
356 "ledger_entry",
+
357 to_string(correctRequest))[jss::result];
+ +
359 jrr,
+
360 "malformedRequest",
+ +
362 location);
+
363
+
364 correctRequest[parentFieldName][fieldName] = Json::nullValue;
+
365 Json::Value const jrr2 = env.rpc(
+
366 apiVersion,
+
367 "json",
+
368 "ledger_entry",
+
369 to_string(correctRequest))[jss::result];
+ +
371 jrr2,
+
372 "malformedRequest",
+ +
374 location);
+
375 }
+
376 auto tryField = [&](Json::Value fieldValue) -> void {
+
377 correctRequest[parentFieldName][fieldName] = fieldValue;
+
378
+
379 Json::Value const jrr = env.rpc(
+
380 apiVersion,
+
381 "json",
+
382 "ledger_entry",
+
383 to_string(correctRequest))[jss::result];
+ +
385 jrr,
+
386 expectedError,
+
387 RPC::expected_field_message(fieldName, getTypeName(typeID)),
+
388 location);
+
389 };
+
390
+
391 auto const& badValues = getBadValues(typeID);
+
392 for (auto const& value : badValues)
+
393 {
+
394 tryField(value);
+
395 }
+
396 });
+
397 }
-
404
-
405 // No subfields
-
406 void
-
- -
408 test::jtx::Env& env,
-
409 Json::StaticString const& parentField,
-
410 source_location const location = source_location::current())
-
411 {
- -
413 env,
-
414 Json::Value{},
-
415 parentField,
- -
417 "malformedRequest",
-
418 true,
-
419 location);
-
420 }
+
398
+
399 // No subfields
+
400 void
+
+ +
402 test::jtx::Env& env,
+
403 Json::StaticString const& parentField,
+ +
405 {
+ +
407 env,
+
408 Json::Value{},
+
409 parentField,
+ +
411 "malformedRequest",
+
412 true,
+
413 location);
+
414 }
-
421
-
-
422 struct Subfield
-
423 {
- - -
426 bool required = true;
-
427 };
+
415
+ -
428
-
429 void
-
- -
431 test::jtx::Env& env,
-
432 Json::StaticString const& parentField,
-
433 std::vector<Subfield> const& subfields,
-
434 source_location const location = source_location::current())
-
435 {
- -
437 env,
-
438 Json::Value{},
-
439 parentField,
- -
441 "malformedRequest",
-
442 true,
-
443 location);
-
444
-
445 Json::Value correctOutput;
-
446 correctOutput[parentField] = Json::objectValue;
+
422
+
423 void
+
+ +
425 test::jtx::Env& env,
+
426 Json::StaticString const& parentField,
+
427 std::vector<Subfield> const& subfields,
+ +
429 {
+ +
431 env,
+
432 Json::Value{},
+
433 parentField,
+ +
435 "malformedRequest",
+
436 true,
+
437 location);
+
438
+
439 Json::Value correctOutput;
+
440 correctOutput[parentField] = Json::objectValue;
+
441 for (auto const& subfield : subfields)
+
442 {
+
443 correctOutput[parentField][subfield.fieldName] =
+
444 getCorrectValue(subfield.fieldName);
+
445 }
+
446
447 for (auto const& subfield : subfields)
448 {
-
449 correctOutput[parentField][subfield.fieldName] =
-
450 getCorrectValue(subfield.fieldName);
-
451 }
-
452
-
453 for (auto const& subfield : subfields)
-
454 {
-
455 auto const fieldType = getFieldType(subfield.fieldName);
- -
457 env,
-
458 correctOutput,
-
459 parentField,
-
460 subfield.fieldName,
-
461 fieldType,
-
462 subfield.malformedErrorMsg,
-
463 subfield.required,
-
464 location);
-
465 }
-
466 }
+
449 auto const fieldType = getFieldType(subfield.fieldName);
+ +
451 env,
+
452 correctOutput,
+
453 parentField,
+
454 subfield.fieldName,
+
455 fieldType,
+
456 subfield.malformedErrorMsg,
+
457 subfield.required,
+
458 location);
+
459 }
+
460 }
-
467
-
468 void
-
- -
470 {
-
471 testcase("Invalid requests");
-
472 using namespace test::jtx;
-
473 Env env{*this};
-
474 Account const alice{"alice"};
-
475 env.fund(XRP(10000), alice);
-
476 env.close();
-
477 {
-
478 // Missing ledger_entry ledger_hash
-
479 Json::Value jvParams;
-
480 jvParams[jss::account_root] = alice.human();
-
481 jvParams[jss::ledger_hash] =
-
482 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-
483 "AA";
-
484 auto const jrr = env.rpc(
-
485 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
486 checkErrorValue(jrr, "lgrNotFound", "ledgerNotFound");
-
487 }
-
488 {
-
489 // Missing ledger_entry ledger_hash
-
490 Json::Value jvParams;
-
491 jvParams[jss::account_root] = alice.human();
-
492 auto const typeId = FieldType::HashField;
-
493
-
494 forAllApiVersions([&, this](unsigned apiVersion) {
-
495 auto tryField = [&](Json::Value fieldValue) -> void {
-
496 jvParams[jss::ledger_hash] = fieldValue;
-
497 Json::Value const jrr = env.rpc(
-
498 apiVersion,
-
499 "json",
-
500 "ledger_entry",
-
501 to_string(jvParams))[jss::result];
- -
503 jrr,
-
504 "invalidParams",
-
505 "Invalid field 'ledger_hash', not hex string.");
-
506 };
-
507
-
508 auto const& badValues = getBadValues(typeId);
-
509 for (auto const& value : badValues)
-
510 {
-
511 tryField(value);
-
512 }
-
513 });
-
514 }
-
515
-
516 {
-
517 // ask for an zero index
-
518 Json::Value jvParams;
-
519 jvParams[jss::ledger_index] = "validated";
-
520 jvParams[jss::index] =
-
521 "00000000000000000000000000000000000000000000000000000000000000"
-
522 "00";
-
523 auto const jrr = env.rpc(
-
524 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
525 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
526 }
-
527
-
528 forAllApiVersions([&, this](unsigned apiVersion) {
-
529 // "features" is not an option supported by ledger_entry.
-
530 {
- -
532 jvParams[jss::features] =
-
533 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-
534 "AAAAAAAAAA";
-
535 jvParams[jss::api_version] = apiVersion;
-
536 Json::Value const jrr = env.rpc(
-
537 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
538
-
539 if (apiVersion < 2u)
-
540 checkErrorValue(jrr, "unknownOption", "");
-
541 else
- -
543 jrr,
-
544 "invalidParams",
-
545 "No ledger_entry params provided.");
-
546 }
-
547 });
-
548 }
+
461
+
462 void
+
+ +
464 {
+
465 testcase("Invalid requests");
+
466 using namespace test::jtx;
+
467 Env env{*this};
+
468 Account const alice{"alice"};
+
469 env.fund(XRP(10000), alice);
+
470 env.close();
+
471 {
+
472 // Missing ledger_entry ledger_hash
+
473 Json::Value jvParams;
+
474 jvParams[jss::account_root] = alice.human();
+
475 jvParams[jss::ledger_hash] =
+
476 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+
477 "AA";
+
478 auto const jrr = env.rpc(
+
479 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
480 checkErrorValue(jrr, "lgrNotFound", "ledgerNotFound");
+
481 }
+
482 {
+
483 // Missing ledger_entry ledger_hash
+
484 Json::Value jvParams;
+
485 jvParams[jss::account_root] = alice.human();
+
486 auto const typeId = FieldType::HashField;
+
487
+
488 forAllApiVersions([&, this](unsigned apiVersion) {
+
489 auto tryField = [&](Json::Value fieldValue) -> void {
+
490 jvParams[jss::ledger_hash] = fieldValue;
+
491 Json::Value const jrr = env.rpc(
+
492 apiVersion,
+
493 "json",
+
494 "ledger_entry",
+
495 to_string(jvParams))[jss::result];
+ +
497 jrr,
+
498 "invalidParams",
+
499 "Invalid field 'ledger_hash', not hex string.");
+
500 };
+
501
+
502 auto const& badValues = getBadValues(typeId);
+
503 for (auto const& value : badValues)
+
504 {
+
505 tryField(value);
+
506 }
+
507 });
+
508 }
+
509
+
510 {
+
511 // ask for an zero index
+
512 Json::Value jvParams;
+
513 jvParams[jss::ledger_index] = "validated";
+
514 jvParams[jss::index] =
+
515 "00000000000000000000000000000000000000000000000000000000000000"
+
516 "00";
+
517 auto const jrr = env.rpc(
+
518 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
519 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
520 }
+
521
+
522 forAllApiVersions([&, this](unsigned apiVersion) {
+
523 // "features" is not an option supported by ledger_entry.
+
524 {
+ +
526 jvParams[jss::features] =
+
527 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+
528 "AAAAAAAAAA";
+
529 jvParams[jss::api_version] = apiVersion;
+
530 Json::Value const jrr = env.rpc(
+
531 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
532
+
533 if (apiVersion < 2u)
+
534 checkErrorValue(jrr, "unknownOption", "");
+
535 else
+ +
537 jrr,
+
538 "invalidParams",
+
539 "No ledger_entry params provided.");
+
540 }
+
541 });
+
542 }
+
543
+
544 void
+
+ +
546 {
+
547 testcase("AccountRoot");
+
548 using namespace test::jtx;
549
-
550 void
-
- -
552 {
-
553 testcase("AccountRoot");
-
554 using namespace test::jtx;
-
555
-
556 auto cfg = envconfig();
-
557 cfg->FEES.reference_fee = 10;
-
558 Env env{*this, std::move(cfg)};
-
559
-
560 Account const alice{"alice"};
-
561 env.fund(XRP(10000), alice);
-
562 env.close();
-
563
-
564 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
565 {
-
566 // Exercise ledger_closed along the way.
-
567 Json::Value const jrr = env.rpc("ledger_closed")[jss::result];
-
568 BEAST_EXPECT(jrr[jss::ledger_hash] == ledgerHash);
-
569 BEAST_EXPECT(jrr[jss::ledger_index] == 3);
-
570 }
-
571
-
572 std::string accountRootIndex;
-
573 {
-
574 // Request alice's account root.
-
575 Json::Value jvParams;
-
576 jvParams[jss::account_root] = alice.human();
-
577 jvParams[jss::ledger_hash] = ledgerHash;
-
578 Json::Value const jrr = env.rpc(
-
579 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
580 BEAST_EXPECT(jrr.isMember(jss::node));
-
581 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
-
582 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
-
583 accountRootIndex = jrr[jss::index].asString();
-
584 }
-
585 {
-
586 constexpr char alicesAcctRootBinary[]{
-
587 "1100612200800000240000000425000000032D00000000559CE54C3B934E4"
-
588 "73A995B477E92EC229F99CED5B62BF4D2ACE4DC42719103AE2F6240000002"
-
589 "540BE4008114AE123A8556F3CF91154711376AFB0F894F832B3D"};
-
590
-
591 // Request alice's account root, but with binary == true;
-
592 Json::Value jvParams;
-
593 jvParams[jss::account_root] = alice.human();
-
594 jvParams[jss::binary] = 1;
-
595 jvParams[jss::ledger_hash] = ledgerHash;
-
596 Json::Value const jrr = env.rpc(
-
597 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
598 BEAST_EXPECT(jrr.isMember(jss::node_binary));
-
599 BEAST_EXPECT(jrr[jss::node_binary] == alicesAcctRootBinary);
-
600 }
-
601 {
-
602 // Request alice's account root using the index.
-
603 Json::Value jvParams;
-
604 jvParams[jss::index] = accountRootIndex;
-
605 Json::Value const jrr = env.rpc(
-
606 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
607 BEAST_EXPECT(!jrr.isMember(jss::node_binary));
-
608 BEAST_EXPECT(jrr.isMember(jss::node));
-
609 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
-
610 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
-
611 }
-
612 {
-
613 // Request alice's account root by index, but with binary == false.
-
614 Json::Value jvParams;
-
615 jvParams[jss::index] = accountRootIndex;
-
616 jvParams[jss::binary] = 0;
-
617 Json::Value const jrr = env.rpc(
-
618 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
619 BEAST_EXPECT(jrr.isMember(jss::node));
-
620 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
-
621 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
-
622 }
-
623 {
-
624 // Check alias
-
625 Json::Value jvParams;
-
626 jvParams[jss::account] = alice.human();
-
627 jvParams[jss::ledger_hash] = ledgerHash;
-
628 Json::Value const jrr = env.rpc(
-
629 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
630 BEAST_EXPECT(jrr.isMember(jss::node));
-
631 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
-
632 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
-
633 accountRootIndex = jrr[jss::index].asString();
-
634 }
-
635 {
-
636 // Check malformed cases
-
637 Json::Value jvParams;
- -
639 env,
-
640 jvParams,
-
641 jss::account_root,
- -
643 "malformedAddress");
-
644 }
-
645 {
-
646 // Request an account that is not in the ledger.
-
647 Json::Value jvParams;
-
648 jvParams[jss::account_root] = Account("bob").human();
-
649 jvParams[jss::ledger_hash] = ledgerHash;
-
650 Json::Value const jrr = env.rpc(
-
651 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
652 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
653 }
-
654 }
+
550 auto cfg = envconfig();
+
551 cfg->FEES.reference_fee = 10;
+
552 Env env{*this, std::move(cfg)};
+
553
+
554 Account const alice{"alice"};
+
555 env.fund(XRP(10000), alice);
+
556 env.close();
+
557
+
558 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
559 {
+
560 // Exercise ledger_closed along the way.
+
561 Json::Value const jrr = env.rpc("ledger_closed")[jss::result];
+
562 BEAST_EXPECT(jrr[jss::ledger_hash] == ledgerHash);
+
563 BEAST_EXPECT(jrr[jss::ledger_index] == 3);
+
564 }
+
565
+
566 std::string accountRootIndex;
+
567 {
+
568 // Request alice's account root.
+
569 Json::Value jvParams;
+
570 jvParams[jss::account_root] = alice.human();
+
571 jvParams[jss::ledger_hash] = ledgerHash;
+
572 Json::Value const jrr = env.rpc(
+
573 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
574 BEAST_EXPECT(jrr.isMember(jss::node));
+
575 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
+
576 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
+
577 accountRootIndex = jrr[jss::index].asString();
+
578 }
+
579 {
+
580 constexpr char alicesAcctRootBinary[]{
+
581 "1100612200800000240000000425000000032D00000000559CE54C3B934E4"
+
582 "73A995B477E92EC229F99CED5B62BF4D2ACE4DC42719103AE2F6240000002"
+
583 "540BE4008114AE123A8556F3CF91154711376AFB0F894F832B3D"};
+
584
+
585 // Request alice's account root, but with binary == true;
+
586 Json::Value jvParams;
+
587 jvParams[jss::account_root] = alice.human();
+
588 jvParams[jss::binary] = 1;
+
589 jvParams[jss::ledger_hash] = ledgerHash;
+
590 Json::Value const jrr = env.rpc(
+
591 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
592 BEAST_EXPECT(jrr.isMember(jss::node_binary));
+
593 BEAST_EXPECT(jrr[jss::node_binary] == alicesAcctRootBinary);
+
594 }
+
595 {
+
596 // Request alice's account root using the index.
+
597 Json::Value jvParams;
+
598 jvParams[jss::index] = accountRootIndex;
+
599 Json::Value const jrr = env.rpc(
+
600 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
601 BEAST_EXPECT(!jrr.isMember(jss::node_binary));
+
602 BEAST_EXPECT(jrr.isMember(jss::node));
+
603 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
+
604 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
+
605 }
+
606 {
+
607 // Request alice's account root by index, but with binary == false.
+
608 Json::Value jvParams;
+
609 jvParams[jss::index] = accountRootIndex;
+
610 jvParams[jss::binary] = 0;
+
611 Json::Value const jrr = env.rpc(
+
612 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
613 BEAST_EXPECT(jrr.isMember(jss::node));
+
614 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
+
615 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
+
616 }
+
617 {
+
618 // Check alias
+
619 Json::Value jvParams;
+
620 jvParams[jss::account] = alice.human();
+
621 jvParams[jss::ledger_hash] = ledgerHash;
+
622 Json::Value const jrr = env.rpc(
+
623 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
624 BEAST_EXPECT(jrr.isMember(jss::node));
+
625 BEAST_EXPECT(jrr[jss::node][jss::Account] == alice.human());
+
626 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "10000000000");
+
627 accountRootIndex = jrr[jss::index].asString();
+
628 }
+
629 {
+
630 // Check malformed cases
+
631 Json::Value jvParams;
+ +
633 env,
+
634 jvParams,
+
635 jss::account_root,
+ +
637 "malformedAddress");
+
638 }
+
639 {
+
640 // Request an account that is not in the ledger.
+
641 Json::Value jvParams;
+
642 jvParams[jss::account_root] = Account("bob").human();
+
643 jvParams[jss::ledger_hash] = ledgerHash;
+
644 Json::Value const jrr = env.rpc(
+
645 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
646 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
647 }
+
648 }
-
655
-
656 void
-
- -
658 {
-
659 testcase("Amendments");
-
660 using namespace test::jtx;
-
661 Env env{*this};
-
662
-
663 // positive test
-
664 {
-
665 Keylet const keylet = keylet::amendments();
-
666
-
667 // easier to hack an object into the ledger than generate it
-
668 // legitimately
-
669 {
-
670 auto const amendments = [&](OpenView& view,
-
671 beast::Journal) -> bool {
-
672 auto const sle = std::make_shared<SLE>(keylet);
-
673
-
674 // Create Amendments vector (enabled amendments)
-
675 std::vector<uint256> enabledAmendments;
+
649
+
650 void
+
+ +
652 {
+
653 testcase("Amendments");
+
654 using namespace test::jtx;
+
655 Env env{*this};
+
656
+
657 // positive test
+
658 {
+
659 Keylet const keylet = keylet::amendments();
+
660
+
661 // easier to hack an object into the ledger than generate it
+
662 // legitimately
+
663 {
+
664 auto const amendments = [&](OpenView& view,
+
665 beast::Journal) -> bool {
+
666 auto const sle = std::make_shared<SLE>(keylet);
+
667
+
668 // Create Amendments vector (enabled amendments)
+
669 std::vector<uint256> enabledAmendments;
+
670 enabledAmendments.push_back(
+
671 uint256::fromVoid("42426C4D4F1009EE67080A9B7965B44656D7"
+
672 "714D104A72F9B4369F97ABF044EE"));
+
673 enabledAmendments.push_back(
+
674 uint256::fromVoid("4C97EBA926031A7CF7D7B36FDE3ED66DDA54"
+
675 "21192D63DE53FFB46E43B9DC8373"));
676 enabledAmendments.push_back(
-
677 uint256::fromVoid("42426C4D4F1009EE67080A9B7965B44656D7"
-
678 "714D104A72F9B4369F97ABF044EE"));
+
677 uint256::fromVoid("03BDC0099C4E14163ADA272C1B6F6FABB448"
+
678 "CC3E51F522F978041E4B57D9158C"));
679 enabledAmendments.push_back(
-
680 uint256::fromVoid("4C97EBA926031A7CF7D7B36FDE3ED66DDA54"
-
681 "21192D63DE53FFB46E43B9DC8373"));
-
682 enabledAmendments.push_back(
-
683 uint256::fromVoid("03BDC0099C4E14163ADA272C1B6F6FABB448"
-
684 "CC3E51F522F978041E4B57D9158C"));
-
685 enabledAmendments.push_back(
-
686 uint256::fromVoid("35291ADD2D79EB6991343BDA0912269C817D"
-
687 "0F094B02226C1C14AD2858962ED4"));
-
688 sle->setFieldV256(
-
689 sfAmendments, STVector256(enabledAmendments));
-
690
-
691 // Create Majorities array
-
692 STArray majorities;
-
693
-
694 auto majority1 = STObject::makeInnerObject(sfMajority);
-
695 majority1.setFieldH256(
-
696 sfAmendment,
-
697 uint256::fromVoid("7BB62DC13EC72B775091E9C71BF8CF97E122"
-
698 "647693B50C5E87A80DFD6FCFAC50"));
-
699 majority1.setFieldU32(sfCloseTime, 779561310);
-
700 majorities.push_back(std::move(majority1));
-
701
-
702 auto majority2 = STObject::makeInnerObject(sfMajority);
-
703 majority2.setFieldH256(
-
704 sfAmendment,
-
705 uint256::fromVoid("755C971C29971C9F20C6F080F2ED96F87884"
-
706 "E40AD19554A5EBECDCEC8A1F77FE"));
-
707 majority2.setFieldU32(sfCloseTime, 779561310);
-
708 majorities.push_back(std::move(majority2));
-
709
-
710 sle->setFieldArray(sfMajorities, majorities);
+
680 uint256::fromVoid("35291ADD2D79EB6991343BDA0912269C817D"
+
681 "0F094B02226C1C14AD2858962ED4"));
+
682 sle->setFieldV256(
+
683 sfAmendments, STVector256(enabledAmendments));
+
684
+
685 // Create Majorities array
+
686 STArray majorities;
+
687
+
688 auto majority1 = STObject::makeInnerObject(sfMajority);
+
689 majority1.setFieldH256(
+
690 sfAmendment,
+
691 uint256::fromVoid("7BB62DC13EC72B775091E9C71BF8CF97E122"
+
692 "647693B50C5E87A80DFD6FCFAC50"));
+
693 majority1.setFieldU32(sfCloseTime, 779561310);
+
694 majorities.push_back(std::move(majority1));
+
695
+
696 auto majority2 = STObject::makeInnerObject(sfMajority);
+
697 majority2.setFieldH256(
+
698 sfAmendment,
+
699 uint256::fromVoid("755C971C29971C9F20C6F080F2ED96F87884"
+
700 "E40AD19554A5EBECDCEC8A1F77FE"));
+
701 majority2.setFieldU32(sfCloseTime, 779561310);
+
702 majorities.push_back(std::move(majority2));
+
703
+
704 sle->setFieldArray(sfMajorities, majorities);
+
705
+
706 view.rawInsert(sle);
+
707 return true;
+
708 };
+
709 env.app().openLedger().modify(amendments);
+
710 }
711
-
712 view.rawInsert(sle);
-
713 return true;
-
714 };
-
715 env.app().openLedger().modify(amendments);
-
716 }
-
717
-
718 Json::Value jvParams;
-
719 jvParams[jss::amendments] = to_string(keylet.key);
-
720 Json::Value const jrr = env.rpc(
-
721 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
722 BEAST_EXPECT(
-
723 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Amendments);
-
724 }
-
725
-
726 // negative tests
- -
728 env,
-
729 Json::Value{},
-
730 jss::amendments,
- -
732 "malformedRequest");
-
733 }
+
712 Json::Value jvParams;
+
713 jvParams[jss::amendments] = to_string(keylet.key);
+
714 Json::Value const jrr = env.rpc(
+
715 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
716 BEAST_EXPECT(
+
717 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Amendments);
+
718 }
+
719
+
720 // negative tests
+ +
722 env,
+
723 Json::Value{},
+
724 jss::amendments,
+ +
726 "malformedRequest");
+
727 }
-
734
-
735 void
-
- -
737 {
-
738 testcase("AMM");
-
739 using namespace test::jtx;
-
740 Env env{*this};
-
741
-
742 // positive test
-
743 Account const alice{"alice"};
-
744 env.fund(XRP(10000), alice);
-
745 env.close();
-
746 AMM amm(env, alice, XRP(10), alice["USD"](1000));
-
747 env.close();
-
748
-
749 {
-
750 Json::Value jvParams;
-
751 jvParams[jss::amm] = to_string(amm.ammID());
-
752 auto const result =
-
753 env.rpc("json", "ledger_entry", to_string(jvParams));
-
754 BEAST_EXPECT(
-
755 result.isObject() && result.isMember(jss::result) &&
-
756 !result[jss::result].isMember(jss::error) &&
-
757 result[jss::result].isMember(jss::node) &&
-
758 result[jss::result][jss::node].isMember(
-
759 sfLedgerEntryType.jsonName) &&
-
760 result[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
761 jss::AMM);
-
762 }
-
763
-
764 {
-
765 Json::Value jvParams;
- -
767 {
- -
769 obj[jss::currency] = "XRP";
-
770 ammParams[jss::asset] = obj;
+
728
+
729 void
+
+ +
731 {
+
732 testcase("AMM");
+
733 using namespace test::jtx;
+
734 Env env{*this};
+
735
+
736 // positive test
+
737 Account const alice{"alice"};
+
738 env.fund(XRP(10000), alice);
+
739 env.close();
+
740 AMM amm(env, alice, XRP(10), alice["USD"](1000));
+
741 env.close();
+
742
+
743 {
+
744 Json::Value jvParams;
+
745 jvParams[jss::amm] = to_string(amm.ammID());
+
746 auto const result =
+
747 env.rpc("json", "ledger_entry", to_string(jvParams));
+
748 BEAST_EXPECT(
+
749 result.isObject() && result.isMember(jss::result) &&
+
750 !result[jss::result].isMember(jss::error) &&
+
751 result[jss::result].isMember(jss::node) &&
+
752 result[jss::result][jss::node].isMember(
+
753 sfLedgerEntryType.jsonName) &&
+
754 result[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
755 jss::AMM);
+
756 }
+
757
+
758 {
+
759 Json::Value jvParams;
+ +
761 {
+ +
763 obj[jss::currency] = "XRP";
+
764 ammParams[jss::asset] = obj;
+
765 }
+
766 {
+ +
768 obj[jss::currency] = "USD";
+
769 obj[jss::issuer] = alice.human();
+
770 ammParams[jss::asset2] = obj;
771 }
-
772 {
- -
774 obj[jss::currency] = "USD";
-
775 obj[jss::issuer] = alice.human();
-
776 ammParams[jss::asset2] = obj;
-
777 }
-
778 jvParams[jss::amm] = ammParams;
-
779 auto const result =
-
780 env.rpc("json", "ledger_entry", to_string(jvParams));
-
781 BEAST_EXPECT(
-
782 result.isObject() && result.isMember(jss::result) &&
-
783 !result[jss::result].isMember(jss::error) &&
-
784 result[jss::result].isMember(jss::node) &&
-
785 result[jss::result][jss::node].isMember(
-
786 sfLedgerEntryType.jsonName) &&
-
787 result[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
788 jss::AMM);
-
789 }
-
790
-
791 // negative tests
- -
793 env,
-
794 jss::amm,
-
795 {
-
796 {jss::asset, "malformedRequest"},
-
797 {jss::asset2, "malformedRequest"},
-
798 });
-
799 }
+
772 jvParams[jss::amm] = ammParams;
+
773 auto const result =
+
774 env.rpc("json", "ledger_entry", to_string(jvParams));
+
775 BEAST_EXPECT(
+
776 result.isObject() && result.isMember(jss::result) &&
+
777 !result[jss::result].isMember(jss::error) &&
+
778 result[jss::result].isMember(jss::node) &&
+
779 result[jss::result][jss::node].isMember(
+
780 sfLedgerEntryType.jsonName) &&
+
781 result[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
782 jss::AMM);
+
783 }
+
784
+
785 // negative tests
+ +
787 env,
+
788 jss::amm,
+
789 {
+
790 {jss::asset, "malformedRequest"},
+
791 {jss::asset2, "malformedRequest"},
+
792 });
+
793 }
-
800
-
801 void
-
- -
803 {
-
804 testcase("Check");
-
805 using namespace test::jtx;
-
806 Env env{*this};
-
807 Account const alice{"alice"};
-
808 env.fund(XRP(10000), alice);
-
809 env.close();
-
810
-
811 auto const checkId = keylet::check(env.master, env.seq(env.master));
-
812
-
813 env(check::create(env.master, alice, XRP(100)));
-
814 env.close();
-
815
-
816 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
817 {
-
818 // Request a check.
-
819 Json::Value jvParams;
-
820 jvParams[jss::check] = to_string(checkId.key);
-
821 jvParams[jss::ledger_hash] = ledgerHash;
-
822 Json::Value const jrr = env.rpc(
-
823 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
824 BEAST_EXPECT(
-
825 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Check);
-
826 BEAST_EXPECT(jrr[jss::node][sfSendMax.jsonName] == "100000000");
-
827 }
-
828 {
-
829 // Request an index that is not a check. We'll use alice's
-
830 // account root index.
-
831 std::string accountRootIndex;
-
832 {
-
833 Json::Value jvParams;
-
834 jvParams[jss::account_root] = alice.human();
-
835 Json::Value const jrr = env.rpc(
-
836 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
837 accountRootIndex = jrr[jss::index].asString();
-
838 }
-
839 Json::Value jvParams;
-
840 jvParams[jss::check] = accountRootIndex;
-
841 jvParams[jss::ledger_hash] = ledgerHash;
-
842 Json::Value const jrr = env.rpc(
-
843 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
845 jrr, "unexpectedLedgerType", "Unexpected ledger type.");
-
846 }
-
847 {
-
848 // Check malformed cases
-
849 runLedgerEntryTest(env, jss::check);
-
850 }
-
851 }
+
794
+
795 void
+
+ +
797 {
+
798 testcase("Check");
+
799 using namespace test::jtx;
+
800 Env env{*this};
+
801 Account const alice{"alice"};
+
802 env.fund(XRP(10000), alice);
+
803 env.close();
+
804
+
805 auto const checkId = keylet::check(env.master, env.seq(env.master));
+
806
+
807 env(check::create(env.master, alice, XRP(100)));
+
808 env.close();
+
809
+
810 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
811 {
+
812 // Request a check.
+
813 Json::Value jvParams;
+
814 jvParams[jss::check] = to_string(checkId.key);
+
815 jvParams[jss::ledger_hash] = ledgerHash;
+
816 Json::Value const jrr = env.rpc(
+
817 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
818 BEAST_EXPECT(
+
819 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Check);
+
820 BEAST_EXPECT(jrr[jss::node][sfSendMax.jsonName] == "100000000");
+
821 }
+
822 {
+
823 // Request an index that is not a check. We'll use alice's
+
824 // account root index.
+
825 std::string accountRootIndex;
+
826 {
+
827 Json::Value jvParams;
+
828 jvParams[jss::account_root] = alice.human();
+
829 Json::Value const jrr = env.rpc(
+
830 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
831 accountRootIndex = jrr[jss::index].asString();
+
832 }
+
833 Json::Value jvParams;
+
834 jvParams[jss::check] = accountRootIndex;
+
835 jvParams[jss::ledger_hash] = ledgerHash;
+
836 Json::Value const jrr = env.rpc(
+
837 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
839 jrr, "unexpectedLedgerType", "Unexpected ledger type.");
+
840 }
+
841 {
+
842 // Check malformed cases
+
843 runLedgerEntryTest(env, jss::check);
+
844 }
+
845 }
-
852
-
853 void
-
- -
855 {
-
856 testcase("Credentials");
-
857
-
858 using namespace test::jtx;
+
846
+
847 void
+
+ +
849 {
+
850 testcase("Credentials");
+
851
+
852 using namespace test::jtx;
+
853
+
854 Env env(*this);
+
855 Account const issuer{"issuer"};
+
856 Account const alice{"alice"};
+
857 Account const bob{"bob"};
+
858 char const credType[] = "abcde";
859
-
860 Env env(*this);
-
861 Account const issuer{"issuer"};
-
862 Account const alice{"alice"};
-
863 Account const bob{"bob"};
-
864 char const credType[] = "abcde";
-
865
-
866 env.fund(XRP(5000), issuer, alice, bob);
-
867 env.close();
-
868
-
869 // Setup credentials with DepositAuth object for Alice and Bob
-
870 env(credentials::create(alice, issuer, credType));
-
871 env.close();
-
872
-
873 {
-
874 // Succeed
-
875 auto jv = credentials::ledgerEntry(env, alice, issuer, credType);
-
876 BEAST_EXPECT(
-
877 jv.isObject() && jv.isMember(jss::result) &&
-
878 !jv[jss::result].isMember(jss::error) &&
-
879 jv[jss::result].isMember(jss::node) &&
-
880 jv[jss::result][jss::node].isMember(
-
881 sfLedgerEntryType.jsonName) &&
-
882 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
883 jss::Credential);
-
884
-
885 std::string const credIdx = jv[jss::result][jss::index].asString();
-
886
-
887 jv = credentials::ledgerEntry(env, credIdx);
-
888 BEAST_EXPECT(
-
889 jv.isObject() && jv.isMember(jss::result) &&
-
890 !jv[jss::result].isMember(jss::error) &&
-
891 jv[jss::result].isMember(jss::node) &&
-
892 jv[jss::result][jss::node].isMember(
-
893 sfLedgerEntryType.jsonName) &&
-
894 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
895 jss::Credential);
-
896 }
-
897
-
898 {
-
899 // Fail, credential doesn't exist
-
900 auto const jv = credentials::ledgerEntry(
-
901 env,
-
902 "48004829F915654A81B11C4AB8218D96FED67F209B58328A72314FB6EA288B"
-
903 "E4");
- -
905 jv[jss::result], "entryNotFound", "Entry not found.");
-
906 }
-
907
-
908 {
-
909 // Check all malformed cases
- -
911 env,
-
912 jss::credential,
-
913 {
-
914 {jss::subject, "malformedRequest"},
-
915 {jss::issuer, "malformedRequest"},
-
916 {jss::credential_type, "malformedRequest"},
-
917 });
-
918 }
-
919 }
+
860 env.fund(XRP(5000), issuer, alice, bob);
+
861 env.close();
+
862
+
863 // Setup credentials with DepositAuth object for Alice and Bob
+
864 env(credentials::create(alice, issuer, credType));
+
865 env.close();
+
866
+
867 {
+
868 // Succeed
+
869 auto jv = credentials::ledgerEntry(env, alice, issuer, credType);
+
870 BEAST_EXPECT(
+
871 jv.isObject() && jv.isMember(jss::result) &&
+
872 !jv[jss::result].isMember(jss::error) &&
+
873 jv[jss::result].isMember(jss::node) &&
+
874 jv[jss::result][jss::node].isMember(
+
875 sfLedgerEntryType.jsonName) &&
+
876 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
877 jss::Credential);
+
878
+
879 std::string const credIdx = jv[jss::result][jss::index].asString();
+
880
+
881 jv = credentials::ledgerEntry(env, credIdx);
+
882 BEAST_EXPECT(
+
883 jv.isObject() && jv.isMember(jss::result) &&
+
884 !jv[jss::result].isMember(jss::error) &&
+
885 jv[jss::result].isMember(jss::node) &&
+
886 jv[jss::result][jss::node].isMember(
+
887 sfLedgerEntryType.jsonName) &&
+
888 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
889 jss::Credential);
+
890 }
+
891
+
892 {
+
893 // Fail, credential doesn't exist
+
894 auto const jv = credentials::ledgerEntry(
+
895 env,
+
896 "48004829F915654A81B11C4AB8218D96FED67F209B58328A72314FB6EA288B"
+
897 "E4");
+ +
899 jv[jss::result], "entryNotFound", "Entry not found.");
+
900 }
+
901
+
902 {
+
903 // Check all malformed cases
+ +
905 env,
+
906 jss::credential,
+
907 {
+
908 {jss::subject, "malformedRequest"},
+
909 {jss::issuer, "malformedRequest"},
+
910 {jss::credential_type, "malformedRequest"},
+
911 });
+
912 }
+
913 }
-
920
-
921 void
-
- -
923 {
-
924 testcase("Delegate");
-
925
-
926 using namespace test::jtx;
-
927
-
928 Env env{*this};
-
929 Account const alice{"alice"};
-
930 Account const bob{"bob"};
-
931 env.fund(XRP(10000), alice, bob);
-
932 env.close();
-
933 env(delegate::set(alice, bob, {"Payment", "CheckCreate"}));
-
934 env.close();
-
935 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
936 std::string delegateIndex;
-
937 {
-
938 // Request by account and authorize
-
939 Json::Value jvParams;
-
940 jvParams[jss::delegate][jss::account] = alice.human();
-
941 jvParams[jss::delegate][jss::authorize] = bob.human();
-
942 jvParams[jss::ledger_hash] = ledgerHash;
-
943 Json::Value const jrr = env.rpc(
-
944 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
945 BEAST_EXPECT(
-
946 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Delegate);
-
947 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
-
948 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == bob.human());
-
949 delegateIndex = jrr[jss::node][jss::index].asString();
-
950 }
-
951 {
-
952 // Request by index.
-
953 Json::Value jvParams;
-
954 jvParams[jss::delegate] = delegateIndex;
-
955 jvParams[jss::ledger_hash] = ledgerHash;
-
956 Json::Value const jrr = env.rpc(
-
957 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
958 BEAST_EXPECT(
-
959 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Delegate);
-
960 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
-
961 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == bob.human());
-
962 }
-
963
-
964 {
-
965 // Check all malformed cases
- -
967 env,
-
968 jss::delegate,
-
969 {
-
970 {jss::account, "malformedAddress"},
-
971 {jss::authorize, "malformedAddress"},
-
972 });
-
973 }
-
974 }
+
914
+
915 void
+
+ +
917 {
+
918 testcase("Delegate");
+
919
+
920 using namespace test::jtx;
+
921
+
922 Env env{*this};
+
923 Account const alice{"alice"};
+
924 Account const bob{"bob"};
+
925 env.fund(XRP(10000), alice, bob);
+
926 env.close();
+
927 env(delegate::set(alice, bob, {"Payment", "CheckCreate"}));
+
928 env.close();
+
929 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
930 std::string delegateIndex;
+
931 {
+
932 // Request by account and authorize
+
933 Json::Value jvParams;
+
934 jvParams[jss::delegate][jss::account] = alice.human();
+
935 jvParams[jss::delegate][jss::authorize] = bob.human();
+
936 jvParams[jss::ledger_hash] = ledgerHash;
+
937 Json::Value const jrr = env.rpc(
+
938 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
939 BEAST_EXPECT(
+
940 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Delegate);
+
941 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
+
942 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == bob.human());
+
943 delegateIndex = jrr[jss::node][jss::index].asString();
+
944 }
+
945 {
+
946 // Request by index.
+
947 Json::Value jvParams;
+
948 jvParams[jss::delegate] = delegateIndex;
+
949 jvParams[jss::ledger_hash] = ledgerHash;
+
950 Json::Value const jrr = env.rpc(
+
951 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
952 BEAST_EXPECT(
+
953 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Delegate);
+
954 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
+
955 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == bob.human());
+
956 }
+
957
+
958 {
+
959 // Check all malformed cases
+ +
961 env,
+
962 jss::delegate,
+
963 {
+
964 {jss::account, "malformedAddress"},
+
965 {jss::authorize, "malformedAddress"},
+
966 });
+
967 }
+
968 }
-
975
-
976 void
-
- -
978 {
-
979 testcase("Deposit Preauth");
+
969
+
970 void
+
+ +
972 {
+
973 testcase("Deposit Preauth");
+
974
+
975 using namespace test::jtx;
+
976
+
977 Env env{*this};
+
978 Account const alice{"alice"};
+
979 Account const becky{"becky"};
980
-
981 using namespace test::jtx;
-
982
-
983 Env env{*this};
-
984 Account const alice{"alice"};
-
985 Account const becky{"becky"};
+
981 env.fund(XRP(10000), alice, becky);
+
982 env.close();
+
983
+
984 env(deposit::auth(alice, becky));
+
985 env.close();
986
-
987 env.fund(XRP(10000), alice, becky);
-
988 env.close();
-
989
-
990 env(deposit::auth(alice, becky));
-
991 env.close();
-
992
-
993 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
994 std::string depositPreauthIndex;
-
995 {
-
996 // Request a depositPreauth by owner and authorized.
-
997 Json::Value jvParams;
-
998 jvParams[jss::deposit_preauth][jss::owner] = alice.human();
-
999 jvParams[jss::deposit_preauth][jss::authorized] = becky.human();
-
1000 jvParams[jss::ledger_hash] = ledgerHash;
-
1001 Json::Value const jrr = env.rpc(
-
1002 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1003
-
1004 BEAST_EXPECT(
-
1005 jrr[jss::node][sfLedgerEntryType.jsonName] ==
-
1006 jss::DepositPreauth);
-
1007 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
-
1008 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
-
1009 depositPreauthIndex = jrr[jss::node][jss::index].asString();
-
1010 }
-
1011 {
-
1012 // Request a depositPreauth by index.
-
1013 Json::Value jvParams;
-
1014 jvParams[jss::deposit_preauth] = depositPreauthIndex;
-
1015 jvParams[jss::ledger_hash] = ledgerHash;
-
1016 Json::Value const jrr = env.rpc(
-
1017 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1018
-
1019 BEAST_EXPECT(
-
1020 jrr[jss::node][sfLedgerEntryType.jsonName] ==
-
1021 jss::DepositPreauth);
-
1022 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
-
1023 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
-
1024 }
-
1025 {
-
1026 // test all missing/malformed field cases
- -
1028 env,
-
1029 jss::deposit_preauth,
-
1030 {
-
1031 {jss::owner, "malformedOwner"},
-
1032 {jss::authorized, "malformedAuthorized", false},
-
1033 });
-
1034 }
-
1035 }
+
987 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
988 std::string depositPreauthIndex;
+
989 {
+
990 // Request a depositPreauth by owner and authorized.
+
991 Json::Value jvParams;
+
992 jvParams[jss::deposit_preauth][jss::owner] = alice.human();
+
993 jvParams[jss::deposit_preauth][jss::authorized] = becky.human();
+
994 jvParams[jss::ledger_hash] = ledgerHash;
+
995 Json::Value const jrr = env.rpc(
+
996 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
997
+
998 BEAST_EXPECT(
+
999 jrr[jss::node][sfLedgerEntryType.jsonName] ==
+
1000 jss::DepositPreauth);
+
1001 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
+
1002 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
+
1003 depositPreauthIndex = jrr[jss::node][jss::index].asString();
+
1004 }
+
1005 {
+
1006 // Request a depositPreauth by index.
+
1007 Json::Value jvParams;
+
1008 jvParams[jss::deposit_preauth] = depositPreauthIndex;
+
1009 jvParams[jss::ledger_hash] = ledgerHash;
+
1010 Json::Value const jrr = env.rpc(
+
1011 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1012
+
1013 BEAST_EXPECT(
+
1014 jrr[jss::node][sfLedgerEntryType.jsonName] ==
+
1015 jss::DepositPreauth);
+
1016 BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
+
1017 BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
+
1018 }
+
1019 {
+
1020 // test all missing/malformed field cases
+ +
1022 env,
+
1023 jss::deposit_preauth,
+
1024 {
+
1025 {jss::owner, "malformedOwner"},
+
1026 {jss::authorized, "malformedAuthorized", false},
+
1027 });
+
1028 }
+
1029 }
-
1036
-
1037 void
-
- -
1039 {
-
1040 testcase("Deposit Preauth with credentials");
-
1041
-
1042 using namespace test::jtx;
+
1030
+
1031 void
+
+ +
1033 {
+
1034 testcase("Deposit Preauth with credentials");
+
1035
+
1036 using namespace test::jtx;
+
1037
+
1038 Env env(*this);
+
1039 Account const issuer{"issuer"};
+
1040 Account const alice{"alice"};
+
1041 Account const bob{"bob"};
+
1042 char const credType[] = "abcde";
1043
-
1044 Env env(*this);
-
1045 Account const issuer{"issuer"};
-
1046 Account const alice{"alice"};
-
1047 Account const bob{"bob"};
-
1048 char const credType[] = "abcde";
-
1049
-
1050 env.fund(XRP(5000), issuer, alice, bob);
-
1051 env.close();
-
1052
-
1053 {
-
1054 // Setup Bob with DepositAuth
-
1055 env(fset(bob, asfDepositAuth));
-
1056 env.close();
-
1057 env(deposit::authCredentials(bob, {{issuer, credType}}));
-
1058 env.close();
-
1059 }
+
1044 env.fund(XRP(5000), issuer, alice, bob);
+
1045 env.close();
+
1046
+
1047 {
+
1048 // Setup Bob with DepositAuth
+
1049 env(fset(bob, asfDepositAuth));
+
1050 env.close();
+
1051 env(deposit::authCredentials(bob, {{issuer, credType}}));
+
1052 env.close();
+
1053 }
+
1054
+
1055 {
+
1056 // Succeed
+
1057 Json::Value jvParams;
+
1058 jvParams[jss::ledger_index] = jss::validated;
+
1059 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
1060
-
1061 {
-
1062 // Succeed
-
1063 Json::Value jvParams;
-
1064 jvParams[jss::ledger_index] = jss::validated;
-
1065 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1066
-
1067 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1069 auto& arr(
-
1070 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1071
-
1072 Json::Value jo;
-
1073 jo[jss::issuer] = issuer.human();
-
1074 jo[jss::credential_type] = strHex(std::string_view(credType));
-
1075 arr.append(std::move(jo));
-
1076 auto const jrr =
-
1077 env.rpc("json", "ledger_entry", to_string(jvParams));
-
1078
-
1079 BEAST_EXPECT(
-
1080 jrr.isObject() && jrr.isMember(jss::result) &&
-
1081 !jrr[jss::result].isMember(jss::error) &&
-
1082 jrr[jss::result].isMember(jss::node) &&
-
1083 jrr[jss::result][jss::node].isMember(
-
1084 sfLedgerEntryType.jsonName) &&
-
1085 jrr[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
1086 jss::DepositPreauth);
-
1087 }
+
1061 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1063 auto& arr(
+
1064 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1065
+
1066 Json::Value jo;
+
1067 jo[jss::issuer] = issuer.human();
+
1068 jo[jss::credential_type] = strHex(std::string_view(credType));
+
1069 arr.append(std::move(jo));
+
1070 auto const jrr =
+
1071 env.rpc("json", "ledger_entry", to_string(jvParams));
+
1072
+
1073 BEAST_EXPECT(
+
1074 jrr.isObject() && jrr.isMember(jss::result) &&
+
1075 !jrr[jss::result].isMember(jss::error) &&
+
1076 jrr[jss::result].isMember(jss::node) &&
+
1077 jrr[jss::result][jss::node].isMember(
+
1078 sfLedgerEntryType.jsonName) &&
+
1079 jrr[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
1080 jss::DepositPreauth);
+
1081 }
+
1082
+
1083 {
+
1084 // Failed, invalid account
+
1085 Json::Value jvParams;
+
1086 jvParams[jss::ledger_index] = jss::validated;
+
1087 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
1088
-
1089 {
-
1090 // Failed, invalid account
-
1091 Json::Value jvParams;
-
1092 jvParams[jss::ledger_index] = jss::validated;
-
1093 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1094
-
1095 auto tryField = [&](Json::Value fieldValue) -> void {
- -
1097 Json::Value jo;
-
1098 jo[jss::issuer] = fieldValue;
-
1099 jo[jss::credential_type] = strHex(std::string_view(credType));
-
1100 arr.append(jo);
-
1101 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
-
1102 arr;
-
1103
-
1104 Json::Value const jrr = env.rpc(
-
1105 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1106 auto const expectedErrMsg = fieldValue.isNull()
-
1107 ? RPC::missing_field_message(jss::issuer.c_str())
-
1108 : RPC::expected_field_message(jss::issuer, "AccountID");
- -
1110 jrr, "malformedAuthorizedCredentials", expectedErrMsg);
-
1111 };
-
1112
-
1113 auto const& badValues = getBadValues(FieldType::AccountField);
-
1114 for (auto const& value : badValues)
-
1115 {
-
1116 tryField(value);
-
1117 }
-
1118 tryField(Json::nullValue);
-
1119 }
+
1089 auto tryField = [&](Json::Value fieldValue) -> void {
+ +
1091 Json::Value jo;
+
1092 jo[jss::issuer] = fieldValue;
+
1093 jo[jss::credential_type] = strHex(std::string_view(credType));
+
1094 arr.append(jo);
+
1095 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+
1096 arr;
+
1097
+
1098 Json::Value const jrr = env.rpc(
+
1099 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1100 auto const expectedErrMsg = fieldValue.isNull()
+
1101 ? RPC::missing_field_message(jss::issuer.c_str())
+
1102 : RPC::expected_field_message(jss::issuer, "AccountID");
+ +
1104 jrr, "malformedAuthorizedCredentials", expectedErrMsg);
+
1105 };
+
1106
+
1107 auto const& badValues = getBadValues(FieldType::AccountField);
+
1108 for (auto const& value : badValues)
+
1109 {
+
1110 tryField(value);
+
1111 }
+
1112 tryField(Json::nullValue);
+
1113 }
+
1114
+
1115 {
+
1116 // Failed, duplicates in credentials
+
1117 Json::Value jvParams;
+
1118 jvParams[jss::ledger_index] = jss::validated;
+
1119 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
1120
-
1121 {
-
1122 // Failed, duplicates in credentials
-
1123 Json::Value jvParams;
-
1124 jvParams[jss::ledger_index] = jss::validated;
-
1125 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1126
-
1127 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1129 auto& arr(
-
1130 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1131
-
1132 Json::Value jo;
-
1133 jo[jss::issuer] = issuer.human();
-
1134 jo[jss::credential_type] = strHex(std::string_view(credType));
-
1135 arr.append(jo);
-
1136 arr.append(std::move(jo));
-
1137 auto const jrr =
-
1138 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1140 jrr[jss::result],
-
1141 "malformedAuthorizedCredentials",
- -
1143 jss::authorized_credentials, "array"));
-
1144 }
+
1121 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1123 auto& arr(
+
1124 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1125
+
1126 Json::Value jo;
+
1127 jo[jss::issuer] = issuer.human();
+
1128 jo[jss::credential_type] = strHex(std::string_view(credType));
+
1129 arr.append(jo);
+
1130 arr.append(std::move(jo));
+
1131 auto const jrr =
+
1132 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1134 jrr[jss::result],
+
1135 "malformedAuthorizedCredentials",
+ +
1137 jss::authorized_credentials, "array"));
+
1138 }
+
1139
+
1140 {
+
1141 // Failed, invalid credential_type
+
1142 Json::Value jvParams;
+
1143 jvParams[jss::ledger_index] = jss::validated;
+
1144 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
1145
-
1146 {
-
1147 // Failed, invalid credential_type
-
1148 Json::Value jvParams;
-
1149 jvParams[jss::ledger_index] = jss::validated;
-
1150 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1151
-
1152 auto tryField = [&](Json::Value fieldValue) -> void {
- -
1154 Json::Value jo;
-
1155 jo[jss::issuer] = issuer.human();
-
1156 jo[jss::credential_type] = fieldValue;
-
1157 arr.append(jo);
-
1158 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
-
1159 arr;
-
1160
-
1161 Json::Value const jrr = env.rpc(
-
1162 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1163 auto const expectedErrMsg = fieldValue.isNull()
-
1164 ? RPC::missing_field_message(jss::credential_type.c_str())
- -
1166 jss::credential_type, "hex string");
- -
1168 jrr, "malformedAuthorizedCredentials", expectedErrMsg);
-
1169 };
-
1170
-
1171 auto const& badValues = getBadValues(FieldType::BlobField);
-
1172 for (auto const& value : badValues)
-
1173 {
-
1174 tryField(value);
-
1175 }
-
1176 tryField(Json::nullValue);
-
1177 }
-
1178
-
1179 {
-
1180 // Failed, authorized and authorized_credentials both present
-
1181 Json::Value jvParams;
-
1182 jvParams[jss::ledger_index] = jss::validated;
-
1183 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1184 jvParams[jss::deposit_preauth][jss::authorized] = alice.human();
-
1185
-
1186 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1188 auto& arr(
-
1189 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1190
-
1191 Json::Value jo;
-
1192 jo[jss::issuer] = issuer.human();
-
1193 jo[jss::credential_type] = strHex(std::string_view(credType));
-
1194 arr.append(std::move(jo));
-
1195
-
1196 auto const jrr =
-
1197 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1199 jrr[jss::result],
-
1200 "malformedRequest",
-
1201 "Must have exactly one of `authorized` and "
-
1202 "`authorized_credentials`.");
-
1203 }
-
1204
-
1205 {
-
1206 // Failed, authorized_credentials is not an array
-
1207 Json::Value jvParams;
-
1208 jvParams[jss::ledger_index] = jss::validated;
-
1209 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
- -
1211 env,
-
1212 jvParams,
-
1213 jss::deposit_preauth,
-
1214 jss::authorized_credentials,
- -
1216 "malformedAuthorizedCredentials",
-
1217 false);
-
1218 }
-
1219
-
1220 {
-
1221 // Failed, authorized_credentials contains string data
-
1222 Json::Value jvParams;
-
1223 jvParams[jss::ledger_index] = jss::validated;
-
1224 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1225 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1227 auto& arr(
-
1228 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1229 arr.append("foobar");
-
1230
-
1231 auto const jrr =
-
1232 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1234 jrr[jss::result],
-
1235 "malformedAuthorizedCredentials",
-
1236 "Invalid field 'authorized_credentials', not array.");
-
1237 }
-
1238
-
1239 {
-
1240 // Failed, authorized_credentials contains arrays
-
1241 Json::Value jvParams;
-
1242 jvParams[jss::ledger_index] = jss::validated;
-
1243 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1244 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1246 auto& arr(
-
1247 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1248 Json::Value payload = Json::arrayValue;
-
1249 payload.append(42);
-
1250 arr.append(std::move(payload));
-
1251
-
1252 auto const jrr =
-
1253 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1255 jrr[jss::result],
-
1256 "malformedAuthorizedCredentials",
-
1257 "Invalid field 'authorized_credentials', not array.");
-
1258 }
-
1259
-
1260 {
-
1261 // Failed, authorized_credentials is empty array
-
1262 Json::Value jvParams;
-
1263 jvParams[jss::ledger_index] = jss::validated;
-
1264 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1265 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1267
-
1268 auto const jrr =
-
1269 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1271 jrr[jss::result],
-
1272 "malformedAuthorizedCredentials",
-
1273 "Invalid field 'authorized_credentials', array empty.");
-
1274 }
-
1275
-
1276 {
-
1277 // Failed, authorized_credentials is too long
-
1278 static std::array<std::string_view, 9> const credTypes = {
-
1279 "cred1",
-
1280 "cred2",
-
1281 "cred3",
-
1282 "cred4",
-
1283 "cred5",
-
1284 "cred6",
-
1285 "cred7",
-
1286 "cred8",
-
1287 "cred9"};
-
1288 static_assert(
-
1289 sizeof(credTypes) / sizeof(credTypes[0]) >
- +
1146 auto tryField = [&](Json::Value fieldValue) -> void {
+ +
1148 Json::Value jo;
+
1149 jo[jss::issuer] = issuer.human();
+
1150 jo[jss::credential_type] = fieldValue;
+
1151 arr.append(jo);
+
1152 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+
1153 arr;
+
1154
+
1155 Json::Value const jrr = env.rpc(
+
1156 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1157 auto const expectedErrMsg = fieldValue.isNull()
+
1158 ? RPC::missing_field_message(jss::credential_type.c_str())
+ +
1160 jss::credential_type, "hex string");
+ +
1162 jrr, "malformedAuthorizedCredentials", expectedErrMsg);
+
1163 };
+
1164
+
1165 auto const& badValues = getBadValues(FieldType::BlobField);
+
1166 for (auto const& value : badValues)
+
1167 {
+
1168 tryField(value);
+
1169 }
+
1170 tryField(Json::nullValue);
+
1171 }
+
1172
+
1173 {
+
1174 // Failed, authorized and authorized_credentials both present
+
1175 Json::Value jvParams;
+
1176 jvParams[jss::ledger_index] = jss::validated;
+
1177 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+
1178 jvParams[jss::deposit_preauth][jss::authorized] = alice.human();
+
1179
+
1180 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1182 auto& arr(
+
1183 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1184
+
1185 Json::Value jo;
+
1186 jo[jss::issuer] = issuer.human();
+
1187 jo[jss::credential_type] = strHex(std::string_view(credType));
+
1188 arr.append(std::move(jo));
+
1189
+
1190 auto const jrr =
+
1191 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1193 jrr[jss::result],
+
1194 "malformedRequest",
+
1195 "Must have exactly one of `authorized` and "
+
1196 "`authorized_credentials`.");
+
1197 }
+
1198
+
1199 {
+
1200 // Failed, authorized_credentials is not an array
+
1201 Json::Value jvParams;
+
1202 jvParams[jss::ledger_index] = jss::validated;
+
1203 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+ +
1205 env,
+
1206 jvParams,
+
1207 jss::deposit_preauth,
+
1208 jss::authorized_credentials,
+ +
1210 "malformedAuthorizedCredentials",
+
1211 false);
+
1212 }
+
1213
+
1214 {
+
1215 // Failed, authorized_credentials contains string data
+
1216 Json::Value jvParams;
+
1217 jvParams[jss::ledger_index] = jss::validated;
+
1218 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+
1219 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1221 auto& arr(
+
1222 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1223 arr.append("foobar");
+
1224
+
1225 auto const jrr =
+
1226 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1228 jrr[jss::result],
+
1229 "malformedAuthorizedCredentials",
+
1230 "Invalid field 'authorized_credentials', not array.");
+
1231 }
+
1232
+
1233 {
+
1234 // Failed, authorized_credentials contains arrays
+
1235 Json::Value jvParams;
+
1236 jvParams[jss::ledger_index] = jss::validated;
+
1237 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+
1238 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1240 auto& arr(
+
1241 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1242 Json::Value payload = Json::arrayValue;
+
1243 payload.append(42);
+
1244 arr.append(std::move(payload));
+
1245
+
1246 auto const jrr =
+
1247 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1249 jrr[jss::result],
+
1250 "malformedAuthorizedCredentials",
+
1251 "Invalid field 'authorized_credentials', not array.");
+
1252 }
+
1253
+
1254 {
+
1255 // Failed, authorized_credentials is empty array
+
1256 Json::Value jvParams;
+
1257 jvParams[jss::ledger_index] = jss::validated;
+
1258 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+
1259 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+ +
1261
+
1262 auto const jrr =
+
1263 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1265 jrr[jss::result],
+
1266 "malformedAuthorizedCredentials",
+
1267 "Invalid field 'authorized_credentials', array empty.");
+
1268 }
+
1269
+
1270 {
+
1271 // Failed, authorized_credentials is too long
+
1272 static std::array<std::string_view, 9> const credTypes = {
+
1273 "cred1",
+
1274 "cred2",
+
1275 "cred3",
+
1276 "cred4",
+
1277 "cred5",
+
1278 "cred6",
+
1279 "cred7",
+
1280 "cred8",
+
1281 "cred9"};
+
1282 static_assert(
+
1283 sizeof(credTypes) / sizeof(credTypes[0]) >
+ +
1285
+
1286 Json::Value jvParams;
+
1287 jvParams[jss::ledger_index] = jss::validated;
+
1288 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
+
1289 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
+
1291
-
1292 Json::Value jvParams;
-
1293 jvParams[jss::ledger_index] = jss::validated;
-
1294 jvParams[jss::deposit_preauth][jss::owner] = bob.human();
-
1295 jvParams[jss::deposit_preauth][jss::authorized_credentials] =
- -
1297
-
1298 auto& arr(
-
1299 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
-
1300
-
1301 for (auto cred : credTypes)
-
1302 {
-
1303 Json::Value jo;
-
1304 jo[jss::issuer] = issuer.human();
-
1305 jo[jss::credential_type] = strHex(std::string_view(cred));
-
1306 arr.append(std::move(jo));
-
1307 }
-
1308
-
1309 auto const jrr =
-
1310 env.rpc("json", "ledger_entry", to_string(jvParams));
- -
1312 jrr[jss::result],
-
1313 "malformedAuthorizedCredentials",
-
1314 "Invalid field 'authorized_credentials', array too long.");
-
1315 }
-
1316 }
+
1292 auto& arr(
+
1293 jvParams[jss::deposit_preauth][jss::authorized_credentials]);
+
1294
+
1295 for (auto cred : credTypes)
+
1296 {
+
1297 Json::Value jo;
+
1298 jo[jss::issuer] = issuer.human();
+
1299 jo[jss::credential_type] = strHex(std::string_view(cred));
+
1300 arr.append(std::move(jo));
+
1301 }
+
1302
+
1303 auto const jrr =
+
1304 env.rpc("json", "ledger_entry", to_string(jvParams));
+ +
1306 jrr[jss::result],
+
1307 "malformedAuthorizedCredentials",
+
1308 "Invalid field 'authorized_credentials', array too long.");
+
1309 }
+
1310 }
-
1317
-
1318 void
-
- -
1320 {
-
1321 testcase("Directory");
-
1322 using namespace test::jtx;
-
1323 Env env{*this};
-
1324 Account const alice{"alice"};
-
1325 Account const gw{"gateway"};
-
1326 auto const USD = gw["USD"];
-
1327 env.fund(XRP(10000), alice, gw);
-
1328 env.close();
-
1329
-
1330 env.trust(USD(1000), alice);
-
1331 env.close();
-
1332
-
1333 // Run up the number of directory entries so alice has two
-
1334 // directory nodes.
-
1335 for (int d = 1'000'032; d >= 1'000'000; --d)
+
1311
+
1312 void
+
+ +
1314 {
+
1315 testcase("Directory");
+
1316 using namespace test::jtx;
+
1317 Env env{*this};
+
1318 Account const alice{"alice"};
+
1319 Account const gw{"gateway"};
+
1320 auto const USD = gw["USD"];
+
1321 env.fund(XRP(10000), alice, gw);
+
1322 env.close();
+
1323
+
1324 env.trust(USD(1000), alice);
+
1325 env.close();
+
1326
+
1327 // Run up the number of directory entries so alice has two
+
1328 // directory nodes.
+
1329 for (int d = 1'000'032; d >= 1'000'000; --d)
+
1330 {
+
1331 env(offer(alice, USD(1), drops(d)));
+
1332 }
+
1333 env.close();
+
1334
+
1335 std::string const ledgerHash{to_string(env.closed()->header().hash)};
1336 {
-
1337 env(offer(alice, USD(1), drops(d)));
-
1338 }
-
1339 env.close();
-
1340
-
1341 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
1342 {
-
1343 // Exercise ledger_closed along the way.
-
1344 Json::Value const jrr = env.rpc("ledger_closed")[jss::result];
-
1345 BEAST_EXPECT(jrr[jss::ledger_hash] == ledgerHash);
-
1346 BEAST_EXPECT(jrr[jss::ledger_index] == 5);
-
1347 }
-
1348
-
1349 std::string const dirRootIndex =
-
1350 "A33EC6BB85FB5674074C4A3A43373BB17645308F3EAE1933E3E35252162B217D";
-
1351 {
-
1352 // Locate directory by index.
-
1353 Json::Value jvParams;
-
1354 jvParams[jss::directory] = dirRootIndex;
-
1355 jvParams[jss::ledger_hash] = ledgerHash;
-
1356 Json::Value const jrr = env.rpc(
-
1357 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1358 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 32);
-
1359 }
-
1360 {
-
1361 // Locate directory by directory root.
-
1362 Json::Value jvParams;
-
1363 jvParams[jss::directory] = Json::objectValue;
-
1364 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
-
1365 Json::Value const jrr = env.rpc(
-
1366 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1367 BEAST_EXPECT(jrr[jss::index] == dirRootIndex);
-
1368 }
-
1369 {
-
1370 // Locate directory by owner.
-
1371 Json::Value jvParams;
-
1372 jvParams[jss::directory] = Json::objectValue;
-
1373 jvParams[jss::directory][jss::owner] = alice.human();
-
1374 jvParams[jss::ledger_hash] = ledgerHash;
-
1375 Json::Value const jrr = env.rpc(
-
1376 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1377 BEAST_EXPECT(jrr[jss::index] == dirRootIndex);
-
1378 }
-
1379 {
-
1380 // Locate directory by directory root and sub_index.
-
1381 Json::Value jvParams;
-
1382 jvParams[jss::directory] = Json::objectValue;
-
1383 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
-
1384 jvParams[jss::directory][jss::sub_index] = 1;
-
1385 Json::Value const jrr = env.rpc(
-
1386 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1387 BEAST_EXPECT(jrr[jss::index] != dirRootIndex);
-
1388 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 2);
-
1389 }
-
1390 {
-
1391 // Locate directory by owner and sub_index.
-
1392 Json::Value jvParams;
-
1393 jvParams[jss::directory] = Json::objectValue;
-
1394 jvParams[jss::directory][jss::owner] = alice.human();
-
1395 jvParams[jss::directory][jss::sub_index] = 1;
-
1396 jvParams[jss::ledger_hash] = ledgerHash;
-
1397 Json::Value const jrr = env.rpc(
-
1398 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1399 BEAST_EXPECT(jrr[jss::index] != dirRootIndex);
-
1400 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 2);
-
1401 }
-
1402 {
-
1403 // Bad directory argument.
-
1404 Json::Value jvParams;
-
1405 jvParams[jss::ledger_hash] = ledgerHash;
- -
1407 env,
-
1408 jvParams,
-
1409 jss::directory,
- -
1411 "malformedRequest");
-
1412 }
-
1413 {
-
1414 // Non-integer sub_index.
-
1415 Json::Value jvParams;
-
1416 jvParams[jss::directory] = Json::objectValue;
-
1417 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
-
1418 jvParams[jss::ledger_hash] = ledgerHash;
- -
1420 env,
-
1421 jvParams,
-
1422 jss::directory,
-
1423 jss::sub_index,
- -
1425 "malformedRequest",
-
1426 false);
-
1427 }
-
1428 {
-
1429 // Malformed owner entry.
-
1430 Json::Value jvParams;
-
1431 jvParams[jss::directory] = Json::objectValue;
-
1432
-
1433 jvParams[jss::ledger_hash] = ledgerHash;
- -
1435 env,
-
1436 jvParams,
-
1437 jss::directory,
-
1438 jss::owner,
- -
1440 "malformedAddress",
-
1441 false);
-
1442 }
-
1443 {
-
1444 // Malformed directory object. Specifies both dir_root and owner.
-
1445 Json::Value jvParams;
-
1446 jvParams[jss::directory] = Json::objectValue;
-
1447 jvParams[jss::directory][jss::owner] = alice.human();
-
1448 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
-
1449 jvParams[jss::ledger_hash] = ledgerHash;
-
1450 Json::Value const jrr = env.rpc(
-
1451 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
1453 jrr,
-
1454 "malformedRequest",
-
1455 "Must have exactly one of `owner` and `dir_root` fields.");
-
1456 }
-
1457 {
-
1458 // Incomplete directory object. Missing both dir_root and owner.
-
1459 Json::Value jvParams;
-
1460 jvParams[jss::directory] = Json::objectValue;
-
1461 jvParams[jss::directory][jss::sub_index] = 1;
-
1462 jvParams[jss::ledger_hash] = ledgerHash;
-
1463 Json::Value const jrr = env.rpc(
-
1464 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
1466 jrr,
-
1467 "malformedRequest",
-
1468 "Must have exactly one of `owner` and `dir_root` fields.");
-
1469 }
-
1470 }
+
1337 // Exercise ledger_closed along the way.
+
1338 Json::Value const jrr = env.rpc("ledger_closed")[jss::result];
+
1339 BEAST_EXPECT(jrr[jss::ledger_hash] == ledgerHash);
+
1340 BEAST_EXPECT(jrr[jss::ledger_index] == 5);
+
1341 }
+
1342
+
1343 std::string const dirRootIndex =
+
1344 "A33EC6BB85FB5674074C4A3A43373BB17645308F3EAE1933E3E35252162B217D";
+
1345 {
+
1346 // Locate directory by index.
+
1347 Json::Value jvParams;
+
1348 jvParams[jss::directory] = dirRootIndex;
+
1349 jvParams[jss::ledger_hash] = ledgerHash;
+
1350 Json::Value const jrr = env.rpc(
+
1351 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1352 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 32);
+
1353 }
+
1354 {
+
1355 // Locate directory by directory root.
+
1356 Json::Value jvParams;
+
1357 jvParams[jss::directory] = Json::objectValue;
+
1358 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
+
1359 Json::Value const jrr = env.rpc(
+
1360 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1361 BEAST_EXPECT(jrr[jss::index] == dirRootIndex);
+
1362 }
+
1363 {
+
1364 // Locate directory by owner.
+
1365 Json::Value jvParams;
+
1366 jvParams[jss::directory] = Json::objectValue;
+
1367 jvParams[jss::directory][jss::owner] = alice.human();
+
1368 jvParams[jss::ledger_hash] = ledgerHash;
+
1369 Json::Value const jrr = env.rpc(
+
1370 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1371 BEAST_EXPECT(jrr[jss::index] == dirRootIndex);
+
1372 }
+
1373 {
+
1374 // Locate directory by directory root and sub_index.
+
1375 Json::Value jvParams;
+
1376 jvParams[jss::directory] = Json::objectValue;
+
1377 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
+
1378 jvParams[jss::directory][jss::sub_index] = 1;
+
1379 Json::Value const jrr = env.rpc(
+
1380 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1381 BEAST_EXPECT(jrr[jss::index] != dirRootIndex);
+
1382 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 2);
+
1383 }
+
1384 {
+
1385 // Locate directory by owner and sub_index.
+
1386 Json::Value jvParams;
+
1387 jvParams[jss::directory] = Json::objectValue;
+
1388 jvParams[jss::directory][jss::owner] = alice.human();
+
1389 jvParams[jss::directory][jss::sub_index] = 1;
+
1390 jvParams[jss::ledger_hash] = ledgerHash;
+
1391 Json::Value const jrr = env.rpc(
+
1392 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1393 BEAST_EXPECT(jrr[jss::index] != dirRootIndex);
+
1394 BEAST_EXPECT(jrr[jss::node][sfIndexes.jsonName].size() == 2);
+
1395 }
+
1396 {
+
1397 // Bad directory argument.
+
1398 Json::Value jvParams;
+
1399 jvParams[jss::ledger_hash] = ledgerHash;
+ +
1401 env,
+
1402 jvParams,
+
1403 jss::directory,
+ +
1405 "malformedRequest");
+
1406 }
+
1407 {
+
1408 // Non-integer sub_index.
+
1409 Json::Value jvParams;
+
1410 jvParams[jss::directory] = Json::objectValue;
+
1411 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
+
1412 jvParams[jss::ledger_hash] = ledgerHash;
+ +
1414 env,
+
1415 jvParams,
+
1416 jss::directory,
+
1417 jss::sub_index,
+ +
1419 "malformedRequest",
+
1420 false);
+
1421 }
+
1422 {
+
1423 // Malformed owner entry.
+
1424 Json::Value jvParams;
+
1425 jvParams[jss::directory] = Json::objectValue;
+
1426
+
1427 jvParams[jss::ledger_hash] = ledgerHash;
+ +
1429 env,
+
1430 jvParams,
+
1431 jss::directory,
+
1432 jss::owner,
+ +
1434 "malformedAddress",
+
1435 false);
+
1436 }
+
1437 {
+
1438 // Malformed directory object. Specifies both dir_root and owner.
+
1439 Json::Value jvParams;
+
1440 jvParams[jss::directory] = Json::objectValue;
+
1441 jvParams[jss::directory][jss::owner] = alice.human();
+
1442 jvParams[jss::directory][jss::dir_root] = dirRootIndex;
+
1443 jvParams[jss::ledger_hash] = ledgerHash;
+
1444 Json::Value const jrr = env.rpc(
+
1445 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
1447 jrr,
+
1448 "malformedRequest",
+
1449 "Must have exactly one of `owner` and `dir_root` fields.");
+
1450 }
+
1451 {
+
1452 // Incomplete directory object. Missing both dir_root and owner.
+
1453 Json::Value jvParams;
+
1454 jvParams[jss::directory] = Json::objectValue;
+
1455 jvParams[jss::directory][jss::sub_index] = 1;
+
1456 jvParams[jss::ledger_hash] = ledgerHash;
+
1457 Json::Value const jrr = env.rpc(
+
1458 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
1460 jrr,
+
1461 "malformedRequest",
+
1462 "Must have exactly one of `owner` and `dir_root` fields.");
+
1463 }
+
1464 }
-
1471
-
1472 void
-
- -
1474 {
-
1475 testcase("Escrow");
-
1476 using namespace test::jtx;
-
1477 Env env{*this};
-
1478 Account const alice{"alice"};
-
1479 env.fund(XRP(10000), alice);
-
1480 env.close();
-
1481
-
1482 // Lambda to create an escrow.
-
1483 auto escrowCreate = [](test::jtx::Account const& account,
-
1484 test::jtx::Account const& to,
-
1485 STAmount const& amount,
-
1486 NetClock::time_point const& cancelAfter) {
-
1487 Json::Value jv;
-
1488 jv[jss::TransactionType] = jss::EscrowCreate;
-
1489 jv[jss::Account] = account.human();
-
1490 jv[jss::Destination] = to.human();
-
1491 jv[jss::Amount] = amount.getJson(JsonOptions::none);
-
1492 jv[sfFinishAfter.jsonName] =
-
1493 cancelAfter.time_since_epoch().count() + 2;
-
1494 return jv;
-
1495 };
-
1496
-
1497 using namespace std::chrono_literals;
-
1498 env(escrowCreate(alice, alice, XRP(333), env.now() + 2s));
-
1499 env.close();
-
1500
-
1501 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
1502 std::string escrowIndex;
-
1503 {
-
1504 // Request the escrow using owner and sequence.
-
1505 Json::Value jvParams;
-
1506 jvParams[jss::escrow] = Json::objectValue;
-
1507 jvParams[jss::escrow][jss::owner] = alice.human();
-
1508 jvParams[jss::escrow][jss::seq] = env.seq(alice) - 1;
-
1509 Json::Value const jrr = env.rpc(
-
1510 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1511 BEAST_EXPECT(
-
1512 jrr[jss::node][jss::Amount] == XRP(333).value().getText());
-
1513 escrowIndex = jrr[jss::index].asString();
-
1514 }
-
1515 {
-
1516 // Request the escrow by index.
-
1517 Json::Value jvParams;
-
1518 jvParams[jss::escrow] = escrowIndex;
-
1519 jvParams[jss::ledger_hash] = ledgerHash;
-
1520 Json::Value const jrr = env.rpc(
-
1521 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1522 BEAST_EXPECT(
-
1523 jrr[jss::node][jss::Amount] == XRP(333).value().getText());
-
1524 }
-
1525 {
-
1526 // Malformed escrow fields
- -
1528 env,
-
1529 jss::escrow,
-
1530 {{jss::owner, "malformedOwner"}, {jss::seq, "malformedSeq"}});
-
1531 }
-
1532 }
+
1465
+
1466 void
+
+ +
1468 {
+
1469 testcase("Escrow");
+
1470 using namespace test::jtx;
+
1471 Env env{*this};
+
1472 Account const alice{"alice"};
+
1473 env.fund(XRP(10000), alice);
+
1474 env.close();
+
1475
+
1476 // Lambda to create an escrow.
+
1477 auto escrowCreate = [](test::jtx::Account const& account,
+
1478 test::jtx::Account const& to,
+
1479 STAmount const& amount,
+
1480 NetClock::time_point const& cancelAfter) {
+
1481 Json::Value jv;
+
1482 jv[jss::TransactionType] = jss::EscrowCreate;
+
1483 jv[jss::Account] = account.human();
+
1484 jv[jss::Destination] = to.human();
+
1485 jv[jss::Amount] = amount.getJson(JsonOptions::none);
+
1486 jv[sfFinishAfter.jsonName] =
+
1487 cancelAfter.time_since_epoch().count() + 2;
+
1488 return jv;
+
1489 };
+
1490
+
1491 using namespace std::chrono_literals;
+
1492 env(escrowCreate(alice, alice, XRP(333), env.now() + 2s));
+
1493 env.close();
+
1494
+
1495 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
1496 std::string escrowIndex;
+
1497 {
+
1498 // Request the escrow using owner and sequence.
+
1499 Json::Value jvParams;
+
1500 jvParams[jss::escrow] = Json::objectValue;
+
1501 jvParams[jss::escrow][jss::owner] = alice.human();
+
1502 jvParams[jss::escrow][jss::seq] = env.seq(alice) - 1;
+
1503 Json::Value const jrr = env.rpc(
+
1504 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1505 BEAST_EXPECT(
+
1506 jrr[jss::node][jss::Amount] == XRP(333).value().getText());
+
1507 escrowIndex = jrr[jss::index].asString();
+
1508 }
+
1509 {
+
1510 // Request the escrow by index.
+
1511 Json::Value jvParams;
+
1512 jvParams[jss::escrow] = escrowIndex;
+
1513 jvParams[jss::ledger_hash] = ledgerHash;
+
1514 Json::Value const jrr = env.rpc(
+
1515 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1516 BEAST_EXPECT(
+
1517 jrr[jss::node][jss::Amount] == XRP(333).value().getText());
+
1518 }
+
1519 {
+
1520 // Malformed escrow fields
+ +
1522 env,
+
1523 jss::escrow,
+
1524 {{jss::owner, "malformedOwner"}, {jss::seq, "malformedSeq"}});
+
1525 }
+
1526 }
-
1533
-
1534 void
-
- -
1536 {
-
1537 testcase("Fee Settings");
-
1538 using namespace test::jtx;
-
1539 Env env{*this};
-
1540
-
1541 // positive test
-
1542 {
-
1543 Keylet const keylet = keylet::fees();
-
1544 Json::Value jvParams;
-
1545 jvParams[jss::fee] = to_string(keylet.key);
-
1546 Json::Value const jrr = env.rpc(
-
1547 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1548 BEAST_EXPECT(
-
1549 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::FeeSettings);
-
1550 }
-
1551
-
1552 // negative tests
- -
1554 env,
-
1555 Json::Value{},
-
1556 jss::fee,
- -
1558 "malformedRequest");
-
1559 }
+
1527
+
1528 void
+
+ +
1530 {
+
1531 testcase("Fee Settings");
+
1532 using namespace test::jtx;
+
1533 Env env{*this};
+
1534
+
1535 // positive test
+
1536 {
+
1537 Keylet const keylet = keylet::fees();
+
1538 Json::Value jvParams;
+
1539 jvParams[jss::fee] = to_string(keylet.key);
+
1540 Json::Value const jrr = env.rpc(
+
1541 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1542 BEAST_EXPECT(
+
1543 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::FeeSettings);
+
1544 }
+
1545
+
1546 // negative tests
+ +
1548 env,
+
1549 Json::Value{},
+
1550 jss::fee,
+ +
1552 "malformedRequest");
+
1553 }
-
1560
-
1561 void
-
- -
1563 {
-
1564 testcase("Ledger Hashes");
-
1565 using namespace test::jtx;
-
1566 Env env{*this};
-
1567
-
1568 // positive test
-
1569 {
-
1570 Keylet const keylet = keylet::skip();
-
1571 Json::Value jvParams;
-
1572 jvParams[jss::hashes] = to_string(keylet.key);
-
1573 Json::Value const jrr = env.rpc(
-
1574 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1575 BEAST_EXPECT(
-
1576 jrr[jss::node][sfLedgerEntryType.jsonName] ==
-
1577 jss::LedgerHashes);
-
1578 }
-
1579
-
1580 // negative tests
- -
1582 env,
-
1583 Json::Value{},
-
1584 jss::hashes,
- -
1586 "malformedRequest");
-
1587 }
+
1554
+
1555 void
+
+ +
1557 {
+
1558 testcase("Ledger Hashes");
+
1559 using namespace test::jtx;
+
1560 Env env{*this};
+
1561
+
1562 // positive test
+
1563 {
+
1564 Keylet const keylet = keylet::skip();
+
1565 Json::Value jvParams;
+
1566 jvParams[jss::hashes] = to_string(keylet.key);
+
1567 Json::Value const jrr = env.rpc(
+
1568 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1569 BEAST_EXPECT(
+
1570 jrr[jss::node][sfLedgerEntryType.jsonName] ==
+
1571 jss::LedgerHashes);
+
1572 }
+
1573
+
1574 // negative tests
+ +
1576 env,
+
1577 Json::Value{},
+
1578 jss::hashes,
+ +
1580 "malformedRequest");
+
1581 }
-
1588
-
1589 void
-
- -
1591 {
-
1592 testcase("NFT Offer");
-
1593 using namespace test::jtx;
-
1594 Env env{*this};
-
1595
-
1596 // positive test
-
1597 Account const issuer{"issuer"};
-
1598 Account const buyer{"buyer"};
-
1599 env.fund(XRP(1000), issuer, buyer);
-
1600
-
1601 uint256 const nftokenID0 =
-
1602 token::getNextID(env, issuer, 0, tfTransferable);
-
1603 env(token::mint(issuer, 0), txflags(tfTransferable));
-
1604 env.close();
-
1605 uint256 const offerID = keylet::nftoffer(issuer, env.seq(issuer)).key;
-
1606 env(token::createOffer(issuer, nftokenID0, drops(1)),
-
1607 token::destination(buyer),
- -
1609
-
1610 {
-
1611 Json::Value jvParams;
-
1612 jvParams[jss::nft_offer] = to_string(offerID);
-
1613 Json::Value const jrr = env.rpc(
-
1614 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1615 BEAST_EXPECT(
-
1616 jrr[jss::node][sfLedgerEntryType.jsonName] ==
-
1617 jss::NFTokenOffer);
-
1618 BEAST_EXPECT(jrr[jss::node][sfOwner.jsonName] == issuer.human());
-
1619 BEAST_EXPECT(
-
1620 jrr[jss::node][sfNFTokenID.jsonName] == to_string(nftokenID0));
-
1621 BEAST_EXPECT(jrr[jss::node][sfAmount.jsonName] == "1");
-
1622 }
-
1623
-
1624 // negative tests
-
1625 runLedgerEntryTest(env, jss::nft_offer);
-
1626 }
+
1582
+
1583 void
+
+ +
1585 {
+
1586 testcase("NFT Offer");
+
1587 using namespace test::jtx;
+
1588 Env env{*this};
+
1589
+
1590 // positive test
+
1591 Account const issuer{"issuer"};
+
1592 Account const buyer{"buyer"};
+
1593 env.fund(XRP(1000), issuer, buyer);
+
1594
+
1595 uint256 const nftokenID0 =
+
1596 token::getNextID(env, issuer, 0, tfTransferable);
+
1597 env(token::mint(issuer, 0), txflags(tfTransferable));
+
1598 env.close();
+
1599 uint256 const offerID = keylet::nftoffer(issuer, env.seq(issuer)).key;
+
1600 env(token::createOffer(issuer, nftokenID0, drops(1)),
+
1601 token::destination(buyer),
+ +
1603
+
1604 {
+
1605 Json::Value jvParams;
+
1606 jvParams[jss::nft_offer] = to_string(offerID);
+
1607 Json::Value const jrr = env.rpc(
+
1608 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1609 BEAST_EXPECT(
+
1610 jrr[jss::node][sfLedgerEntryType.jsonName] ==
+
1611 jss::NFTokenOffer);
+
1612 BEAST_EXPECT(jrr[jss::node][sfOwner.jsonName] == issuer.human());
+
1613 BEAST_EXPECT(
+
1614 jrr[jss::node][sfNFTokenID.jsonName] == to_string(nftokenID0));
+
1615 BEAST_EXPECT(jrr[jss::node][sfAmount.jsonName] == "1");
+
1616 }
+
1617
+
1618 // negative tests
+
1619 runLedgerEntryTest(env, jss::nft_offer);
+
1620 }
-
1627
-
1628 void
-
- -
1630 {
-
1631 testcase("NFT Page");
-
1632 using namespace test::jtx;
-
1633 Env env{*this};
-
1634
-
1635 // positive test
-
1636 Account const issuer{"issuer"};
-
1637 env.fund(XRP(1000), issuer);
+
1621
+
1622 void
+
+ +
1624 {
+
1625 testcase("NFT Page");
+
1626 using namespace test::jtx;
+
1627 Env env{*this};
+
1628
+
1629 // positive test
+
1630 Account const issuer{"issuer"};
+
1631 env.fund(XRP(1000), issuer);
+
1632
+
1633 env(token::mint(issuer, 0), txflags(tfTransferable));
+
1634 env.close();
+
1635
+
1636 auto const nftpage = keylet::nftpage_max(issuer);
+
1637 BEAST_EXPECT(env.le(nftpage) != nullptr);
1638
-
1639 env(token::mint(issuer, 0), txflags(tfTransferable));
-
1640 env.close();
-
1641
-
1642 auto const nftpage = keylet::nftpage_max(issuer);
-
1643 BEAST_EXPECT(env.le(nftpage) != nullptr);
-
1644
-
1645 {
-
1646 Json::Value jvParams;
-
1647 jvParams[jss::nft_page] = to_string(nftpage.key);
-
1648 Json::Value const jrr = env.rpc(
-
1649 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1650 BEAST_EXPECT(
-
1651 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NFTokenPage);
-
1652 }
-
1653
-
1654 // negative tests
-
1655 runLedgerEntryTest(env, jss::nft_page);
-
1656 }
+
1639 {
+
1640 Json::Value jvParams;
+
1641 jvParams[jss::nft_page] = to_string(nftpage.key);
+
1642 Json::Value const jrr = env.rpc(
+
1643 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1644 BEAST_EXPECT(
+
1645 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NFTokenPage);
+
1646 }
+
1647
+
1648 // negative tests
+
1649 runLedgerEntryTest(env, jss::nft_page);
+
1650 }
-
1657
-
1658 void
-
- -
1660 {
-
1661 testcase("Negative UNL");
-
1662 using namespace test::jtx;
-
1663 Env env{*this};
-
1664
-
1665 // positive test
-
1666 {
-
1667 Keylet const keylet = keylet::negativeUNL();
+
1651
+
1652 void
+
+ +
1654 {
+
1655 testcase("Negative UNL");
+
1656 using namespace test::jtx;
+
1657 Env env{*this};
+
1658
+
1659 // positive test
+
1660 {
+
1661 Keylet const keylet = keylet::negativeUNL();
+
1662
+
1663 // easier to hack an object into the ledger than generate it
+
1664 // legitimately
+
1665 {
+
1666 auto const nUNL = [&](OpenView& view, beast::Journal) -> bool {
+
1667 auto const sle = std::make_shared<SLE>(keylet);
1668
-
1669 // easier to hack an object into the ledger than generate it
-
1670 // legitimately
-
1671 {
-
1672 auto const nUNL = [&](OpenView& view, beast::Journal) -> bool {
-
1673 auto const sle = std::make_shared<SLE>(keylet);
-
1674
-
1675 // Create DisabledValidators array
-
1676 STArray disabledValidators;
-
1677 auto disabledValidator =
-
1678 STObject::makeInnerObject(sfDisabledValidator);
-
1679 auto pubKeyBlob = strUnHex(
-
1680 "ED58F6770DB5DD77E59D28CB650EC3816E2FC95021BB56E720C9A1"
-
1681 "2DA79C58A3AB");
-
1682 disabledValidator.setFieldVL(sfPublicKey, *pubKeyBlob);
-
1683 disabledValidator.setFieldU32(
-
1684 sfFirstLedgerSequence, 91371264);
-
1685 disabledValidators.push_back(std::move(disabledValidator));
-
1686
-
1687 sle->setFieldArray(
-
1688 sfDisabledValidators, disabledValidators);
-
1689 sle->setFieldH256(
-
1690 sfPreviousTxnID,
-
1691 uint256::fromVoid("8D47FFE664BE6C335108DF689537625855A6"
-
1692 "A95160CC6D351341B9"
-
1693 "2624D9C5E3"));
-
1694 sle->setFieldU32(sfPreviousTxnLgrSeq, 91442944);
+
1669 // Create DisabledValidators array
+
1670 STArray disabledValidators;
+
1671 auto disabledValidator =
+
1672 STObject::makeInnerObject(sfDisabledValidator);
+
1673 auto pubKeyBlob = strUnHex(
+
1674 "ED58F6770DB5DD77E59D28CB650EC3816E2FC95021BB56E720C9A1"
+
1675 "2DA79C58A3AB");
+
1676 disabledValidator.setFieldVL(sfPublicKey, *pubKeyBlob);
+
1677 disabledValidator.setFieldU32(
+
1678 sfFirstLedgerSequence, 91371264);
+
1679 disabledValidators.push_back(std::move(disabledValidator));
+
1680
+
1681 sle->setFieldArray(
+
1682 sfDisabledValidators, disabledValidators);
+
1683 sle->setFieldH256(
+
1684 sfPreviousTxnID,
+
1685 uint256::fromVoid("8D47FFE664BE6C335108DF689537625855A6"
+
1686 "A95160CC6D351341B9"
+
1687 "2624D9C5E3"));
+
1688 sle->setFieldU32(sfPreviousTxnLgrSeq, 91442944);
+
1689
+
1690 view.rawInsert(sle);
+
1691 return true;
+
1692 };
+
1693 env.app().openLedger().modify(nUNL);
+
1694 }
1695
-
1696 view.rawInsert(sle);
-
1697 return true;
-
1698 };
-
1699 env.app().openLedger().modify(nUNL);
-
1700 }
-
1701
-
1702 Json::Value jvParams;
-
1703 jvParams[jss::nunl] = to_string(keylet.key);
-
1704 Json::Value const jrr = env.rpc(
-
1705 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1706 BEAST_EXPECT(
-
1707 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NegativeUNL);
-
1708 }
-
1709
-
1710 // negative tests
- -
1712 env,
-
1713 Json::Value{},
-
1714 jss::nunl,
- -
1716 "malformedRequest");
-
1717 }
+
1696 Json::Value jvParams;
+
1697 jvParams[jss::nunl] = to_string(keylet.key);
+
1698 Json::Value const jrr = env.rpc(
+
1699 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1700 BEAST_EXPECT(
+
1701 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NegativeUNL);
+
1702 }
+
1703
+
1704 // negative tests
+ +
1706 env,
+
1707 Json::Value{},
+
1708 jss::nunl,
+ +
1710 "malformedRequest");
+
1711 }
-
1718
-
1719 void
-
- -
1721 {
-
1722 testcase("Offer");
-
1723 using namespace test::jtx;
-
1724 Env env{*this};
-
1725 Account const alice{"alice"};
-
1726 Account const gw{"gateway"};
-
1727 auto const USD = gw["USD"];
-
1728 env.fund(XRP(10000), alice, gw);
-
1729 env.close();
-
1730
-
1731 env(offer(alice, USD(321), XRP(322)));
-
1732 env.close();
-
1733
-
1734 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
1735 std::string offerIndex;
-
1736 {
-
1737 // Request the offer using owner and sequence.
-
1738 Json::Value jvParams;
-
1739 jvParams[jss::offer] = Json::objectValue;
-
1740 jvParams[jss::offer][jss::account] = alice.human();
-
1741 jvParams[jss::offer][jss::seq] = env.seq(alice) - 1;
-
1742 jvParams[jss::ledger_hash] = ledgerHash;
-
1743 Json::Value const jrr = env.rpc(
-
1744 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1745 BEAST_EXPECT(jrr[jss::node][jss::TakerGets] == "322000000");
-
1746 offerIndex = jrr[jss::index].asString();
-
1747 }
-
1748 {
-
1749 // Request the offer using its index.
-
1750 Json::Value jvParams;
-
1751 jvParams[jss::offer] = offerIndex;
-
1752 Json::Value const jrr = env.rpc(
-
1753 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1754 BEAST_EXPECT(jrr[jss::node][jss::TakerGets] == "322000000");
-
1755 }
-
1756
-
1757 {
-
1758 // Malformed offer fields
- -
1760 env,
-
1761 jss::offer,
-
1762 {{jss::account, "malformedAddress"},
-
1763 {jss::seq, "malformedRequest"}});
-
1764 }
-
1765 }
+
1712
+
1713 void
+
+ +
1715 {
+
1716 testcase("Offer");
+
1717 using namespace test::jtx;
+
1718 Env env{*this};
+
1719 Account const alice{"alice"};
+
1720 Account const gw{"gateway"};
+
1721 auto const USD = gw["USD"];
+
1722 env.fund(XRP(10000), alice, gw);
+
1723 env.close();
+
1724
+
1725 env(offer(alice, USD(321), XRP(322)));
+
1726 env.close();
+
1727
+
1728 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
1729 std::string offerIndex;
+
1730 {
+
1731 // Request the offer using owner and sequence.
+
1732 Json::Value jvParams;
+
1733 jvParams[jss::offer] = Json::objectValue;
+
1734 jvParams[jss::offer][jss::account] = alice.human();
+
1735 jvParams[jss::offer][jss::seq] = env.seq(alice) - 1;
+
1736 jvParams[jss::ledger_hash] = ledgerHash;
+
1737 Json::Value const jrr = env.rpc(
+
1738 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1739 BEAST_EXPECT(jrr[jss::node][jss::TakerGets] == "322000000");
+
1740 offerIndex = jrr[jss::index].asString();
+
1741 }
+
1742 {
+
1743 // Request the offer using its index.
+
1744 Json::Value jvParams;
+
1745 jvParams[jss::offer] = offerIndex;
+
1746 Json::Value const jrr = env.rpc(
+
1747 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1748 BEAST_EXPECT(jrr[jss::node][jss::TakerGets] == "322000000");
+
1749 }
+
1750
+
1751 {
+
1752 // Malformed offer fields
+ +
1754 env,
+
1755 jss::offer,
+
1756 {{jss::account, "malformedAddress"},
+
1757 {jss::seq, "malformedRequest"}});
+
1758 }
+
1759 }
+
+
1760
+
1761 void
+
+ +
1763 {
+
1764 testcase("Pay Chan");
+
1765 using namespace test::jtx;
+
1766 using namespace std::literals::chrono_literals;
+
1767 Env env{*this};
+
1768 Account const alice{"alice"};
+
1769
+
1770 env.fund(XRP(10000), alice);
+
1771 env.close();
+
1772
+
1773 // Lambda to create a PayChan.
+
1774 auto payChanCreate = [](test::jtx::Account const& account,
+
1775 test::jtx::Account const& to,
+
1776 STAmount const& amount,
+
1777 NetClock::duration const& settleDelay,
+
1778 PublicKey const& pk) {
+
1779 Json::Value jv;
+
1780 jv[jss::TransactionType] = jss::PaymentChannelCreate;
+
1781 jv[jss::Account] = account.human();
+
1782 jv[jss::Destination] = to.human();
+
1783 jv[jss::Amount] = amount.getJson(JsonOptions::none);
+
1784 jv[sfSettleDelay.jsonName] = settleDelay.count();
+
1785 jv[sfPublicKey.jsonName] = strHex(pk.slice());
+
1786 return jv;
+
1787 };
+
1788
+
1789 env(payChanCreate(alice, env.master, XRP(57), 18s, alice.pk()));
+
1790 env.close();
+
1791
+
1792 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
1793
+
1794 uint256 const payChanIndex{
+
1795 keylet::payChan(alice, env.master, env.seq(alice) - 1).key};
+
1796 {
+
1797 // Request the payment channel using its index.
+
1798 Json::Value jvParams;
+
1799 jvParams[jss::payment_channel] = to_string(payChanIndex);
+
1800 jvParams[jss::ledger_hash] = ledgerHash;
+
1801 Json::Value const jrr = env.rpc(
+
1802 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1803 BEAST_EXPECT(jrr[jss::node][sfAmount.jsonName] == "57000000");
+
1804 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "0");
+
1805 BEAST_EXPECT(jrr[jss::node][sfSettleDelay.jsonName] == 18);
+
1806 }
+
1807 {
+
1808 // Request an index that is not a payment channel.
+
1809 Json::Value jvParams;
+
1810 jvParams[jss::payment_channel] = ledgerHash;
+
1811 jvParams[jss::ledger_hash] = ledgerHash;
+
1812 Json::Value const jrr = env.rpc(
+
1813 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1814 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
1815 }
+
1816
+
1817 {
+
1818 // Malformed paychan field
+
1819 runLedgerEntryTest(env, jss::payment_channel);
+
1820 }
+
1821 }
-
1766
-
1767 void
-
- -
1769 {
-
1770 testcase("Pay Chan");
-
1771 using namespace test::jtx;
-
1772 using namespace std::literals::chrono_literals;
-
1773 Env env{*this};
-
1774 Account const alice{"alice"};
-
1775
-
1776 env.fund(XRP(10000), alice);
-
1777 env.close();
-
1778
-
1779 // Lambda to create a PayChan.
-
1780 auto payChanCreate = [](test::jtx::Account const& account,
-
1781 test::jtx::Account const& to,
-
1782 STAmount const& amount,
-
1783 NetClock::duration const& settleDelay,
-
1784 PublicKey const& pk) {
-
1785 Json::Value jv;
-
1786 jv[jss::TransactionType] = jss::PaymentChannelCreate;
-
1787 jv[jss::Account] = account.human();
-
1788 jv[jss::Destination] = to.human();
-
1789 jv[jss::Amount] = amount.getJson(JsonOptions::none);
-
1790 jv[sfSettleDelay.jsonName] = settleDelay.count();
-
1791 jv[sfPublicKey.jsonName] = strHex(pk.slice());
-
1792 return jv;
-
1793 };
-
1794
-
1795 env(payChanCreate(alice, env.master, XRP(57), 18s, alice.pk()));
-
1796 env.close();
-
1797
-
1798 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
1799
-
1800 uint256 const payChanIndex{
-
1801 keylet::payChan(alice, env.master, env.seq(alice) - 1).key};
-
1802 {
-
1803 // Request the payment channel using its index.
-
1804 Json::Value jvParams;
-
1805 jvParams[jss::payment_channel] = to_string(payChanIndex);
-
1806 jvParams[jss::ledger_hash] = ledgerHash;
-
1807 Json::Value const jrr = env.rpc(
-
1808 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1809 BEAST_EXPECT(jrr[jss::node][sfAmount.jsonName] == "57000000");
-
1810 BEAST_EXPECT(jrr[jss::node][sfBalance.jsonName] == "0");
-
1811 BEAST_EXPECT(jrr[jss::node][sfSettleDelay.jsonName] == 18);
-
1812 }
-
1813 {
-
1814 // Request an index that is not a payment channel.
-
1815 Json::Value jvParams;
-
1816 jvParams[jss::payment_channel] = ledgerHash;
-
1817 jvParams[jss::ledger_hash] = ledgerHash;
-
1818 Json::Value const jrr = env.rpc(
-
1819 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1820 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
1821 }
1822
-
1823 {
-
1824 // Malformed paychan field
-
1825 runLedgerEntryTest(env, jss::payment_channel);
-
1826 }
-
1827 }
-
-
1828
-
1829 void
-
- -
1831 {
-
1832 testcase("RippleState");
-
1833 using namespace test::jtx;
-
1834 Env env{*this};
-
1835 Account const alice{"alice"};
-
1836 Account const gw{"gateway"};
-
1837 auto const USD = gw["USD"];
-
1838 env.fund(XRP(10000), alice, gw);
+
1823 void
+
+ +
1825 {
+
1826 testcase("RippleState");
+
1827 using namespace test::jtx;
+
1828 Env env{*this};
+
1829 Account const alice{"alice"};
+
1830 Account const gw{"gateway"};
+
1831 auto const USD = gw["USD"];
+
1832 env.fund(XRP(10000), alice, gw);
+
1833 env.close();
+
1834
+
1835 env.trust(USD(999), alice);
+
1836 env.close();
+
1837
+
1838 env(pay(gw, alice, USD(97)));
1839 env.close();
1840
-
1841 env.trust(USD(999), alice);
-
1842 env.close();
-
1843
-
1844 env(pay(gw, alice, USD(97)));
-
1845 env.close();
-
1846
-
1847 // check both aliases
-
1848 for (auto const& fieldName : {jss::ripple_state, jss::state})
-
1849 {
-
1850 std::string const ledgerHash{
-
1851 to_string(env.closed()->header().hash)};
-
1852 {
-
1853 // Request the trust line using the accounts and currency.
-
1854 Json::Value jvParams;
-
1855 jvParams[fieldName] = Json::objectValue;
-
1856 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1857 jvParams[fieldName][jss::accounts][0u] = alice.human();
-
1858 jvParams[fieldName][jss::accounts][1u] = gw.human();
-
1859 jvParams[fieldName][jss::currency] = "USD";
-
1860 jvParams[jss::ledger_hash] = ledgerHash;
-
1861 Json::Value const jrr = env.rpc(
-
1862 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
1863 BEAST_EXPECT(
-
1864 jrr[jss::node][sfBalance.jsonName][jss::value] == "-97");
-
1865 BEAST_EXPECT(
-
1866 jrr[jss::node][sfHighLimit.jsonName][jss::value] == "999");
-
1867 }
-
1868 {
-
1869 // test basic malformed scenarios
- -
1871 env,
-
1872 fieldName,
-
1873 {
-
1874 {jss::accounts, "malformedRequest"},
-
1875 {jss::currency, "malformedCurrency"},
-
1876 });
-
1877 }
-
1878 {
-
1879 // ripple_state one of the accounts is missing.
-
1880 Json::Value jvParams;
-
1881 jvParams[fieldName] = Json::objectValue;
-
1882 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1883 jvParams[fieldName][jss::accounts][0u] = alice.human();
-
1884 jvParams[fieldName][jss::currency] = "USD";
-
1885 jvParams[jss::ledger_hash] = ledgerHash;
-
1886 Json::Value const jrr = env.rpc(
-
1887 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
1889 jrr,
-
1890 "malformedRequest",
-
1891 "Invalid field 'accounts', not length-2 array of "
-
1892 "Accounts.");
-
1893 }
-
1894 {
-
1895 // ripple_state more than 2 accounts.
-
1896 Json::Value jvParams;
-
1897 jvParams[fieldName] = Json::objectValue;
-
1898 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1899 jvParams[fieldName][jss::accounts][0u] = alice.human();
-
1900 jvParams[fieldName][jss::accounts][1u] = gw.human();
-
1901 jvParams[fieldName][jss::accounts][2u] = alice.human();
-
1902 jvParams[fieldName][jss::currency] = "USD";
-
1903 jvParams[jss::ledger_hash] = ledgerHash;
-
1904 Json::Value const jrr = env.rpc(
-
1905 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
1907 jrr,
-
1908 "malformedRequest",
-
1909 "Invalid field 'accounts', not length-2 array of "
-
1910 "Accounts.");
-
1911 }
-
1912 {
-
1913 // ripple_state account[0] / account[1] is not an account.
-
1914 Json::Value jvParams;
-
1915 jvParams[fieldName] = Json::objectValue;
-
1916 auto tryField = [&](Json::Value badAccount) -> void {
-
1917 {
-
1918 // account[0]
-
1919 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1920 jvParams[fieldName][jss::accounts][0u] = badAccount;
-
1921 jvParams[fieldName][jss::accounts][1u] = gw.human();
-
1922 jvParams[fieldName][jss::currency] = "USD";
-
1923
-
1924 Json::Value const jrr = env.rpc(
-
1925 "json",
-
1926 "ledger_entry",
-
1927 to_string(jvParams))[jss::result];
- -
1929 jrr,
-
1930 "malformedAddress",
- -
1932 jss::accounts, "array of Accounts"));
-
1933 }
-
1934
-
1935 {
-
1936 // account[1]
-
1937 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1938 jvParams[fieldName][jss::accounts][0u] = alice.human();
-
1939 jvParams[fieldName][jss::accounts][1u] = badAccount;
-
1940 jvParams[fieldName][jss::currency] = "USD";
-
1941
-
1942 Json::Value const jrr = env.rpc(
-
1943 "json",
-
1944 "ledger_entry",
-
1945 to_string(jvParams))[jss::result];
- -
1947 jrr,
-
1948 "malformedAddress",
- -
1950 jss::accounts, "array of Accounts"));
-
1951 }
-
1952 };
-
1953
-
1954 auto const& badValues = getBadValues(FieldType::AccountField);
-
1955 for (auto const& value : badValues)
-
1956 {
-
1957 tryField(value);
-
1958 }
-
1959 tryField(Json::nullValue);
-
1960 }
-
1961 {
-
1962 // ripple_state account[0] == account[1].
-
1963 Json::Value jvParams;
-
1964 jvParams[fieldName] = Json::objectValue;
-
1965 jvParams[fieldName][jss::accounts] = Json::arrayValue;
-
1966 jvParams[fieldName][jss::accounts][0u] = alice.human();
-
1967 jvParams[fieldName][jss::accounts][1u] = alice.human();
-
1968 jvParams[fieldName][jss::currency] = "USD";
-
1969 jvParams[jss::ledger_hash] = ledgerHash;
-
1970 Json::Value const jrr = env.rpc(
-
1971 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
1973 jrr,
-
1974 "malformedRequest",
-
1975 "Cannot have a trustline to self.");
-
1976 }
-
1977 }
-
1978 }
+
1841 // check both aliases
+
1842 for (auto const& fieldName : {jss::ripple_state, jss::state})
+
1843 {
+
1844 std::string const ledgerHash{
+
1845 to_string(env.closed()->header().hash)};
+
1846 {
+
1847 // Request the trust line using the accounts and currency.
+
1848 Json::Value jvParams;
+
1849 jvParams[fieldName] = Json::objectValue;
+
1850 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1851 jvParams[fieldName][jss::accounts][0u] = alice.human();
+
1852 jvParams[fieldName][jss::accounts][1u] = gw.human();
+
1853 jvParams[fieldName][jss::currency] = "USD";
+
1854 jvParams[jss::ledger_hash] = ledgerHash;
+
1855 Json::Value const jrr = env.rpc(
+
1856 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
1857 BEAST_EXPECT(
+
1858 jrr[jss::node][sfBalance.jsonName][jss::value] == "-97");
+
1859 BEAST_EXPECT(
+
1860 jrr[jss::node][sfHighLimit.jsonName][jss::value] == "999");
+
1861 }
+
1862 {
+
1863 // test basic malformed scenarios
+ +
1865 env,
+
1866 fieldName,
+
1867 {
+
1868 {jss::accounts, "malformedRequest"},
+
1869 {jss::currency, "malformedCurrency"},
+
1870 });
+
1871 }
+
1872 {
+
1873 // ripple_state one of the accounts is missing.
+
1874 Json::Value jvParams;
+
1875 jvParams[fieldName] = Json::objectValue;
+
1876 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1877 jvParams[fieldName][jss::accounts][0u] = alice.human();
+
1878 jvParams[fieldName][jss::currency] = "USD";
+
1879 jvParams[jss::ledger_hash] = ledgerHash;
+
1880 Json::Value const jrr = env.rpc(
+
1881 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
1883 jrr,
+
1884 "malformedRequest",
+
1885 "Invalid field 'accounts', not length-2 array of "
+
1886 "Accounts.");
+
1887 }
+
1888 {
+
1889 // ripple_state more than 2 accounts.
+
1890 Json::Value jvParams;
+
1891 jvParams[fieldName] = Json::objectValue;
+
1892 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1893 jvParams[fieldName][jss::accounts][0u] = alice.human();
+
1894 jvParams[fieldName][jss::accounts][1u] = gw.human();
+
1895 jvParams[fieldName][jss::accounts][2u] = alice.human();
+
1896 jvParams[fieldName][jss::currency] = "USD";
+
1897 jvParams[jss::ledger_hash] = ledgerHash;
+
1898 Json::Value const jrr = env.rpc(
+
1899 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
1901 jrr,
+
1902 "malformedRequest",
+
1903 "Invalid field 'accounts', not length-2 array of "
+
1904 "Accounts.");
+
1905 }
+
1906 {
+
1907 // ripple_state account[0] / account[1] is not an account.
+
1908 Json::Value jvParams;
+
1909 jvParams[fieldName] = Json::objectValue;
+
1910 auto tryField = [&](Json::Value badAccount) -> void {
+
1911 {
+
1912 // account[0]
+
1913 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1914 jvParams[fieldName][jss::accounts][0u] = badAccount;
+
1915 jvParams[fieldName][jss::accounts][1u] = gw.human();
+
1916 jvParams[fieldName][jss::currency] = "USD";
+
1917
+
1918 Json::Value const jrr = env.rpc(
+
1919 "json",
+
1920 "ledger_entry",
+
1921 to_string(jvParams))[jss::result];
+ +
1923 jrr,
+
1924 "malformedAddress",
+ +
1926 jss::accounts, "array of Accounts"));
+
1927 }
+
1928
+
1929 {
+
1930 // account[1]
+
1931 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1932 jvParams[fieldName][jss::accounts][0u] = alice.human();
+
1933 jvParams[fieldName][jss::accounts][1u] = badAccount;
+
1934 jvParams[fieldName][jss::currency] = "USD";
+
1935
+
1936 Json::Value const jrr = env.rpc(
+
1937 "json",
+
1938 "ledger_entry",
+
1939 to_string(jvParams))[jss::result];
+ +
1941 jrr,
+
1942 "malformedAddress",
+ +
1944 jss::accounts, "array of Accounts"));
+
1945 }
+
1946 };
+
1947
+
1948 auto const& badValues = getBadValues(FieldType::AccountField);
+
1949 for (auto const& value : badValues)
+
1950 {
+
1951 tryField(value);
+
1952 }
+
1953 tryField(Json::nullValue);
+
1954 }
+
1955 {
+
1956 // ripple_state account[0] == account[1].
+
1957 Json::Value jvParams;
+
1958 jvParams[fieldName] = Json::objectValue;
+
1959 jvParams[fieldName][jss::accounts] = Json::arrayValue;
+
1960 jvParams[fieldName][jss::accounts][0u] = alice.human();
+
1961 jvParams[fieldName][jss::accounts][1u] = alice.human();
+
1962 jvParams[fieldName][jss::currency] = "USD";
+
1963 jvParams[jss::ledger_hash] = ledgerHash;
+
1964 Json::Value const jrr = env.rpc(
+
1965 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
1967 jrr,
+
1968 "malformedRequest",
+
1969 "Cannot have a trustline to self.");
+
1970 }
+
1971 }
+
1972 }
-
1979
-
1980 void
-
- -
1982 {
-
1983 testcase("Signer List");
-
1984 using namespace test::jtx;
-
1985 Env env{*this};
-
1986 runLedgerEntryTest(env, jss::signer_list);
-
1987 }
+
1973
+
1974 void
+
+ +
1976 {
+
1977 testcase("Signer List");
+
1978 using namespace test::jtx;
+
1979 Env env{*this};
+
1980 runLedgerEntryTest(env, jss::signer_list);
+
1981 }
-
1988
-
1989 void
-
- -
1991 {
-
1992 testcase("Ticket");
-
1993 using namespace test::jtx;
-
1994 Env env{*this};
-
1995 env.close();
-
1996
-
1997 // Create two tickets.
-
1998 std::uint32_t const tkt1{env.seq(env.master) + 1};
-
1999 env(ticket::create(env.master, 2));
-
2000 env.close();
-
2001
-
2002 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
2003 // Request four tickets: one before the first one we created, the
-
2004 // two created tickets, and the ticket that would come after the
-
2005 // last created ticket.
-
2006 {
-
2007 // Not a valid ticket requested by index.
-
2008 Json::Value jvParams;
-
2009 jvParams[jss::ticket] =
-
2010 to_string(getTicketIndex(env.master, tkt1 - 1));
-
2011 jvParams[jss::ledger_hash] = ledgerHash;
-
2012 Json::Value const jrr = env.rpc(
-
2013 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2014 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2015 }
-
2016 {
-
2017 // First real ticket requested by index.
-
2018 Json::Value jvParams;
-
2019 jvParams[jss::ticket] = to_string(getTicketIndex(env.master, tkt1));
-
2020 jvParams[jss::ledger_hash] = ledgerHash;
-
2021 Json::Value const jrr = env.rpc(
-
2022 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2023 BEAST_EXPECT(
-
2024 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Ticket);
-
2025 BEAST_EXPECT(jrr[jss::node][sfTicketSequence.jsonName] == tkt1);
-
2026 }
-
2027 {
-
2028 // Second real ticket requested by account and sequence.
-
2029 Json::Value jvParams;
-
2030 jvParams[jss::ticket] = Json::objectValue;
-
2031 jvParams[jss::ticket][jss::account] = env.master.human();
-
2032 jvParams[jss::ticket][jss::ticket_seq] = tkt1 + 1;
-
2033 jvParams[jss::ledger_hash] = ledgerHash;
-
2034 Json::Value const jrr = env.rpc(
-
2035 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2036 BEAST_EXPECT(
-
2037 jrr[jss::node][jss::index] ==
-
2038 to_string(getTicketIndex(env.master, tkt1 + 1)));
-
2039 }
-
2040 {
-
2041 // Not a valid ticket requested by account and sequence.
-
2042 Json::Value jvParams;
-
2043 jvParams[jss::ticket] = Json::objectValue;
-
2044 jvParams[jss::ticket][jss::account] = env.master.human();
-
2045 jvParams[jss::ticket][jss::ticket_seq] = tkt1 + 2;
-
2046 jvParams[jss::ledger_hash] = ledgerHash;
-
2047 Json::Value const jrr = env.rpc(
-
2048 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2049 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2050 }
-
2051 {
-
2052 // Request a ticket using an account root entry.
-
2053 Json::Value jvParams;
-
2054 jvParams[jss::ticket] = to_string(keylet::account(env.master).key);
-
2055 jvParams[jss::ledger_hash] = ledgerHash;
-
2056 Json::Value const jrr = env.rpc(
-
2057 "json", "ledger_entry", to_string(jvParams))[jss::result];
- -
2059 jrr, "unexpectedLedgerType", "Unexpected ledger type.");
-
2060 }
-
2061
-
2062 {
-
2063 // test basic malformed scenarios
- -
2065 env,
-
2066 jss::ticket,
-
2067 {
-
2068 {jss::account, "malformedAddress"},
-
2069 {jss::ticket_seq, "malformedRequest"},
-
2070 });
-
2071 }
-
2072 }
+
1982
+
1983 void
+
+ +
1985 {
+
1986 testcase("Ticket");
+
1987 using namespace test::jtx;
+
1988 Env env{*this};
+
1989 env.close();
+
1990
+
1991 // Create two tickets.
+
1992 std::uint32_t const tkt1{env.seq(env.master) + 1};
+
1993 env(ticket::create(env.master, 2));
+
1994 env.close();
+
1995
+
1996 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
1997 // Request four tickets: one before the first one we created, the
+
1998 // two created tickets, and the ticket that would come after the
+
1999 // last created ticket.
+
2000 {
+
2001 // Not a valid ticket requested by index.
+
2002 Json::Value jvParams;
+
2003 jvParams[jss::ticket] =
+
2004 to_string(getTicketIndex(env.master, tkt1 - 1));
+
2005 jvParams[jss::ledger_hash] = ledgerHash;
+
2006 Json::Value const jrr = env.rpc(
+
2007 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2008 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2009 }
+
2010 {
+
2011 // First real ticket requested by index.
+
2012 Json::Value jvParams;
+
2013 jvParams[jss::ticket] = to_string(getTicketIndex(env.master, tkt1));
+
2014 jvParams[jss::ledger_hash] = ledgerHash;
+
2015 Json::Value const jrr = env.rpc(
+
2016 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2017 BEAST_EXPECT(
+
2018 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Ticket);
+
2019 BEAST_EXPECT(jrr[jss::node][sfTicketSequence.jsonName] == tkt1);
+
2020 }
+
2021 {
+
2022 // Second real ticket requested by account and sequence.
+
2023 Json::Value jvParams;
+
2024 jvParams[jss::ticket] = Json::objectValue;
+
2025 jvParams[jss::ticket][jss::account] = env.master.human();
+
2026 jvParams[jss::ticket][jss::ticket_seq] = tkt1 + 1;
+
2027 jvParams[jss::ledger_hash] = ledgerHash;
+
2028 Json::Value const jrr = env.rpc(
+
2029 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2030 BEAST_EXPECT(
+
2031 jrr[jss::node][jss::index] ==
+
2032 to_string(getTicketIndex(env.master, tkt1 + 1)));
+
2033 }
+
2034 {
+
2035 // Not a valid ticket requested by account and sequence.
+
2036 Json::Value jvParams;
+
2037 jvParams[jss::ticket] = Json::objectValue;
+
2038 jvParams[jss::ticket][jss::account] = env.master.human();
+
2039 jvParams[jss::ticket][jss::ticket_seq] = tkt1 + 2;
+
2040 jvParams[jss::ledger_hash] = ledgerHash;
+
2041 Json::Value const jrr = env.rpc(
+
2042 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2043 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2044 }
+
2045 {
+
2046 // Request a ticket using an account root entry.
+
2047 Json::Value jvParams;
+
2048 jvParams[jss::ticket] = to_string(keylet::account(env.master).key);
+
2049 jvParams[jss::ledger_hash] = ledgerHash;
+
2050 Json::Value const jrr = env.rpc(
+
2051 "json", "ledger_entry", to_string(jvParams))[jss::result];
+ +
2053 jrr, "unexpectedLedgerType", "Unexpected ledger type.");
+
2054 }
+
2055
+
2056 {
+
2057 // test basic malformed scenarios
+ +
2059 env,
+
2060 jss::ticket,
+
2061 {
+
2062 {jss::account, "malformedAddress"},
+
2063 {jss::ticket_seq, "malformedRequest"},
+
2064 });
+
2065 }
+
2066 }
-
2073
-
2074 void
-
- -
2076 {
-
2077 testcase("DID");
-
2078 using namespace test::jtx;
-
2079 using namespace std::literals::chrono_literals;
-
2080 Env env{*this};
-
2081 Account const alice{"alice"};
-
2082
-
2083 env.fund(XRP(10000), alice);
-
2084 env.close();
-
2085
-
2086 // Lambda to create a DID.
-
2087 auto didCreate = [](test::jtx::Account const& account) {
-
2088 Json::Value jv;
-
2089 jv[jss::TransactionType] = jss::DIDSet;
-
2090 jv[jss::Account] = account.human();
-
2091 jv[sfDIDDocument.jsonName] = strHex(std::string{"data"});
-
2092 jv[sfURI.jsonName] = strHex(std::string{"uri"});
-
2093 return jv;
-
2094 };
-
2095
-
2096 env(didCreate(alice));
-
2097 env.close();
-
2098
-
2099 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
2100
-
2101 {
-
2102 // Request the DID using its index.
-
2103 Json::Value jvParams;
-
2104 jvParams[jss::did] = alice.human();
-
2105 jvParams[jss::ledger_hash] = ledgerHash;
-
2106 Json::Value const jrr = env.rpc(
-
2107 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2108 BEAST_EXPECT(
-
2109 jrr[jss::node][sfDIDDocument.jsonName] ==
-
2110 strHex(std::string{"data"}));
-
2111 BEAST_EXPECT(
-
2112 jrr[jss::node][sfURI.jsonName] == strHex(std::string{"uri"}));
-
2113 }
-
2114 {
-
2115 // Request an index that is not a DID.
-
2116 Json::Value jvParams;
-
2117 jvParams[jss::did] = env.master.human();
-
2118 jvParams[jss::ledger_hash] = ledgerHash;
-
2119 Json::Value const jrr = env.rpc(
-
2120 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2121 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2122 }
-
2123 {
-
2124 // Malformed DID index
-
2125 Json::Value jvParams;
- -
2127 env,
-
2128 jvParams,
-
2129 jss::did,
- -
2131 "malformedAddress");
-
2132 }
-
2133 }
+
2067
+
2068 void
+
+ +
2070 {
+
2071 testcase("DID");
+
2072 using namespace test::jtx;
+
2073 using namespace std::literals::chrono_literals;
+
2074 Env env{*this};
+
2075 Account const alice{"alice"};
+
2076
+
2077 env.fund(XRP(10000), alice);
+
2078 env.close();
+
2079
+
2080 // Lambda to create a DID.
+
2081 auto didCreate = [](test::jtx::Account const& account) {
+
2082 Json::Value jv;
+
2083 jv[jss::TransactionType] = jss::DIDSet;
+
2084 jv[jss::Account] = account.human();
+
2085 jv[sfDIDDocument.jsonName] = strHex(std::string{"data"});
+
2086 jv[sfURI.jsonName] = strHex(std::string{"uri"});
+
2087 return jv;
+
2088 };
+
2089
+
2090 env(didCreate(alice));
+
2091 env.close();
+
2092
+
2093 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
2094
+
2095 {
+
2096 // Request the DID using its index.
+
2097 Json::Value jvParams;
+
2098 jvParams[jss::did] = alice.human();
+
2099 jvParams[jss::ledger_hash] = ledgerHash;
+
2100 Json::Value const jrr = env.rpc(
+
2101 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2102 BEAST_EXPECT(
+
2103 jrr[jss::node][sfDIDDocument.jsonName] ==
+
2104 strHex(std::string{"data"}));
+
2105 BEAST_EXPECT(
+
2106 jrr[jss::node][sfURI.jsonName] == strHex(std::string{"uri"}));
+
2107 }
+
2108 {
+
2109 // Request an index that is not a DID.
+
2110 Json::Value jvParams;
+
2111 jvParams[jss::did] = env.master.human();
+
2112 jvParams[jss::ledger_hash] = ledgerHash;
+
2113 Json::Value const jrr = env.rpc(
+
2114 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2115 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2116 }
+
2117 {
+
2118 // Malformed DID index
+
2119 Json::Value jvParams;
+ +
2121 env,
+
2122 jvParams,
+
2123 jss::did,
+ +
2125 "malformedAddress");
+
2126 }
+
2127 }
-
2134
-
2135 void
-
- -
2137 {
-
2138 testcase("Invalid Oracle Ledger Entry");
-
2139 using namespace xrpl::test::jtx;
-
2140 using namespace xrpl::test::jtx::oracle;
-
2141
-
2142 Env env(*this);
-
2143 Account const owner("owner");
-
2144 env.fund(XRP(1'000), owner);
-
2145 Oracle oracle(
-
2146 env,
-
2147 {.owner = owner,
-
2148 .fee = static_cast<int>(env.current()->fees().base.drops())});
-
2149
-
2150 {
-
2151 // test basic malformed scenarios
- -
2153 env,
-
2154 jss::oracle,
-
2155 {
-
2156 {jss::account, "malformedAccount"},
-
2157 {jss::oracle_document_id, "malformedDocumentID"},
-
2158 });
-
2159 }
-
2160 }
+
2128
+
2129 void
+
+ +
2131 {
+
2132 testcase("Invalid Oracle Ledger Entry");
+
2133 using namespace xrpl::test::jtx;
+
2134 using namespace xrpl::test::jtx::oracle;
+
2135
+
2136 Env env(*this);
+
2137 Account const owner("owner");
+
2138 env.fund(XRP(1'000), owner);
+
2139 Oracle oracle(
+
2140 env,
+
2141 {.owner = owner,
+
2142 .fee = static_cast<int>(env.current()->fees().base.drops())});
+
2143
+
2144 {
+
2145 // test basic malformed scenarios
+ +
2147 env,
+
2148 jss::oracle,
+
2149 {
+
2150 {jss::account, "malformedAccount"},
+
2151 {jss::oracle_document_id, "malformedDocumentID"},
+
2152 });
+
2153 }
+
2154 }
-
2161
-
2162 void
-
- -
2164 {
-
2165 testcase("Oracle Ledger Entry");
-
2166 using namespace xrpl::test::jtx;
-
2167 using namespace xrpl::test::jtx::oracle;
-
2168
-
2169 Env env(*this);
-
2170 auto const baseFee =
-
2171 static_cast<int>(env.current()->fees().base.drops());
-
2172 std::vector<AccountID> accounts;
- -
2174 for (int i = 0; i < 10; ++i)
-
2175 {
-
2176 Account const owner(std::string("owner") + std::to_string(i));
-
2177 env.fund(XRP(1'000), owner);
-
2178 // different accounts can have the same asset pair
-
2179 Oracle oracle(
-
2180 env, {.owner = owner, .documentID = i, .fee = baseFee});
-
2181 accounts.push_back(owner.id());
-
2182 oracles.push_back(oracle.documentID());
-
2183 // same account can have different asset pair
-
2184 Oracle oracle1(
-
2185 env, {.owner = owner, .documentID = i + 10, .fee = baseFee});
-
2186 accounts.push_back(owner.id());
-
2187 oracles.push_back(oracle1.documentID());
-
2188 }
-
2189 for (int i = 0; i < accounts.size(); ++i)
-
2190 {
-
2191 auto const jv = [&]() {
-
2192 // document id is uint32
-
2193 if (i % 2)
-
2194 return Oracle::ledgerEntry(env, accounts[i], oracles[i]);
-
2195 // document id is string
-
2196 return Oracle::ledgerEntry(
-
2197 env, accounts[i], std::to_string(oracles[i]));
-
2198 }();
-
2199 try
-
2200 {
-
2201 BEAST_EXPECT(
-
2202 jv[jss::node][jss::Owner] == to_string(accounts[i]));
-
2203 }
-
2204 catch (...)
-
2205 {
-
2206 fail();
-
2207 }
-
2208 }
-
2209 }
+
2155
+
2156 void
+
+ +
2158 {
+
2159 testcase("Oracle Ledger Entry");
+
2160 using namespace xrpl::test::jtx;
+
2161 using namespace xrpl::test::jtx::oracle;
+
2162
+
2163 Env env(*this);
+
2164 auto const baseFee =
+
2165 static_cast<int>(env.current()->fees().base.drops());
+
2166 std::vector<AccountID> accounts;
+ +
2168 for (int i = 0; i < 10; ++i)
+
2169 {
+
2170 Account const owner(std::string("owner") + std::to_string(i));
+
2171 env.fund(XRP(1'000), owner);
+
2172 // different accounts can have the same asset pair
+
2173 Oracle oracle(
+
2174 env, {.owner = owner, .documentID = i, .fee = baseFee});
+
2175 accounts.push_back(owner.id());
+
2176 oracles.push_back(oracle.documentID());
+
2177 // same account can have different asset pair
+
2178 Oracle oracle1(
+
2179 env, {.owner = owner, .documentID = i + 10, .fee = baseFee});
+
2180 accounts.push_back(owner.id());
+
2181 oracles.push_back(oracle1.documentID());
+
2182 }
+
2183 for (int i = 0; i < accounts.size(); ++i)
+
2184 {
+
2185 auto const jv = [&]() {
+
2186 // document id is uint32
+
2187 if (i % 2)
+
2188 return Oracle::ledgerEntry(env, accounts[i], oracles[i]);
+
2189 // document id is string
+
2190 return Oracle::ledgerEntry(
+
2191 env, accounts[i], std::to_string(oracles[i]));
+
2192 }();
+
2193 try
+
2194 {
+
2195 BEAST_EXPECT(
+
2196 jv[jss::node][jss::Owner] == to_string(accounts[i]));
+
2197 }
+
2198 catch (...)
+
2199 {
+
2200 fail();
+
2201 }
+
2202 }
+
2203 }
-
2210
-
2211 void
-
- -
2213 {
-
2214 testcase("MPT");
-
2215 using namespace test::jtx;
-
2216 using namespace std::literals::chrono_literals;
-
2217 Env env{*this};
-
2218 Account const alice{"alice"};
-
2219 Account const bob("bob");
-
2220
-
2221 MPTTester mptAlice(env, alice, {.holders = {bob}});
-
2222 mptAlice.create(
-
2223 {.transferFee = 10,
-
2224 .metadata = "123",
-
2225 .ownerCount = 1,
- - -
2228 mptAlice.authorize({.account = bob, .holderCount = 1});
-
2229
-
2230 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
2231
-
2232 std::string const badMptID =
-
2233 "00000193B9DDCAF401B5B3B26875986043F82CD0D13B4315";
-
2234 {
-
2235 // Request the MPTIssuance using its MPTIssuanceID.
-
2236 Json::Value jvParams;
-
2237 jvParams[jss::mpt_issuance] = strHex(mptAlice.issuanceID());
-
2238 jvParams[jss::ledger_hash] = ledgerHash;
-
2239 Json::Value const jrr = env.rpc(
-
2240 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2241 BEAST_EXPECT(
-
2242 jrr[jss::node][sfMPTokenMetadata.jsonName] ==
-
2243 strHex(std::string{"123"}));
-
2244 BEAST_EXPECT(
-
2245 jrr[jss::node][jss::mpt_issuance_id] ==
-
2246 strHex(mptAlice.issuanceID()));
-
2247 }
-
2248 {
-
2249 // Request an index that is not a MPTIssuance.
-
2250 Json::Value jvParams;
-
2251 jvParams[jss::mpt_issuance] = badMptID;
-
2252 jvParams[jss::ledger_hash] = ledgerHash;
-
2253 Json::Value const jrr = env.rpc(
-
2254 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2255 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2256 }
-
2257 {
-
2258 // Request the MPToken using its owner + mptIssuanceID.
-
2259 Json::Value jvParams;
-
2260 jvParams[jss::mptoken] = Json::objectValue;
-
2261 jvParams[jss::mptoken][jss::account] = bob.human();
-
2262 jvParams[jss::mptoken][jss::mpt_issuance_id] =
-
2263 strHex(mptAlice.issuanceID());
-
2264 jvParams[jss::ledger_hash] = ledgerHash;
-
2265 Json::Value const jrr = env.rpc(
-
2266 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2267 BEAST_EXPECT(
-
2268 jrr[jss::node][sfMPTokenIssuanceID.jsonName] ==
-
2269 strHex(mptAlice.issuanceID()));
-
2270 }
-
2271 {
-
2272 // Request the MPToken using a bad mptIssuanceID.
-
2273 Json::Value jvParams;
-
2274 jvParams[jss::mptoken] = Json::objectValue;
-
2275 jvParams[jss::mptoken][jss::account] = bob.human();
-
2276 jvParams[jss::mptoken][jss::mpt_issuance_id] = badMptID;
-
2277 jvParams[jss::ledger_hash] = ledgerHash;
-
2278 Json::Value const jrr = env.rpc(
-
2279 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2280 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2281 }
-
2282 {
-
2283 // Malformed MPTIssuance index
-
2284 Json::Value jvParams;
- -
2286 env,
-
2287 jvParams,
-
2288 jss::mptoken,
- -
2290 "malformedRequest");
-
2291 }
-
2292 }
+
2204
+
2205 void
+
+ +
2207 {
+
2208 testcase("MPT");
+
2209 using namespace test::jtx;
+
2210 using namespace std::literals::chrono_literals;
+
2211 Env env{*this};
+
2212 Account const alice{"alice"};
+
2213 Account const bob("bob");
+
2214
+
2215 MPTTester mptAlice(env, alice, {.holders = {bob}});
+
2216 mptAlice.create(
+
2217 {.transferFee = 10,
+
2218 .metadata = "123",
+
2219 .ownerCount = 1,
+ + +
2222 mptAlice.authorize({.account = bob, .holderCount = 1});
+
2223
+
2224 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
2225
+
2226 std::string const badMptID =
+
2227 "00000193B9DDCAF401B5B3B26875986043F82CD0D13B4315";
+
2228 {
+
2229 // Request the MPTIssuance using its MPTIssuanceID.
+
2230 Json::Value jvParams;
+
2231 jvParams[jss::mpt_issuance] = strHex(mptAlice.issuanceID());
+
2232 jvParams[jss::ledger_hash] = ledgerHash;
+
2233 Json::Value const jrr = env.rpc(
+
2234 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2235 BEAST_EXPECT(
+
2236 jrr[jss::node][sfMPTokenMetadata.jsonName] ==
+
2237 strHex(std::string{"123"}));
+
2238 BEAST_EXPECT(
+
2239 jrr[jss::node][jss::mpt_issuance_id] ==
+
2240 strHex(mptAlice.issuanceID()));
+
2241 }
+
2242 {
+
2243 // Request an index that is not a MPTIssuance.
+
2244 Json::Value jvParams;
+
2245 jvParams[jss::mpt_issuance] = badMptID;
+
2246 jvParams[jss::ledger_hash] = ledgerHash;
+
2247 Json::Value const jrr = env.rpc(
+
2248 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2249 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2250 }
+
2251 {
+
2252 // Request the MPToken using its owner + mptIssuanceID.
+
2253 Json::Value jvParams;
+
2254 jvParams[jss::mptoken] = Json::objectValue;
+
2255 jvParams[jss::mptoken][jss::account] = bob.human();
+
2256 jvParams[jss::mptoken][jss::mpt_issuance_id] =
+
2257 strHex(mptAlice.issuanceID());
+
2258 jvParams[jss::ledger_hash] = ledgerHash;
+
2259 Json::Value const jrr = env.rpc(
+
2260 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2261 BEAST_EXPECT(
+
2262 jrr[jss::node][sfMPTokenIssuanceID.jsonName] ==
+
2263 strHex(mptAlice.issuanceID()));
+
2264 }
+
2265 {
+
2266 // Request the MPToken using a bad mptIssuanceID.
+
2267 Json::Value jvParams;
+
2268 jvParams[jss::mptoken] = Json::objectValue;
+
2269 jvParams[jss::mptoken][jss::account] = bob.human();
+
2270 jvParams[jss::mptoken][jss::mpt_issuance_id] = badMptID;
+
2271 jvParams[jss::ledger_hash] = ledgerHash;
+
2272 Json::Value const jrr = env.rpc(
+
2273 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2274 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2275 }
+
2276 {
+
2277 // Malformed MPTIssuance index
+
2278 Json::Value jvParams;
+ +
2280 env,
+
2281 jvParams,
+
2282 jss::mptoken,
+ +
2284 "malformedRequest");
+
2285 }
+
2286 }
-
2293
-
2294 void
-
- -
2296 {
-
2297 testcase("PermissionedDomain");
-
2298
-
2299 using namespace test::jtx;
-
2300
-
2301 Env env(*this, testable_amendments() | featurePermissionedDomains);
-
2302 Account const issuer{"issuer"};
-
2303 Account const alice{"alice"};
-
2304 Account const bob{"bob"};
-
2305
-
2306 env.fund(XRP(5000), issuer, alice, bob);
-
2307 env.close();
-
2308
-
2309 auto const seq = env.seq(alice);
-
2310 env(pdomain::setTx(alice, {{alice, "first credential"}}));
-
2311 env.close();
-
2312 auto const objects = pdomain::getObjects(alice, env);
-
2313 if (!BEAST_EXPECT(objects.size() == 1))
-
2314 return;
-
2315
-
2316 {
-
2317 // Succeed
-
2318 Json::Value params;
-
2319 params[jss::ledger_index] = jss::validated;
-
2320 params[jss::permissioned_domain][jss::account] = alice.human();
-
2321 params[jss::permissioned_domain][jss::seq] = seq;
-
2322 auto jv = env.rpc("json", "ledger_entry", to_string(params));
-
2323 BEAST_EXPECT(
-
2324 jv.isObject() && jv.isMember(jss::result) &&
-
2325 !jv[jss::result].isMember(jss::error) &&
-
2326 jv[jss::result].isMember(jss::node) &&
-
2327 jv[jss::result][jss::node].isMember(
-
2328 sfLedgerEntryType.jsonName) &&
-
2329 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
2330 jss::PermissionedDomain);
-
2331
-
2332 std::string const pdIdx = jv[jss::result][jss::index].asString();
-
2333 BEAST_EXPECT(
-
2334 strHex(keylet::permissionedDomain(alice, seq).key) == pdIdx);
-
2335
-
2336 params.clear();
-
2337 params[jss::ledger_index] = jss::validated;
-
2338 params[jss::permissioned_domain] = pdIdx;
-
2339 jv = env.rpc("json", "ledger_entry", to_string(params));
-
2340 BEAST_EXPECT(
-
2341 jv.isObject() && jv.isMember(jss::result) &&
-
2342 !jv[jss::result].isMember(jss::error) &&
-
2343 jv[jss::result].isMember(jss::node) &&
-
2344 jv[jss::result][jss::node].isMember(
-
2345 sfLedgerEntryType.jsonName) &&
-
2346 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
-
2347 jss::PermissionedDomain);
-
2348 }
-
2349
-
2350 {
-
2351 // Fail, invalid permissioned domain index
-
2352 Json::Value params;
-
2353 params[jss::ledger_index] = jss::validated;
-
2354 params[jss::permissioned_domain] =
-
2355 "12F1F1F1F180D67377B2FAB292A31C922470326268D2B9B74CD1E582645B9A"
-
2356 "DE";
-
2357 auto const jrr = env.rpc("json", "ledger_entry", to_string(params));
- -
2359 jrr[jss::result], "entryNotFound", "Entry not found.");
-
2360 }
-
2361 {
-
2362 // test basic malformed scenarios
- -
2364 env,
-
2365 jss::permissioned_domain,
-
2366 {
-
2367 {jss::account, "malformedAddress"},
-
2368 {jss::seq, "malformedRequest"},
-
2369 });
-
2370 }
-
2371 }
+
2287
+
2288 void
+
+ +
2290 {
+
2291 testcase("PermissionedDomain");
+
2292
+
2293 using namespace test::jtx;
+
2294
+
2295 Env env(*this, testable_amendments() | featurePermissionedDomains);
+
2296 Account const issuer{"issuer"};
+
2297 Account const alice{"alice"};
+
2298 Account const bob{"bob"};
+
2299
+
2300 env.fund(XRP(5000), issuer, alice, bob);
+
2301 env.close();
+
2302
+
2303 auto const seq = env.seq(alice);
+
2304 env(pdomain::setTx(alice, {{alice, "first credential"}}));
+
2305 env.close();
+
2306 auto const objects = pdomain::getObjects(alice, env);
+
2307 if (!BEAST_EXPECT(objects.size() == 1))
+
2308 return;
+
2309
+
2310 {
+
2311 // Succeed
+
2312 Json::Value params;
+
2313 params[jss::ledger_index] = jss::validated;
+
2314 params[jss::permissioned_domain][jss::account] = alice.human();
+
2315 params[jss::permissioned_domain][jss::seq] = seq;
+
2316 auto jv = env.rpc("json", "ledger_entry", to_string(params));
+
2317 BEAST_EXPECT(
+
2318 jv.isObject() && jv.isMember(jss::result) &&
+
2319 !jv[jss::result].isMember(jss::error) &&
+
2320 jv[jss::result].isMember(jss::node) &&
+
2321 jv[jss::result][jss::node].isMember(
+
2322 sfLedgerEntryType.jsonName) &&
+
2323 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
2324 jss::PermissionedDomain);
+
2325
+
2326 std::string const pdIdx = jv[jss::result][jss::index].asString();
+
2327 BEAST_EXPECT(
+
2328 strHex(keylet::permissionedDomain(alice, seq).key) == pdIdx);
+
2329
+
2330 params.clear();
+
2331 params[jss::ledger_index] = jss::validated;
+
2332 params[jss::permissioned_domain] = pdIdx;
+
2333 jv = env.rpc("json", "ledger_entry", to_string(params));
+
2334 BEAST_EXPECT(
+
2335 jv.isObject() && jv.isMember(jss::result) &&
+
2336 !jv[jss::result].isMember(jss::error) &&
+
2337 jv[jss::result].isMember(jss::node) &&
+
2338 jv[jss::result][jss::node].isMember(
+
2339 sfLedgerEntryType.jsonName) &&
+
2340 jv[jss::result][jss::node][sfLedgerEntryType.jsonName] ==
+
2341 jss::PermissionedDomain);
+
2342 }
+
2343
+
2344 {
+
2345 // Fail, invalid permissioned domain index
+
2346 Json::Value params;
+
2347 params[jss::ledger_index] = jss::validated;
+
2348 params[jss::permissioned_domain] =
+
2349 "12F1F1F1F180D67377B2FAB292A31C922470326268D2B9B74CD1E582645B9A"
+
2350 "DE";
+
2351 auto const jrr = env.rpc("json", "ledger_entry", to_string(params));
+ +
2353 jrr[jss::result], "entryNotFound", "Entry not found.");
+
2354 }
+
2355 {
+
2356 // test basic malformed scenarios
+ +
2358 env,
+
2359 jss::permissioned_domain,
+
2360 {
+
2361 {jss::account, "malformedAddress"},
+
2362 {jss::seq, "malformedRequest"},
+
2363 });
+
2364 }
+
2365 }
+
2366
+
2368 void
+
+ +
2370 {
+
2371 using namespace test::jtx;
2372
-
2374 void
-
- -
2376 {
-
2377 using namespace test::jtx;
-
2378
-
2379 Account const alice{"alice"};
-
2380 Account const bob{"bob"};
-
2381
-
2382 Env env{*this, envconfig([](auto cfg) {
-
2383 cfg->START_UP = Config::FRESH;
-
2384 return cfg;
-
2385 })};
-
2386
-
2387 env.close();
-
2388
-
2399 auto checkResult =
-
2400 [&](bool good,
-
2401 Json::Value const& jv,
-
2402 Json::StaticString const& expectedType,
-
2403 std::optional<std::string> const& expectedError = {}) {
-
2404 if (good)
-
2405 {
-
2406 BEAST_EXPECTS(
-
2407 jv.isObject() && jv.isMember(jss::result) &&
-
2408 !jv[jss::result].isMember(jss::error) &&
-
2409 jv[jss::result].isMember(jss::node) &&
-
2410 jv[jss::result][jss::node].isMember(
-
2411 sfLedgerEntryType.jsonName) &&
-
2412 jv[jss::result][jss::node]
-
2413 [sfLedgerEntryType.jsonName] == expectedType,
-
2414 to_string(jv));
-
2415 }
-
2416 else
-
2417 {
-
2418 BEAST_EXPECTS(
-
2419 jv.isObject() && jv.isMember(jss::result) &&
-
2420 jv[jss::result].isMember(jss::error) &&
-
2421 !jv[jss::result].isMember(jss::node) &&
-
2422 jv[jss::result][jss::error] ==
-
2423 expectedError.value_or("entryNotFound"),
-
2424 to_string(jv));
-
2425 }
-
2426 };
-
2427
-
2438 auto test = [&](Json::StaticString const& field,
-
2439 Json::StaticString const& expectedType,
-
2440 Keylet const& expectedKey,
-
2441 bool good) {
-
2442 testcase << expectedType.c_str() << (good ? "" : " not")
-
2443 << " found";
-
2444
-
2445 auto const hexKey = strHex(expectedKey.key);
-
2446
-
2447 {
-
2448 // Test bad values
-
2449 // "field":null
-
2450 Json::Value params;
-
2451 params[jss::ledger_index] = jss::validated;
-
2452 params[field] = Json::nullValue;
-
2453 auto const jv =
-
2454 env.rpc("json", "ledger_entry", to_string(params));
-
2455 checkResult(false, jv, expectedType, "malformedRequest");
-
2456 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2457 }
-
2458
-
2459 {
-
2460 Json::Value params;
-
2461 // "field":"string"
-
2462 params[jss::ledger_index] = jss::validated;
-
2463 params[field] = "arbitrary string";
-
2464 auto const jv =
-
2465 env.rpc("json", "ledger_entry", to_string(params));
-
2466 checkResult(false, jv, expectedType, "malformedRequest");
-
2467 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2468 }
-
2469
-
2470 {
-
2471 Json::Value params;
-
2472 // "field":false
-
2473 params[jss::ledger_index] = jss::validated;
-
2474 params[field] = false;
-
2475 auto const jv =
-
2476 env.rpc("json", "ledger_entry", to_string(params));
-
2477 checkResult(false, jv, expectedType, "invalidParams");
-
2478 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2479 }
-
2480
-
2481 {
-
2482 Json::Value params;
-
2483
-
2484 // "field":[incorrect index hash]
-
2485 auto const badKey = strHex(expectedKey.key + uint256{1});
-
2486 params[jss::ledger_index] = jss::validated;
-
2487 params[field] = badKey;
-
2488 auto const jv =
-
2489 env.rpc("json", "ledger_entry", to_string(params));
-
2490 checkResult(false, jv, expectedType, "entryNotFound");
-
2491 BEAST_EXPECTS(
-
2492 jv[jss::result][jss::index] == badKey, to_string(jv));
-
2493 }
-
2494
-
2495 {
-
2496 Json::Value params;
-
2497 // "index":"field" using API 2
-
2498 params[jss::ledger_index] = jss::validated;
-
2499 params[jss::index] = field;
-
2500 params[jss::api_version] = 2;
-
2501 auto const jv =
-
2502 env.rpc("json", "ledger_entry", to_string(params));
-
2503 checkResult(false, jv, expectedType, "malformedRequest");
-
2504 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2505 }
-
2506
-
2507 std::string const pdIdx = [&]() {
-
2508 {
-
2509 Json::Value params;
-
2510 // Test good values
-
2511 // Use the "field":true notation
-
2512 params[jss::ledger_index] = jss::validated;
-
2513 params[field] = true;
-
2514 auto const jv =
-
2515 env.rpc("json", "ledger_entry", to_string(params));
-
2516 // Index will always be returned for valid parameters.
-
2517 std::string const pdIdx =
-
2518 jv[jss::result][jss::index].asString();
-
2519 BEAST_EXPECTS(hexKey == pdIdx, to_string(jv));
-
2520 checkResult(good, jv, expectedType);
-
2521
-
2522 return pdIdx;
-
2523 }
-
2524 }();
-
2525
-
2526 {
-
2527 Json::Value params;
-
2528 // "field":"[index hash]"
-
2529 params[jss::ledger_index] = jss::validated;
-
2530 params[field] = hexKey;
-
2531 auto const jv =
-
2532 env.rpc("json", "ledger_entry", to_string(params));
-
2533 checkResult(good, jv, expectedType);
-
2534 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
-
2535 }
-
2536
-
2537 {
-
2538 // Bad value
-
2539 // Use the "index":"field" notation with API 2
-
2540 Json::Value params;
-
2541 params[jss::ledger_index] = jss::validated;
-
2542 params[jss::index] = field;
-
2543 params[jss::api_version] = 2;
-
2544 auto const jv =
-
2545 env.rpc("json", "ledger_entry", to_string(params));
-
2546 checkResult(false, jv, expectedType, "malformedRequest");
-
2547 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2548 }
-
2549
-
2550 {
-
2551 Json::Value params;
-
2552 // Use the "index":"field" notation with API 3
-
2553 params[jss::ledger_index] = jss::validated;
-
2554 params[jss::index] = field;
-
2555 params[jss::api_version] = 3;
-
2556 auto const jv =
-
2557 env.rpc("json", "ledger_entry", to_string(params));
-
2558 // Index is correct either way
-
2559 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
-
2560 checkResult(good, jv, expectedType);
-
2561 }
-
2562
-
2563 {
-
2564 Json::Value params;
-
2565 // Use the "index":"[index hash]" notation
-
2566 params[jss::ledger_index] = jss::validated;
-
2567 params[jss::index] = pdIdx;
-
2568 auto const jv =
-
2569 env.rpc("json", "ledger_entry", to_string(params));
-
2570 // Index is correct either way
-
2571 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
-
2572 checkResult(good, jv, expectedType);
-
2573 }
-
2574 };
-
2575
-
2576 test(jss::amendments, jss::Amendments, keylet::amendments(), true);
-
2577 test(jss::fee, jss::FeeSettings, keylet::fees(), true);
-
2578 // There won't be an nunl
-
2579 test(jss::nunl, jss::NegativeUNL, keylet::negativeUNL(), false);
-
2580 // Can only get the short skip list this way
-
2581 test(jss::hashes, jss::LedgerHashes, keylet::skip(), true);
-
2582 }
+
2373 Account const alice{"alice"};
+
2374 Account const bob{"bob"};
+
2375
+
2376 Env env{*this, envconfig([](auto cfg) {
+
2377 cfg->START_UP = Config::FRESH;
+
2378 return cfg;
+
2379 })};
+
2380
+
2381 env.close();
+
2382
+
2393 auto checkResult =
+
2394 [&](bool good,
+
2395 Json::Value const& jv,
+
2396 Json::StaticString const& expectedType,
+
2397 std::optional<std::string> const& expectedError = {}) {
+
2398 if (good)
+
2399 {
+
2400 BEAST_EXPECTS(
+
2401 jv.isObject() && jv.isMember(jss::result) &&
+
2402 !jv[jss::result].isMember(jss::error) &&
+
2403 jv[jss::result].isMember(jss::node) &&
+
2404 jv[jss::result][jss::node].isMember(
+
2405 sfLedgerEntryType.jsonName) &&
+
2406 jv[jss::result][jss::node]
+
2407 [sfLedgerEntryType.jsonName] == expectedType,
+
2408 to_string(jv));
+
2409 }
+
2410 else
+
2411 {
+
2412 BEAST_EXPECTS(
+
2413 jv.isObject() && jv.isMember(jss::result) &&
+
2414 jv[jss::result].isMember(jss::error) &&
+
2415 !jv[jss::result].isMember(jss::node) &&
+
2416 jv[jss::result][jss::error] ==
+
2417 expectedError.value_or("entryNotFound"),
+
2418 to_string(jv));
+
2419 }
+
2420 };
+
2421
+
2432 auto test = [&](Json::StaticString const& field,
+
2433 Json::StaticString const& expectedType,
+
2434 Keylet const& expectedKey,
+
2435 bool good) {
+
2436 testcase << expectedType.c_str() << (good ? "" : " not")
+
2437 << " found";
+
2438
+
2439 auto const hexKey = strHex(expectedKey.key);
+
2440
+
2441 {
+
2442 // Test bad values
+
2443 // "field":null
+
2444 Json::Value params;
+
2445 params[jss::ledger_index] = jss::validated;
+
2446 params[field] = Json::nullValue;
+
2447 auto const jv =
+
2448 env.rpc("json", "ledger_entry", to_string(params));
+
2449 checkResult(false, jv, expectedType, "malformedRequest");
+
2450 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2451 }
+
2452
+
2453 {
+
2454 Json::Value params;
+
2455 // "field":"string"
+
2456 params[jss::ledger_index] = jss::validated;
+
2457 params[field] = "arbitrary string";
+
2458 auto const jv =
+
2459 env.rpc("json", "ledger_entry", to_string(params));
+
2460 checkResult(false, jv, expectedType, "malformedRequest");
+
2461 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2462 }
+
2463
+
2464 {
+
2465 Json::Value params;
+
2466 // "field":false
+
2467 params[jss::ledger_index] = jss::validated;
+
2468 params[field] = false;
+
2469 auto const jv =
+
2470 env.rpc("json", "ledger_entry", to_string(params));
+
2471 checkResult(false, jv, expectedType, "invalidParams");
+
2472 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2473 }
+
2474
+
2475 {
+
2476 Json::Value params;
+
2477
+
2478 // "field":[incorrect index hash]
+
2479 auto const badKey = strHex(expectedKey.key + uint256{1});
+
2480 params[jss::ledger_index] = jss::validated;
+
2481 params[field] = badKey;
+
2482 auto const jv =
+
2483 env.rpc("json", "ledger_entry", to_string(params));
+
2484 checkResult(false, jv, expectedType, "entryNotFound");
+
2485 BEAST_EXPECTS(
+
2486 jv[jss::result][jss::index] == badKey, to_string(jv));
+
2487 }
+
2488
+
2489 {
+
2490 Json::Value params;
+
2491 // "index":"field" using API 2
+
2492 params[jss::ledger_index] = jss::validated;
+
2493 params[jss::index] = field;
+
2494 params[jss::api_version] = 2;
+
2495 auto const jv =
+
2496 env.rpc("json", "ledger_entry", to_string(params));
+
2497 checkResult(false, jv, expectedType, "malformedRequest");
+
2498 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2499 }
+
2500
+
2501 std::string const pdIdx = [&]() {
+
2502 {
+
2503 Json::Value params;
+
2504 // Test good values
+
2505 // Use the "field":true notation
+
2506 params[jss::ledger_index] = jss::validated;
+
2507 params[field] = true;
+
2508 auto const jv =
+
2509 env.rpc("json", "ledger_entry", to_string(params));
+
2510 // Index will always be returned for valid parameters.
+
2511 std::string const pdIdx =
+
2512 jv[jss::result][jss::index].asString();
+
2513 BEAST_EXPECTS(hexKey == pdIdx, to_string(jv));
+
2514 checkResult(good, jv, expectedType);
+
2515
+
2516 return pdIdx;
+
2517 }
+
2518 }();
+
2519
+
2520 {
+
2521 Json::Value params;
+
2522 // "field":"[index hash]"
+
2523 params[jss::ledger_index] = jss::validated;
+
2524 params[field] = hexKey;
+
2525 auto const jv =
+
2526 env.rpc("json", "ledger_entry", to_string(params));
+
2527 checkResult(good, jv, expectedType);
+
2528 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
+
2529 }
+
2530
+
2531 {
+
2532 // Bad value
+
2533 // Use the "index":"field" notation with API 2
+
2534 Json::Value params;
+
2535 params[jss::ledger_index] = jss::validated;
+
2536 params[jss::index] = field;
+
2537 params[jss::api_version] = 2;
+
2538 auto const jv =
+
2539 env.rpc("json", "ledger_entry", to_string(params));
+
2540 checkResult(false, jv, expectedType, "malformedRequest");
+
2541 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2542 }
+
2543
+
2544 {
+
2545 Json::Value params;
+
2546 // Use the "index":"field" notation with API 3
+
2547 params[jss::ledger_index] = jss::validated;
+
2548 params[jss::index] = field;
+
2549 params[jss::api_version] = 3;
+
2550 auto const jv =
+
2551 env.rpc("json", "ledger_entry", to_string(params));
+
2552 // Index is correct either way
+
2553 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
+
2554 checkResult(good, jv, expectedType);
+
2555 }
+
2556
+
2557 {
+
2558 Json::Value params;
+
2559 // Use the "index":"[index hash]" notation
+
2560 params[jss::ledger_index] = jss::validated;
+
2561 params[jss::index] = pdIdx;
+
2562 auto const jv =
+
2563 env.rpc("json", "ledger_entry", to_string(params));
+
2564 // Index is correct either way
+
2565 BEAST_EXPECT(jv[jss::result][jss::index].asString() == hexKey);
+
2566 checkResult(good, jv, expectedType);
+
2567 }
+
2568 };
+
2569
+
2570 test(jss::amendments, jss::Amendments, keylet::amendments(), true);
+
2571 test(jss::fee, jss::FeeSettings, keylet::fees(), true);
+
2572 // There won't be an nunl
+
2573 test(jss::nunl, jss::NegativeUNL, keylet::negativeUNL(), false);
+
2574 // Can only get the short skip list this way
+
2575 test(jss::hashes, jss::LedgerHashes, keylet::skip(), true);
+
2576 }
-
2583
-
2584 void
-
- -
2586 {
-
2587 using namespace test::jtx;
-
2588
-
2589 Account const alice{"alice"};
-
2590 Account const bob{"bob"};
-
2591
-
2592 Env env{*this, envconfig([](auto cfg) {
-
2593 cfg->START_UP = Config::FRESH;
-
2594 return cfg;
-
2595 })};
-
2596
-
2597 env.close();
-
2598
-
2609 auto checkResult =
-
2610 [&](bool good,
-
2611 Json::Value const& jv,
-
2612 int expectedCount,
-
2613 std::optional<std::string> const& expectedError = {}) {
-
2614 if (good)
-
2615 {
-
2616 BEAST_EXPECTS(
-
2617 jv.isObject() && jv.isMember(jss::result) &&
-
2618 !jv[jss::result].isMember(jss::error) &&
-
2619 jv[jss::result].isMember(jss::node) &&
-
2620 jv[jss::result][jss::node].isMember(
-
2621 sfLedgerEntryType.jsonName) &&
-
2622 jv[jss::result][jss::node]
-
2623 [sfLedgerEntryType.jsonName] == jss::LedgerHashes,
-
2624 to_string(jv));
-
2625 BEAST_EXPECTS(
-
2626 jv[jss::result].isMember(jss::node) &&
-
2627 jv[jss::result][jss::node].isMember("Hashes") &&
-
2628 jv[jss::result][jss::node]["Hashes"].size() ==
-
2629 expectedCount,
-
2630 to_string(jv[jss::result][jss::node]["Hashes"].size()));
-
2631 }
-
2632 else
-
2633 {
-
2634 BEAST_EXPECTS(
-
2635 jv.isObject() && jv.isMember(jss::result) &&
-
2636 jv[jss::result].isMember(jss::error) &&
-
2637 !jv[jss::result].isMember(jss::node) &&
-
2638 jv[jss::result][jss::error] ==
-
2639 expectedError.value_or("entryNotFound"),
-
2640 to_string(jv));
-
2641 }
-
2642 };
-
2643
-
2654 auto test = [&](Json::Value ledger,
-
2655 Keylet const& expectedKey,
-
2656 bool good,
-
2657 int expectedCount = 0) {
-
2658 testcase << "LedgerHashes: seq: " << env.current()->header().seq
-
2659 << " \"hashes\":" << to_string(ledger)
-
2660 << (good ? "" : " not") << " found";
-
2661
-
2662 auto const hexKey = strHex(expectedKey.key);
-
2663
-
2664 {
-
2665 // Test bad values
-
2666 // "hashes":null
-
2667 Json::Value params;
-
2668 params[jss::ledger_index] = jss::validated;
-
2669 params[jss::hashes] = Json::nullValue;
-
2670 auto jv = env.rpc("json", "ledger_entry", to_string(params));
-
2671 checkResult(false, jv, 0, "malformedRequest");
-
2672 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2673 }
-
2674
-
2675 {
-
2676 Json::Value params;
-
2677 // "hashes":"non-uint string"
-
2678 params[jss::ledger_index] = jss::validated;
-
2679 params[jss::hashes] = "arbitrary string";
-
2680 auto const jv =
-
2681 env.rpc("json", "ledger_entry", to_string(params));
-
2682 checkResult(false, jv, 0, "malformedRequest");
-
2683 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2684 }
-
2685
-
2686 {
-
2687 Json::Value params;
-
2688 // "hashes":"uint string" is invalid, too
-
2689 params[jss::ledger_index] = jss::validated;
-
2690 params[jss::hashes] = "10";
-
2691 auto const jv =
-
2692 env.rpc("json", "ledger_entry", to_string(params));
-
2693 checkResult(false, jv, 0, "malformedRequest");
-
2694 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2695 }
-
2696
-
2697 {
-
2698 Json::Value params;
-
2699 // "hashes":false
-
2700 params[jss::ledger_index] = jss::validated;
-
2701 params[jss::hashes] = false;
-
2702 auto const jv =
-
2703 env.rpc("json", "ledger_entry", to_string(params));
-
2704 checkResult(false, jv, 0, "invalidParams");
-
2705 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2706 }
-
2707
-
2708 {
-
2709 Json::Value params;
-
2710 // "hashes":-1
-
2711 params[jss::ledger_index] = jss::validated;
-
2712 params[jss::hashes] = -1;
-
2713 auto const jv =
-
2714 env.rpc("json", "ledger_entry", to_string(params));
-
2715 checkResult(false, jv, 0, "internal");
-
2716 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
-
2717 }
-
2718
-
2719 // "hashes":[incorrect index hash]
-
2720 {
-
2721 Json::Value params;
-
2722 auto const badKey = strHex(expectedKey.key + uint256{1});
-
2723 params[jss::ledger_index] = jss::validated;
-
2724 params[jss::hashes] = badKey;
-
2725 auto const jv =
-
2726 env.rpc("json", "ledger_entry", to_string(params));
-
2727 checkResult(false, jv, 0, "entryNotFound");
-
2728 BEAST_EXPECT(jv[jss::result][jss::index] == badKey);
-
2729 }
-
2730
-
2731 {
-
2732 Json::Value params;
-
2733 // Test good values
-
2734 // Use the "hashes":ledger notation
-
2735 params[jss::ledger_index] = jss::validated;
-
2736 params[jss::hashes] = ledger;
-
2737 auto const jv =
-
2738 env.rpc("json", "ledger_entry", to_string(params));
-
2739 checkResult(good, jv, expectedCount);
-
2740 // Index will always be returned for valid parameters.
-
2741 std::string const pdIdx =
-
2742 jv[jss::result][jss::index].asString();
-
2743 BEAST_EXPECTS(hexKey == pdIdx, strHex(pdIdx));
-
2744 }
-
2745
-
2746 {
-
2747 Json::Value params;
-
2748 // "hashes":"[index hash]"
-
2749 params[jss::ledger_index] = jss::validated;
-
2750 params[jss::hashes] = hexKey;
-
2751 auto const jv =
-
2752 env.rpc("json", "ledger_entry", to_string(params));
-
2753 checkResult(good, jv, expectedCount);
-
2754 // Index is correct either way
-
2755 BEAST_EXPECTS(
-
2756 hexKey == jv[jss::result][jss::index].asString(),
-
2757 strHex(jv[jss::result][jss::index].asString()));
-
2758 }
-
2759
-
2760 {
-
2761 Json::Value params;
-
2762 // Use the "index":"[index hash]" notation
-
2763 params[jss::ledger_index] = jss::validated;
-
2764 params[jss::index] = hexKey;
-
2765 auto const jv =
-
2766 env.rpc("json", "ledger_entry", to_string(params));
-
2767 checkResult(good, jv, expectedCount);
-
2768 // Index is correct either way
-
2769 BEAST_EXPECTS(
-
2770 hexKey == jv[jss::result][jss::index].asString(),
-
2771 strHex(jv[jss::result][jss::index].asString()));
-
2772 }
-
2773 };
-
2774
-
2775 // short skip list
-
2776 test(true, keylet::skip(), true, 2);
-
2777 // long skip list at index 0
-
2778 test(1, keylet::skip(1), false);
-
2779 // long skip list at index 1
-
2780 test(1 << 17, keylet::skip(1 << 17), false);
-
2781
-
2782 // Close more ledgers, but stop short of the flag ledger
-
2783 for (auto i = env.current()->seq(); i <= 250; ++i)
-
2784 env.close();
-
2785
-
2786 // short skip list
-
2787 test(true, keylet::skip(), true, 249);
-
2788 // long skip list at index 0
-
2789 test(1, keylet::skip(1), false);
-
2790 // long skip list at index 1
-
2791 test(1 << 17, keylet::skip(1 << 17), false);
-
2792
-
2793 // Close a flag ledger so the first "long" skip list is created
-
2794 for (auto i = env.current()->seq(); i <= 260; ++i)
-
2795 env.close();
-
2796
-
2797 // short skip list
-
2798 test(true, keylet::skip(), true, 256);
-
2799 // long skip list at index 0
-
2800 test(1, keylet::skip(1), true, 1);
-
2801 // long skip list at index 1
-
2802 test(1 << 17, keylet::skip(1 << 17), false);
-
2803 }
+
2577
+
2578 void
+
+ +
2580 {
+
2581 using namespace test::jtx;
+
2582
+
2583 Account const alice{"alice"};
+
2584 Account const bob{"bob"};
+
2585
+
2586 Env env{*this, envconfig([](auto cfg) {
+
2587 cfg->START_UP = Config::FRESH;
+
2588 return cfg;
+
2589 })};
+
2590
+
2591 env.close();
+
2592
+
2603 auto checkResult =
+
2604 [&](bool good,
+
2605 Json::Value const& jv,
+
2606 int expectedCount,
+
2607 std::optional<std::string> const& expectedError = {}) {
+
2608 if (good)
+
2609 {
+
2610 BEAST_EXPECTS(
+
2611 jv.isObject() && jv.isMember(jss::result) &&
+
2612 !jv[jss::result].isMember(jss::error) &&
+
2613 jv[jss::result].isMember(jss::node) &&
+
2614 jv[jss::result][jss::node].isMember(
+
2615 sfLedgerEntryType.jsonName) &&
+
2616 jv[jss::result][jss::node]
+
2617 [sfLedgerEntryType.jsonName] == jss::LedgerHashes,
+
2618 to_string(jv));
+
2619 BEAST_EXPECTS(
+
2620 jv[jss::result].isMember(jss::node) &&
+
2621 jv[jss::result][jss::node].isMember("Hashes") &&
+
2622 jv[jss::result][jss::node]["Hashes"].size() ==
+
2623 expectedCount,
+
2624 to_string(jv[jss::result][jss::node]["Hashes"].size()));
+
2625 }
+
2626 else
+
2627 {
+
2628 BEAST_EXPECTS(
+
2629 jv.isObject() && jv.isMember(jss::result) &&
+
2630 jv[jss::result].isMember(jss::error) &&
+
2631 !jv[jss::result].isMember(jss::node) &&
+
2632 jv[jss::result][jss::error] ==
+
2633 expectedError.value_or("entryNotFound"),
+
2634 to_string(jv));
+
2635 }
+
2636 };
+
2637
+
2648 auto test = [&](Json::Value ledger,
+
2649 Keylet const& expectedKey,
+
2650 bool good,
+
2651 int expectedCount = 0) {
+
2652 testcase << "LedgerHashes: seq: " << env.current()->header().seq
+
2653 << " \"hashes\":" << to_string(ledger)
+
2654 << (good ? "" : " not") << " found";
+
2655
+
2656 auto const hexKey = strHex(expectedKey.key);
+
2657
+
2658 {
+
2659 // Test bad values
+
2660 // "hashes":null
+
2661 Json::Value params;
+
2662 params[jss::ledger_index] = jss::validated;
+
2663 params[jss::hashes] = Json::nullValue;
+
2664 auto jv = env.rpc("json", "ledger_entry", to_string(params));
+
2665 checkResult(false, jv, 0, "malformedRequest");
+
2666 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2667 }
+
2668
+
2669 {
+
2670 Json::Value params;
+
2671 // "hashes":"non-uint string"
+
2672 params[jss::ledger_index] = jss::validated;
+
2673 params[jss::hashes] = "arbitrary string";
+
2674 auto const jv =
+
2675 env.rpc("json", "ledger_entry", to_string(params));
+
2676 checkResult(false, jv, 0, "malformedRequest");
+
2677 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2678 }
+
2679
+
2680 {
+
2681 Json::Value params;
+
2682 // "hashes":"uint string" is invalid, too
+
2683 params[jss::ledger_index] = jss::validated;
+
2684 params[jss::hashes] = "10";
+
2685 auto const jv =
+
2686 env.rpc("json", "ledger_entry", to_string(params));
+
2687 checkResult(false, jv, 0, "malformedRequest");
+
2688 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2689 }
+
2690
+
2691 {
+
2692 Json::Value params;
+
2693 // "hashes":false
+
2694 params[jss::ledger_index] = jss::validated;
+
2695 params[jss::hashes] = false;
+
2696 auto const jv =
+
2697 env.rpc("json", "ledger_entry", to_string(params));
+
2698 checkResult(false, jv, 0, "invalidParams");
+
2699 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2700 }
+
2701
+
2702 {
+
2703 Json::Value params;
+
2704 // "hashes":-1
+
2705 params[jss::ledger_index] = jss::validated;
+
2706 params[jss::hashes] = -1;
+
2707 auto const jv =
+
2708 env.rpc("json", "ledger_entry", to_string(params));
+
2709 checkResult(false, jv, 0, "internal");
+
2710 BEAST_EXPECT(!jv[jss::result].isMember(jss::index));
+
2711 }
+
2712
+
2713 // "hashes":[incorrect index hash]
+
2714 {
+
2715 Json::Value params;
+
2716 auto const badKey = strHex(expectedKey.key + uint256{1});
+
2717 params[jss::ledger_index] = jss::validated;
+
2718 params[jss::hashes] = badKey;
+
2719 auto const jv =
+
2720 env.rpc("json", "ledger_entry", to_string(params));
+
2721 checkResult(false, jv, 0, "entryNotFound");
+
2722 BEAST_EXPECT(jv[jss::result][jss::index] == badKey);
+
2723 }
+
2724
+
2725 {
+
2726 Json::Value params;
+
2727 // Test good values
+
2728 // Use the "hashes":ledger notation
+
2729 params[jss::ledger_index] = jss::validated;
+
2730 params[jss::hashes] = ledger;
+
2731 auto const jv =
+
2732 env.rpc("json", "ledger_entry", to_string(params));
+
2733 checkResult(good, jv, expectedCount);
+
2734 // Index will always be returned for valid parameters.
+
2735 std::string const pdIdx =
+
2736 jv[jss::result][jss::index].asString();
+
2737 BEAST_EXPECTS(hexKey == pdIdx, strHex(pdIdx));
+
2738 }
+
2739
+
2740 {
+
2741 Json::Value params;
+
2742 // "hashes":"[index hash]"
+
2743 params[jss::ledger_index] = jss::validated;
+
2744 params[jss::hashes] = hexKey;
+
2745 auto const jv =
+
2746 env.rpc("json", "ledger_entry", to_string(params));
+
2747 checkResult(good, jv, expectedCount);
+
2748 // Index is correct either way
+
2749 BEAST_EXPECTS(
+
2750 hexKey == jv[jss::result][jss::index].asString(),
+
2751 strHex(jv[jss::result][jss::index].asString()));
+
2752 }
+
2753
+
2754 {
+
2755 Json::Value params;
+
2756 // Use the "index":"[index hash]" notation
+
2757 params[jss::ledger_index] = jss::validated;
+
2758 params[jss::index] = hexKey;
+
2759 auto const jv =
+
2760 env.rpc("json", "ledger_entry", to_string(params));
+
2761 checkResult(good, jv, expectedCount);
+
2762 // Index is correct either way
+
2763 BEAST_EXPECTS(
+
2764 hexKey == jv[jss::result][jss::index].asString(),
+
2765 strHex(jv[jss::result][jss::index].asString()));
+
2766 }
+
2767 };
+
2768
+
2769 // short skip list
+
2770 test(true, keylet::skip(), true, 2);
+
2771 // long skip list at index 0
+
2772 test(1, keylet::skip(1), false);
+
2773 // long skip list at index 1
+
2774 test(1 << 17, keylet::skip(1 << 17), false);
+
2775
+
2776 // Close more ledgers, but stop short of the flag ledger
+
2777 for (auto i = env.current()->seq(); i <= 250; ++i)
+
2778 env.close();
+
2779
+
2780 // short skip list
+
2781 test(true, keylet::skip(), true, 249);
+
2782 // long skip list at index 0
+
2783 test(1, keylet::skip(1), false);
+
2784 // long skip list at index 1
+
2785 test(1 << 17, keylet::skip(1 << 17), false);
+
2786
+
2787 // Close a flag ledger so the first "long" skip list is created
+
2788 for (auto i = env.current()->seq(); i <= 260; ++i)
+
2789 env.close();
+
2790
+
2791 // short skip list
+
2792 test(true, keylet::skip(), true, 256);
+
2793 // long skip list at index 0
+
2794 test(1, keylet::skip(1), true, 1);
+
2795 // long skip list at index 1
+
2796 test(1 << 17, keylet::skip(1 << 17), false);
+
2797 }
+
2798
+
2799 void
+
+ +
2801 {
+
2802 testcase("command-line");
+
2803 using namespace test::jtx;
2804
-
2805 void
-
- -
2807 {
-
2808 testcase("command-line");
-
2809 using namespace test::jtx;
-
2810
-
2811 Env env{*this};
-
2812 Account const alice{"alice"};
-
2813 env.fund(XRP(10000), alice);
-
2814 env.close();
-
2815
-
2816 auto const checkId = keylet::check(env.master, env.seq(env.master));
-
2817
-
2818 env(check::create(env.master, alice, XRP(100)));
-
2819 env.close();
-
2820
-
2821 std::string const ledgerHash{to_string(env.closed()->header().hash)};
-
2822 {
-
2823 // Request a check.
-
2824 Json::Value const jrr =
-
2825 env.rpc("ledger_entry", to_string(checkId.key))[jss::result];
-
2826 BEAST_EXPECT(
-
2827 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Check);
-
2828 BEAST_EXPECT(jrr[jss::node][sfSendMax.jsonName] == "100000000");
-
2829 }
-
2830 }
+
2805 Env env{*this};
+
2806 Account const alice{"alice"};
+
2807 env.fund(XRP(10000), alice);
+
2808 env.close();
+
2809
+
2810 auto const checkId = keylet::check(env.master, env.seq(env.master));
+
2811
+
2812 env(check::create(env.master, alice, XRP(100)));
+
2813 env.close();
+
2814
+
2815 std::string const ledgerHash{to_string(env.closed()->header().hash)};
+
2816 {
+
2817 // Request a check.
+
2818 Json::Value const jrr =
+
2819 env.rpc("ledger_entry", to_string(checkId.key))[jss::result];
+
2820 BEAST_EXPECT(
+
2821 jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Check);
+
2822 BEAST_EXPECT(jrr[jss::node][sfSendMax.jsonName] == "100000000");
+
2823 }
+
2824 }
-
2831
-
2832public:
-
2833 void
-
-
2834 run() override
-
2835 {
-
2836 testInvalid();
- - -
2839 testAMM();
-
2840 testCheck();
- -
2842 testDelegate();
- - -
2845 testDirectory();
-
2846 testEscrow();
- - - - - -
2852 testOffer();
-
2853 testPayChan();
- - -
2856 testTicket();
-
2857 testDID();
- - -
2860 testMPT();
- -
2862 testFixed();
-
2863 testHashes();
-
2864 testCLI();
-
2865 }
+
2825
+
2826public:
+
2827 void
+
+
2828 run() override
+
2829 {
+
2830 testInvalid();
+ + +
2833 testAMM();
+
2834 testCheck();
+ +
2836 testDelegate();
+ + +
2839 testDirectory();
+
2840 testEscrow();
+ + + + + +
2846 testOffer();
+
2847 testPayChan();
+ + +
2850 testTicket();
+
2851 testDID();
+ + +
2854 testMPT();
+ +
2856 testFixed();
+
2857 testHashes();
+
2858 testCLI();
+
2859 }
-
2866};
+
2860};
-
2867
-
- - -
2870{
-
2871 void
-
- -
2873 Json::Value const& jv,
-
2874 std::string const& err,
-
2875 std::string const& msg)
-
2876 {
-
2877 if (BEAST_EXPECT(jv.isMember(jss::status)))
-
2878 BEAST_EXPECT(jv[jss::status] == "error");
-
2879 if (BEAST_EXPECT(jv.isMember(jss::error)))
-
2880 BEAST_EXPECT(jv[jss::error] == err);
-
2881 if (msg.empty())
-
2882 {
-
2883 BEAST_EXPECT(
-
2884 jv[jss::error_message] == Json::nullValue ||
-
2885 jv[jss::error_message] == "");
-
2886 }
-
2887 else if (BEAST_EXPECT(jv.isMember(jss::error_message)))
-
2888 BEAST_EXPECT(jv[jss::error_message] == msg);
-
2889 }
+
2861
+
+ + +
2864{
+
2865 void
+
+ +
2867 Json::Value const& jv,
+
2868 std::string const& err,
+
2869 std::string const& msg)
+
2870 {
+
2871 if (BEAST_EXPECT(jv.isMember(jss::status)))
+
2872 BEAST_EXPECT(jv[jss::status] == "error");
+
2873 if (BEAST_EXPECT(jv.isMember(jss::error)))
+
2874 BEAST_EXPECT(jv[jss::error] == err);
+
2875 if (msg.empty())
+
2876 {
+
2877 BEAST_EXPECT(
+
2878 jv[jss::error_message] == Json::nullValue ||
+
2879 jv[jss::error_message] == "");
+
2880 }
+
2881 else if (BEAST_EXPECT(jv.isMember(jss::error_message)))
+
2882 BEAST_EXPECT(jv[jss::error_message] == msg);
+
2883 }
+
2884
+
2885 void
+
+ +
2887 {
+
2888 testcase("ledger_entry: bridge");
+
2889 using namespace test::jtx;
2890
-
2891 void
-
- -
2893 {
-
2894 testcase("ledger_entry: bridge");
-
2895 using namespace test::jtx;
-
2896
-
2897 Env mcEnv{*this, features};
-
2898 Env scEnv(*this, envconfig(), features);
-
2899
-
2900 createBridgeObjects(mcEnv, scEnv);
-
2901
-
2902 std::string const ledgerHash{to_string(mcEnv.closed()->header().hash)};
-
2903 std::string bridge_index;
-
2904 Json::Value mcBridge;
-
2905 {
-
2906 // request the bridge via RPC
-
2907 Json::Value jvParams;
-
2908 jvParams[jss::bridge_account] = mcDoor.human();
-
2909 jvParams[jss::bridge] = jvb;
-
2910 Json::Value const jrr = mcEnv.rpc(
-
2911 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2891 Env mcEnv{*this, features};
+
2892 Env scEnv(*this, envconfig(), features);
+
2893
+
2894 createBridgeObjects(mcEnv, scEnv);
+
2895
+
2896 std::string const ledgerHash{to_string(mcEnv.closed()->header().hash)};
+
2897 std::string bridge_index;
+
2898 Json::Value mcBridge;
+
2899 {
+
2900 // request the bridge via RPC
+
2901 Json::Value jvParams;
+
2902 jvParams[jss::bridge_account] = mcDoor.human();
+
2903 jvParams[jss::bridge] = jvb;
+
2904 Json::Value const jrr = mcEnv.rpc(
+
2905 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2906
+
2907 BEAST_EXPECT(jrr.isMember(jss::node));
+
2908 auto r = jrr[jss::node];
+
2909
+
2910 BEAST_EXPECT(r.isMember(jss::Account));
+
2911 BEAST_EXPECT(r[jss::Account] == mcDoor.human());
2912
-
2913 BEAST_EXPECT(jrr.isMember(jss::node));
-
2914 auto r = jrr[jss::node];
-
2915
-
2916 BEAST_EXPECT(r.isMember(jss::Account));
-
2917 BEAST_EXPECT(r[jss::Account] == mcDoor.human());
-
2918
-
2919 BEAST_EXPECT(r.isMember(jss::Flags));
-
2920
-
2921 BEAST_EXPECT(r.isMember(sfLedgerEntryType.jsonName));
-
2922 BEAST_EXPECT(r[sfLedgerEntryType.jsonName] == jss::Bridge);
-
2923
-
2924 // we not created an account yet
-
2925 BEAST_EXPECT(r.isMember(sfXChainAccountCreateCount.jsonName));
-
2926 BEAST_EXPECT(r[sfXChainAccountCreateCount.jsonName].asInt() == 0);
-
2927
-
2928 // we have not claimed a locking chain tx yet
-
2929 BEAST_EXPECT(r.isMember(sfXChainAccountClaimCount.jsonName));
-
2930 BEAST_EXPECT(r[sfXChainAccountClaimCount.jsonName].asInt() == 0);
-
2931
-
2932 BEAST_EXPECT(r.isMember(jss::index));
-
2933 bridge_index = r[jss::index].asString();
-
2934 mcBridge = r;
-
2935 }
-
2936 {
-
2937 // request the bridge via RPC by index
-
2938 Json::Value jvParams;
-
2939 jvParams[jss::index] = bridge_index;
-
2940 Json::Value const jrr = mcEnv.rpc(
-
2941 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2942
-
2943 BEAST_EXPECT(jrr.isMember(jss::node));
-
2944 BEAST_EXPECT(jrr[jss::node] == mcBridge);
-
2945 }
-
2946 {
-
2947 // swap door accounts and make sure we get an error value
-
2948 Json::Value jvParams;
-
2949 // Sidechain door account is "master", not scDoor
-
2950 jvParams[jss::bridge_account] = Account::master.human();
-
2951 jvParams[jss::bridge] = jvb;
-
2952 jvParams[jss::ledger_hash] = ledgerHash;
-
2953 Json::Value const jrr = mcEnv.rpc(
-
2954 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2955
-
2956 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
2957 }
-
2958 {
-
2959 // create two claim ids and verify that the bridge counter was
-
2960 // incremented
- -
2962 mcEnv.close();
- -
2964 mcEnv.close();
-
2965
-
2966 // request the bridge via RPC
-
2967 Json::Value jvParams;
-
2968 jvParams[jss::bridge_account] = mcDoor.human();
-
2969 jvParams[jss::bridge] = jvb;
-
2970 Json::Value const jrr = mcEnv.rpc(
-
2971 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
2972
-
2973 BEAST_EXPECT(jrr.isMember(jss::node));
-
2974 auto r = jrr[jss::node];
+
2913 BEAST_EXPECT(r.isMember(jss::Flags));
+
2914
+
2915 BEAST_EXPECT(r.isMember(sfLedgerEntryType.jsonName));
+
2916 BEAST_EXPECT(r[sfLedgerEntryType.jsonName] == jss::Bridge);
+
2917
+
2918 // we not created an account yet
+
2919 BEAST_EXPECT(r.isMember(sfXChainAccountCreateCount.jsonName));
+
2920 BEAST_EXPECT(r[sfXChainAccountCreateCount.jsonName].asInt() == 0);
+
2921
+
2922 // we have not claimed a locking chain tx yet
+
2923 BEAST_EXPECT(r.isMember(sfXChainAccountClaimCount.jsonName));
+
2924 BEAST_EXPECT(r[sfXChainAccountClaimCount.jsonName].asInt() == 0);
+
2925
+
2926 BEAST_EXPECT(r.isMember(jss::index));
+
2927 bridge_index = r[jss::index].asString();
+
2928 mcBridge = r;
+
2929 }
+
2930 {
+
2931 // request the bridge via RPC by index
+
2932 Json::Value jvParams;
+
2933 jvParams[jss::index] = bridge_index;
+
2934 Json::Value const jrr = mcEnv.rpc(
+
2935 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2936
+
2937 BEAST_EXPECT(jrr.isMember(jss::node));
+
2938 BEAST_EXPECT(jrr[jss::node] == mcBridge);
+
2939 }
+
2940 {
+
2941 // swap door accounts and make sure we get an error value
+
2942 Json::Value jvParams;
+
2943 // Sidechain door account is "master", not scDoor
+
2944 jvParams[jss::bridge_account] = Account::master.human();
+
2945 jvParams[jss::bridge] = jvb;
+
2946 jvParams[jss::ledger_hash] = ledgerHash;
+
2947 Json::Value const jrr = mcEnv.rpc(
+
2948 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2949
+
2950 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
2951 }
+
2952 {
+
2953 // create two claim ids and verify that the bridge counter was
+
2954 // incremented
+ +
2956 mcEnv.close();
+ +
2958 mcEnv.close();
+
2959
+
2960 // request the bridge via RPC
+
2961 Json::Value jvParams;
+
2962 jvParams[jss::bridge_account] = mcDoor.human();
+
2963 jvParams[jss::bridge] = jvb;
+
2964 Json::Value const jrr = mcEnv.rpc(
+
2965 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
2966
+
2967 BEAST_EXPECT(jrr.isMember(jss::node));
+
2968 auto r = jrr[jss::node];
+
2969
+
2970 // we executed two create claim id txs
+
2971 BEAST_EXPECT(r.isMember(sfXChainClaimID.jsonName));
+
2972 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 2);
+
2973 }
+
2974 }
+
2975
-
2976 // we executed two create claim id txs
-
2977 BEAST_EXPECT(r.isMember(sfXChainClaimID.jsonName));
-
2978 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 2);
-
2979 }
-
2980 }
-
+
2976 void
+
+ +
2978 {
+
2979 testcase("ledger_entry: xchain_claim_id");
+
2980 using namespace test::jtx;
2981
-
2982 void
-
- -
2984 {
-
2985 testcase("ledger_entry: xchain_claim_id");
-
2986 using namespace test::jtx;
-
2987
-
2988 Env mcEnv{*this, features};
-
2989 Env scEnv(*this, envconfig(), features);
-
2990
-
2991 createBridgeObjects(mcEnv, scEnv);
-
2992
- -
2994 scEnv.close();
- -
2996 scEnv.close();
-
2997
-
2998 std::string bridge_index;
-
2999 {
-
3000 // request the xchain_claim_id via RPC
-
3001 Json::Value jvParams;
-
3002 jvParams[jss::xchain_owned_claim_id] = jvXRPBridgeRPC;
-
3003 jvParams[jss::xchain_owned_claim_id][jss::xchain_owned_claim_id] =
-
3004 1;
-
3005 Json::Value const jrr = scEnv.rpc(
-
3006 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
3007
-
3008 BEAST_EXPECT(jrr.isMember(jss::node));
-
3009 auto r = jrr[jss::node];
-
3010
-
3011 BEAST_EXPECT(r.isMember(jss::Account));
-
3012 BEAST_EXPECT(r[jss::Account] == scAlice.human());
-
3013 BEAST_EXPECT(
-
3014 r[sfLedgerEntryType.jsonName] == jss::XChainOwnedClaimID);
-
3015 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 1);
-
3016 BEAST_EXPECT(r[sfOwnerNode.jsonName].asInt() == 0);
-
3017 }
-
3018
-
3019 {
-
3020 // request the xchain_claim_id via RPC
-
3021 Json::Value jvParams;
-
3022 jvParams[jss::xchain_owned_claim_id] = jvXRPBridgeRPC;
-
3023 jvParams[jss::xchain_owned_claim_id][jss::xchain_owned_claim_id] =
-
3024 2;
-
3025 Json::Value const jrr = scEnv.rpc(
-
3026 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
3027
-
3028 BEAST_EXPECT(jrr.isMember(jss::node));
-
3029 auto r = jrr[jss::node];
-
3030
-
3031 BEAST_EXPECT(r.isMember(jss::Account));
-
3032 BEAST_EXPECT(r[jss::Account] == scBob.human());
-
3033 BEAST_EXPECT(
-
3034 r[sfLedgerEntryType.jsonName] == jss::XChainOwnedClaimID);
-
3035 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 2);
-
3036 BEAST_EXPECT(r[sfOwnerNode.jsonName].asInt() == 0);
-
3037 }
-
3038 }
+
2982 Env mcEnv{*this, features};
+
2983 Env scEnv(*this, envconfig(), features);
+
2984
+
2985 createBridgeObjects(mcEnv, scEnv);
+
2986
+ +
2988 scEnv.close();
+ +
2990 scEnv.close();
+
2991
+
2992 std::string bridge_index;
+
2993 {
+
2994 // request the xchain_claim_id via RPC
+
2995 Json::Value jvParams;
+
2996 jvParams[jss::xchain_owned_claim_id] = jvXRPBridgeRPC;
+
2997 jvParams[jss::xchain_owned_claim_id][jss::xchain_owned_claim_id] =
+
2998 1;
+
2999 Json::Value const jrr = scEnv.rpc(
+
3000 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
3001
+
3002 BEAST_EXPECT(jrr.isMember(jss::node));
+
3003 auto r = jrr[jss::node];
+
3004
+
3005 BEAST_EXPECT(r.isMember(jss::Account));
+
3006 BEAST_EXPECT(r[jss::Account] == scAlice.human());
+
3007 BEAST_EXPECT(
+
3008 r[sfLedgerEntryType.jsonName] == jss::XChainOwnedClaimID);
+
3009 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 1);
+
3010 BEAST_EXPECT(r[sfOwnerNode.jsonName].asInt() == 0);
+
3011 }
+
3012
+
3013 {
+
3014 // request the xchain_claim_id via RPC
+
3015 Json::Value jvParams;
+
3016 jvParams[jss::xchain_owned_claim_id] = jvXRPBridgeRPC;
+
3017 jvParams[jss::xchain_owned_claim_id][jss::xchain_owned_claim_id] =
+
3018 2;
+
3019 Json::Value const jrr = scEnv.rpc(
+
3020 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
3021
+
3022 BEAST_EXPECT(jrr.isMember(jss::node));
+
3023 auto r = jrr[jss::node];
+
3024
+
3025 BEAST_EXPECT(r.isMember(jss::Account));
+
3026 BEAST_EXPECT(r[jss::Account] == scBob.human());
+
3027 BEAST_EXPECT(
+
3028 r[sfLedgerEntryType.jsonName] == jss::XChainOwnedClaimID);
+
3029 BEAST_EXPECT(r[sfXChainClaimID.jsonName].asInt() == 2);
+
3030 BEAST_EXPECT(r[sfOwnerNode.jsonName].asInt() == 0);
+
3031 }
+
3032 }
+
3033
+
3034 void
+
+ +
3036 {
+
3037 testcase("ledger_entry: xchain_create_account_claim_id");
+
3038 using namespace test::jtx;
3039
-
3040 void
-
- -
3042 {
-
3043 testcase("ledger_entry: xchain_create_account_claim_id");
-
3044 using namespace test::jtx;
+
3040 Env mcEnv{*this, features};
+
3041 Env scEnv(*this, envconfig(), features);
+
3042
+
3043 // note: signers.size() and quorum are both 5 in createBridgeObjects
+
3044 createBridgeObjects(mcEnv, scEnv);
3045
-
3046 Env mcEnv{*this, features};
-
3047 Env scEnv(*this, envconfig(), features);
-
3048
-
3049 // note: signers.size() and quorum are both 5 in createBridgeObjects
-
3050 createBridgeObjects(mcEnv, scEnv);
-
3051
-
3052 auto scCarol =
-
3053 Account("scCarol"); // Don't fund it - it will be created with the
-
3054 // xchain transaction
-
3055 auto const amt = XRP(1000);
- -
3057 mcAlice, jvb, scCarol, amt, reward));
-
3058 mcEnv.close();
-
3059
-
3060 // send less than quorum of attestations (otherwise funds are
-
3061 // immediately transferred and no "claim" object is created)
-
3062 size_t constexpr num_attest = 3;
-
3063 auto attestations = create_account_attestations(
-
3064 scAttester,
-
3065 jvb,
-
3066 mcAlice,
-
3067 amt,
-
3068 reward,
-
3069 payee,
-
3070 /*wasLockingChainSend*/ true,
-
3071 1,
-
3072 scCarol,
-
3073 signers,
- -
3075 for (size_t i = 0; i < num_attest; ++i)
-
3076 {
-
3077 scEnv(attestations[i]);
-
3078 }
-
3079 scEnv.close();
-
3080
-
3081 {
-
3082 // request the create account claim_id via RPC
-
3083 Json::Value jvParams;
-
3084 jvParams[jss::xchain_owned_create_account_claim_id] =
- -
3086 jvParams[jss::xchain_owned_create_account_claim_id]
-
3087 [jss::xchain_owned_create_account_claim_id] = 1;
-
3088 Json::Value const jrr = scEnv.rpc(
-
3089 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
3046 auto scCarol =
+
3047 Account("scCarol"); // Don't fund it - it will be created with the
+
3048 // xchain transaction
+
3049 auto const amt = XRP(1000);
+ +
3051 mcAlice, jvb, scCarol, amt, reward));
+
3052 mcEnv.close();
+
3053
+
3054 // send less than quorum of attestations (otherwise funds are
+
3055 // immediately transferred and no "claim" object is created)
+
3056 size_t constexpr num_attest = 3;
+
3057 auto attestations = create_account_attestations(
+
3058 scAttester,
+
3059 jvb,
+
3060 mcAlice,
+
3061 amt,
+
3062 reward,
+
3063 payee,
+
3064 /*wasLockingChainSend*/ true,
+
3065 1,
+
3066 scCarol,
+
3067 signers,
+ +
3069 for (size_t i = 0; i < num_attest; ++i)
+
3070 {
+
3071 scEnv(attestations[i]);
+
3072 }
+
3073 scEnv.close();
+
3074
+
3075 {
+
3076 // request the create account claim_id via RPC
+
3077 Json::Value jvParams;
+
3078 jvParams[jss::xchain_owned_create_account_claim_id] =
+ +
3080 jvParams[jss::xchain_owned_create_account_claim_id]
+
3081 [jss::xchain_owned_create_account_claim_id] = 1;
+
3082 Json::Value const jrr = scEnv.rpc(
+
3083 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
3084
+
3085 BEAST_EXPECT(jrr.isMember(jss::node));
+
3086 auto r = jrr[jss::node];
+
3087
+
3088 BEAST_EXPECT(r.isMember(jss::Account));
+
3089 BEAST_EXPECT(r[jss::Account] == Account::master.human());
3090
-
3091 BEAST_EXPECT(jrr.isMember(jss::node));
-
3092 auto r = jrr[jss::node];
+
3091 BEAST_EXPECT(r.isMember(sfXChainAccountCreateCount.jsonName));
+
3092 BEAST_EXPECT(r[sfXChainAccountCreateCount.jsonName].asInt() == 1);
3093
-
3094 BEAST_EXPECT(r.isMember(jss::Account));
-
3095 BEAST_EXPECT(r[jss::Account] == Account::master.human());
-
3096
-
3097 BEAST_EXPECT(r.isMember(sfXChainAccountCreateCount.jsonName));
-
3098 BEAST_EXPECT(r[sfXChainAccountCreateCount.jsonName].asInt() == 1);
-
3099
-
3100 BEAST_EXPECT(
-
3101 r.isMember(sfXChainCreateAccountAttestations.jsonName));
-
3102 auto attest = r[sfXChainCreateAccountAttestations.jsonName];
-
3103 BEAST_EXPECT(attest.isArray());
-
3104 BEAST_EXPECT(attest.size() == 3);
-
3105 BEAST_EXPECT(attest[Json::Value::UInt(0)].isMember(
-
3106 sfXChainCreateAccountProofSig.jsonName));
-
3107 Json::Value a[num_attest];
-
3108 for (size_t i = 0; i < num_attest; ++i)
-
3109 {
-
3110 a[i] = attest[Json::Value::UInt(0)]
-
3111 [sfXChainCreateAccountProofSig.jsonName];
+
3094 BEAST_EXPECT(
+
3095 r.isMember(sfXChainCreateAccountAttestations.jsonName));
+
3096 auto attest = r[sfXChainCreateAccountAttestations.jsonName];
+
3097 BEAST_EXPECT(attest.isArray());
+
3098 BEAST_EXPECT(attest.size() == 3);
+
3099 BEAST_EXPECT(attest[Json::Value::UInt(0)].isMember(
+
3100 sfXChainCreateAccountProofSig.jsonName));
+
3101 Json::Value a[num_attest];
+
3102 for (size_t i = 0; i < num_attest; ++i)
+
3103 {
+
3104 a[i] = attest[Json::Value::UInt(0)]
+
3105 [sfXChainCreateAccountProofSig.jsonName];
+
3106 BEAST_EXPECT(
+
3107 a[i].isMember(jss::Amount) &&
+
3108 a[i][jss::Amount].asInt() == 1000 * drop_per_xrp);
+
3109 BEAST_EXPECT(
+
3110 a[i].isMember(jss::Destination) &&
+
3111 a[i][jss::Destination] == scCarol.human());
3112 BEAST_EXPECT(
-
3113 a[i].isMember(jss::Amount) &&
-
3114 a[i][jss::Amount].asInt() == 1000 * drop_per_xrp);
-
3115 BEAST_EXPECT(
-
3116 a[i].isMember(jss::Destination) &&
-
3117 a[i][jss::Destination] == scCarol.human());
-
3118 BEAST_EXPECT(
-
3119 a[i].isMember(sfAttestationSignerAccount.jsonName) &&
- -
3121 signers.begin(), signers.end(), [&](signer const& s) {
-
3122 return a[i][sfAttestationSignerAccount.jsonName] ==
-
3123 s.account.human();
-
3124 }));
-
3125 BEAST_EXPECT(
-
3126 a[i].isMember(sfAttestationRewardAccount.jsonName) &&
- -
3128 payee.begin(),
-
3129 payee.end(),
-
3130 [&](Account const& account) {
-
3131 return a[i][sfAttestationRewardAccount.jsonName] ==
-
3132 account.human();
-
3133 }));
-
3134 BEAST_EXPECT(
-
3135 a[i].isMember(sfWasLockingChainSend.jsonName) &&
-
3136 a[i][sfWasLockingChainSend.jsonName] == 1);
-
3137 BEAST_EXPECT(
-
3138 a[i].isMember(sfSignatureReward.jsonName) &&
-
3139 a[i][sfSignatureReward.jsonName].asInt() ==
-
3140 1 * drop_per_xrp);
-
3141 }
-
3142 }
-
3143
-
3144 // complete attestations quorum - CreateAccountClaimID should not be
-
3145 // present anymore
-
3146 for (size_t i = num_attest; i < UT_XCHAIN_DEFAULT_NUM_SIGNERS; ++i)
-
3147 {
-
3148 scEnv(attestations[i]);
-
3149 }
-
3150 scEnv.close();
-
3151 {
-
3152 // request the create account claim_id via RPC
-
3153 Json::Value jvParams;
-
3154 jvParams[jss::xchain_owned_create_account_claim_id] =
- -
3156 jvParams[jss::xchain_owned_create_account_claim_id]
-
3157 [jss::xchain_owned_create_account_claim_id] = 1;
-
3158 Json::Value const jrr = scEnv.rpc(
-
3159 "json", "ledger_entry", to_string(jvParams))[jss::result];
-
3160 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
-
3161 }
-
3162 }
+
3113 a[i].isMember(sfAttestationSignerAccount.jsonName) &&
+ +
3115 signers.begin(), signers.end(), [&](signer const& s) {
+
3116 return a[i][sfAttestationSignerAccount.jsonName] ==
+
3117 s.account.human();
+
3118 }));
+
3119 BEAST_EXPECT(
+
3120 a[i].isMember(sfAttestationRewardAccount.jsonName) &&
+ +
3122 payee.begin(),
+
3123 payee.end(),
+
3124 [&](Account const& account) {
+
3125 return a[i][sfAttestationRewardAccount.jsonName] ==
+
3126 account.human();
+
3127 }));
+
3128 BEAST_EXPECT(
+
3129 a[i].isMember(sfWasLockingChainSend.jsonName) &&
+
3130 a[i][sfWasLockingChainSend.jsonName] == 1);
+
3131 BEAST_EXPECT(
+
3132 a[i].isMember(sfSignatureReward.jsonName) &&
+
3133 a[i][sfSignatureReward.jsonName].asInt() ==
+
3134 1 * drop_per_xrp);
+
3135 }
+
3136 }
+
3137
+
3138 // complete attestations quorum - CreateAccountClaimID should not be
+
3139 // present anymore
+
3140 for (size_t i = num_attest; i < UT_XCHAIN_DEFAULT_NUM_SIGNERS; ++i)
+
3141 {
+
3142 scEnv(attestations[i]);
+
3143 }
+
3144 scEnv.close();
+
3145 {
+
3146 // request the create account claim_id via RPC
+
3147 Json::Value jvParams;
+
3148 jvParams[jss::xchain_owned_create_account_claim_id] =
+ +
3150 jvParams[jss::xchain_owned_create_account_claim_id]
+
3151 [jss::xchain_owned_create_account_claim_id] = 1;
+
3152 Json::Value const jrr = scEnv.rpc(
+
3153 "json", "ledger_entry", to_string(jvParams))[jss::result];
+
3154 checkErrorValue(jrr, "entryNotFound", "Entry not found.");
+
3155 }
+
3156 }
-
3163
-
3164public:
-
3165 void
-
-
3166 run() override
-
3167 {
-
3168 testBridge();
-
3169 testClaimID();
- -
3171 }
+
3157
+
3158public:
+
3159 void
+
+
3160 run() override
+
3161 {
+
3162 testBridge();
+
3163 testClaimID();
+ +
3165 }
-
3172};
+
3166};
-
3173
-
3174BEAST_DEFINE_TESTSUITE(LedgerEntry, rpc, xrpl);
-
3175BEAST_DEFINE_TESTSUITE(LedgerEntry_XChain, rpc, xrpl);
-
3176
-
3177} // namespace test
-
3178} // namespace xrpl
+
3167
+
3168BEAST_DEFINE_TESTSUITE(LedgerEntry, rpc, xrpl);
+
3169BEAST_DEFINE_TESTSUITE(LedgerEntry_XChain, rpc, xrpl);
+
3170
+
3171} // namespace test
+
3172} // namespace xrpl
T any_of(T... args)
@@ -3352,50 +3346,50 @@ $(document).ready(function() { init_codefold(0); });
static base_uint fromVoid(void const *data)
Definition base_uint.h:300
- - -
void run() override
Runs the suite.
-
void checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg)
- - - - - - - - - -
void testMalformedSubfield(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())
-
void run() override
Runs the suite.
- - -
void testMalformedField(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())
- - - - - - -
void testFixed()
Test the ledger entry types that don't take parameters.
- - - - - - -
Json::Value getCorrectValue(Json::StaticString fieldName)
-
void runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, source_location const location=source_location::current())
- -
void runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, source_location const location=source_location::current())
-
std::vector< Json::Value > getBadValues(FieldType fieldType)
- - - - - - -
void checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg, source_location const location=source_location::current())
- + + +
void run() override
Runs the suite.
+
void checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg)
+ + + + +
void checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg, std::source_location const location=std::source_location::current())
+ + +
void testMalformedSubfield(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())
+ + + +
void run() override
Runs the suite.
+ + +
void testMalformedField(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())
+ + + + +
void runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::source_location const location=std::source_location::current())
+ +
void runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, std::source_location const location=std::source_location::current())
+ +
void testFixed()
Test the ledger entry types that don't take parameters.
+ + + + + + +
Json::Value getCorrectValue(Json::StaticString fieldName)
+ +
std::vector< Json::Value > getBadValues(FieldType fieldType)
+ + + + + + +
Convenience class to test AMM functionality.
Definition AMM.h:105
Immutable cryptographic account descriptor.
Definition Account.h:20
std::string const & human() const
Returns the human readable public key.
Definition Account.h:99
@@ -3419,6 +3413,7 @@ $(document).ready(function() { init_codefold(0); });
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition rpc.h:16
Sets the optional Destination field on an NFTokenOffer.
Definition token.h:144
Set the flags on a JTx.
Definition txflags.h:12
+
T current(T... args)
T empty(T... args)
T end(T... args)
@@ -3441,7 +3436,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Definition Indexes.cpp:204
Keylet permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
Definition Indexes.cpp:564
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
Json::Value ledgerEntry(jtx::Env &env, jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:59
Json::Value create(jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:13
Json::Value set(jtx::Account const &account, jtx::Account const &authorize, std::vector< std::string > const &permissions)
Definition delegate.cpp:12
@@ -3463,12 +3458,12 @@ $(document).ready(function() { init_codefold(0); });
JValueVec create_account_attestations(jtx::Account const &submittingAccount, Json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, jtx::AnyAmount const &rewardAmount, std::vector< jtx::Account > const &rewardAccounts, bool wasLockingChainSend, std::uint64_t createCount, jtx::Account const &dst, std::vector< jtx::signer > const &signers, std::size_t const numAtts, std::size_t const fromIdx)
Json::Value xchain_create_claim_id(Account const &acc, Json::Value const &bridge, STAmount const &reward, Account const &otherChainSource)
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:10
- + @@ -3482,10 +3477,10 @@ $(document).ready(function() { init_codefold(0); }); -
std::vector< std::pair< Json::StaticString, FieldType > > mappings
-
FieldType getFieldType(Json::StaticString fieldName)
+
std::vector< std::pair< Json::StaticString, FieldType > > mappings
+
FieldType getFieldType(Json::StaticString fieldName)
static uint256 ledgerHash(LedgerHeader const &info)
-
std::string getTypeName(FieldType typeID)
+
std::string getTypeName(FieldType typeID)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::uint32_t const tfTransferable
Definition TxFlags.h:123
constexpr std::uint32_t const tfMPTCanTransfer
Definition TxFlags.h:133
@@ -3512,10 +3507,10 @@ $(document).ready(function() { init_codefold(0); });
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:20
uint256 key
Definition Keylet.h:21
- - - - + + + +
void createBridgeObjects(Env &mcEnv, Env &scEnv)
diff --git a/LedgerToJson_8cpp_source.html b/LedgerToJson_8cpp_source.html index fd9ed6c513..05f421b26b 100644 --- a/LedgerToJson_8cpp_source.html +++ b/LedgerToJson_8cpp_source.html @@ -455,7 +455,7 @@ $(document).ready(function() { init_codefold(0); });
void insertMPTokenIssuanceID(Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
void insertDeliveredAmount(Json::Value &meta, ReadView const &, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &)
Add a delivered_amount field to the meta input/output parameter.
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ fhIGNORE_FREEZE
Definition View.h:59
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
diff --git a/LoanBroker__test_8cpp_source.html b/LoanBroker__test_8cpp_source.html index 8da97c7bef..e067c76b7f 100644 --- a/LoanBroker__test_8cpp_source.html +++ b/LoanBroker__test_8cpp_source.html @@ -2213,24 +2213,24 @@ $(document).ready(function() { init_codefold(0); });
Json::Value coverDeposit(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
Json::Value coverWithdraw(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
Json::Value set(AccountID const &account, uint256 const &vaultId, uint32_t flags)
- +
Json::Value coverClawback(AccountID const &account, std::uint32_t flags)
- +
Json::Value pay(AccountID const &account, uint256 const &loanID, STAmount const &amount, std::uint32_t flags)
Json::Value set(AccountID const &account, uint256 const &loanBrokerID, Number principalRequested, std::uint32_t flags)
Json::Value del(AccountID const &account, uint256 const &loanID, std::uint32_t flags)
static MPTInit const mptInitNoFund
Definition mpt.h:108
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:13
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition flags.h:102
static none_t const none
Definition tags.h:15
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
auto const MPTDEXFlags
Definition mpt.h:17
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
-
bool checkVL(Slice const &result, std::string const &expected)
+
bool checkVL(Slice const &result, std::string const &expected)
STTx createTx(bool disabling, LedgerIndex seq, PublicKey const &txKey)
Create ttUNL_MODIFY Tx.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
diff --git a/Loan__test_8cpp_source.html b/Loan__test_8cpp_source.html index e2a3b0d3e7..32f6984c8c 100644 --- a/Loan__test_8cpp_source.html +++ b/Loan__test_8cpp_source.html @@ -8246,22 +8246,22 @@ $(document).ready(function() { init_codefold(0); });
Json::Value coverDeposit(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
Json::Value coverWithdraw(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
Json::Value del(AccountID const &account, uint256 const &brokerID, uint32_t flags)
- +
Json::Value coverClawback(AccountID const &account, std::uint32_t flags)
- -
auto const loanServiceFee
- -
auto const paymentInterval
-
auto const lateInterestRate
+ +
auto const loanServiceFee
+ +
auto const paymentInterval
+
auto const lateInterestRate
Json::Value set(AccountID const &account, uint256 const &loanBrokerID, Number principalRequested, std::uint32_t flags)
-
auto const latePaymentFee
-
auto const closePaymentFee
+
auto const latePaymentFee
+
auto const closePaymentFee
Json::Value manage(AccountID const &account, uint256 const &loanID, std::uint32_t flags)
- -
auto const closeInterestRate
- + +
auto const closeInterestRate
+
static MPTInit const mptInitNoFund
Definition mpt.h:108
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Json::Value noop(Account const &account)
The null transaction.
Definition noop.h:12
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:13
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
@@ -8274,7 +8274,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition flags.h:102
static none_t const none
Definition tags.h:15
FeatureBitset testable_amendments()
Definition Env.h:55
-
auto const amount
+
auto const amount
auto const MPTDEXFlags
Definition mpt.h:17
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
diff --git a/NegativeUNL__test_8cpp_source.html b/NegativeUNL__test_8cpp_source.html index 4d22303cfb..e5f33b321e 100644 --- a/NegativeUNL__test_8cpp_source.html +++ b/NegativeUNL__test_8cpp_source.html @@ -2096,7 +2096,7 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
Keylet const & negativeUNL() noexcept
The (fixed) index of the object containing the ledger negativeUNL.
Definition Indexes.cpp:212
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
FeatureBitset testable_amendments()
Definition Env.h:55
bool negUnlSizeTest(std::shared_ptr< Ledger const > const &l, size_t size, bool hasToDisable, bool hasToReEnable)
Test the size of the negative UNL in a ledger, also test if the ledger has ToDisable and/or ToReEnabl...
bool voteAndCheck(NetworkHistory &history, NodeID const &myId, std::size_t expect, PreVote const &pre=defaultPreVote)
Create a NegativeUNLVote object.
diff --git a/Oracle_8cpp_source.html b/Oracle_8cpp_source.html index f09ad932c2..b4b406c581 100644 --- a/Oracle_8cpp_source.html +++ b/Oracle_8cpp_source.html @@ -515,7 +515,7 @@ $(document).ready(function() { init_codefold(0); });
constexpr char const * NonePattern
Definition Oracle.h:21
void toJsonHex(Json::Value &jv, AnyValue const &v)
Definition Oracle.cpp:316
void toJson(Json::Value &jv, AnyValue const &v)
Definition Oracle.cpp:310
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
std::string strHex(FwdIt begin, FwdIt end)
Definition strHex.h:11
diff --git a/Path__test_8cpp_source.html b/Path__test_8cpp_source.html index f3851c7a10..238c788c3a 100644 --- a/Path__test_8cpp_source.html +++ b/Path__test_8cpp_source.html @@ -2369,14 +2369,14 @@ $(document).ready(function() { init_codefold(0); });
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Definition Indexes.cpp:428
Keylet line(AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
The index of a trust line for a given currency.
Definition Indexes.cpp:226
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:13
-
bool same(STPathSet const &st1, Args const &... args)
+
bool same(STPathSet const &st1, Args const &... args)
Json::Value rate(Account const &account, double multiplier)
Set a transfer rate.
Definition rate.cpp:13
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
uint256 setupDomain(jtx::Env &env, std::vector< jtx::Account > const &accounts, jtx::Account const &domainOwner, std::string const &credType)
STPathElement IPE(Issue const &iss)
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
-
STPath stpath(Args const &... args)
+
STPath stpath(Args const &... args)
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:10
diff --git a/Pathfinder_8cpp_source.html b/Pathfinder_8cpp_source.html index 0b8f8b8192..0036f0279e 100644 --- a/Pathfinder_8cpp_source.html +++ b/Pathfinder_8cpp_source.html @@ -1593,7 +1593,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet line(AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
The index of a trust line for a given currency.
Definition Indexes.cpp:226
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
STAmount divide(STAmount const &amount, Rate const &rate)
Definition Rate2.cpp:74
STAmount convertAmount(STAmount const &amt, bool all)
diff --git a/PerfLog__test_8cpp_source.html b/PerfLog__test_8cpp_source.html index d0f0cd2608..84ac896edd 100644 --- a/PerfLog__test_8cpp_source.html +++ b/PerfLog__test_8cpp_source.html @@ -1226,7 +1226,7 @@ $(document).ready(function() { init_codefold(0); });
std::set< char const * > getHandlerNames()
Return names of all methods.
Definition Handler.cpp:301
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
std::unique_ptr< PerfLog > make_PerfLog(PerfLog::Setup const &setup, Application &app, beast::Journal journal, std::function< void()> &&signalStop)
-
auto make_vector(Input const &input)
+
auto make_vector(Input const &input)
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ current
This was a new validation and was added.
diff --git a/Quality_8cpp_source.html b/Quality_8cpp_source.html index 06129f4fe0..f6b769eb55 100644 --- a/Quality_8cpp_source.html +++ b/Quality_8cpp_source.html @@ -284,7 +284,7 @@ $(document).ready(function() { init_codefold(0); }); -
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Quality composed_quality(Quality const &lhs, Quality const &rhs)
Definition Quality.cpp:137
static Amounts ceil_in_impl(Amounts const &amount, STAmount const &limit, bool roundUp, Quality const &quality)
Definition Quality.cpp:58
diff --git a/Quality_8h_source.html b/Quality_8h_source.html index acf5dec688..b2d0c6e8e0 100644 --- a/Quality_8h_source.html +++ b/Quality_8h_source.html @@ -444,7 +444,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet quality(Keylet const &k, std::uint64_t q) noexcept
The initial directory page for a specific quality.
Definition Indexes.cpp:262
Rate rate(Env &env, Account const &account, std::uint32_t const &seq)
Definition escrow.cpp:50
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
Definition Slice.h:204
Quality composed_quality(Quality const &lhs, Quality const &rhs)
Definition Quality.cpp:137
diff --git a/RocksDBFactory_8cpp_source.html b/RocksDBFactory_8cpp_source.html index 3acb740d03..d6067fe8ff 100644 --- a/RocksDBFactory_8cpp_source.html +++ b/RocksDBFactory_8cpp_source.html @@ -578,7 +578,7 @@ $(document).ready(function() { init_codefold(0); });
void registerRocksDBFactory(Manager &manager)
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
constexpr auto megabytes(T value) noexcept
diff --git a/STIssue__test_8cpp_source.html b/STIssue__test_8cpp_source.html index a6272d3d00..0b616cf6c2 100644 --- a/STIssue__test_8cpp_source.html +++ b/STIssue__test_8cpp_source.html @@ -256,7 +256,7 @@ $(document).ready(function() { init_codefold(0); });
Immutable cryptographic account descriptor.
Definition Account.h:20
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition Issue.h:99
Currency const & xrpCurrency()
XRP currency.
diff --git a/Slice_8cpp_source.html b/Slice_8cpp_source.html index 09111d206c..8caf188a0b 100644 --- a/Slice_8cpp_source.html +++ b/Slice_8cpp_source.html @@ -167,7 +167,7 @@ $(document).ready(function() { init_codefold(0); });
An immutable linear range of bytes.
Definition Slice.h:27
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:225
diff --git a/TMGetObjectByHash__test_8cpp_source.html b/TMGetObjectByHash__test_8cpp_source.html index d09394c0c3..b5814de31b 100644 --- a/TMGetObjectByHash__test_8cpp_source.html +++ b/TMGetObjectByHash__test_8cpp_source.html @@ -340,7 +340,7 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
@ hardMaxReplyNodes
The hard cap on the number of ledger entries in a single reply.
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
diff --git a/TestHelpers_8cpp_source.html b/TestHelpers_8cpp_source.html index 931b495de7..af950c8991 100644 --- a/TestHelpers_8cpp_source.html +++ b/TestHelpers_8cpp_source.html @@ -726,7 +726,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value ledgerEntryRoot(Env &env, Account const &acct)
bool equal(STAmount const &sa1, STAmount const &sa2)
constexpr XRPAmount dropsPerXRP
-
auto const amount
+
auto const amount
bool checkArraySize(Json::Value const &val, unsigned int size)
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
void stpath_append_one(STPath &st, Account const &account)
diff --git a/TestHelpers_8h_source.html b/TestHelpers_8h_source.html index 9fffdd4fcc..a5e21a1def 100644 --- a/TestHelpers_8h_source.html +++ b/TestHelpers_8h_source.html @@ -98,910 +98,903 @@ $(document).ready(function() { init_codefold(0); });
15#include <xrpl/protocol/Units.h>
16#include <xrpl/protocol/jss.h>
17
-
18#include <vector>
-
19
-
20#if (defined(__clang_major__) && __clang_major__ < 15)
-
21#include <experimental/source_location>
- -
23#else
-
24#include <source_location>
- -
26#endif
-
27
-
28namespace xrpl {
-
29namespace test {
-
30namespace jtx {
-
31
-
37template <
-
38 class SField,
-
39 class StoredValue = typename SField::type::value_type,
-
40 class OutputValue = StoredValue>
-
- -
42{
-
43 using SF = SField;
-
44 using SV = StoredValue;
-
45 using OV = OutputValue;
-
46
-
47protected:
-
48 SF const& sfield_;
- -
50
-
51public:
-
-
52 explicit JTxField(SF const& sfield, SV const& value)
-
53 : sfield_(sfield), value_(value)
-
54 {
-
55 }
+
18#include <source_location>
+
19#include <vector>
+
20
+
21namespace xrpl {
+
22namespace test {
+
23namespace jtx {
+
24
+
30template <
+
31 class SField,
+
32 class StoredValue = typename SField::type::value_type,
+
33 class OutputValue = StoredValue>
+
+ +
35{
+
36 using SF = SField;
+
37 using SV = StoredValue;
+
38 using OV = OutputValue;
+
39
+
40protected:
+
41 SF const& sfield_;
+ +
43
+
44public:
+
+
45 explicit JTxField(SF const& sfield, SV const& value)
+
46 : sfield_(sfield), value_(value)
+
47 {
+
48 }
+
+
49
+
50 virtual ~JTxField() = default;
+
51
+
52 virtual OV
+
53 value() const = 0;
+
54
+
55 virtual void
+
+
56 operator()(Env&, JTx& jt) const
+
57 {
+
58 jt.jv[sfield_.jsonName] = value();
+
59 }
+
+
60};
-
56
-
57 virtual ~JTxField() = default;
-
58
-
59 virtual OV
-
60 value() const = 0;
61
-
62 virtual void
-
-
63 operator()(Env&, JTx& jt) const
-
64 {
-
65 jt.jv[sfield_.jsonName] = value();
-
66 }
-
-
67};
-
+
62template <class SField, class StoredValue>
+
+
63struct JTxField<SField, StoredValue, StoredValue>
+
64{
+
65 using SF = SField;
+
66 using SV = StoredValue;
+
67 using OV = SV;
68
-
69template <class SField, class StoredValue>
-
-
70struct JTxField<SField, StoredValue, StoredValue>
-
71{
-
72 using SF = SField;
-
73 using SV = StoredValue;
-
74 using OV = SV;
-
75
-
76protected:
-
77 SF const& sfield_;
- -
79
-
80public:
-
-
81 explicit JTxField(SF const& sfield, SV const& value)
-
82 : sfield_(sfield), value_(value)
-
83 {
-
84 }
+
69protected:
+
70 SF const& sfield_;
+ +
72
+
73public:
+
+
74 explicit JTxField(SF const& sfield, SV const& value)
+
75 : sfield_(sfield), value_(value)
+
76 {
+
77 }
+
+
78
+
79 void
+
+
80 operator()(Env&, JTx& jt) const
+
81 {
+ +
83 }
+
+
84};
85
-
86 void
-
-
87 operator()(Env&, JTx& jt) const
-
88 {
- -
90 }
+
+ +
87 : public JTxField<SF_UINT32, NetClock::time_point, NetClock::rep>
+
88{
+
89 using SF = SF_UINT32;
+ + + +
93
+
94protected:
+
95 using base::value_;
+
96
+
97public:
+
+
98 explicit timePointField(SF const& sfield, SV const& value)
+
99 : JTxField(sfield, value)
+
100 {
+
101 }
-
91};
+
102
+
103 OV
+
+
104 value() const override
+
105 {
+
106 return value_.time_since_epoch().count();
+
107 }
-
92
-
- -
94 : public JTxField<SF_UINT32, NetClock::time_point, NetClock::rep>
-
95{
-
96 using SF = SF_UINT32;
- - - -
100
-
101protected:
-
102 using base::value_;
-
103
-
104public:
-
-
105 explicit timePointField(SF const& sfield, SV const& value)
-
106 : JTxField(sfield, value)
-
107 {
-
108 }
+
108};
109
-
110 OV
-
-
111 value() const override
-
112 {
-
113 return value_.time_since_epoch().count();
-
114 }
-
-
115};
-
+
+
110struct uint256Field : public JTxField<SF_UINT256, uint256, std::string>
+
111{
+
112 using SF = SF_UINT256;
+
113 using SV = uint256;
+ +
116
-
-
117struct uint256Field : public JTxField<SF_UINT256, uint256, std::string>
-
118{
-
119 using SF = SF_UINT256;
-
120 using SV = uint256;
- - -
123
-
124protected:
-
125 using base::value_;
-
126
-
127public:
-
-
128 explicit uint256Field(SF const& sfield, SV const& value)
-
129 : JTxField(sfield, value)
-
130 {
-
131 }
+
117protected:
+
118 using base::value_;
+
119
+
120public:
+
+
121 explicit uint256Field(SF const& sfield, SV const& value)
+
122 : JTxField(sfield, value)
+
123 {
+
124 }
+
+
125
+
126 OV
+
+
127 value() const override
+
128 {
+
129 return to_string(value_);
+
130 }
+
+
131};
132
-
133 OV
-
-
134 value() const override
-
135 {
-
136 return to_string(value_);
-
137 }
-
-
138};
-
+
+
133struct accountIDField : public JTxField<SF_ACCOUNT, AccountID, std::string>
+
134{
+
135 using SF = SF_ACCOUNT;
+
136 using SV = AccountID;
+ +
139
-
-
140struct accountIDField : public JTxField<SF_ACCOUNT, AccountID, std::string>
-
141{
-
142 using SF = SF_ACCOUNT;
-
143 using SV = AccountID;
- - -
146
-
147protected:
-
148 using base::value_;
-
149
-
150public:
-
-
151 explicit accountIDField(SF const& sfield, SV const& value)
-
152 : JTxField(sfield, value)
-
153 {
-
154 }
+
140protected:
+
141 using base::value_;
+
142
+
143public:
+
+
144 explicit accountIDField(SF const& sfield, SV const& value)
+
145 : JTxField(sfield, value)
+
146 {
+
147 }
+
+
148
+
149 OV
+
+
150 value() const override
+
151 {
+
152 return toBase58(value_);
+
153 }
+
+
154};
155
-
156 OV
-
-
157 value() const override
-
158 {
-
159 return toBase58(value_);
-
160 }
-
-
161};
-
+
+
156struct stAmountField : public JTxField<SF_AMOUNT, STAmount, Json::Value>
+
157{
+
158 using SF = SF_AMOUNT;
+
159 using SV = STAmount;
+ +
162
-
-
163struct stAmountField : public JTxField<SF_AMOUNT, STAmount, Json::Value>
-
164{
-
165 using SF = SF_AMOUNT;
-
166 using SV = STAmount;
- - -
169
-
170protected:
-
171 using base::value_;
-
172
-
173public:
-
-
174 explicit stAmountField(SF const& sfield, SV const& value)
-
175 : JTxField(sfield, value)
-
176 {
-
177 }
+
163protected:
+
164 using base::value_;
+
165
+
166public:
+
+
167 explicit stAmountField(SF const& sfield, SV const& value)
+
168 : JTxField(sfield, value)
+
169 {
+
170 }
+
+
171
+
172 OV
+
+
173 value() const override
+
174 {
+ +
176 }
+
+
177};
178
-
179 OV
-
-
180 value() const override
-
181 {
- -
183 }
+
+
179struct blobField : public JTxField<SF_VL, std::string>
+
180{
+
181 using SF = SF_VL;
+ + +
184
+
185 using JTxField::JTxField;
+
186
+
+
187 explicit blobField(SF const& sfield, Slice const& cond)
+
188 : JTxField(sfield, strHex(cond))
+
189 {
+
190 }
-
184};
-
-
185
-
-
186struct blobField : public JTxField<SF_VL, std::string>
-
187{
-
188 using SF = SF_VL;
- -
191
-
192 using JTxField::JTxField;
-
193
-
-
194 explicit blobField(SF const& sfield, Slice const& cond)
-
195 : JTxField(sfield, strHex(cond))
-
196 {
-
197 }
+
192 template <size_t N>
+
+
193 explicit blobField(SF const& sfield, std::array<std::uint8_t, N> const& c)
+
194 : blobField(sfield, makeSlice(c))
+
195 {
+
196 }
+
+
197};
198
-
199 template <size_t N>
-
-
200 explicit blobField(SF const& sfield, std::array<std::uint8_t, N> const& c)
-
201 : blobField(sfield, makeSlice(c))
-
202 {
-
203 }
+
199template <class SField, class UnitTag, class ValueType>
+
+ +
201 : public JTxField<SField, unit::ValueUnit<UnitTag, ValueType>, ValueType>
+
202{
+
203 using SF = SField;
+ +
205 using OV = ValueType;
+ +
207
+ +
209
+
210protected:
+
211 using base::value_;
+
212
+
213public:
+
214 using JTxField<SF, SV, OV>::JTxField;
+
215
+
216 OV
+
+
217 value() const override
+
218 {
+
219 return value_.value();
+
220 }
-
204};
+
221};
-
205
-
206template <class SField, class UnitTag, class ValueType>
-
- -
208 : public JTxField<SField, unit::ValueUnit<UnitTag, ValueType>, ValueType>
-
209{
-
210 using SF = SField;
- -
212 using OV = ValueType;
- -
214
- -
216
-
217protected:
-
218 using base::value_;
-
219
-
220public:
-
221 using JTxField<SF, SV, OV>::JTxField;
222
-
223 OV
-
-
224 value() const override
-
225 {
-
226 return value_.value();
-
227 }
-
-
228};
-
+
223template <class JTxField>
+
+ +
225{
+
226 using JF = JTxField;
+
227 using SF = typename JF::SF;
+
228 using SV = typename JF::SV;
229
-
230template <class JTxField>
-
- -
232{
-
233 using JF = JTxField;
-
234 using SF = typename JF::SF;
-
235 using SV = typename JF::SV;
-
236
-
237protected:
-
238 SF const& sfield_;
-
239
-
240public:
-
-
241 explicit JTxFieldWrapper(SF const& sfield) : sfield_(sfield)
-
242 {
-
243 }
+
230protected:
+
231 SF const& sfield_;
+
232
+
233public:
+
+
234 explicit JTxFieldWrapper(SF const& sfield) : sfield_(sfield)
+
235 {
+
236 }
+
+
237
+
238 JF
+
+
239 operator()(SV const& value) const
+
240 {
+
241 return JTxField(sfield_, value);
+
242 }
+
+
243};
244
-
245 JF
-
-
246 operator()(SV const& value) const
-
247 {
-
248 return JTxField(sfield_, value);
-
249 }
-
-
250};
-
+
245template <>
+
+ +
247{
+
248 using JF = blobField;
+
249 using SF = JF::SF;
+
250 using SV = JF::SV;
251
-
252template <>
-
- -
254{
-
255 using JF = blobField;
-
256 using SF = JF::SF;
-
257 using SV = JF::SV;
-
258
-
259protected:
-
260 SF const& sfield_;
-
261
-
262public:
-
-
263 explicit JTxFieldWrapper(SF const& sfield) : sfield_(sfield)
-
264 {
-
265 }
+
252protected:
+
253 SF const& sfield_;
+
254
+
255public:
+
+
256 explicit JTxFieldWrapper(SF const& sfield) : sfield_(sfield)
+
257 {
+
258 }
-
266
-
267 JF
-
-
268 operator()(SV const& cond) const
-
269 {
-
270 return JF(sfield_, makeSlice(cond));
-
271 }
+
259
+
260 JF
+
+
261 operator()(SV const& cond) const
+
262 {
+
263 return JF(sfield_, makeSlice(cond));
+
264 }
-
272
+
265
+
266 JF
+
+
267 operator()(Slice const& cond) const
+
268 {
+
269 return JF(sfield_, cond);
+
270 }
+
+
271
+
272 template <size_t N>
273 JF
-
274 operator()(Slice const& cond) const
+
275 {
-
276 return JF(sfield_, cond);
+
276 return operator()(makeSlice(c));
277 }
-
278
-
279 template <size_t N>
-
280 JF
-
- -
282 {
-
283 return operator()(makeSlice(c));
-
284 }
-
-
285};
+
278};
+
279
+
280template <
+
281 class SField,
+
282 class UnitTag,
+
283 class ValueType = typename SField::type::value_type>
+ +
286
-
287template <
-
288 class SField,
-
289 class UnitTag,
-
290 class ValueType = typename SField::type::value_type>
- - +
287template <class SField, class StoredValue = typename SField::type::value_type>
+ +
289
+
292auto const data = JTxFieldWrapper<blobField>(sfData);
293
-
294template <class SField, class StoredValue = typename SField::type::value_type>
- -
296
-
299auto const data = JTxFieldWrapper<blobField>(sfData);
-
300
- -
302
-
303// TODO We only need this long "requires" clause as polyfill, for C++20
-
304// implementations which are missing <ranges> header. Replace with
-
305// `std::ranges::range<Input>`, and accordingly use std::ranges::begin/end
-
306// when we have moved to better compilers.
-
307template <typename Input>
-
308auto
-
-
309make_vector(Input const& input)
-
310 requires requires(Input& v) {
-
311 std::begin(v);
-
312 std::end(v);
-
313 }
-
314{
-
315 return std::vector(std::begin(input), std::end(input));
-
316}
+ +
295
+
296// TODO We only need this long "requires" clause as polyfill, for C++20
+
297// implementations which are missing <ranges> header. Replace with
+
298// `std::ranges::range<Input>`, and accordingly use std::ranges::begin/end
+
299// when we have moved to better compilers.
+
300template <typename Input>
+
301auto
+
+
302make_vector(Input const& input)
+
303 requires requires(Input& v) {
+
304 std::begin(v);
+
305 std::end(v);
+
306 }
+
307{
+
308 return std::vector(std::begin(input), std::end(input));
+
309}
-
317
-
318// Functions used in debugging
- -
320getAccountOffers(Env& env, AccountID const& acct, bool current = false);
-
321
-
322inline Json::Value
-
-
323getAccountOffers(Env& env, Account const& acct, bool current = false)
-
324{
-
325 return getAccountOffers(env, acct.id(), current);
-
326}
+
310
+
311// Functions used in debugging
+ +
313getAccountOffers(Env& env, AccountID const& acct, bool current = false);
+
314
+
315inline Json::Value
+
+
316getAccountOffers(Env& env, Account const& acct, bool current = false)
+
317{
+
318 return getAccountOffers(env, acct.id(), current);
+
319}
-
327
- -
329getAccountLines(Env& env, AccountID const& acctId);
-
330
-
331inline Json::Value
+
320
+ +
322getAccountLines(Env& env, AccountID const& acctId);
+
323
+
324inline Json::Value
+
+
325getAccountLines(Env& env, Account const& acct)
+
326{
+
327 return getAccountLines(env, acct.id());
+
328}
+
+
329
+
330template <typename... IOU>
+
-
332getAccountLines(Env& env, Account const& acct)
+
332getAccountLines(Env& env, AccountID const& acctId, IOU... ious)
333{
-
334 return getAccountLines(env, acct.id());
-
335}
-
-
336
-
337template <typename... IOU>
- -
-
339getAccountLines(Env& env, AccountID const& acctId, IOU... ious)
-
340{
-
341 auto const jrr = getAccountLines(env, acctId);
-
342 Json::Value res;
-
343 for (auto const& line : jrr[jss::lines])
-
344 {
-
345 for (auto const& iou : {ious...})
-
346 {
-
347 if (line[jss::currency].asString() == to_string(iou.currency))
-
348 {
-
349 Json::Value v;
-
350 v[jss::currency] = line[jss::currency];
-
351 v[jss::balance] = line[jss::balance];
-
352 v[jss::limit] = line[jss::limit];
-
353 v[jss::account] = line[jss::account];
-
354 res[jss::lines].append(v);
-
355 }
-
356 }
-
357 }
-
358 if (!res.isNull())
-
359 return res;
-
360 return jrr;
-
361}
+
334 auto const jrr = getAccountLines(env, acctId);
+
335 Json::Value res;
+
336 for (auto const& line : jrr[jss::lines])
+
337 {
+
338 for (auto const& iou : {ious...})
+
339 {
+
340 if (line[jss::currency].asString() == to_string(iou.currency))
+
341 {
+
342 Json::Value v;
+
343 v[jss::currency] = line[jss::currency];
+
344 v[jss::balance] = line[jss::balance];
+
345 v[jss::limit] = line[jss::limit];
+
346 v[jss::account] = line[jss::account];
+
347 res[jss::lines].append(v);
+
348 }
+
349 }
+
350 }
+
351 if (!res.isNull())
+
352 return res;
+
353 return jrr;
+
354}
+
355
+
356[[nodiscard]] bool
+
357checkArraySize(Json::Value const& val, unsigned int size);
+
358
+
359// Helper function that returns the owner count on an account.
+ +
361ownerCount(test::jtx::Env const& env, test::jtx::Account const& account);
362
-
363[[nodiscard]] bool
-
364checkArraySize(Json::Value const& val, unsigned int size);
-
365
-
366// Helper function that returns the owner count on an account.
- -
368ownerCount(test::jtx::Env const& env, test::jtx::Account const& account);
-
369
-
370[[nodiscard]]
-
371inline bool
-
-
372checkVL(Slice const& result, std::string const& expected)
-
373{
-
374 Serializer s;
-
375 s.addRaw(result);
-
376 return s.getString() == expected;
-
377}
+
363[[nodiscard]]
+
364inline bool
+
+
365checkVL(Slice const& result, std::string const& expected)
+
366{
+
367 Serializer s;
+
368 s.addRaw(result);
+
369 return s.getString() == expected;
+
370}
-
378
-
379[[nodiscard]]
-
380inline bool
-
- - -
383 SField const& field,
-
384 std::string const& expected)
-
385{
-
386 return strHex(expected) == strHex(sle->getFieldVL(field));
-
387}
+
371
+
372[[nodiscard]]
+
373inline bool
+
+ + +
376 SField const& field,
+
377 std::string const& expected)
+
378{
+
379 return strHex(expected) == strHex(sle->getFieldVL(field));
+
380}
+
+
381
+
382/* Path finding */
+
383/******************************************************************************/
+
384void
+
385stpath_append_one(STPath& st, Account const& account);
+
386
+
387template <class T>
+ +
+
389stpath_append_one(STPath& st, T const& t)
+
390{
+ +
392}
-
388
-
389/* Path finding */
-
390/******************************************************************************/
-
391void
-
392stpath_append_one(STPath& st, Account const& account);
393
-
394template <class T>
- -
-
396stpath_append_one(STPath& st, T const& t)
-
397{
- -
399}
+
394void
+ +
396
+
397template <class T, class... Args>
+
398void
+
+
399stpath_append(STPath& st, T const& t, Args const&... args)
+
400{
+
401 stpath_append_one(st, t);
+
402 if constexpr (sizeof...(args) > 0)
+
403 stpath_append(st, args...);
+
404}
-
400
-
401void
- -
403
-
404template <class T, class... Args>
-
405void
-
-
406stpath_append(STPath& st, T const& t, Args const&... args)
-
407{
-
408 stpath_append_one(st, t);
-
409 if constexpr (sizeof...(args) > 0)
-
410 stpath_append(st, args...);
-
411}
-
-
412
-
413template <class... Args>
-
414void
-
-
415stpathset_append(STPathSet& st, STPath const& p, Args const&... args)
-
416{
-
417 st.push_back(p);
-
418 if constexpr (sizeof...(args) > 0)
-
419 stpathset_append(st, args...);
-
420}
+
405
+
406template <class... Args>
+
407void
+
+
408stpathset_append(STPathSet& st, STPath const& p, Args const&... args)
+
409{
+
410 st.push_back(p);
+
411 if constexpr (sizeof...(args) > 0)
+
412 stpathset_append(st, args...);
+
413}
+
414
+
415bool
+
416equal(STAmount const& sa1, STAmount const& sa2);
+
417
+
418// Issue path element
+ +
420IPE(Issue const& iss);
421
-
422bool
-
423equal(STAmount const& sa1, STAmount const& sa2);
-
424
-
425// Issue path element
- -
427IPE(Issue const& iss);
-
428
-
429template <class... Args>
-
430STPath
-
-
431stpath(Args const&... args)
-
432{
-
433 STPath st;
-
434 stpath_append(st, args...);
-
435 return st;
-
436}
+
422template <class... Args>
+
423STPath
+
+
424stpath(Args const&... args)
+
425{
+
426 STPath st;
+
427 stpath_append(st, args...);
+
428 return st;
+
429}
-
437
-
438template <class... Args>
-
439bool
-
-
440same(STPathSet const& st1, Args const&... args)
-
441{
-
442 STPathSet st2;
-
443 stpathset_append(st2, args...);
-
444 if (st1.size() != st2.size())
-
445 return false;
-
446
-
447 for (auto const& p : st2)
-
448 {
-
449 if (std::find(st1.begin(), st1.end(), p) == st1.end())
-
450 return false;
-
451 }
-
452 return true;
-
453}
+
430
+
431template <class... Args>
+
432bool
+
+
433same(STPathSet const& st1, Args const&... args)
+
434{
+
435 STPathSet st2;
+
436 stpathset_append(st2, args...);
+
437 if (st1.size() != st2.size())
+
438 return false;
+
439
+
440 for (auto const& p : st2)
+
441 {
+
442 if (std::find(st1.begin(), st1.end(), p) == st1.end())
+
443 return false;
+
444 }
+
445 return true;
+
446}
-
454
-
455/******************************************************************************/
-
456
- -
458txfee(Env const& env, std::uint16_t n);
-
459
- -
461xrpMinusFee(Env const& env, std::int64_t xrpAmount);
+
447
+
448/******************************************************************************/
+
449
+ +
451txfee(Env const& env, std::uint16_t n);
+
452
+ +
454xrpMinusFee(Env const& env, std::int64_t xrpAmount);
+
455
+
456bool
+ +
458 Env& env,
+
459 AccountID const& account,
+
460 STAmount const& value,
+
461 bool defaultLimits = false);
462
-
463bool
- -
465 Env& env,
-
466 AccountID const& account,
-
467 STAmount const& value,
-
468 bool defaultLimits = false);
-
469
-
470template <typename... Amts>
-
471bool
-
- -
473 Env& env,
-
474 AccountID const& account,
-
475 STAmount const& value,
-
476 Amts const&... amts)
-
477{
-
478 return expectHolding(env, account, value, false) &&
-
479 expectHolding(env, account, amts...);
-
480}
+
463template <typename... Amts>
+
464bool
+
+ +
466 Env& env,
+
467 AccountID const& account,
+
468 STAmount const& value,
+
469 Amts const&... amts)
+
470{
+
471 return expectHolding(env, account, value, false) &&
+
472 expectHolding(env, account, amts...);
+
473}
-
481
-
482bool
-
483expectHolding(Env& env, AccountID const& account, None const& value);
+
474
+
475bool
+
476expectHolding(Env& env, AccountID const& account, None const& value);
+
477
+
478bool
+ +
480 Env& env,
+
481 AccountID const& account,
+
482 std::uint16_t size,
+
483 std::vector<Amounts> const& toMatch = {});
484
-
485bool
- -
487 Env& env,
-
488 AccountID const& account,
-
489 std::uint16_t size,
-
490 std::vector<Amounts> const& toMatch = {});
-
491
- -
493ledgerEntryRoot(Env& env, Account const& acct);
+ +
486ledgerEntryRoot(Env& env, Account const& acct);
+
487
+ + +
490 Env& env,
+
491 Account const& acct_a,
+
492 Account const& acct_b,
+
493 std::string const& currency);
494
- -
497 Env& env,
-
498 Account const& acct_a,
-
499 Account const& acct_b,
-
500 std::string const& currency);
-
501
- -
503accountBalance(Env& env, Account const& acct);
-
504
-
505[[nodiscard]] bool
- -
507 Env& env,
-
508 Account const& acct,
-
509 STAmount const& expectedValue);
-
510
-
511/* Payment Channel */
-
512/******************************************************************************/
-
513namespace paychan {
-
514
- -
516create(
-
517 AccountID const& account,
-
518 AccountID const& to,
-
519 STAmount const& amount,
-
520 NetClock::duration const& settleDelay,
-
521 PublicKey const& pk,
- - -
524
-
525inline Json::Value
-
- -
527 Account const& account,
-
528 Account const& to,
-
529 STAmount const& amount,
-
530 NetClock::duration const& settleDelay,
-
531 PublicKey const& pk,
- - -
534{
-
535 return create(
-
536 account.id(), to.id(), amount, settleDelay, pk, cancelAfter, dstTag);
-
537}
+
496accountBalance(Env& env, Account const& acct);
+
497
+
498[[nodiscard]] bool
+ +
500 Env& env,
+
501 Account const& acct,
+
502 STAmount const& expectedValue);
+
503
+
504/* Payment Channel */
+
505/******************************************************************************/
+
506namespace paychan {
+
507
+ +
509create(
+
510 AccountID const& account,
+
511 AccountID const& to,
+
512 STAmount const& amount,
+
513 NetClock::duration const& settleDelay,
+
514 PublicKey const& pk,
+ + +
517
+
518inline Json::Value
+
+ +
520 Account const& account,
+
521 Account const& to,
+
522 STAmount const& amount,
+
523 NetClock::duration const& settleDelay,
+
524 PublicKey const& pk,
+ + +
527{
+
528 return create(
+
529 account.id(), to.id(), amount, settleDelay, pk, cancelAfter, dstTag);
+
530}
+
531
+ +
533fund(
+
534 AccountID const& account,
+
535 uint256 const& channel,
+
536 STAmount const& amount,
+
538
-
540fund(
+
540claim(
541 AccountID const& account,
542 uint256 const& channel,
-
543 STAmount const& amount,
- -
545
- -
547claim(
-
548 AccountID const& account,
-
549 uint256 const& channel,
- - -
552 std::optional<Slice> const& signature = std::nullopt,
- -
554
- -
556channel(
-
557 AccountID const& account,
-
558 AccountID const& dst,
-
559 std::uint32_t seqProxyValue);
-
560
-
561inline uint256
-
-
562channel(Account const& account, Account const& dst, std::uint32_t seqProxyValue)
-
563{
-
564 return channel(account.id(), dst.id(), seqProxyValue);
-
565}
+ + +
545 std::optional<Slice> const& signature = std::nullopt,
+ +
547
+ +
549channel(
+
550 AccountID const& account,
+
551 AccountID const& dst,
+
552 std::uint32_t seqProxyValue);
+
553
+
554inline uint256
+
+
555channel(Account const& account, Account const& dst, std::uint32_t seqProxyValue)
+
556{
+
557 return channel(account.id(), dst.id(), seqProxyValue);
+
558}
-
566
- -
568channelBalance(ReadView const& view, uint256 const& chan);
-
569
-
570bool
-
571channelExists(ReadView const& view, uint256 const& chan);
-
572
-
573} // namespace paychan
-
574
-
575/* Crossing Limits */
-
576/******************************************************************************/
-
577
-
578void
- -
580 Env& env,
-
581 std::size_t n,
-
582 Account const& account,
-
583 STAmount const& in,
-
584 STAmount const& out);
+
559
+ +
561channelBalance(ReadView const& view, uint256 const& chan);
+
562
+
563bool
+
564channelExists(ReadView const& view, uint256 const& chan);
+
565
+
566} // namespace paychan
+
567
+
568/* Crossing Limits */
+
569/******************************************************************************/
+
570
+
571void
+ +
573 Env& env,
+
574 std::size_t n,
+
575 Account const& account,
+
576 STAmount const& in,
+
577 STAmount const& out);
+
578
+
579/* Pay Strand */
+
580/***************************************************************/
+
581
+
582// Currency path element
+ +
584cpe(Currency const& c);
585
-
586/* Pay Strand */
-
587/***************************************************************/
-
588
-
589// Currency path element
- -
591cpe(Currency const& c);
-
592
-
593// All path element
- -
595allpe(AccountID const& a, Issue const& iss);
-
596/***************************************************************/
-
597
-
598/* Check */
-
599/***************************************************************/
-
600namespace check {
-
601
-
603// clang-format off
-
604template <typename A>
- - -
-
607create(A const& account, A const& dest, STAmount const& sendMax)
-
608{
-
609 Json::Value jv;
-
610 jv[sfAccount.jsonName] = to_string(account);
-
611 jv[sfSendMax.jsonName] = sendMax.getJson(JsonOptions::none);
-
612 jv[sfDestination.jsonName] = to_string(dest);
-
613 jv[sfTransactionType.jsonName] = jss::CheckCreate;
-
614 return jv;
-
615}
+
586// All path element
+ +
588allpe(AccountID const& a, Issue const& iss);
+
589/***************************************************************/
+
590
+
591/* Check */
+
592/***************************************************************/
+
593namespace check {
+
594
+
596// clang-format off
+
597template <typename A>
+ + +
+
600create(A const& account, A const& dest, STAmount const& sendMax)
+
601{
+
602 Json::Value jv;
+
603 jv[sfAccount.jsonName] = to_string(account);
+
604 jv[sfSendMax.jsonName] = sendMax.getJson(JsonOptions::none);
+
605 jv[sfDestination.jsonName] = to_string(dest);
+
606 jv[sfTransactionType.jsonName] = jss::CheckCreate;
+
607 return jv;
+
608}
-
616// clang-format on
-
617
-
618inline Json::Value
-
- -
620 jtx::Account const& account,
-
621 jtx::Account const& dest,
-
622 STAmount const& sendMax)
-
623{
-
624 return create(account.id(), dest.id(), sendMax);
-
625}
+
609// clang-format on
+
610
+
611inline Json::Value
+
+ +
613 jtx::Account const& account,
+
614 jtx::Account const& dest,
+
615 STAmount const& sendMax)
+
616{
+
617 return create(account.id(), dest.id(), sendMax);
+
618}
-
626
-
627} // namespace check
-
628
- - -
631
-
632template <class Suite>
-
633void
-
- -
635 Suite& test,
-
636 jtx::Env& env,
-
637 std::size_t expectedCount,
-
638 std::optional<std::size_t> expectedMaxCount,
-
639 std::size_t expectedInLedger,
-
640 std::size_t expectedPerLedger,
-
641 std::uint64_t expectedMinFeeLevel = baseFeeLevel.fee(),
-
642 std::uint64_t expectedMedFeeLevel = minEscalationFeeLevel.fee(),
-
643 source_location const location = source_location::current())
-
644{
-
645 int line = location.line();
-
646 char const* file = location.file_name();
-
647 FeeLevel64 const expectedMin{expectedMinFeeLevel};
-
648 FeeLevel64 const expectedMed{expectedMedFeeLevel};
-
649 auto const metrics = env.app().getTxQ().getMetrics(*env.current());
-
650 using namespace std::string_literals;
-
651
- -
653 ? test.pass()
-
654 : test.fail(
-
655 "reference: "s +
-
656 std::to_string(metrics.referenceFeeLevel.value()) + "/" +
- -
658 file,
-
659 line);
-
660
-
661 metrics.txCount == expectedCount
-
662 ? test.pass()
-
663 : test.fail(
-
664 "txCount: "s + std::to_string(metrics.txCount) + "/" +
-
665 std::to_string(expectedCount),
-
666 file,
-
667 line);
-
668
-
669 metrics.txQMaxSize == expectedMaxCount
-
670 ? test.pass()
-
671 : test.fail(
-
672 "txQMaxSize: "s + std::to_string(metrics.txQMaxSize.value_or(0)) +
-
673 "/" + std::to_string(expectedMaxCount.value_or(0)),
-
674 file,
-
675 line);
-
676
-
677 metrics.txInLedger == expectedInLedger
-
678 ? test.pass()
-
679 : test.fail(
-
680 "txInLedger: "s + std::to_string(metrics.txInLedger) + "/" +
-
681 std::to_string(expectedInLedger),
-
682 file,
-
683 line);
-
684
-
685 metrics.txPerLedger == expectedPerLedger
-
686 ? test.pass()
-
687 : test.fail(
-
688 "txPerLedger: "s + std::to_string(metrics.txPerLedger) + "/" +
-
689 std::to_string(expectedPerLedger),
-
690 file,
-
691 line);
-
692
-
693 metrics.minProcessingFeeLevel == expectedMin
-
694 ? test.pass()
-
695 : test.fail(
-
696 "minProcessingFeeLevel: "s +
-
697 std::to_string(metrics.minProcessingFeeLevel.value()) + "/" +
-
698 std::to_string(expectedMin.value()),
-
699 file,
-
700 line);
-
701
-
702 metrics.medFeeLevel == expectedMed
-
703 ? test.pass()
-
704 : test.fail(
-
705 "medFeeLevel: "s + std::to_string(metrics.medFeeLevel.value()) +
-
706 "/" + std::to_string(expectedMed.value()),
-
707 file,
-
708 line);
-
709
-
710 auto const expectedCurFeeLevel = expectedInLedger > expectedPerLedger
-
711 ? expectedMed * expectedInLedger * expectedInLedger /
-
712 (expectedPerLedger * expectedPerLedger)
-
713 : metrics.referenceFeeLevel;
-
714
-
715 metrics.openLedgerFeeLevel == expectedCurFeeLevel
-
716 ? test.pass()
-
717 : test.fail(
-
718 "openLedgerFeeLevel: "s +
-
719 std::to_string(metrics.openLedgerFeeLevel.value()) + "/" +
-
720 std::to_string(expectedCurFeeLevel.value()),
-
721 file,
-
722 line);
-
723}
+
619
+
620} // namespace check
+
621
+ + +
624
+
625template <class Suite>
+
626void
+
+ +
628 Suite& test,
+
629 jtx::Env& env,
+
630 std::size_t expectedCount,
+
631 std::optional<std::size_t> expectedMaxCount,
+
632 std::size_t expectedInLedger,
+
633 std::size_t expectedPerLedger,
+
634 std::uint64_t expectedMinFeeLevel = baseFeeLevel.fee(),
+
635 std::uint64_t expectedMedFeeLevel = minEscalationFeeLevel.fee(),
+ +
637{
+
638 int line = location.line();
+
639 char const* file = location.file_name();
+
640 FeeLevel64 const expectedMin{expectedMinFeeLevel};
+
641 FeeLevel64 const expectedMed{expectedMedFeeLevel};
+
642 auto const metrics = env.app().getTxQ().getMetrics(*env.current());
+
643 using namespace std::string_literals;
+
644
+ +
646 ? test.pass()
+
647 : test.fail(
+
648 "reference: "s +
+
649 std::to_string(metrics.referenceFeeLevel.value()) + "/" +
+ +
651 file,
+
652 line);
+
653
+
654 metrics.txCount == expectedCount
+
655 ? test.pass()
+
656 : test.fail(
+
657 "txCount: "s + std::to_string(metrics.txCount) + "/" +
+
658 std::to_string(expectedCount),
+
659 file,
+
660 line);
+
661
+
662 metrics.txQMaxSize == expectedMaxCount
+
663 ? test.pass()
+
664 : test.fail(
+
665 "txQMaxSize: "s + std::to_string(metrics.txQMaxSize.value_or(0)) +
+
666 "/" + std::to_string(expectedMaxCount.value_or(0)),
+
667 file,
+
668 line);
+
669
+
670 metrics.txInLedger == expectedInLedger
+
671 ? test.pass()
+
672 : test.fail(
+
673 "txInLedger: "s + std::to_string(metrics.txInLedger) + "/" +
+
674 std::to_string(expectedInLedger),
+
675 file,
+
676 line);
+
677
+
678 metrics.txPerLedger == expectedPerLedger
+
679 ? test.pass()
+
680 : test.fail(
+
681 "txPerLedger: "s + std::to_string(metrics.txPerLedger) + "/" +
+
682 std::to_string(expectedPerLedger),
+
683 file,
+
684 line);
+
685
+
686 metrics.minProcessingFeeLevel == expectedMin
+
687 ? test.pass()
+
688 : test.fail(
+
689 "minProcessingFeeLevel: "s +
+
690 std::to_string(metrics.minProcessingFeeLevel.value()) + "/" +
+
691 std::to_string(expectedMin.value()),
+
692 file,
+
693 line);
+
694
+
695 metrics.medFeeLevel == expectedMed
+
696 ? test.pass()
+
697 : test.fail(
+
698 "medFeeLevel: "s + std::to_string(metrics.medFeeLevel.value()) +
+
699 "/" + std::to_string(expectedMed.value()),
+
700 file,
+
701 line);
+
702
+
703 auto const expectedCurFeeLevel = expectedInLedger > expectedPerLedger
+
704 ? expectedMed * expectedInLedger * expectedInLedger /
+
705 (expectedPerLedger * expectedPerLedger)
+
706 : metrics.referenceFeeLevel;
+
707
+
708 metrics.openLedgerFeeLevel == expectedCurFeeLevel
+
709 ? test.pass()
+
710 : test.fail(
+
711 "openLedgerFeeLevel: "s +
+
712 std::to_string(metrics.openLedgerFeeLevel.value()) + "/" +
+
713 std::to_string(expectedCurFeeLevel.value()),
+
714 file,
+
715 line);
+
716}
-
724
-
725/* LoanBroker */
-
726/******************************************************************************/
-
727
-
728namespace loanBroker {
+
717
+
718/* LoanBroker */
+
719/******************************************************************************/
+
720
+
721namespace loanBroker {
+
722
+ +
724set(AccountID const& account, uint256 const& vaultId, std::uint32_t flags = 0);
+
725
+
726// Use "del" because "delete" is a reserved word in C++.
+ +
728del(AccountID const& account, uint256 const& brokerID, std::uint32_t flags = 0);
729
-
731set(AccountID const& account, uint256 const& vaultId, std::uint32_t flags = 0);
-
732
-
733// Use "del" because "delete" is a reserved word in C++.
- -
735del(AccountID const& account, uint256 const& brokerID, std::uint32_t flags = 0);
+ +
732 AccountID const& account,
+
733 uint256 const& brokerID,
+
734 STAmount const& amount,
+
735 std::uint32_t flags = 0);
736
- +
739 AccountID const& account,
740 uint256 const& brokerID,
741 STAmount const& amount,
742 std::uint32_t flags = 0);
743
- - -
746 AccountID const& account,
-
747 uint256 const& brokerID,
-
748 STAmount const& amount,
-
749 std::uint32_t flags = 0);
-
750
-
751// Must specify at least one of loanBrokerID or amount.
- -
753coverClawback(AccountID const& account, std::uint32_t flags = 0);
+
744// Must specify at least one of loanBrokerID or amount.
+ +
746coverClawback(AccountID const& account, std::uint32_t flags = 0);
+
747
+
748auto const loanBrokerID = JTxFieldWrapper<uint256Field>(sfLoanBrokerID);
+
749
+ + +
752
+
753auto const debtMaximum = simpleField<SF_NUMBER>(sfDebtMaximum);
754
-
755auto const loanBrokerID = JTxFieldWrapper<uint256Field>(sfLoanBrokerID);
-
756
- - -
759
-
760auto const debtMaximum = simpleField<SF_NUMBER>(sfDebtMaximum);
-
761
- - + + +
757
+ + +
760
+ +
762
+
763} // namespace loanBroker
764
- - -
767
- -
769
-
770} // namespace loanBroker
-
771
-
772/* Loan */
-
773/******************************************************************************/
-
774namespace loan {
-
775
- -
777set(AccountID const& account,
-
778 uint256 const& loanBrokerID,
-
779 Number principalRequested,
-
780 std::uint32_t flags = 0);
-
781
- -
783
-
784// For `CounterPartySignature`, use `sig(sfCounterpartySignature, ...)`
-
785
-
786auto const loanOriginationFee = simpleField<SF_NUMBER>(sfLoanOriginationFee);
-
787
-
788auto const loanServiceFee = simpleField<SF_NUMBER>(sfLoanServiceFee);
+
765/* Loan */
+
766/******************************************************************************/
+
767namespace loan {
+
768
+ +
770set(AccountID const& account,
+
771 uint256 const& loanBrokerID,
+
772 Number principalRequested,
+
773 std::uint32_t flags = 0);
+
774
+ +
776
+
777// For `CounterPartySignature`, use `sig(sfCounterpartySignature, ...)`
+
778
+
779auto const loanOriginationFee = simpleField<SF_NUMBER>(sfLoanOriginationFee);
+
780
+
781auto const loanServiceFee = simpleField<SF_NUMBER>(sfLoanServiceFee);
+
782
+
783auto const latePaymentFee = simpleField<SF_NUMBER>(sfLatePaymentFee);
+
784
+
785auto const closePaymentFee = simpleField<SF_NUMBER>(sfClosePaymentFee);
+
786
+
787auto const overpaymentFee =
+
789
-
790auto const latePaymentFee = simpleField<SF_NUMBER>(sfLatePaymentFee);
-
791
-
792auto const closePaymentFee = simpleField<SF_NUMBER>(sfClosePaymentFee);
-
793
-
794auto const overpaymentFee =
- -
796
-
797auto const interestRate =
- -
799
- - -
802
- - +
790auto const interestRate =
+ +
792
+ + +
795
+ + +
798
+ +
800 valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfOverpaymentInterestRate);
+
801
+
802auto const paymentTotal = simpleField<SF_UINT32>(sfPaymentTotal);
+
803
+
804auto const paymentInterval = simpleField<SF_UINT32>(sfPaymentInterval);
805
- -
807 valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfOverpaymentInterestRate);
-
808
-
809auto const paymentTotal = simpleField<SF_UINT32>(sfPaymentTotal);
+
806auto const gracePeriod = simpleField<SF_UINT32>(sfGracePeriod);
+
807
+ +
809manage(AccountID const& account, uint256 const& loanID, std::uint32_t flags);
810
-
811auto const paymentInterval = simpleField<SF_UINT32>(sfPaymentInterval);
-
812
-
813auto const gracePeriod = simpleField<SF_UINT32>(sfGracePeriod);
-
814
- -
816manage(AccountID const& account, uint256 const& loanID, std::uint32_t flags);
-
817
- -
819del(AccountID const& account, uint256 const& loanID, std::uint32_t flags = 0);
-
820
- -
822pay(AccountID const& account,
-
823 uint256 const& loanID,
-
824 STAmount const& amount,
-
825 std::uint32_t flags = 0);
-
826
-
827} // namespace loan
-
828
-
829} // namespace jtx
-
830} // namespace test
-
831} // namespace xrpl
-
832
-
833#endif // XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED
+ +
812del(AccountID const& account, uint256 const& loanID, std::uint32_t flags = 0);
+
813
+ +
815pay(AccountID const& account,
+
816 uint256 const& loanID,
+
817 STAmount const& amount,
+
818 std::uint32_t flags = 0);
+
819
+
820} // namespace loan
+
821
+
822} // namespace jtx
+
823} // namespace test
+
824} // namespace xrpl
+
825
+
826#endif // XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED
T begin(T... args)
@@ -1046,74 +1039,75 @@ $(document).ready(function() { init_codefold(0); });
constexpr value_type value() const
Returns the underlying value.
Definition Units.h:325
constexpr value_type fee() const
Returns the number of drops.
Definition Units.h:278
+
T current(T... args)
T end(T... args)
T find(T... args)
T is_same_v
-
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
- - +
Json::Value create(A const &account, A const &dest, STAmount const &sendMax)
Create a check.
+ +
Json::Value coverDeposit(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
- +
Json::Value coverWithdraw(AccountID const &account, uint256 const &brokerID, STAmount const &amount, uint32_t flags)
Json::Value del(AccountID const &account, uint256 const &brokerID, uint32_t flags)
- +
Json::Value coverClawback(AccountID const &account, std::uint32_t flags)
- - - -
auto const loanOriginationFee
-
auto const loanServiceFee
+ + + +
auto const loanOriginationFee
+
auto const loanServiceFee
Json::Value pay(AccountID const &account, uint256 const &loanID, STAmount const &amount, std::uint32_t flags)
- -
auto const paymentInterval
-
auto const overpaymentFee
-
auto const lateInterestRate
-
auto const latePaymentFee
-
auto const overpaymentInterestRate
-
auto const closePaymentFee
+ +
auto const paymentInterval
+
auto const overpaymentFee
+
auto const lateInterestRate
+
auto const latePaymentFee
+
auto const overpaymentInterestRate
+
auto const closePaymentFee
Json::Value manage(AccountID const &account, uint256 const &loanID, std::uint32_t flags)
- -
auto const closeInterestRate
+ +
auto const closeInterestRate
Json::Value del(AccountID const &account, uint256 const &loanID, std::uint32_t flags)
- +
STAmount channelBalance(ReadView const &view, uint256 const &chan)
uint256 channel(AccountID const &account, AccountID const &dst, std::uint32_t seqProxyValue)
Json::Value claim(AccountID const &account, uint256 const &channel, std::optional< STAmount > const &balance, std::optional< STAmount > const &amount, std::optional< Slice > const &signature, std::optional< PublicKey > const &pk)
Json::Value fund(AccountID const &account, uint256 const &channel, STAmount const &amount, std::optional< NetClock::time_point > const &expiration)
bool channelExists(ReadView const &view, uint256 const &chan)
Json::Value create(AccountID const &account, AccountID const &to, STAmount const &amount, NetClock::duration const &settleDelay, PublicKey const &pk, std::optional< NetClock::time_point > const &cancelAfter, std::optional< std::uint32_t > const &dstTag)
-
static constexpr FeeLevel64 baseFeeLevel
-
auto make_vector(Input const &input)
+
static constexpr FeeLevel64 baseFeeLevel
+
auto make_vector(Input const &input)
bool expectLedgerEntryRoot(Env &env, Account const &acct, STAmount const &expectedValue)
Json::Value getAccountOffers(Env &env, AccountID const &acct, bool current)
PrettyAmount xrpMinusFee(Env const &env, std::int64_t xrpAmount)
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
bool expectOffers(Env &env, AccountID const &account, std::uint16_t size, std::vector< Amounts > const &toMatch)
bool expectHolding(Env &env, AccountID const &account, STAmount const &value, bool defaultLimits)
Json::Value ledgerEntryState(Env &env, Account const &acct_a, Account const &acct_b, std::string const &currency)
-
bool same(STPathSet const &st1, Args const &... args)
+
bool same(STPathSet const &st1, Args const &... args)
std::uint32_t ownerCount(Env const &env, Account const &account)
XRPAmount txfee(Env const &env, std::uint16_t n)
STPathElement allpe(AccountID const &a, Issue const &iss)
-
void stpathset_append(STPathSet &st, STPath const &p, Args const &... args)
-
void stpath_append(STPath &st, T const &t, Args const &... args)
+
void stpathset_append(STPathSet &st, STPath const &p, Args const &... args)
+
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), std::source_location const location=std::source_location::current())
+
void stpath_append(STPath &st, T const &t, Args const &... args)
Json::Value accountBalance(Env &env, Account const &acct)
STPathElement IPE(Issue const &iss)
STPathElement cpe(Currency const &c)
Json::Value ledgerEntryRoot(Env &env, Account const &acct)
bool equal(STAmount const &sa1, STAmount const &sa2)
-
auto const amount
+
auto const amount
bool checkArraySize(Json::Value const &val, unsigned int size)
-
STPath stpath(Args const &... args)
+
STPath stpath(Args const &... args)
void stpath_append_one(STPath &st, Account const &account)
void n_offers(Env &env, std::size_t n, Account const &account, STAmount const &in, STAmount const &out)
-
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), source_location const location=source_location::current())
-
bool checkVL(Slice const &result, std::string const &expected)
+
bool checkVL(Slice const &result, std::string const &expected)
Json::Value getAccountLines(Env &env, AccountID const &acctId)
-
static constexpr FeeLevel64 minEscalationFeeLevel
+
static constexpr FeeLevel64 minEscalationFeeLevel
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
TypedField< STAmount > SF_AMOUNT
Definition SField.h:349
@@ -1137,67 +1131,67 @@ $(document).ready(function() { init_codefold(0); });
FeeLevel64 referenceFeeLevel
Reference transaction fee level.
Definition TxQ.h:159
A field with a type known at compile time.
Definition SField.h:304
- -
JF operator()(std::array< std::uint8_t, N > const &c) const
- - - - - -
JTxFieldWrapper(SF const &sfield)
- -
JF operator()(SV const &value) const
- - - - - - - - -
Generic helper class for helper classes that set a field on a JTx.
Definition TestHelpers.h:42
-
JTxField(SF const &sfield, SV const &value)
Definition TestHelpers.h:52
- -
virtual void operator()(Env &, JTx &jt) const
Definition TestHelpers.h:63
- + +
JF operator()(std::array< std::uint8_t, N > const &c) const
+ + + + + +
JTxFieldWrapper(SF const &sfield)
+ +
JF operator()(SV const &value) const
+ + + + + + + + +
Generic helper class for helper classes that set a field on a JTx.
Definition TestHelpers.h:35
+
JTxField(SF const &sfield, SV const &value)
Definition TestHelpers.h:45
+ +
virtual void operator()(Env &, JTx &jt) const
Definition TestHelpers.h:56
+
virtual OV value() const =0
virtual ~JTxField()=default
- - - + + +
Execution context for applying a JSON transaction.
Definition JTx.h:26
Json::Value jv
Definition JTx.h:27
Represents an XRP or IOU quantity This customizes the string conversion and supports XRP conversions ...
- - - - -
accountIDField(SF const &sfield, SV const &value)
- -
blobField(SF const &sfield, Slice const &cond)
-
blobField(SF const &sfield, std::array< std::uint8_t, N > const &c)
- - -
OV value() const override
- -
stAmountField(SF const &sfield, SV const &value)
- - - -
timePointField(SF const &sfield, SV const &value)
- - - -
OV value() const override
- -
uint256Field(SF const &sfield, SV const &value)
- -
unit::ValueUnit< UnitTag, ValueType > SV
- - - - + + + + +
accountIDField(SF const &sfield, SV const &value)
+ +
blobField(SF const &sfield, Slice const &cond)
+
blobField(SF const &sfield, std::array< std::uint8_t, N > const &c)
+ + +
OV value() const override
+ +
stAmountField(SF const &sfield, SV const &value)
+ + + +
timePointField(SF const &sfield, SV const &value)
Definition TestHelpers.h:98
+ + + +
OV value() const override
+ +
uint256Field(SF const &sfield, SV const &value)
+ +
unit::ValueUnit< UnitTag, ValueType > SV
+ + + +
T time_since_epoch(T... args)
T to_string(T... args)
diff --git a/TrustedPublisherServer_8h_source.html b/TrustedPublisherServer_8h_source.html index 346ed3d100..8f4e7e3270 100644 --- a/TrustedPublisherServer_8h_source.html +++ b/TrustedPublisherServer_8h_source.html @@ -905,7 +905,7 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
void write(nudb::detail::ostream &os, std::size_t t)
Definition varint.h:115
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
void sign(Json::Value &jv, Account const &account, Json::Value &sigObject)
Sign automatically into a specific Json field of the jv object.
Definition utility.cpp:27
char const * getEnvLocalhostAddr()
Definition envconfig.h:17
std::shared_ptr< TrustedPublisherServer > make_TrustedPublisherServer(boost::asio::io_context &ioc, std::vector< TrustedPublisherServer::Validator > const &validators, NetClock::time_point validUntil, std::vector< std::pair< NetClock::time_point, NetClock::time_point > > const &futures, bool useSSL=false, int version=1, bool immediateStart=true, int sequence=1)
diff --git a/TxQ__test_8cpp_source.html b/TxQ__test_8cpp_source.html index 6546b93ca5..234768cfe2 100644 --- a/TxQ__test_8cpp_source.html +++ b/TxQ__test_8cpp_source.html @@ -196,7 +196,7 @@ $(document).ready(function() { init_codefold(0); });
101 // transactions as though they are ordinary transactions.
102 auto const flagPerLedger = 1 + xrpl::detail::numUpVotedAmendments();
103 auto const flagMaxQueue = ledgersInQueue * flagPerLedger;
-
104 checkMetrics(*this, env, 0, flagMaxQueue, 0, flagPerLedger);
+
104 checkMetrics(*this, env, 0, flagMaxQueue, 0, flagPerLedger);
105
106 // Pad a couple of txs with normal fees so the median comes
107 // back down to normal
@@ -207,7 +207,7 @@ $(document).ready(function() { init_codefold(0); });
112 // metrics to reset to defaults, EXCEPT the maxQueue size.
113 using namespace std::chrono_literals;
114 env.close(env.now() + 5s, 10000ms);
-
115 checkMetrics(*this, env, 0, flagMaxQueue, 0, expectedPerLedger);
+
115 checkMetrics(*this, env, 0, flagMaxQueue, 0, expectedPerLedger);
116 auto const fees = env.current()->fees();
117 BEAST_EXPECT(fees.base == XRPAmount{base});
118 BEAST_EXPECT(fees.reserve == XRPAmount{reserve});
@@ -241,36 +241,36 @@ $(document).ready(function() { init_codefold(0); });
144 auto queued = ter(terQUEUED);
145 auto const baseFee = env.current()->fees().base.drops();
146
-
147 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
147 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
148
149 // Create several accounts while the fee is cheap so they all apply.
150 env.fund(XRP(50000), noripple(alice, bob, charlie, daria));
-
151 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
151 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
152
153 // Alice - price starts exploding: held
154 env(noop(alice), queued);
-
155 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
+
155 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
156
157 // Bob with really high fee - applies
158 env(noop(bob), fee(openLedgerCost(env)));
-
159 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
+
159 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
160
161 // Daria with low fee: hold
162 env(noop(daria), fee(baseFee * 100), queued);
-
163 checkMetrics(*this, env, 2, std::nullopt, 5, 3);
+
163 checkMetrics(*this, env, 2, std::nullopt, 5, 3);
164
165 env.close();
166 // Verify that the held transactions got applied
-
167 checkMetrics(*this, env, 0, 10, 2, 5);
+
167 checkMetrics(*this, env, 0, 10, 2, 5);
168
170
171 // Make some more accounts. We'll need them later to abuse the queue.
172 env.fund(XRP(50000), noripple(elmo, fred, gwen, hank));
-
173 checkMetrics(*this, env, 0, 10, 6, 5);
+
173 checkMetrics(*this, env, 0, 10, 6, 5);
174
175 // Now get a bunch of transactions held.
176 env(noop(alice), fee(baseFee * 1.2), queued);
-
177 checkMetrics(*this, env, 1, 10, 6, 5);
+
177 checkMetrics(*this, env, 1, 10, 6, 5);
178
179 env(noop(bob), fee(baseFee), queued); // won't clear the queue
180 env(noop(charlie), fee(baseFee * 2), queued);
@@ -279,11 +279,11 @@ $(document).ready(function() { init_codefold(0); });
183 env(noop(fred), fee(baseFee * 1.9), queued);
184 env(noop(gwen), fee(baseFee * 1.6), queued);
185 env(noop(hank), fee(baseFee * 1.8), queued);
-
186 checkMetrics(*this, env, 8, 10, 6, 5);
+
186 checkMetrics(*this, env, 8, 10, 6, 5);
187
188 env.close();
189 // Verify that the held transactions got applied
-
190 checkMetrics(*this, env, 1, 12, 7, 6);
+
190 checkMetrics(*this, env, 1, 12, 7, 6);
191
192 // Bob's transaction is still stuck in the queue.
193
@@ -291,45 +291,45 @@ $(document).ready(function() { init_codefold(0); });
196 // Hank sends another txn
197 env(noop(hank), fee(baseFee), queued);
198 // But he's not going to leave it in the queue
-
199 checkMetrics(*this, env, 2, 12, 7, 6);
+
199 checkMetrics(*this, env, 2, 12, 7, 6);
200
201 // Hank sees his txn got held and bumps the fee,
202 // but doesn't even bump it enough to requeue
203 env(noop(hank), fee(baseFee * 1.1), ter(telCAN_NOT_QUEUE_FEE));
-
204 checkMetrics(*this, env, 2, 12, 7, 6);
+
204 checkMetrics(*this, env, 2, 12, 7, 6);
205
206 // Hank sees his txn got held and bumps the fee,
207 // enough to requeue, but doesn't bump it enough to
208 // apply to the ledger
209 env(noop(hank), fee(baseFee * 600), queued);
210 // But he's not going to leave it in the queue
-
211 checkMetrics(*this, env, 2, 12, 7, 6);
+
211 checkMetrics(*this, env, 2, 12, 7, 6);
212
213 // Hank sees his txn got held and bumps the fee,
214 // high enough to get into the open ledger, because
215 // he doesn't want to wait.
216 env(noop(hank), fee(openLedgerCost(env)));
-
217 checkMetrics(*this, env, 1, 12, 8, 6);
+
217 checkMetrics(*this, env, 1, 12, 8, 6);
218
219 // Hank then sends another, less important txn
220 // (In addition to the metrics, this will verify that
221 // the original txn got removed.)
222 env(noop(hank), fee(baseFee * 2), queued);
-
223 checkMetrics(*this, env, 2, 12, 8, 6);
+
223 checkMetrics(*this, env, 2, 12, 8, 6);
224
225 env.close();
226
227 // Verify that bob and hank's txns were applied
-
228 checkMetrics(*this, env, 0, 16, 2, 8);
+
228 checkMetrics(*this, env, 0, 16, 2, 8);
229
230 // Close again with a simulated time leap to
231 // reset the escalation limit down to minimum
232 env.close(env.now() + 5s, 10000ms);
-
233 checkMetrics(*this, env, 0, 16, 0, 3);
+
233 checkMetrics(*this, env, 0, 16, 0, 3);
234 // Then close once more without the time leap
235 // to reset the queue maxsize down to minimum
236 env.close();
-
237 checkMetrics(*this, env, 0, 6, 0, 3);
+
237 checkMetrics(*this, env, 0, 6, 0, 3);
238
240
241 constexpr auto largeFeeMultiplier = 700;
@@ -341,7 +341,7 @@ $(document).ready(function() { init_codefold(0); });
247 env(noop(gwen), fee(largeFee));
248 env(noop(fred), fee(largeFee));
249 env(noop(elmo), fee(largeFee));
-
250 checkMetrics(*this, env, 0, 6, 4, 3);
+
250 checkMetrics(*this, env, 0, 6, 4, 3);
251
252 // Use explicit fees so we can control which txn
253 // will get dropped
@@ -357,7 +357,7 @@ $(document).ready(function() { init_codefold(0); });
263
264 // Queue is full now.
265 // clang-format off
-
266 checkMetrics(*this, env, 6, 6, 4, 3, txFeeLevelByAccount(env, daria) + 1);
+
266 checkMetrics(*this, env, 6, 6, 4, 3, txFeeLevelByAccount(env, daria) + 1);
267 // clang-format on
268 // Try to add another transaction with the default (low) fee,
269 // it should fail because the queue is full.
@@ -370,7 +370,7 @@ $(document).ready(function() { init_codefold(0); });
276
277 // Queue is still full, of course, but the min fee has gone up
278 // clang-format off
-
279 checkMetrics(*this, env, 6, 6, 4, 3, txFeeLevelByAccount(env, elmo) + 1);
+
279 checkMetrics(*this, env, 6, 6, 4, 3, txFeeLevelByAccount(env, elmo) + 1);
280 // clang-format on
281
282 // Close out the ledger, the transactions are accepted, the
@@ -379,11 +379,11 @@ $(document).ready(function() { init_codefold(0); });
285 // is put back in. Neat.
286 env.close();
287 // clang-format off
-
288 checkMetrics(*this, env, 2, 8, 5, 4, baseFeeLevel.fee(), calcMedFeeLevel(FeeLevel64{baseFeeLevel.fee() * largeFeeMultiplier}));
+
288 checkMetrics(*this, env, 2, 8, 5, 4, baseFeeLevel.fee(), calcMedFeeLevel(FeeLevel64{baseFeeLevel.fee() * largeFeeMultiplier}));
289 // clang-format on
290
291 env.close();
-
292 checkMetrics(*this, env, 0, 10, 2, 5);
+
292 checkMetrics(*this, env, 0, 10, 2, 5);
293
295
296 // Attempt to put a transaction in the queue for an account
@@ -396,10 +396,10 @@ $(document).ready(function() { init_codefold(0); });
303 env(noop(daria));
304 env(pay(alice, iris, XRP(1000)), queued);
305 env(noop(iris), seq(1), fee(baseFee * 2), ter(terNO_ACCOUNT));
-
306 checkMetrics(*this, env, 1, 10, 6, 5);
+
306 checkMetrics(*this, env, 1, 10, 6, 5);
307
308 env.close();
-
309 checkMetrics(*this, env, 0, 12, 1, 6);
+
309 checkMetrics(*this, env, 0, 12, 1, 6);
310
311 env.require(balance(iris, XRP(1000)));
312 BEAST_EXPECT(env.seq(iris) == 11);
@@ -423,7 +423,7 @@ $(document).ready(function() { init_codefold(0); });
331 env(noop(env.master), fee(baseFee * 2), queued);
332 ++metrics.txCount;
333
- +
335 *this,
336 env,
337 metrics.txCount,
@@ -447,14 +447,14 @@ $(document).ready(function() { init_codefold(0); });
353 auto queued = ter(terQUEUED);
354 auto const baseFee = env.current()->fees().base.drops();
355
-
356 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
356 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
357
358 // Fund alice and then fill the ledger.
359 env.fund(XRP(50000), noripple(alice));
360 env(noop(alice));
361 env(noop(alice));
362 env(noop(alice));
-
363 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
363 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
364
366
367 // Alice requests tickets, but that transaction is queued. So
@@ -465,11 +465,11 @@ $(document).ready(function() { init_codefold(0); });
372 env(noop(alice), ticket::use(tkt1 - 2), ter(tefNO_TICKET));
373 env(noop(alice), ticket::use(tkt1 - 1), ter(terPRE_TICKET));
374 env.require(owners(alice, 0), tickets(alice, 0));
-
375 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
+
375 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
376
377 env.close();
378 env.require(owners(alice, 250), tickets(alice, 250));
-
379 checkMetrics(*this, env, 0, 8, 1, 4);
+
379 checkMetrics(*this, env, 0, 8, 1, 4);
380 BEAST_EXPECT(env.seq(alice) == tkt1 + 250);
381
383
@@ -496,7 +496,7 @@ $(document).ready(function() { init_codefold(0); });
404 ticket::use(tkt1 + 13),
405 fee(baseFee * 2.3),
-
407 checkMetrics(*this, env, 8, 8, 5, 4, expectedMinFeeLevel);
+
407 checkMetrics(*this, env, 8, 8, 5, 4, expectedMinFeeLevel);
408
409 // Check which of the queued transactions got into the ledger by
410 // attempting to replace them.
@@ -528,7 +528,7 @@ $(document).ready(function() { init_codefold(0); });
436 // the queue.
437 env(noop(alice), ticket::use(tkt1 + 13), ter(telCAN_NOT_QUEUE_FEE));
438
-
439 checkMetrics(*this, env, 3, 10, 6, 5);
+
439 checkMetrics(*this, env, 3, 10, 6, 5);
440
442
443 // Do some experiments with putting sequence-based transactions
@@ -558,7 +558,7 @@ $(document).ready(function() { init_codefold(0); });
467 env(noop(alice), seq(nextSeq + 5), queued);
468 env(noop(alice), seq(nextSeq + 6), queued);
469 env(noop(alice), seq(nextSeq + 7), ter(telCAN_NOT_QUEUE_FULL));
-
470 checkMetrics(*this, env, 10, 10, 6, 5, 257);
+
470 checkMetrics(*this, env, 10, 10, 6, 5, 257);
471
472 // Check which of the queued transactions got into the ledger by
473 // attempting to replace them.
@@ -586,7 +586,7 @@ $(document).ready(function() { init_codefold(0); });
495 env(noop(alice), seq(nextSeq + 6), ter(telCAN_NOT_QUEUE_FEE));
496 env(noop(alice), seq(nextSeq + 7), ter(telCAN_NOT_QUEUE_FEE));
497
-
498 checkMetrics(*this, env, 4, 12, 7, 6);
+
498 checkMetrics(*this, env, 4, 12, 7, 6);
499 BEAST_EXPECT(env.seq(alice) == nextSeq + 4);
500
502
@@ -616,7 +616,7 @@ $(document).ready(function() { init_codefold(0); });
526 fee(baseFee * 2.1),
528
-
529 checkMetrics(*this, env, 10, 12, 7, 6);
+
529 checkMetrics(*this, env, 10, 12, 7, 6);
530
531 env.close();
532 env.require(owners(alice, 231), tickets(alice, 231));
@@ -647,7 +647,7 @@ $(document).ready(function() { init_codefold(0); });
557 env(noop(alice), seq(nextSeq + 7), ter(telCAN_NOT_QUEUE_FEE));
558
559 BEAST_EXPECT(env.seq(alice) == nextSeq + 6);
-
560 checkMetrics(*this, env, 6, 14, 8, 7);
+
560 checkMetrics(*this, env, 6, 14, 8, 7);
561
563
564 // Since we still have two ticket-based transactions in the queue
@@ -685,7 +685,7 @@ $(document).ready(function() { init_codefold(0); });
596 env(noop(alice), seq(nextSeq + 7), ter(tefPAST_SEQ));
597
598 BEAST_EXPECT(env.seq(alice) == nextSeq + 8);
-
599 checkMetrics(*this, env, 0, 16, 6, 8);
+
599 checkMetrics(*this, env, 0, 16, 6, 8);
600 }
601
@@ -702,28 +702,28 @@ $(document).ready(function() { init_codefold(0); });
611 auto gw = Account("gw");
612 auto USD = gw["USD"];
613
-
614 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
614 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
615
616 // Create accounts
617 env.fund(XRP(50000), noripple(alice, gw));
-
618 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
+
618 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
619 env.close();
-
620 checkMetrics(*this, env, 0, 4, 0, 2);
+
620 checkMetrics(*this, env, 0, 4, 0, 2);
621
622 // Alice creates an unfunded offer while the ledger is not full
623 env(offer(alice, XRP(1000), USD(1000)), ter(tecUNFUNDED_OFFER));
-
624 checkMetrics(*this, env, 0, 4, 1, 2);
+
624 checkMetrics(*this, env, 0, 4, 1, 2);
625
626 fillQueue(env, alice);
-
627 checkMetrics(*this, env, 0, 4, 3, 2);
+
627 checkMetrics(*this, env, 0, 4, 3, 2);
628
629 // Alice creates an unfunded offer that goes in the queue
630 env(offer(alice, XRP(1000), USD(1000)), ter(terQUEUED));
-
631 checkMetrics(*this, env, 1, 4, 3, 2);
+
631 checkMetrics(*this, env, 1, 4, 3, 2);
632
633 // The offer comes out of the queue
634 env.close();
-
635 checkMetrics(*this, env, 0, 6, 1, 3);
+
635 checkMetrics(*this, env, 0, 6, 1, 3);
636 }
637
@@ -744,44 +744,44 @@ $(document).ready(function() { init_codefold(0); });
651 auto queued = ter(terQUEUED);
652 auto const baseFee = env.current()->fees().base.drops();
653
-
654 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
654 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
655
656 // Create several accounts while the fee is cheap so they all apply.
657 env.fund(XRP(50000), noripple(alice, bob, charlie));
-
658 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
658 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
659
660 // Future transaction for Alice - fails
661 env(noop(alice),
662 fee(openLedgerCost(env)),
663 seq(env.seq(alice) + 1),
664 ter(terPRE_SEQ));
-
665 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
665 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
666
667 // Current transaction for Alice: held
668 env(noop(alice), queued);
-
669 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
669 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
670
671 // Alice - sequence is too far ahead, so won't queue.
672 env(noop(alice), seq(env.seq(alice) + 2), ter(telCAN_NOT_QUEUE));
-
673 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
673 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
674
675 // Bob with really high fee - applies
676 env(noop(bob), fee(openLedgerCost(env)));
-
677 checkMetrics(*this, env, 1, std::nullopt, 4, 2);
+
677 checkMetrics(*this, env, 1, std::nullopt, 4, 2);
678
679 // Daria with low fee: hold
680 env(noop(charlie), fee(baseFee * 100), queued);
-
681 checkMetrics(*this, env, 2, std::nullopt, 4, 2);
+
681 checkMetrics(*this, env, 2, std::nullopt, 4, 2);
682
683 // Alice with normal fee: hold
684 env(noop(alice), seq(env.seq(alice) + 1), queued);
-
685 checkMetrics(*this, env, 3, std::nullopt, 4, 2);
+
685 checkMetrics(*this, env, 3, std::nullopt, 4, 2);
686
687 env.close();
688 // Verify that the held transactions got applied
689 // Alice's bad transaction applied from the
690 // Local Txs.
-
691 checkMetrics(*this, env, 0, 8, 4, 4);
+
691 checkMetrics(*this, env, 0, 8, 4, 4);
692 }
693
@@ -805,7 +805,7 @@ $(document).ready(function() { init_codefold(0); });
710 auto queued = ter(terQUEUED);
711 auto const baseFee = env.current()->fees().base.drops();
712
-
713 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
713 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
714
715 // Fund across several ledgers so the TxQ metrics stay restricted.
716 env.fund(XRP(1000), noripple(alice, bob));
@@ -815,11 +815,11 @@ $(document).ready(function() { init_codefold(0); });
720 env.fund(XRP(1000), noripple(edgar, felicia));
721 env.close(env.now() + 5s, 10000ms);
722
-
723 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
723 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
724 env(noop(bob));
725 env(noop(charlie));
726 env(noop(daria));
-
727 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
727 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
728
729 BEAST_EXPECT(env.current()->header().seq == 6);
730 // Fail to queue an item with a low LastLedgerSeq
@@ -836,7 +836,7 @@ $(document).ready(function() { init_codefold(0); });
741 env(noop(charlie), fee(largeFee), queued);
742 env(noop(daria), fee(largeFee), queued);
743 env(noop(edgar), fee(largeFee), queued);
-
744 checkMetrics(*this, env, 5, std::nullopt, 3, 2);
+
744 checkMetrics(*this, env, 5, std::nullopt, 3, 2);
745 {
746 auto& txQ = env.app().getTxQ();
747 auto aliceStat = txQ.getAccountTxs(alice.id());
@@ -860,7 +860,7 @@ $(document).ready(function() { init_codefold(0); });
765 }
766
767 env.close();
-
768 checkMetrics(*this, env, 1, 6, 4, 3);
+
768 checkMetrics(*this, env, 1, 6, 4, 3);
769
770 // Keep alice's transaction waiting.
771 env(noop(bob), fee(largeFee), queued);
@@ -868,12 +868,12 @@ $(document).ready(function() { init_codefold(0); });
773 env(noop(daria), fee(largeFee), queued);
774 env(noop(edgar), fee(largeFee), queued);
775 env(noop(felicia), fee(largeFee - 1), queued);
-
776 checkMetrics(*this, env, 6, 6, 4, 3, 257);
+
776 checkMetrics(*this, env, 6, 6, 4, 3, 257);
777
778 env.close();
779 // alice's transaction is still hanging around
780 // clang-format off
-
781 checkMetrics(*this, env, 1, 8, 5, 4, baseFeeLevel.fee(), baseFeeLevel.fee() * largeFeeMultiplier);
+
781 checkMetrics(*this, env, 1, 8, 5, 4, baseFeeLevel.fee(), baseFeeLevel.fee() * largeFeeMultiplier);
782 // clang-format on
783 BEAST_EXPECT(env.seq(alice) == 3);
784
@@ -888,7 +888,7 @@ $(document).ready(function() { init_codefold(0); });
793 env(noop(edgar), fee(anotherLargeFee), queued);
794 env(noop(felicia), fee(anotherLargeFee - 1), queued);
795 env(noop(felicia), fee(anotherLargeFee - 1), seq(env.seq(felicia) + 1), queued);
-
796 checkMetrics(*this, env, 8, 8, 5, 4, baseFeeLevel.fee() + 1, baseFeeLevel.fee() * largeFeeMultiplier);
+
796 checkMetrics(*this, env, 8, 8, 5, 4, baseFeeLevel.fee() + 1, baseFeeLevel.fee() * largeFeeMultiplier);
797 // clang-format on
798
799 env.close();
@@ -896,7 +896,7 @@ $(document).ready(function() { init_codefold(0); });
801 // into the ledger, so her transaction is gone,
802 // though one of felicia's is still in the queue.
803 // clang-format off
-
804 checkMetrics(*this, env, 1, 10, 6, 5, baseFeeLevel.fee(), baseFeeLevel.fee() * largeFeeMultiplier);
+
804 checkMetrics(*this, env, 1, 10, 6, 5, baseFeeLevel.fee(), baseFeeLevel.fee() * largeFeeMultiplier);
805 // clang-format on
806 BEAST_EXPECT(env.seq(alice) == 3);
807 BEAST_EXPECT(env.seq(felicia) == 7);
@@ -904,7 +904,7 @@ $(document).ready(function() { init_codefold(0); });
809 env.close();
810 // And now the queue is empty
811 // clang-format off
-
812 checkMetrics(*this, env, 0, 12, 1, 6, baseFeeLevel.fee(), baseFeeLevel.fee() * anotherLargeFeeMultiplier);
+
812 checkMetrics(*this, env, 0, 12, 1, 6, baseFeeLevel.fee(), baseFeeLevel.fee() * anotherLargeFeeMultiplier);
813 // clang-format on
814 BEAST_EXPECT(env.seq(alice) == 3);
815 BEAST_EXPECT(env.seq(felicia) == 8);
@@ -928,7 +928,7 @@ $(document).ready(function() { init_codefold(0); });
831 auto queued = ter(terQUEUED);
832 auto const baseFee = env.current()->fees().base.drops();
833
-
834 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
834 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
835
836 // Fund across several ledgers so the TxQ metrics stay restricted.
837 env.fund(XRP(1000), noripple(alice, bob));
@@ -940,21 +940,21 @@ $(document).ready(function() { init_codefold(0); });
843 env(noop(alice));
844 env(noop(alice));
845 env(noop(alice));
-
846 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
846 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
847
848 env(noop(bob), queued);
-
849 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
849 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
850
851 // Since Alice's queue is empty this blocker can go into her queue.
852 env(regkey(alice, bob), fee(0), queued);
-
853 checkMetrics(*this, env, 2, std::nullopt, 3, 2);
+
853 checkMetrics(*this, env, 2, std::nullopt, 3, 2);
854
855 // Close out this ledger so we can get a maxsize
856 env.close();
-
857 checkMetrics(*this, env, 0, 6, 2, 3);
+
857 checkMetrics(*this, env, 0, 6, 2, 3);
858
859 fillQueue(env, alice);
-
860 checkMetrics(*this, env, 0, 6, 4, 3);
+
860 checkMetrics(*this, env, 0, 6, 4, 3);
861
862 constexpr auto aliceFeeMultiplier = 3;
863 auto feeAlice = baseFee * aliceFeeMultiplier;
@@ -965,12 +965,12 @@ $(document).ready(function() { init_codefold(0); });
868 feeAlice = (feeAlice + 1) * 125 / 100;
869 ++seqAlice;
870 }
-
871 checkMetrics(*this, env, 4, 6, 4, 3);
+
871 checkMetrics(*this, env, 4, 6, 4, 3);
872
873 // Bob adds a zero fee blocker to his queue.
874 auto const seqBob = env.seq(bob);
875 env(regkey(bob, alice), fee(0), queued);
-
876 checkMetrics(*this, env, 5, 6, 4, 3);
+
876 checkMetrics(*this, env, 5, 6, 4, 3);
877
878 // Carol fills the queue.
879 auto feeCarol = feeAlice;
@@ -982,7 +982,7 @@ $(document).ready(function() { init_codefold(0); });
885 ++seqCarol;
886 }
887 // clang-format off
-
888 checkMetrics(*this, env, 6, 6, 4, 3, baseFeeLevel.fee() * aliceFeeMultiplier + 1);
+
888 checkMetrics(*this, env, 6, 6, 4, 3, baseFeeLevel.fee() * aliceFeeMultiplier + 1);
889 // clang-format on
890
891 // Carol submits high enough to beat Bob's average fee which kicks
@@ -994,20 +994,20 @@ $(document).ready(function() { init_codefold(0); });
897 env.close();
898 // Some of Alice's transactions stay in the queue. Bob's
899 // transaction returns to the TxQ.
-
900 checkMetrics(*this, env, 5, 8, 5, 4);
+
900 checkMetrics(*this, env, 5, 8, 5, 4);
901 BEAST_EXPECT(env.seq(alice) == seqAlice - 4);
902 BEAST_EXPECT(env.seq(bob) == seqBob);
903 BEAST_EXPECT(env.seq(carol) == seqCarol + 1);
904
905 env.close();
906 // The remaining queued transactions flush through to the ledger.
-
907 checkMetrics(*this, env, 0, 10, 5, 5);
+
907 checkMetrics(*this, env, 0, 10, 5, 5);
908 BEAST_EXPECT(env.seq(alice) == seqAlice);
909 BEAST_EXPECT(env.seq(bob) == seqBob + 1);
910 BEAST_EXPECT(env.seq(carol) == seqCarol + 1);
911
912 env.close();
-
913 checkMetrics(*this, env, 0, 10, 0, 5);
+
913 checkMetrics(*this, env, 0, 10, 0, 5);
914 BEAST_EXPECT(env.seq(alice) == seqAlice);
915 BEAST_EXPECT(env.seq(bob) == seqBob + 1);
916 BEAST_EXPECT(env.seq(carol) == seqCarol + 1);
@@ -1057,19 +1057,19 @@ $(document).ready(function() { init_codefold(0); });
956
957 auto queued = ter(terQUEUED);
958
-
959 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
959 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
960
961 env.fund(XRP(1000), noripple(alice, bob));
962
-
963 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
+
963 checkMetrics(*this, env, 0, std::nullopt, 2, 2);
964
965 // Fill the ledger
966 env(noop(alice));
-
967 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
+
967 checkMetrics(*this, env, 0, std::nullopt, 3, 2);
968
969 // Put a transaction in the queue
970 env(noop(alice), queued);
-
971 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
+
971 checkMetrics(*this, env, 1, std::nullopt, 3, 2);
972
973 // Now cheat, and bypass the queue.
974 {
@@ -1087,12 +1087,12 @@ $(document).ready(function() { init_codefold(0); });
986 });
987 env.postconditions(jt, parsed);
988 }
-
989 checkMetrics(*this, env, 1, std::nullopt, 4, 2);
+
989 checkMetrics(*this, env, 1, std::nullopt, 4, 2);
990
991 env.close();
992 // Alice's queued transaction failed in TxQ::accept
993 // with tefPAST_SEQ
-
994 checkMetrics(*this, env, 0, 8, 0, 4);
+
994 checkMetrics(*this, env, 0, 8, 0, 4);
995 }
996
@@ -1116,7 +1116,7 @@ $(document).ready(function() { init_codefold(0); });
1013
1014 auto queued = ter(terQUEUED);
1015
-
1016 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
1016 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
1017
1018 // ledgers in queue is 2 because of makeConfig
1019 auto const initQueueMax = initFee(env, 3, 2, 10, 200, 50);
@@ -1124,11 +1124,11 @@ $(document).ready(function() { init_codefold(0); });
1021 // Create several accounts while the fee is cheap so they all apply.
1022 env.fund(drops(2000), noripple(alice));
1023 env.fund(XRP(500000), noripple(bob, charlie, daria));
-
1024 checkMetrics(*this, env, 0, initQueueMax, 4, 3);
+
1024 checkMetrics(*this, env, 0, initQueueMax, 4, 3);
1025
1026 // Alice - price starts exploding: held
1027 env(noop(alice), fee(11), queued);
-
1028 checkMetrics(*this, env, 1, initQueueMax, 4, 3);
+
1028 checkMetrics(*this, env, 1, initQueueMax, 4, 3);
1029
1030 auto aliceSeq = env.seq(alice);
1031 auto bobSeq = env.seq(bob);
@@ -1136,28 +1136,28 @@ $(document).ready(function() { init_codefold(0); });
1033
1034 // Alice - try to queue a second transaction, but leave a gap
1035 env(noop(alice), seq(aliceSeq + 2), fee(100), ter(telCAN_NOT_QUEUE));
-
1036 checkMetrics(*this, env, 1, initQueueMax, 4, 3);
+
1036 checkMetrics(*this, env, 1, initQueueMax, 4, 3);
1037
1038 // Alice - queue a second transaction. Yay!
1039 env(noop(alice), seq(aliceSeq + 1), fee(13), queued);
-
1040 checkMetrics(*this, env, 2, initQueueMax, 4, 3);
+
1040 checkMetrics(*this, env, 2, initQueueMax, 4, 3);
1041
1042 // Alice - queue a third transaction. Yay.
1043 env(noop(alice), seq(aliceSeq + 2), fee(17), queued);
-
1044 checkMetrics(*this, env, 3, initQueueMax, 4, 3);
+
1044 checkMetrics(*this, env, 3, initQueueMax, 4, 3);
1045
1046 // Bob - queue a transaction
1047 env(noop(bob), queued);
-
1048 checkMetrics(*this, env, 4, initQueueMax, 4, 3);
+
1048 checkMetrics(*this, env, 4, initQueueMax, 4, 3);
1049
1050 // Bob - queue a second transaction
1051 env(noop(bob), seq(bobSeq + 1), fee(50), queued);
-
1052 checkMetrics(*this, env, 5, initQueueMax, 4, 3);
+
1052 checkMetrics(*this, env, 5, initQueueMax, 4, 3);
1053
1054 // Charlie - queue a transaction, with a higher fee
1055 // than default
1056 env(noop(charlie), fee(15), queued);
-
1057 checkMetrics(*this, env, 6, initQueueMax, 4, 3, 257);
+
1057 checkMetrics(*this, env, 6, initQueueMax, 4, 3, 257);
1058
1059 BEAST_EXPECT(env.seq(alice) == aliceSeq);
1060 BEAST_EXPECT(env.seq(bob) == bobSeq);
@@ -1166,7 +1166,7 @@ $(document).ready(function() { init_codefold(0); });
1063 env.close();
1064 // Verify that all of but one of the queued transactions
1065 // got applied.
-
1066 checkMetrics(*this, env, 1, 8, 5, 4);
+
1066 checkMetrics(*this, env, 1, 8, 5, 4);
1067
1068 // Verify that the stuck transaction is Bob's second.
1069 // Even though it had a higher fee than Alice's and
@@ -1188,7 +1188,7 @@ $(document).ready(function() { init_codefold(0); });
1085 queued);
1086 ++aliceSeq;
1087 }
-
1088 checkMetrics(*this, env, 8, 8, 5, 4, 513);
+
1088 checkMetrics(*this, env, 8, 8, 5, 4, 513);
1089 {
1090 auto& txQ = env.app().getTxQ();
1091 auto aliceStat = txQ.getAccountTxs(alice.id());
@@ -1219,24 +1219,24 @@ $(document).ready(function() { init_codefold(0); });
1116 json(jss::LastLedgerSequence, lastLedgerSeq + 7),
1117 fee(aliceFee),
-
1119 checkMetrics(*this, env, 8, 8, 5, 4, 513);
+
1119 checkMetrics(*this, env, 8, 8, 5, 4, 513);
1120
1121 // Charlie - try to add another item to the queue,
1122 // which fails because fee is lower than Alice's
1123 // queued average.
1124 env(noop(charlie), fee(19), ter(telCAN_NOT_QUEUE_FULL));
-
1125 checkMetrics(*this, env, 8, 8, 5, 4, 513);
+
1125 checkMetrics(*this, env, 8, 8, 5, 4, 513);
1126
1127 // Charlie - add another item to the queue, which
1128 // causes Alice's last txn to drop
1129 env(noop(charlie), fee(30), queued);
-
1130 checkMetrics(*this, env, 8, 8, 5, 4, 538);
+
1130 checkMetrics(*this, env, 8, 8, 5, 4, 538);
1131
1132 // Alice - now attempt to add one more to the queue,
1133 // which fails because the last tx was dropped, so
1134 // there is no complete chain.
1135 env(noop(alice), seq(aliceSeq), fee(aliceFee), ter(telCAN_NOT_QUEUE));
-
1136 checkMetrics(*this, env, 8, 8, 5, 4, 538);
+
1136 checkMetrics(*this, env, 8, 8, 5, 4, 538);
1137
1138 // Alice wants this tx more than the dropped tx,
1139 // so resubmits with higher fee, but the queue
@@ -1245,7 +1245,7 @@ $(document).ready(function() { init_codefold(0); });
1142 seq(aliceSeq - 1),
1143 fee(aliceFee),
-
1145 checkMetrics(*this, env, 8, 8, 5, 4, 538);
+
1145 checkMetrics(*this, env, 8, 8, 5, 4, 538);
1146
1147 // Try to replace a middle item in the queue
1148 // without enough fee.
@@ -1255,18 +1255,18 @@ $(document).ready(function() { init_codefold(0); });
1152 seq(aliceSeq),
1153 fee(aliceFee),
-
1155 checkMetrics(*this, env, 8, 8, 5, 4, 538);
+
1155 checkMetrics(*this, env, 8, 8, 5, 4, 538);
1156
1157 // Replace a middle item from the queue successfully
1158 ++aliceFee;
1159 env(noop(alice), seq(aliceSeq), fee(aliceFee), queued);
-
1160 checkMetrics(*this, env, 8, 8, 5, 4, 538);
+
1160 checkMetrics(*this, env, 8, 8, 5, 4, 538);
1161
1162 env.close();
1163 // Alice's transactions processed, along with
1164 // Charlie's, and the lost one is replayed and
1165 // added back to the queue.
-
1166 checkMetrics(*this, env, 4, 10, 6, 5);
+
1166 checkMetrics(*this, env, 4, 10, 6, 5);
1167
1168 aliceSeq = env.seq(alice) + 1;
1169
@@ -1280,18 +1280,18 @@ $(document).ready(function() { init_codefold(0); });
1177 seq(aliceSeq),
1178 fee(aliceFee),
-
1180 checkMetrics(*this, env, 4, 10, 6, 5);
+
1180 checkMetrics(*this, env, 4, 10, 6, 5);
1181
1182 // Try to spend more than Alice can afford with all the other txs.
1183 aliceSeq += 2;
1184 env(noop(alice), seq(aliceSeq), fee(aliceFee), ter(terINSUF_FEE_B));
-
1185 checkMetrics(*this, env, 4, 10, 6, 5);
+
1185 checkMetrics(*this, env, 4, 10, 6, 5);
1186
1187 // Replace the last queued item with a transaction that will
1188 // bankrupt Alice
1189 --aliceFee;
1190 env(noop(alice), seq(aliceSeq), fee(aliceFee), queued);
-
1191 checkMetrics(*this, env, 4, 10, 6, 5);
+
1191 checkMetrics(*this, env, 4, 10, 6, 5);
1192
1193 // Alice - Attempt to queue a last transaction, but it
1194 // fails because the fee in flight is too high, before
@@ -1302,14 +1302,14 @@ $(document).ready(function() { init_codefold(0); });
1199 seq(aliceSeq),
1200 fee(aliceFee),
-
1202 checkMetrics(*this, env, 4, 10, 6, 5);
+
1202 checkMetrics(*this, env, 4, 10, 6, 5);
1203
1204 env.close();
1205 // All of Alice's transactions applied.
-
1206 checkMetrics(*this, env, 0, 12, 4, 6);
+
1206 checkMetrics(*this, env, 0, 12, 4, 6);
1207
1208 env.close();
-
1209 checkMetrics(*this, env, 0, 12, 0, 6);
+
1209 checkMetrics(*this, env, 0, 12, 0, 6);
1210
1211 // Alice is broke
1212 env.require(balance(alice, XRP(0)));
@@ -1319,17 +1319,17 @@ $(document).ready(function() { init_codefold(0); });
1216 // account limit (10) txs.
1217 fillQueue(env, bob);
1218 bobSeq = env.seq(bob);
-
1219 checkMetrics(*this, env, 0, 12, 7, 6);
+
1219 checkMetrics(*this, env, 0, 12, 7, 6);
1220 for (int i = 0; i < 10; ++i)
1221 env(noop(bob), seq(bobSeq + i), queued);
-
1222 checkMetrics(*this, env, 10, 12, 7, 6);
+
1222 checkMetrics(*this, env, 10, 12, 7, 6);
1223 // Bob hit the single account limit
1224 env(noop(bob), seq(bobSeq + 10), ter(telCAN_NOT_QUEUE_FULL));
-
1225 checkMetrics(*this, env, 10, 12, 7, 6);
+
1225 checkMetrics(*this, env, 10, 12, 7, 6);
1226 // Bob can replace one of the earlier txs regardless
1227 // of the limit
1228 env(noop(bob), seq(bobSeq + 5), fee(20), queued);
-
1229 checkMetrics(*this, env, 10, 12, 7, 6);
+
1229 checkMetrics(*this, env, 10, 12, 7, 6);
1230
1231 // Try to replace a middle item in the queue
1232 // with enough fee to bankrupt bob and make the
@@ -1340,7 +1340,7 @@ $(document).ready(function() { init_codefold(0); });
1237 seq(bobSeq + 5),
1238 fee(bobFee),
-
1240 checkMetrics(*this, env, 10, 12, 7, 6);
+
1240 checkMetrics(*this, env, 10, 12, 7, 6);
1241
1242 // Attempt to replace a middle item in the queue with enough fee
1243 // to bankrupt bob, and also to use fee averaging to clear out the
@@ -1354,14 +1354,14 @@ $(document).ready(function() { init_codefold(0); });
1251 seq(bobSeq + 5),
1252 fee(bobFee),
-
1254 checkMetrics(*this, env, 10, 12, 7, 6);
+
1254 checkMetrics(*this, env, 10, 12, 7, 6);
1255
1256 // Close the ledger and verify that the queued transactions succeed
1257 // and bob has the right ending balance.
1258 env.close();
-
1259 checkMetrics(*this, env, 3, 14, 8, 7);
+
1259 checkMetrics(*this, env, 3, 14, 8, 7);
1260 env.close();
-
1261 checkMetrics(*this, env, 0, 16, 3, 8);
+
1261 checkMetrics(*this, env, 0, 16, 3, 8);
1262 env.require(balance(bob, drops(499'999'999'750)));
1263 }
@@ -1391,20 +1391,20 @@ $(document).ready(function() { init_codefold(0); });
1286
1287 BEAST_EXPECT(env.current()->fees().base == 10);
1288
-
1289 checkMetrics(*this, env, 0, std::nullopt, 0, 4);
+
1289 checkMetrics(*this, env, 0, std::nullopt, 0, 4);
1290
1291 // Create several accounts while the fee is cheap so they all apply.
1292 env.fund(XRP(50000), noripple(alice, bob, charlie, daria));
-
1293 checkMetrics(*this, env, 0, std::nullopt, 4, 4);
+
1293 checkMetrics(*this, env, 0, std::nullopt, 4, 4);
1294
1295 env.close();
-
1296 checkMetrics(*this, env, 0, 8, 0, 4);
+
1296 checkMetrics(*this, env, 0, 8, 0, 4);
1297
1298 env.fund(XRP(50000), noripple(elmo, fred, gwen, hank));
-
1299 checkMetrics(*this, env, 0, 8, 4, 4);
+
1299 checkMetrics(*this, env, 0, 8, 4, 4);
1300
1301 env.close();
-
1302 checkMetrics(*this, env, 0, 8, 0, 4);
+
1302 checkMetrics(*this, env, 0, 8, 0, 4);
1303
1305
1306 // Stuff the ledger and queue so we can verify that
@@ -1414,7 +1414,7 @@ $(document).ready(function() { init_codefold(0); });
1310 env(noop(gwen));
1311 env(noop(fred));
1312 env(noop(elmo));
-
1313 checkMetrics(*this, env, 0, 8, 5, 4);
+
1313 checkMetrics(*this, env, 0, 8, 5, 4);
1314
1315 auto aliceSeq = env.seq(alice);
1316 auto bobSeq = env.seq(bob);
@@ -1441,7 +1441,7 @@ $(document).ready(function() { init_codefold(0); });
1337 // Queue is full now. Minimum fee now reflects the
1338 // lowest fee in the queue.
1339 auto minFeeLevel = txFeeLevelByAccount(env, alice);
-
1340 checkMetrics(*this, env, 8, 8, 5, 4, minFeeLevel + 1);
+
1340 checkMetrics(*this, env, 8, 8, 5, 4, minFeeLevel + 1);
1341
1342 // Try to add another transaction with the default (low) fee,
1343 // it should fail because it can't replace the one already
@@ -1454,13 +1454,13 @@ $(document).ready(function() { init_codefold(0); });
1350 env(noop(charlie), fee(100), seq(charlieSeq + 1), queued);
1351
1352 // Queue is still full.
-
1353 checkMetrics(*this, env, 8, 8, 5, 4, minFeeLevel + 1);
+
1353 checkMetrics(*this, env, 8, 8, 5, 4, minFeeLevel + 1);
1354
1355 // Six txs are processed out of the queue into the ledger,
1356 // leaving two txs. The dropped tx is retried from localTxs, and
1357 // put back into the queue.
1358 env.close();
-
1359 checkMetrics(*this, env, 3, 10, 6, 5);
+
1359 checkMetrics(*this, env, 3, 10, 6, 5);
1360
1361 // This next test should remain unchanged regardless of
1362 // transaction ordering
@@ -1546,7 +1546,7 @@ $(document).ready(function() { init_codefold(0); });
1442 env(noop(gwen), seq(gwenSeq + qTxCount1[gwen.id()]++), fee(15), queued);
1443
1444 minFeeLevel = txFeeLevelByAccount(env, gwen) + 1;
-
1445 checkMetrics(*this, env, 10, 10, 6, 5, minFeeLevel);
+
1445 checkMetrics(*this, env, 10, 10, 6, 5, minFeeLevel);
1446
1447 // Add another transaction, with a higher fee,
1448 // Not high enough to get into the ledger, but high
@@ -1556,13 +1556,13 @@ $(document).ready(function() { init_codefold(0); });
1452 seq(aliceSeq + qTxCount1[alice.id()]++),
1453 queued);
1454
-
1455 checkMetrics(*this, env, 10, 10, 6, 5, minFeeLevel);
+
1455 checkMetrics(*this, env, 10, 10, 6, 5, minFeeLevel);
1456
1457 // Seven txs are processed out of the queue, leaving 3. One
1458 // dropped tx is retried from localTxs, and put back into the
1459 // queue.
1460 env.close();
-
1461 checkMetrics(*this, env, 4, 12, 7, 6);
+
1461 checkMetrics(*this, env, 4, 12, 7, 6);
1462
1463 // Refresh the queue counts
1464 auto qTxCount2 = getTxsQueued();
@@ -1629,13 +1629,13 @@ $(document).ready(function() { init_codefold(0); });
1523
1524 auto alice = Account("alice");
1525
-
1526 checkMetrics(*this, env, 0, std::nullopt, 0, 1);
+
1526 checkMetrics(*this, env, 0, std::nullopt, 0, 1);
1527
1528 env.fund(XRP(50000), noripple(alice));
-
1529 checkMetrics(*this, env, 0, std::nullopt, 1, 1);
+
1529 checkMetrics(*this, env, 0, std::nullopt, 1, 1);
1530
1531 env(fset(alice, asfAccountTxnID));
-
1532 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
+
1532 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
1533
1534 // Immediately after the fset, the sfAccountTxnID field
1535 // is still uninitialized, so preflight succeeds here,
@@ -1644,14 +1644,14 @@ $(document).ready(function() { init_codefold(0); });
1538 json(R"({"AccountTxnID": "0"})"),
1540
-
1541 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
+
1541 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
1542 env.close();
1543 // The failed transaction is retried from LocalTx
1544 // and succeeds.
-
1545 checkMetrics(*this, env, 0, 4, 1, 2);
+
1545 checkMetrics(*this, env, 0, 4, 1, 2);
1546
1547 env(noop(alice));
-
1548 checkMetrics(*this, env, 0, 4, 2, 2);
+
1548 checkMetrics(*this, env, 0, 4, 2, 2);
1549
1550 env(noop(alice), json(R"({"AccountTxnID": "0"})"), ter(tefWRONG_PRIOR));
1551 }
@@ -1677,10 +1677,10 @@ $(document).ready(function() { init_codefold(0); });
1569
1570 auto alice = Account("alice");
1571
-
1572 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
+
1572 checkMetrics(*this, env, 0, std::nullopt, 0, 2);
1573
1574 env.fund(XRP(50000), noripple(alice));
-
1575 checkMetrics(*this, env, 0, std::nullopt, 1, 2);
+
1575 checkMetrics(*this, env, 0, std::nullopt, 1, 2);
1576
1577 FeeLevel64 medFeeLevel;
1578 for (int i = 0; i < 10; ++i)
@@ -1700,12 +1700,12 @@ $(document).ready(function() { init_codefold(0); });
1592 env(noop(alice), fee(cost));
1593 }
1594
-
1595 checkMetrics(*this, env, 0, std::nullopt, 11, 2);
+
1595 checkMetrics(*this, env, 0, std::nullopt, 11, 2);
1596
1597 env.close();
1598 // If not for the maximum, the per ledger would be 11.
1599 // clang-format off
-
1600 checkMetrics(*this, env, 0, 10, 0, 5, baseFeeLevel.fee(), calcMedFeeLevel(medFeeLevel));
+
1600 checkMetrics(*this, env, 0, 10, 0, 5, baseFeeLevel.fee(), calcMedFeeLevel(medFeeLevel));
1601 // clang-format on
1602 }
1603
@@ -1796,22 +1796,22 @@ $(document).ready(function() { init_codefold(0); });
1686 // ledgers in queue is 2 because of makeConfig
1687 auto const initQueueMax = initFee(env, 3, 2, 10, 200, 50);
1688
-
1689 checkMetrics(*this, env, 0, initQueueMax, 0, 3);
+
1689 checkMetrics(*this, env, 0, initQueueMax, 0, 3);
1690
1691 env.fund(drops(5000), noripple(alice));
1692 env.fund(XRP(50000), noripple(bob));
-
1693 checkMetrics(*this, env, 0, initQueueMax, 2, 3);
+
1693 checkMetrics(*this, env, 0, initQueueMax, 2, 3);
1694 auto USD = bob["USD"];
1695
1696 env(offer(alice, USD(5000), drops(5000)), require(owners(alice, 1)));
-
1697 checkMetrics(*this, env, 0, initQueueMax, 3, 3);
+
1697 checkMetrics(*this, env, 0, initQueueMax, 3, 3);
1698
1699 env.close();
-
1700 checkMetrics(*this, env, 0, 6, 0, 3);
+
1700 checkMetrics(*this, env, 0, 6, 0, 3);
1701
1702 // Fill up the ledger
1703 fillQueue(env, alice);
-
1704 checkMetrics(*this, env, 0, 6, 4, 3);
+
1704 checkMetrics(*this, env, 0, 6, 4, 3);
1705
1706 // Queue up a couple of transactions, plus one
1707 // more expensive one.
@@ -1820,7 +1820,7 @@ $(document).ready(function() { init_codefold(0); });
1710 env(noop(alice), seq(aliceSeq++), queued);
1711 env(noop(alice), seq(aliceSeq++), queued);
1712 env(noop(alice), fee(drops(1000)), seq(aliceSeq), queued);
-
1713 checkMetrics(*this, env, 4, 6, 4, 3);
+
1713 checkMetrics(*this, env, 4, 6, 4, 3);
1714
1715 // This offer should take Alice's offer
1716 // up to Alice's reserve.
@@ -1828,7 +1828,7 @@ $(document).ready(function() { init_codefold(0); });
1718 fee(openLedgerCost(env)),
1719 require(
1720 balance(alice, drops(250)), owners(alice, 1), lines(alice, 1)));
-
1721 checkMetrics(*this, env, 4, 6, 5, 3);
+
1721 checkMetrics(*this, env, 4, 6, 5, 3);
1722
1723 // Try adding a new transaction.
1724 // Too many fees in flight.
@@ -1836,12 +1836,12 @@ $(document).ready(function() { init_codefold(0); });
1726 fee(drops(200)),
1727 seq(aliceSeq + 1),
-
1729 checkMetrics(*this, env, 4, 6, 5, 3);
+
1729 checkMetrics(*this, env, 4, 6, 5, 3);
1730
1731 // Close the ledger. All of Alice's transactions
1732 // take a fee, except the last one.
1733 env.close();
-
1734 checkMetrics(*this, env, 1, 10, 3, 5);
+
1734 checkMetrics(*this, env, 1, 10, 3, 5);
1735 env.require(balance(alice, drops(250 - 30)));
1736
1737 // Still can't add a new transaction for Alice,
@@ -1850,7 +1850,7 @@ $(document).ready(function() { init_codefold(0); });
1740 fee(drops(200)),
1741 seq(aliceSeq + 1),
-
1743 checkMetrics(*this, env, 1, 10, 3, 5);
+
1743 checkMetrics(*this, env, 1, 10, 3, 5);
1744
1745 /* At this point, Alice's transaction is indefinitely
1746 stuck in the queue. Eventually it will either
@@ -1862,13 +1862,13 @@ $(document).ready(function() { init_codefold(0); });
1752 for (int i = 0; i < 9; ++i)
1753 {
1754 env.close();
-
1755 checkMetrics(*this, env, 1, 10, 0, 5);
+
1755 checkMetrics(*this, env, 1, 10, 0, 5);
1756 }
1757
1758 // And Alice's transaction expires (via the retry limit,
1759 // not LastLedgerSequence).
1760 env.close();
-
1761 checkMetrics(*this, env, 0, 10, 0, 5);
+
1761 checkMetrics(*this, env, 0, 10, 0, 5);
1762 }
1763
@@ -1889,11 +1889,11 @@ $(document).ready(function() { init_codefold(0); });
1777 Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));
1778 auto const baseFee = env.current()->fees().base.drops();
1779
-
1780 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
1780 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
1781
1782 env.fund(XRP(50000), noripple(alice, bob));
1783 env.memoize(charlie);
-
1784 checkMetrics(*this, env, 0, std::nullopt, 2, 3);
+
1784 checkMetrics(*this, env, 0, std::nullopt, 2, 3);
1785 {
1786 // Cannot put a blocker in an account's queue if that queue
1787 // already holds two or more (non-blocker) entries.
@@ -1902,7 +1902,7 @@ $(document).ready(function() { init_codefold(0); });
1790 env(noop(alice));
1791 // Set a regular key just to clear the password spent flag
1792 env(regkey(alice, charlie));
-
1793 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
1793 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
1794
1795 // Put two "normal" txs in the queue
1796 auto const aliceSeq = env.seq(alice);
@@ -1928,11 +1928,11 @@ $(document).ready(function() { init_codefold(0); });
1816
1817 // Other accounts are not affected
1818 env(noop(bob), queued);
-
1819 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
+
1819 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
1820
1821 // Drain the queue.
1822 env.close();
-
1823 checkMetrics(*this, env, 0, 8, 4, 4);
+
1823 checkMetrics(*this, env, 0, 8, 4, 4);
1824 }
1825 {
1826 // Replace a lone non-blocking tx with a blocker.
@@ -1973,7 +1973,7 @@ $(document).ready(function() { init_codefold(0); });
1861
1862 // Drain the queue.
1863 env.close();
-
1864 checkMetrics(*this, env, 0, 10, 3, 5);
+
1864 checkMetrics(*this, env, 0, 10, 3, 5);
1865 }
1866 {
1867 // Put a blocker in an empty queue.
@@ -2001,7 +2001,7 @@ $(document).ready(function() { init_codefold(0); });
1889
1890 // Drain the queue.
1891 env.close();
-
1892 checkMetrics(*this, env, 0, 12, 3, 6);
+
1892 checkMetrics(*this, env, 0, 12, 3, 6);
1893 }
1894 }
@@ -2023,12 +2023,12 @@ $(document).ready(function() { init_codefold(0); });
1909 Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));
1910 auto const baseFee = env.current()->fees().base.drops();
1911
-
1912 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
1912 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
1913
1914 env.fund(XRP(50000), noripple(alice, bob));
1915 env.memoize(charlie);
1916
-
1917 checkMetrics(*this, env, 0, std::nullopt, 2, 3);
+
1917 checkMetrics(*this, env, 0, std::nullopt, 2, 3);
1918
1919 std::uint32_t tkt{env.seq(alice) + 1};
1920 {
@@ -2039,7 +2039,7 @@ $(document).ready(function() { init_codefold(0); });
1925 env(ticket::create(alice, 250), seq(tkt - 1));
1926 // Set a regular key just to clear the password spent flag
1927 env(regkey(alice, charlie));
-
1928 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
1928 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
1929
1930 // Put two "normal" txs in the queue
1931 auto const aliceSeq = env.seq(alice);
@@ -2069,11 +2069,11 @@ $(document).ready(function() { init_codefold(0); });
1955
1956 // Other accounts are not affected
1957 env(noop(bob), queued);
-
1958 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
+
1958 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
1959
1960 // Drain the queue and local transactions.
1961 env.close();
-
1962 checkMetrics(*this, env, 0, 8, 5, 4);
+
1962 checkMetrics(*this, env, 0, 8, 5, 4);
1963
1964 // Show that the local transactions have flushed through as well.
1965 BEAST_EXPECT(env.seq(alice) == aliceSeq + 1);
@@ -2135,7 +2135,7 @@ $(document).ready(function() { init_codefold(0); });
2021
2022 // Drain the queue.
2023 env.close();
-
2024 checkMetrics(*this, env, 0, 10, 4, 5);
+
2024 checkMetrics(*this, env, 0, 10, 4, 5);
2025
2026 // Show that the local transactions have flushed through as well.
2027 BEAST_EXPECT(env.seq(alice) == aliceSeq + 1);
@@ -2169,7 +2169,7 @@ $(document).ready(function() { init_codefold(0); });
2055
2056 // Drain the queue.
2057 env.close();
-
2058 checkMetrics(*this, env, 0, 12, 3, 6);
+
2058 checkMetrics(*this, env, 0, 12, 3, 6);
2059 }
2060 }
@@ -2203,10 +2203,10 @@ $(document).ready(function() { init_codefold(0); });
2087
2088 auto limit = 3;
2089
-
2090 checkMetrics(*this, env, 0, initQueueMax, 0, limit);
+
2090 checkMetrics(*this, env, 0, initQueueMax, 0, limit);
2091
2092 env.fund(XRP(50000), noripple(alice, charlie), gw);
-
2093 checkMetrics(*this, env, 0, initQueueMax, limit + 1, limit);
+
2093 checkMetrics(*this, env, 0, initQueueMax, limit + 1, limit);
2094
2095 auto USD = gw["USD"];
2096 auto BUX = gw["BUX"];
@@ -2220,16 +2220,16 @@ $(document).ready(function() { init_codefold(0); });
2105 // If this offer crosses, all of alice's
2106 // XRP will be taken (except the reserve).
2107 env(offer(alice, BUX(5000), XRP(50000)), queued);
-
2108 checkMetrics(*this, env, 1, initQueueMax, limit + 1, limit);
+
2108 checkMetrics(*this, env, 1, initQueueMax, limit + 1, limit);
2109
2110 // But because the reserve is protected, another
2111 // transaction will be allowed to queue
2112 env(noop(alice), seq(aliceSeq + 1), queued);
-
2113 checkMetrics(*this, env, 2, initQueueMax, limit + 1, limit);
+
2113 checkMetrics(*this, env, 2, initQueueMax, limit + 1, limit);
2114
2115 env.close();
2116 ++limit;
-
2117 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2117 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2118
2119 // But once we close the ledger, we find alice
2120 // has plenty of XRP, because the offer didn't
@@ -2240,7 +2240,7 @@ $(document).ready(function() { init_codefold(0); });
2125
2127 // Offer with high XRP out and high total fee blocks later txs
2128 fillQueue(env, alice);
-
2129 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2129 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2130 aliceSeq = env.seq(alice);
2131 aliceBal = env.balance(alice);
2132
@@ -2248,12 +2248,12 @@ $(document).ready(function() { init_codefold(0); });
2134
2135 // Alice creates an offer with a fee of half the reserve
2136 env(offer(alice, BUX(5000), XRP(50000)), fee(drops(100)), queued);
-
2137 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
+
2137 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
2138
2139 // Alice creates another offer with a fee
2140 // that brings the total to just shy of the reserve
2141 env(noop(alice), fee(drops(99)), seq(aliceSeq + 1), queued);
-
2142 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2142 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2143
2144 // So even a noop will look like alice
2145 // doesn't have the balance to pay the fee
@@ -2261,11 +2261,11 @@ $(document).ready(function() { init_codefold(0); });
2147 fee(drops(51)),
2148 seq(aliceSeq + 2),
-
2150 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2150 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2151
2152 env.close();
2153 ++limit;
-
2154 checkMetrics(*this, env, 0, limit * 2, 3, limit);
+
2154 checkMetrics(*this, env, 0, limit * 2, 3, limit);
2155
2156 // But once we close the ledger, we find alice
2157 // has plenty of XRP, because the offer didn't
@@ -2276,7 +2276,7 @@ $(document).ready(function() { init_codefold(0); });
2162
2164 // Offer with high XRP out and super high fee blocks later txs
2165 fillQueue(env, alice);
-
2166 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2166 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2167 aliceSeq = env.seq(alice);
2168 aliceBal = env.balance(alice);
2169
@@ -2285,7 +2285,7 @@ $(document).ready(function() { init_codefold(0); });
2172 // Alice creates an offer with a fee larger than the reserve
2173 // This one can queue because it's the first in the queue for alice
2174 env(offer(alice, BUX(5000), XRP(50000)), fee(drops(300)), queued);
-
2175 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
+
2175 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
2176
2177 // So even a noop will look like alice
2178 // doesn't have the balance to pay the fee
@@ -2293,11 +2293,11 @@ $(document).ready(function() { init_codefold(0); });
2180 fee(drops(51)),
2181 seq(aliceSeq + 1),
-
2183 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
+
2183 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
2184
2185 env.close();
2186 ++limit;
-
2187 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2187 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2188
2189 // But once we close the ledger, we find alice
2190 // has plenty of XRP, because the offer didn't
@@ -2308,7 +2308,7 @@ $(document).ready(function() { init_codefold(0); });
2195
2197 // Offer with low XRP out allows later txs
2198 fillQueue(env, alice);
-
2199 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2199 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2200 aliceSeq = env.seq(alice);
2201 aliceBal = env.balance(alice);
2202
@@ -2318,11 +2318,11 @@ $(document).ready(function() { init_codefold(0); });
2206
2207 // And later transactions are just fine
2208 env(noop(alice), seq(aliceSeq + 1), queued);
-
2209 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2209 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2210
2211 env.close();
2212 ++limit;
-
2213 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2213 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2214
2215 // But once we close the ledger, we find alice
2216 // has plenty of XRP, because the offer didn't
@@ -2333,7 +2333,7 @@ $(document).ready(function() { init_codefold(0); });
2221
2223 // Large XRP payment doesn't block later txs
2224 fillQueue(env, alice);
-
2225 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2225 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2226
2227 aliceSeq = env.seq(alice);
2228 aliceBal = env.balance(alice);
@@ -2346,11 +2346,11 @@ $(document).ready(function() { init_codefold(0); });
2235 // But because the reserve is protected, another
2236 // transaction will be allowed to queue
2237 env(noop(alice), seq(aliceSeq + 1), queued);
-
2238 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2238 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2239
2240 env.close();
2241 ++limit;
-
2242 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2242 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2243
2244 // But once we close the ledger, we find alice
2245 // still has most of her balance, because the
@@ -2359,7 +2359,7 @@ $(document).ready(function() { init_codefold(0); });
2248
2250 // Small XRP payment allows later txs
2251 fillQueue(env, alice);
-
2252 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2252 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2253
2254 aliceSeq = env.seq(alice);
2255 aliceBal = env.balance(alice);
@@ -2370,11 +2370,11 @@ $(document).ready(function() { init_codefold(0); });
2260
2261 // And later transactions are just fine
2262 env(noop(alice), seq(aliceSeq + 1), queued);
-
2263 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2263 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2264
2265 env.close();
2266 ++limit;
-
2267 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2267 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2268
2269 // The payment succeeds
2270 env.require(
@@ -2384,19 +2384,19 @@ $(document).ready(function() { init_codefold(0); });
2275 auto const amount = USD(500000);
2276 env(trust(alice, USD(50000000)));
2277 env(trust(charlie, USD(50000000)));
-
2278 checkMetrics(*this, env, 0, limit * 2, 4, limit);
+
2278 checkMetrics(*this, env, 0, limit * 2, 4, limit);
2279 // Close so we don't have to deal
2280 // with tx ordering in consensus.
2281 env.close();
2282
2283 env(pay(gw, alice, amount));
-
2284 checkMetrics(*this, env, 0, limit * 2, 1, limit);
+
2284 checkMetrics(*this, env, 0, limit * 2, 1, limit);
2285 // Close so we don't have to deal
2286 // with tx ordering in consensus.
2287 env.close();
2288
2289 fillQueue(env, alice);
-
2290 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2290 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2291
2292 aliceSeq = env.seq(alice);
2293 aliceBal = env.balance(alice);
@@ -2409,11 +2409,11 @@ $(document).ready(function() { init_codefold(0); });
2300 // But that's fine, because it doesn't affect
2301 // alice's XRP balance (other than the fee, of course).
2302 env(noop(alice), seq(aliceSeq + 1), queued);
-
2303 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2303 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2304
2305 env.close();
2306 ++limit;
-
2307 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2307 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2308
2309 // So once we close the ledger, alice has her
2310 // XRP balance, but her USD balance went to charlie.
@@ -2432,7 +2432,7 @@ $(document).ready(function() { init_codefold(0); });
2324 env.close();
2325
2326 fillQueue(env, charlie);
-
2327 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2327 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2328
2329 aliceSeq = env.seq(alice);
2330 aliceBal = env.balance(alice);
@@ -2448,11 +2448,11 @@ $(document).ready(function() { init_codefold(0); });
2340 // But because the reserve is protected, another
2341 // transaction will be allowed to queue
2342 env(noop(alice), seq(aliceSeq + 1), queued);
-
2343 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2343 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2344
2345 env.close();
2346 ++limit;
-
2347 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2347 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2348
2349 // So once we close the ledger, alice sent a payment
2350 // to charlie using only a portion of her XRP balance
@@ -2466,7 +2466,7 @@ $(document).ready(function() { init_codefold(0); });
2359 // Small XRP to IOU payment allows later txs.
2360
2361 fillQueue(env, charlie);
-
2362 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2362 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2363
2364 aliceSeq = env.seq(alice);
2365 aliceBal = env.balance(alice);
@@ -2481,11 +2481,11 @@ $(document).ready(function() { init_codefold(0); });
2374
2375 // And later transactions are just fine
2376 env(noop(alice), seq(aliceSeq + 1), queued);
-
2377 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
+
2377 checkMetrics(*this, env, 2, limit * 2, limit + 1, limit);
2378
2379 env.close();
2380 ++limit;
-
2381 checkMetrics(*this, env, 0, limit * 2, 2, limit);
+
2381 checkMetrics(*this, env, 0, limit * 2, 2, limit);
2382
2383 // So once we close the ledger, alice sent a payment
2384 // to charlie using only a portion of her XRP balance
@@ -2501,7 +2501,7 @@ $(document).ready(function() { init_codefold(0); });
2395 env.close();
2396
2397 fillQueue(env, charlie);
-
2398 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
+
2398 checkMetrics(*this, env, 0, limit * 2, limit + 1, limit);
2399
2400 aliceSeq = env.seq(alice);
2401 aliceBal = env.balance(alice);
@@ -2511,11 +2511,11 @@ $(document).ready(function() { init_codefold(0); });
2405 env(noop(alice), seq(aliceSeq + 1), ter(terINSUF_FEE_B));
2406 BEAST_EXPECT(env.balance(alice) == drops(30));
2407
-
2408 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
+
2408 checkMetrics(*this, env, 1, limit * 2, limit + 1, limit);
2409
2410 env.close();
2411 ++limit;
-
2412 checkMetrics(*this, env, 0, limit * 2, 1, limit);
+
2412 checkMetrics(*this, env, 0, limit * 2, 1, limit);
2413 BEAST_EXPECT(env.balance(alice) == drops(5));
2414 }
@@ -2604,27 +2604,27 @@ $(document).ready(function() { init_codefold(0); });
2494 Env env(*this, makeConfig({{"minimum_txn_in_ledger_standalone", "3"}}));
2495 auto const baseFee = env.current()->fees().base.drops();
2496
-
2497 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
2497 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
2498
2499 // Fund accounts while the fee is cheap so they all apply.
2500 env.fund(XRP(50000), noripple(alice, bob, charlie));
-
2501 checkMetrics(*this, env, 0, std::nullopt, 3, 3);
+
2501 checkMetrics(*this, env, 0, std::nullopt, 3, 3);
2502
2503 // Alice - no fee change yet
2504 env(noop(alice));
-
2505 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
2505 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
2506
2507 // Bob with really high fee - applies
2508 env(noop(bob), fee(openLedgerCost(env)));
-
2509 checkMetrics(*this, env, 0, std::nullopt, 5, 3);
+
2509 checkMetrics(*this, env, 0, std::nullopt, 5, 3);
2510
2511 // Charlie with low fee: queued
2512 env(noop(charlie), fee(baseFee * 100), queued);
-
2513 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
+
2513 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
2514
2515 env.close();
2516 // Verify that the queued transaction was applied
-
2517 checkMetrics(*this, env, 0, 10, 1, 5);
+
2517 checkMetrics(*this, env, 0, 10, 1, 5);
2518
2520
2521 // Stuff the ledger and queue so we can verify that
@@ -2634,7 +2634,7 @@ $(document).ready(function() { init_codefold(0); });
2525 env(noop(bob), fee(baseFee * 100));
2526 env(noop(bob), fee(baseFee * 100));
2527 env(noop(bob), fee(baseFee * 100));
-
2528 checkMetrics(*this, env, 0, 10, 6, 5);
+
2528 checkMetrics(*this, env, 0, 10, 6, 5);
2529
2530 // Use explicit fees so we can control which txn
2531 // will get dropped
@@ -2659,7 +2659,7 @@ $(document).ready(function() { init_codefold(0); });
2550 env(noop(alice), fee(baseFee * 2.1), seq(aliceSeq++), queued);
2551
2552 // Queue is full now.
-
2553 checkMetrics(*this, env, 10, 10, 6, 5, expectedFeeLevel + 1);
+
2553 checkMetrics(*this, env, 10, 10, 6, 5, expectedFeeLevel + 1);
2554
2555 // Try to add another transaction with the default (low) fee,
2556 // it should fail because the queue is full.
@@ -2792,7 +2792,7 @@ $(document).ready(function() { init_codefold(0); });
2680 auto const bob = Account("bob");
2681
2682 env.fund(XRP(500000), noripple(alice, bob));
-
2683 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
+
2683 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
2684
2685 auto const aliceSeq = env.seq(alice);
2686 BEAST_EXPECT(env.current()->header().seq == 3);
@@ -2806,7 +2806,7 @@ $(document).ready(function() { init_codefold(0); });
2694 seq(aliceSeq + 3),
2695 last_ledger_seq(11),
2696 ter(terQUEUED));
-
2697 checkMetrics(*this, env, 4, std::nullopt, 2, 1);
+
2697 checkMetrics(*this, env, 4, std::nullopt, 2, 1);
2698 auto const bobSeq = env.seq(bob);
2699 // Ledger 4 gets 3,
2700 // Ledger 5 gets 4,
@@ -2815,17 +2815,17 @@ $(document).ready(function() { init_codefold(0); });
2703 {
2704 env(noop(bob), seq(bobSeq + i), fee(baseFee * 20), ter(terQUEUED));
2705 }
-
2706 checkMetrics(*this, env, 4 + 3 + 4 + 5, std::nullopt, 2, 1);
+
2706 checkMetrics(*this, env, 4 + 3 + 4 + 5, std::nullopt, 2, 1);
2707 // Close ledger 3
2708 env.close();
-
2709 checkMetrics(*this, env, 4 + 4 + 5, 20, 3, 2);
+
2709 checkMetrics(*this, env, 4 + 4 + 5, 20, 3, 2);
2710 // Close ledger 4
2711 env.close();
-
2712 checkMetrics(*this, env, 4 + 5, 30, 4, 3);
+
2712 checkMetrics(*this, env, 4 + 5, 30, 4, 3);
2713 // Close ledger 5
2714 env.close();
2715 // Alice's first two txs expired.
-
2716 checkMetrics(*this, env, 2, 40, 5, 4);
+
2716 checkMetrics(*this, env, 2, 40, 5, 4);
2717
2718 // Because aliceSeq is missing, aliceSeq + 1 fails
2719 env(noop(alice), seq(aliceSeq + 1), ter(terPRE_SEQ));
@@ -2834,27 +2834,27 @@ $(document).ready(function() { init_codefold(0); });
2722 env(fset(alice, asfAccountTxnID),
2723 seq(aliceSeq),
-
2725 checkMetrics(*this, env, 2, 40, 5, 4);
+
2725 checkMetrics(*this, env, 2, 40, 5, 4);
2726
2727 // However we can fill the gap with a non-blocker.
2728 env(noop(alice), seq(aliceSeq), fee(baseFee * 2), ter(terQUEUED));
-
2729 checkMetrics(*this, env, 3, 40, 5, 4);
+
2729 checkMetrics(*this, env, 3, 40, 5, 4);
2730
2731 // Attempt to queue up a new aliceSeq + 1 tx that's a blocker.
2732 env(fset(alice, asfAccountTxnID),
2733 seq(aliceSeq + 1),
-
2735 checkMetrics(*this, env, 3, 40, 5, 4);
+
2735 checkMetrics(*this, env, 3, 40, 5, 4);
2736
2737 // Queue up a non-blocker replacement for aliceSeq + 1.
2738 env(noop(alice), seq(aliceSeq + 1), fee(baseFee * 2), ter(terQUEUED));
-
2739 checkMetrics(*this, env, 4, 40, 5, 4);
+
2739 checkMetrics(*this, env, 4, 40, 5, 4);
2740
2741 // Close ledger 6
2742 env.close();
2743 // We expect that all of alice's queued tx's got into
2744 // the open ledger.
-
2745 checkMetrics(*this, env, 0, 50, 4, 5);
+
2745 checkMetrics(*this, env, 0, 50, 4, 5);
2746 BEAST_EXPECT(env.seq(alice) == aliceSeq + 4);
2747 }
@@ -2890,7 +2890,7 @@ $(document).ready(function() { init_codefold(0); });
2776 auto const bob = Account("bob");
2777
2778 env.fund(XRP(500000), noripple(alice, bob));
-
2779 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
+
2779 checkMetrics(*this, env, 0, std::nullopt, 2, 1);
2780
2781 auto const aliceSeq = env.seq(alice);
2782 BEAST_EXPECT(env.current()->header().seq == 3);
@@ -2937,7 +2937,7 @@ $(document).ready(function() { init_codefold(0); });
2823 seq(aliceSeq + 19),
2824 last_ledger_seq(11),
2825 ter(terQUEUED));
-
2826 checkMetrics(*this, env, 10, std::nullopt, 2, 1);
+
2826 checkMetrics(*this, env, 10, std::nullopt, 2, 1);
2827
2828 auto const bobSeq = env.seq(bob);
2829 // Ledger 4 gets 2 from bob and 1 from alice,
@@ -2947,21 +2947,21 @@ $(document).ready(function() { init_codefold(0); });
2833 {
2834 env(noop(bob), seq(bobSeq + i), fee(baseFee * 20), ter(terQUEUED));
2835 }
-
2836 checkMetrics(*this, env, 10 + 2 + 4 + 5, std::nullopt, 2, 1);
+
2836 checkMetrics(*this, env, 10 + 2 + 4 + 5, std::nullopt, 2, 1);
2837 // Close ledger 3
2838 env.close();
-
2839 checkMetrics(*this, env, 9 + 4 + 5, 20, 3, 2);
+
2839 checkMetrics(*this, env, 9 + 4 + 5, 20, 3, 2);
2840 BEAST_EXPECT(env.seq(alice) == aliceSeq + 12);
2841
2842 // Close ledger 4
2843 env.close();
-
2844 checkMetrics(*this, env, 9 + 5, 30, 4, 3);
+
2844 checkMetrics(*this, env, 9 + 5, 30, 4, 3);
2845 BEAST_EXPECT(env.seq(alice) == aliceSeq + 12);
2846
2847 // Close ledger 5
2848 env.close();
2849 // Three of Alice's txs expired.
-
2850 checkMetrics(*this, env, 6, 40, 5, 4);
+
2850 checkMetrics(*this, env, 6, 40, 5, 4);
2851 BEAST_EXPECT(env.seq(alice) == aliceSeq + 12);
2852
2853 // Top off Alice's queue again using Tickets so the sequence gap is
@@ -2972,7 +2972,7 @@ $(document).ready(function() { init_codefold(0); });
2858 env(noop(alice), ticket::use(aliceSeq + 4), ter(terQUEUED));
2859 env(noop(alice), ticket::use(aliceSeq + 5), ter(terQUEUED));
2860 env(noop(alice), ticket::use(aliceSeq + 6), ter(telCAN_NOT_QUEUE_FULL));
-
2861 checkMetrics(*this, env, 11, 40, 5, 4);
+
2861 checkMetrics(*this, env, 11, 40, 5, 4);
2862
2863 // Even though alice's queue is full we can still slide in a couple
2864 // more transactions because she has a sequence gap. But we
@@ -3003,7 +3003,7 @@ $(document).ready(function() { init_codefold(0); });
2889
2890 // Finally we can fill in the entire gap.
2891 env(noop(alice), seq(aliceSeq + 18), ter(terQUEUED));
-
2892 checkMetrics(*this, env, 14, 40, 5, 4);
+
2892 checkMetrics(*this, env, 14, 40, 5, 4);
2893
2894 // Verify that nothing can be added now that the gap is filled.
2895 env(noop(alice), seq(aliceSeq + 20), ter(telCAN_NOT_QUEUE_FULL));
@@ -3012,18 +3012,18 @@ $(document).ready(function() { init_codefold(0); });
2898 // but alice adds some more transaction(s) so expectedCount
2899 // may not reduce to 8.
2900 env.close();
-
2901 checkMetrics(*this, env, 9, 50, 6, 5);
+
2901 checkMetrics(*this, env, 9, 50, 6, 5);
2902 BEAST_EXPECT(env.seq(alice) == aliceSeq + 15);
2903
2904 // Close ledger 7. That should remove 4 more of alice's transactions.
2905 env.close();
-
2906 checkMetrics(*this, env, 2, 60, 7, 6);
+
2906 checkMetrics(*this, env, 2, 60, 7, 6);
2907 BEAST_EXPECT(env.seq(alice) == aliceSeq + 19);
2908
2909 // Close one last ledger to see all of alice's transactions moved
2910 // into the ledger, including the tickets
2911 env.close();
-
2912 checkMetrics(*this, env, 0, 70, 2, 7);
+
2912 checkMetrics(*this, env, 0, 70, 2, 7);
2913 BEAST_EXPECT(env.seq(alice) == aliceSeq + 21);
2914 }
@@ -3044,7 +3044,7 @@ $(document).ready(function() { init_codefold(0); });
2928 env.fund(XRP(100000), alice, bob);
2929
2930 fillQueue(env, alice);
-
2931 checkMetrics(*this, env, 0, std::nullopt, 7, 6);
+
2931 checkMetrics(*this, env, 0, std::nullopt, 7, 6);
2932
2933 // Queue up several transactions for alice sign-and-submit
2934 auto const aliceSeq = env.seq(alice);
@@ -3065,7 +3065,7 @@ $(document).ready(function() { init_codefold(0); });
2949 noop(alice), fee(baseFee * 100), seq(none), ter(terQUEUED))(
2950 submitParams);
2951 }
-
2952 checkMetrics(*this, env, 5, std::nullopt, 7, 6);
+
2952 checkMetrics(*this, env, 5, std::nullopt, 7, 6);
2953 {
2954 auto aliceStat = txQ.getAccountTxs(alice.id());
2955 SeqProxy seq = SeqProxy::sequence(aliceSeq);
@@ -3091,25 +3091,25 @@ $(document).ready(function() { init_codefold(0); });
2975 // Give them a higher fee so they'll beat alice's.
2976 for (int i = 0; i < 8; ++i)
2977 envs(noop(bob), fee(baseFee * 200), seq(none), ter(terQUEUED))();
-
2978 checkMetrics(*this, env, 13, std::nullopt, 7, 6);
+
2978 checkMetrics(*this, env, 13, std::nullopt, 7, 6);
2979
2980 env.close();
-
2981 checkMetrics(*this, env, 5, 14, 8, 7);
+
2981 checkMetrics(*this, env, 5, 14, 8, 7);
2982 // Put some more txs in the queue for bob.
2983 // Give them a higher fee so they'll beat alice's.
2984 fillQueue(env, bob);
2985 for (int i = 0; i < 9; ++i)
2986 envs(noop(bob), fee(baseFee * 200), seq(none), ter(terQUEUED))();
-
2987 checkMetrics(*this, env, 14, 14, 8, 7, 25601);
+
2987 checkMetrics(*this, env, 14, 14, 8, 7, 25601);
2988 env.close();
2989 // Put some more txs in the queue for bob.
2990 // Give them a higher fee so they'll beat alice's.
2991 fillQueue(env, bob);
2992 for (int i = 0; i < 10; ++i)
2993 envs(noop(bob), fee(baseFee * 200), seq(none), ter(terQUEUED))();
-
2994 checkMetrics(*this, env, 15, 16, 9, 8);
+
2994 checkMetrics(*this, env, 15, 16, 9, 8);
2995 env.close();
-
2996 checkMetrics(*this, env, 4, 18, 10, 9);
+
2996 checkMetrics(*this, env, 4, 18, 10, 9);
2997 {
2998 // Bob has nothing left in the queue.
2999 auto bobStat = txQ.getAccountTxs(bob.id());
@@ -3137,7 +3137,7 @@ $(document).ready(function() { init_codefold(0); });
3021 // Now, fill the gap.
3022 envs(noop(alice), fee(baseFee * 100), seq(none), ter(terQUEUED))(
3023 submitParams);
-
3024 checkMetrics(*this, env, 5, 18, 10, 9);
+
3024 checkMetrics(*this, env, 5, 18, 10, 9);
3025 {
3026 auto aliceStat = txQ.getAccountTxs(alice.id());
3027 auto seq = aliceSeq;
@@ -3152,7 +3152,7 @@ $(document).ready(function() { init_codefold(0); });
3036 }
3037
3038 env.close();
-
3039 checkMetrics(*this, env, 0, 20, 5, 10);
+
3039 checkMetrics(*this, env, 0, 20, 5, 10);
3040 {
3041 // Bob's data has been cleaned up.
3042 auto bobStat = txQ.getAccountTxs(bob.id());
@@ -3221,10 +3221,10 @@ $(document).ready(function() { init_codefold(0); });
3103 BEAST_EXPECT(!queue_data.isMember(jss::max_spend_drops_total));
3104 BEAST_EXPECT(!queue_data.isMember(jss::transactions));
3105 }
-
3106 checkMetrics(*this, env, 0, 6, 0, 3);
+
3106 checkMetrics(*this, env, 0, 6, 0, 3);
3107
3108 fillQueue(env, alice);
-
3109 checkMetrics(*this, env, 0, 6, 4, 3);
+
3109 checkMetrics(*this, env, 0, 6, 4, 3);
3110
3111 {
3112 auto const info =
@@ -3254,7 +3254,7 @@ $(document).ready(function() { init_codefold(0); });
3136 submitParams);
3137 envs(noop(alice), fee(baseFee * 10), seq(none), ter(terQUEUED))(
3138 submitParams);
-
3139 checkMetrics(*this, env, 4, 6, 4, 3);
+
3139 checkMetrics(*this, env, 4, 6, 4, 3);
3140
3141 {
3142 auto const info =
@@ -3307,7 +3307,7 @@ $(document).ready(function() { init_codefold(0); });
3189
3190 // Drain the queue so we can queue up a blocker.
3191 env.close();
-
3192 checkMetrics(*this, env, 0, 8, 4, 4);
+
3192 checkMetrics(*this, env, 0, 8, 4, 4);
3193
3194 // Fill the ledger and then queue up a blocker.
3195 envs(noop(alice), seq(none))(submitParams);
@@ -3318,7 +3318,7 @@ $(document).ready(function() { init_codefold(0); });
3200 seq(none),
3201 json(jss::LastLedgerSequence, 10),
3202 ter(terQUEUED))(submitParams);
-
3203 checkMetrics(*this, env, 1, 8, 5, 4);
+
3203 checkMetrics(*this, env, 1, 8, 5, 4);
3204
3205 {
3206 auto const info =
@@ -3383,7 +3383,7 @@ $(document).ready(function() { init_codefold(0); });
3265 fee(baseFee * 10),
3266 seq(none),
3267 ter(telCAN_NOT_QUEUE_BLOCKED))(submitParams);
-
3268 checkMetrics(*this, env, 1, 8, 5, 4);
+
3268 checkMetrics(*this, env, 1, 8, 5, 4);
3269
3270 {
3271 auto const info =
@@ -3462,9 +3462,9 @@ $(document).ready(function() { init_codefold(0); });
3344 }
3345
3346 env.close();
-
3347 checkMetrics(*this, env, 0, 10, 2, 5);
+
3347 checkMetrics(*this, env, 0, 10, 2, 5);
3348 env.close();
-
3349 checkMetrics(*this, env, 0, 10, 0, 5);
+
3349 checkMetrics(*this, env, 0, 10, 0, 5);
3350
3351 {
3352 auto const info =
@@ -3537,10 +3537,10 @@ $(document).ready(function() { init_codefold(0); });
3417 state[jss::load_factor_fee_reference] == 256);
3418 }
3419
-
3420 checkMetrics(*this, env, 0, 6, 0, 3);
+
3420 checkMetrics(*this, env, 0, 6, 0, 3);
3421
3422 fillQueue(env, alice);
-
3423 checkMetrics(*this, env, 0, 6, 4, 3);
+
3423 checkMetrics(*this, env, 0, 6, 4, 3);
3424
3425 auto aliceSeq = env.seq(alice);
3426 auto submitParams = Json::Value(Json::objectValue);
@@ -3550,7 +3550,7 @@ $(document).ready(function() { init_codefold(0); });
3430 fee(baseFee * 10),
3431 seq(aliceSeq + i),
3432 ter(terQUEUED))(submitParams);
-
3433 checkMetrics(*this, env, 4, 6, 4, 3);
+
3433 checkMetrics(*this, env, 4, 6, 4, 3);
3434
3435 {
3436 auto const server_info = env.rpc("server_info");
@@ -3778,7 +3778,7 @@ $(document).ready(function() { init_codefold(0); });
3656
3657 // Fund the first few accounts at non escalated fee
3658 env.fund(XRP(50000), noripple(a, b, c, d));
-
3659 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
3659 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
3660
3661 // First transaction establishes the messaging
3662 using namespace std::chrono_literals;
@@ -3828,7 +3828,7 @@ $(document).ready(function() { init_codefold(0); });
3706 jv[jss::load_factor_fee_reference] == 256;
3707 }));
3708
-
3709 checkMetrics(*this, env, 0, 8, 0, 4);
+
3709 checkMetrics(*this, env, 0, 8, 0, 4);
3710
3711 // Fund then next few accounts at non escalated fee
3712 env.fund(XRP(50000), noripple(e, f, g, h, i));
@@ -3842,7 +3842,7 @@ $(document).ready(function() { init_codefold(0); });
3720 env(noop(e), fee(baseFee), queued);
3721 env(noop(f), fee(baseFee), queued);
3722 env(noop(g), fee(baseFee), queued);
-
3723 checkMetrics(*this, env, 7, 8, 5, 4);
+
3723 checkMetrics(*this, env, 7, 8, 5, 4);
3724
3725 // Last transaction escalates the fee
3726 BEAST_EXPECT(wsc->findMsg(5s, [&](auto const& jv) {
@@ -3914,7 +3914,7 @@ $(document).ready(function() { init_codefold(0); });
3790 auto alice = Account("alice");
3791 auto bob = Account("bob");
3792
-
3793 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
3793 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
3794 env.fund(XRP(50000000), alice, bob);
3795
3796 fillQueue(env, alice);
@@ -3968,7 +3968,7 @@ $(document).ready(function() { init_codefold(0); });
3844 seq(aliceSeq++),
3845 ter(terQUEUED));
3846
-
3847 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
+
3847 checkMetrics(*this, env, 3, std::nullopt, 4, 3);
3848
3849 // Figure out how much it would cost to cover all the
3850 // queued txs + itself
@@ -3980,7 +3980,7 @@ $(document).ready(function() { init_codefold(0); });
3856 // the edge case test.
3857 env(noop(alice), fee(totalFee), seq(aliceSeq++), ter(terQUEUED));
3858
-
3859 checkMetrics(*this, env, 4, std::nullopt, 4, 3);
+
3859 checkMetrics(*this, env, 4, std::nullopt, 4, 3);
3860
3861 // Now repeat the process including the new tx
3862 // and avoiding the rounding error
@@ -3990,7 +3990,7 @@ $(document).ready(function() { init_codefold(0); });
3866 // Submit a transaction with that fee. It will succeed.
3867 env(noop(alice), fee(totalFee), seq(aliceSeq++));
3868
-
3869 checkMetrics(*this, env, 0, std::nullopt, 9, 3);
+
3869 checkMetrics(*this, env, 0, std::nullopt, 9, 3);
3870 }
3871
3872 testcase("replace last tx with enough to clear queue");
@@ -4015,7 +4015,7 @@ $(document).ready(function() { init_codefold(0); });
3891 seq(aliceSeq++),
3892 ter(terQUEUED));
3893
-
3894 checkMetrics(*this, env, 3, std::nullopt, 9, 3);
+
3894 checkMetrics(*this, env, 3, std::nullopt, 9, 3);
3895
3896 // Figure out how much it would cost to cover all the
3897 // queued txs + itself
@@ -4027,10 +4027,10 @@ $(document).ready(function() { init_codefold(0); });
3903 env(noop(alice), fee(totalFee), seq(aliceSeq++));
3904
3905 // The queue is clear
-
3906 checkMetrics(*this, env, 0, std::nullopt, 12, 3);
+
3906 checkMetrics(*this, env, 0, std::nullopt, 12, 3);
3907
3908 env.close();
-
3909 checkMetrics(*this, env, 0, 24, 0, 12);
+
3909 checkMetrics(*this, env, 0, 24, 0, 12);
3910 }
3911
3912 testcase("replace middle tx with enough to clear queue");
@@ -4046,7 +4046,7 @@ $(document).ready(function() { init_codefold(0); });
3922 ter(terQUEUED));
3923 }
3924
-
3925 checkMetrics(*this, env, 5, 24, 13, 12);
+
3925 checkMetrics(*this, env, 5, 24, 13, 12);
3926
3927 // Figure out how much it would cost to cover 3 txns
3928 uint64_t const totalFee = calcTotalFee(baseFee * 10 * 2, 3);
@@ -4054,7 +4054,7 @@ $(document).ready(function() { init_codefold(0); });
3930 aliceSeq -= 3;
3931 env(noop(alice), fee(totalFee), seq(aliceSeq++));
3932
-
3933 checkMetrics(*this, env, 2, 24, 16, 12);
+
3933 checkMetrics(*this, env, 2, 24, 16, 12);
3934 auto const aliceQueue =
3935 env.app().getTxQ().getAccountTxs(alice.id());
3936 BEAST_EXPECT(aliceQueue.size() == 2);
@@ -4069,7 +4069,7 @@ $(document).ready(function() { init_codefold(0); });
3945
3946 // Close the ledger to clear the queue
3947 env.close();
-
3948 checkMetrics(*this, env, 0, 32, 2, 16);
+
3948 checkMetrics(*this, env, 0, 32, 2, 16);
3949 }
3950
3951 testcase("clear queue failure (load)");
@@ -4095,7 +4095,7 @@ $(document).ready(function() { init_codefold(0); });
3971 totalPaid += baseFee * 2.2;
3972 }
3973
-
3974 checkMetrics(*this, env, 4, 32, 17, 16);
+
3974 checkMetrics(*this, env, 4, 32, 17, 16);
3975
3976 // Figure out how much it would cost to cover all the txns
3977 // + 1
@@ -4109,11 +4109,11 @@ $(document).ready(function() { init_codefold(0); });
3985 env(noop(alice), fee(totalFee), seq(aliceSeq++), ter(terQUEUED));
3986
3987 // The original last transaction is still in the queue
-
3988 checkMetrics(*this, env, 5, 32, 17, 16);
+
3988 checkMetrics(*this, env, 5, 32, 17, 16);
3989
3990 // With high load, some of the txs stay in the queue
3991 env.close();
-
3992 checkMetrics(*this, env, 3, 34, 2, 17);
+
3992 checkMetrics(*this, env, 3, 34, 2, 17);
3993
3994 // Load drops back down
3995 feeTrack.setRemoteFee(origFee);
@@ -4121,14 +4121,14 @@ $(document).ready(function() { init_codefold(0); });
3997 // Because of the earlier failure, alice can not clear the queue,
3998 // no matter how high the fee
3999 fillQueue(env, bob);
-
4000 checkMetrics(*this, env, 3, 34, 18, 17);
+
4000 checkMetrics(*this, env, 3, 34, 18, 17);
4001
4002 env(noop(alice), fee(XRP(1)), seq(aliceSeq++), ter(terQUEUED));
-
4003 checkMetrics(*this, env, 4, 34, 18, 17);
+
4003 checkMetrics(*this, env, 4, 34, 18, 17);
4004
4005 // With normal load, those txs get into the ledger
4006 env.close();
-
4007 checkMetrics(*this, env, 0, 36, 4, 18);
+
4007 checkMetrics(*this, env, 0, 36, 4, 18);
4008 }
4009 }
@@ -4152,77 +4152,77 @@ $(document).ready(function() { init_codefold(0); });
4026 {"maximum_txn_per_account", "200"}}));
4027 auto alice = Account("alice");
4028
-
4029 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
4029 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
4030 env.fund(XRP(50000000), alice);
4031
4032 fillQueue(env, alice);
-
4033 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
4033 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
4034 auto seqAlice = env.seq(alice);
4035 auto txCount = 140;
4036 for (int i = 0; i < txCount; ++i)
4037 env(noop(alice), seq(seqAlice++), ter(terQUEUED));
-
4038 checkMetrics(*this, env, txCount, std::nullopt, 4, 3);
+
4038 checkMetrics(*this, env, txCount, std::nullopt, 4, 3);
4039
4040 // Close a few ledgers successfully, so the limit grows
4041
4042 env.close();
4043 // 4 + 25% = 5
4044 txCount -= 6;
-
4045 checkMetrics(*this, env, txCount, 10, 6, 5, 257);
+
4045 checkMetrics(*this, env, txCount, 10, 6, 5, 257);
4046
4047 env.close();
4048 // 6 + 25% = 7
4049 txCount -= 8;
-
4050 checkMetrics(*this, env, txCount, 14, 8, 7, 257);
+
4050 checkMetrics(*this, env, txCount, 14, 8, 7, 257);
4051
4052 env.close();
4053 // 8 + 25% = 10
4054 txCount -= 11;
-
4055 checkMetrics(*this, env, txCount, 20, 11, 10, 257);
+
4055 checkMetrics(*this, env, txCount, 20, 11, 10, 257);
4056
4057 env.close();
4058 // 11 + 25% = 13
4059 txCount -= 14;
-
4060 checkMetrics(*this, env, txCount, 26, 14, 13, 257);
+
4060 checkMetrics(*this, env, txCount, 26, 14, 13, 257);
4061
4062 env.close();
4063 // 14 + 25% = 17
4064 txCount -= 18;
-
4065 checkMetrics(*this, env, txCount, 34, 18, 17, 257);
+
4065 checkMetrics(*this, env, txCount, 34, 18, 17, 257);
4066
4067 env.close();
4068 // 18 + 25% = 22
4069 txCount -= 23;
-
4070 checkMetrics(*this, env, txCount, 44, 23, 22, 257);
+
4070 checkMetrics(*this, env, txCount, 44, 23, 22, 257);
4071
4072 env.close();
4073 // 23 + 25% = 28
4074 txCount -= 29;
-
4075 checkMetrics(*this, env, txCount, 56, 29, 28);
+
4075 checkMetrics(*this, env, txCount, 56, 29, 28);
4076
4077 // From 3 expected to 28 in 7 "fast" ledgers.
4078
4079 // Close the ledger with a delay.
4080 env.close(env.now() + 5s, 10000ms);
4081 txCount -= 15;
-
4082 checkMetrics(*this, env, txCount, 56, 15, 14);
+
4082 checkMetrics(*this, env, txCount, 56, 15, 14);
4083
4084 // Close the ledger with a delay.
4085 env.close(env.now() + 5s, 10000ms);
4086 txCount -= 8;
-
4087 checkMetrics(*this, env, txCount, 56, 8, 7);
+
4087 checkMetrics(*this, env, txCount, 56, 8, 7);
4088
4089 // Close the ledger with a delay.
4090 env.close(env.now() + 5s, 10000ms);
4091 txCount -= 4;
-
4092 checkMetrics(*this, env, txCount, 56, 4, 3);
+
4092 checkMetrics(*this, env, txCount, 56, 4, 3);
4093
4094 // From 28 expected back down to 3 in 3 "slow" ledgers.
4095
4096 // Confirm the minimum sticks
4097 env.close(env.now() + 5s, 10000ms);
4098 txCount -= 4;
-
4099 checkMetrics(*this, env, txCount, 56, 4, 3);
+
4099 checkMetrics(*this, env, txCount, 56, 4, 3);
4100
4101 BEAST_EXPECT(!txCount);
4102 }
@@ -4238,35 +4238,35 @@ $(document).ready(function() { init_codefold(0); });
4112 {"maximum_txn_per_account", "200"}}));
4113 auto alice = Account("alice");
4114
-
4115 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
4115 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
4116 env.fund(XRP(50000000), alice);
4117
4118 fillQueue(env, alice);
-
4119 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
4119 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
4120 auto seqAlice = env.seq(alice);
4121 auto txCount = 43;
4122 for (int i = 0; i < txCount; ++i)
4123 env(noop(alice), seq(seqAlice++), ter(terQUEUED));
-
4124 checkMetrics(*this, env, txCount, std::nullopt, 4, 3);
+
4124 checkMetrics(*this, env, txCount, std::nullopt, 4, 3);
4125
4126 // Close a few ledgers successfully, so the limit grows
4127
4128 env.close();
4129 // 4 + 150% = 10
4130 txCount -= 11;
-
4131 checkMetrics(*this, env, txCount, 20, 11, 10, 257);
+
4131 checkMetrics(*this, env, txCount, 20, 11, 10, 257);
4132
4133 env.close();
4134 // 11 + 150% = 27
4135 txCount -= 28;
-
4136 checkMetrics(*this, env, txCount, 54, 28, 27);
+
4136 checkMetrics(*this, env, txCount, 54, 28, 27);
4137
4138 // From 3 expected to 28 in 7 "fast" ledgers.
4139
4140 // Close the ledger with a delay.
4141 env.close(env.now() + 5s, 10000ms);
4142 txCount -= 4;
-
4143 checkMetrics(*this, env, txCount, 54, 4, 3);
+
4143 checkMetrics(*this, env, txCount, 54, 4, 3);
4144
4145 // From 28 expected back down to 3 in 3 "slow" ledgers.
4146
@@ -4296,19 +4296,19 @@ $(document).ready(function() { init_codefold(0); });
4168
4169 auto const queued = ter(terQUEUED);
4170
-
4171 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
4171 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
4172
4173 // Create account
4174 env.fund(XRP(50000), noripple(alice));
-
4175 checkMetrics(*this, env, 0, std::nullopt, 1, 3);
+
4175 checkMetrics(*this, env, 0, std::nullopt, 1, 3);
4176
4177 fillQueue(env, alice);
-
4178 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
4178 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
4179
4180 // Queue a transaction
4181 auto const aliceSeq = env.seq(alice);
4182 env(noop(alice), queued);
-
4183 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
+
4183 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
4184
4185 // Now, apply a (different) transaction directly
4186 // to the open ledger, bypassing the queue
@@ -4324,23 +4324,23 @@ $(document).ready(function() { init_codefold(0); });
4196 return result.applied;
4197 });
4198 // the queued transaction is still there
-
4199 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
+
4199 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
4200
4201 // The next transaction should be able to go into the open
4202 // ledger, even though aliceSeq is queued. In earlier incarnations
4203 // of the TxQ this would cause an assert.
4204 env(noop(alice), seq(aliceSeq + 1), fee(openLedgerCost(env)));
-
4205 checkMetrics(*this, env, 1, std::nullopt, 6, 3);
+
4205 checkMetrics(*this, env, 1, std::nullopt, 6, 3);
4206 // Now queue a couple more transactions to make sure
4207 // they succeed despite aliceSeq being queued
4208 env(noop(alice), seq(aliceSeq + 2), queued);
4209 env(noop(alice), seq(aliceSeq + 3), queued);
-
4210 checkMetrics(*this, env, 3, std::nullopt, 6, 3);
+
4210 checkMetrics(*this, env, 3, std::nullopt, 6, 3);
4211
4212 // Now close the ledger. One of the queued transactions
4213 // (aliceSeq) should be dropped.
4214 env.close();
-
4215 checkMetrics(*this, env, 0, 12, 2, 6);
+
4215 checkMetrics(*this, env, 0, 12, 2, 6);
4216 }
4217
@@ -4363,11 +4363,11 @@ $(document).ready(function() { init_codefold(0); });
4233
4234 auto queued = ter(terQUEUED);
4235
-
4236 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
4236 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
4237
4238 // Create account
4239 env.fund(XRP(50000), noripple(alice));
-
4240 checkMetrics(*this, env, 0, std::nullopt, 1, 3);
+
4240 checkMetrics(*this, env, 0, std::nullopt, 1, 3);
4241
4242 // Create tickets
4243 std::uint32_t const tktSeq0{env.seq(alice) + 1};
@@ -4375,12 +4375,12 @@ $(document).ready(function() { init_codefold(0); });
4245
4246 // Fill the queue so the next transaction will be queued.
4247 fillQueue(env, alice);
-
4248 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
+
4248 checkMetrics(*this, env, 0, std::nullopt, 4, 3);
4249
4250 // Queue a transaction with a ticket. Leave an unused ticket
4251 // on either side.
4252 env(noop(alice), ticket::use(tktSeq0 + 1), queued);
-
4253 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
+
4253 checkMetrics(*this, env, 1, std::nullopt, 4, 3);
4254
4255 // Now, apply a (different) transaction directly
4256 // to the open ledger, bypassing the queue
@@ -4398,25 +4398,25 @@ $(document).ready(function() { init_codefold(0); });
4268 return result.applied;
4269 });
4270 // the queued transaction is still there
-
4271 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
+
4271 checkMetrics(*this, env, 1, std::nullopt, 5, 3);
4272
4273 // The next (sequence-based) transaction should be able to go into
4274 // the open ledger, even though tktSeq0 is queued. Note that this
4275 // sequence-based transaction goes in front of the queued
4276 // transaction, so the queued transaction is left in the queue.
4277 env(noop(alice), fee(openLedgerCost(env)));
-
4278 checkMetrics(*this, env, 1, std::nullopt, 6, 3);
+
4278 checkMetrics(*this, env, 1, std::nullopt, 6, 3);
4279
4280 // We should be able to do the same thing with a ticket that goes
4281 // if front of the queued transaction. This one too will leave
4282 // the queued transaction in place.
4283 env(noop(alice), ticket::use(tktSeq0 + 0), fee(openLedgerCost(env)));
-
4284 checkMetrics(*this, env, 1, std::nullopt, 7, 3);
+
4284 checkMetrics(*this, env, 1, std::nullopt, 7, 3);
4285
4286 // We have one ticketed transaction in the queue. We should able
4287 // to add another to the queue.
4288 env(noop(alice), ticket::use(tktSeq0 + 2), queued);
-
4289 checkMetrics(*this, env, 2, std::nullopt, 7, 3);
+
4289 checkMetrics(*this, env, 2, std::nullopt, 7, 3);
4290
4291 // Here we try to force the queued transactions into the ledger by
4292 // adding one more queued (ticketed) transaction that pays enough
@@ -4432,12 +4432,12 @@ $(document).ready(function() { init_codefold(0); });
4302 // transaction is equally capable of going into the ledger independent
4303 // of all other ticket- or sequence-based transactions.
4304 env(noop(alice), ticket::use(tktSeq0 + 3), fee(XRP(10)));
-
4305 checkMetrics(*this, env, 2, std::nullopt, 8, 3);
+
4305 checkMetrics(*this, env, 2, std::nullopt, 8, 3);
4306
4307 // Now close the ledger. One of the queued transactions
4308 // (the one with tktSeq0 + 1) should be dropped.
4309 env.close();
-
4310 checkMetrics(*this, env, 0, 16, 1, 8);
+
4310 checkMetrics(*this, env, 0, 16, 1, 8);
4311 }
4312
@@ -4493,7 +4493,7 @@ $(document).ready(function() { init_codefold(0); });
4361 env.close();
4362
4363 auto const metrics = env.app().getTxQ().getMetrics(*env.current());
-
4364 checkMetrics(*this, env, 0, ledgersInQueue * metrics.txPerLedger, 0, 2);
+
4364 checkMetrics(*this, env, 0, ledgersInQueue * metrics.txPerLedger, 0, 2);
4365
4366 // Close ledgers until the amendments show up.
4367 int i = 0;
@@ -4504,7 +4504,7 @@ $(document).ready(function() { init_codefold(0); });
4372 break;
4373 }
4374 auto expectedPerLedger = xrpl::detail::numUpVotedAmendments() + 1;
- +
4376 *this,
4377 env,
4378 0,
@@ -4525,7 +4525,7 @@ $(document).ready(function() { init_codefold(0); });
4393 auto const baseFee = env.current()->fees().base.drops();
4394 // We're very close to the flag ledger. Fill the ledger.
4395 fillQueue(env, alice);
- +
4397 *this,
4398 env,
4399 0,
@@ -4576,7 +4576,7 @@ $(document).ready(function() { init_codefold(0); });
4444 ter(terQUEUED));
4445 }
4446 std::size_t expectedInQueue = multiplier;
- +
4448 *this,
4449 env,
4450 expectedInQueue,
@@ -4603,7 +4603,7 @@ $(document).ready(function() { init_codefold(0); });
4471 : 0);
4472 expectedInLedger -= expectedInQueue;
4473 ++expectedPerLedger;
- +
4475 *this,
4476 env,
4477 expectedInQueue,
@@ -4693,7 +4693,7 @@ $(document).ready(function() { init_codefold(0); });
4559 // of their transactions expire out of the queue. To start out
4560 // alice fills the ledger.
4561 fillQueue(env, alice);
-
4562 checkMetrics(*this, env, 0, 50, 7, 6);
+
4562 checkMetrics(*this, env, 0, 50, 7, 6);
4563
4564 // Now put a few transactions into alice's queue, including one that
4565 // will expire out soon.
@@ -4739,9 +4739,9 @@ $(document).ready(function() { init_codefold(0); });
4605 env(noop(fiona), seq(seqFiona++), fee(--feeDrops), ter(terQUEUED));
4606 }
4607
-
4608 checkMetrics(*this, env, 34, 50, 7, 6);
+
4608 checkMetrics(*this, env, 34, 50, 7, 6);
4609 env.close();
-
4610 checkMetrics(*this, env, 26, 50, 8, 7);
+
4610 checkMetrics(*this, env, 26, 50, 8, 7);
4611
4612 // Re-fill the queue so alice and bob stay stuck.
4613 feeDrops = medFee;
@@ -4752,9 +4752,9 @@ $(document).ready(function() { init_codefold(0); });
4618 env(noop(ellie), seq(seqEllie++), fee(--feeDrops), ter(terQUEUED));
4619 env(noop(fiona), seq(seqFiona++), fee(--feeDrops), ter(terQUEUED));
4620 }
-
4621 checkMetrics(*this, env, 38, 50, 8, 7);
+
4621 checkMetrics(*this, env, 38, 50, 8, 7);
4622 env.close();
-
4623 checkMetrics(*this, env, 29, 50, 9, 8);
+
4623 checkMetrics(*this, env, 29, 50, 9, 8);
4624
4625 // One more time...
4626 feeDrops = medFee;
@@ -4765,9 +4765,9 @@ $(document).ready(function() { init_codefold(0); });
4631 env(noop(ellie), seq(seqEllie++), fee(--feeDrops), ter(terQUEUED));
4632 env(noop(fiona), seq(seqFiona++), fee(--feeDrops), ter(terQUEUED));
4633 }
-
4634 checkMetrics(*this, env, 41, 50, 9, 8);
+
4634 checkMetrics(*this, env, 41, 50, 9, 8);
4635 env.close();
-
4636 checkMetrics(*this, env, 29, 50, 10, 9);
+
4636 checkMetrics(*this, env, 29, 50, 10, 9);
4637
4638 // Finally the stage is set. alice's and bob's transactions expired
4639 // out of the queue which caused the dropPenalty flag to be set on
@@ -4789,7 +4789,7 @@ $(document).ready(function() { init_codefold(0); });
4655 env(noop(carol), seq(seqCarol++), fee(--feeDrops), ter(terQUEUED));
4656 env(noop(daria), seq(seqDaria++), fee(--feeDrops), ter(terQUEUED));
4657 env(noop(ellie), seq(seqEllie++), fee(--feeDrops), ter(terQUEUED));
-
4658 checkMetrics(*this, env, 48, 50, 10, 9);
+
4658 checkMetrics(*this, env, 48, 50, 10, 9);
4659
4660 // Now induce a fee jump which should cause all the transactions
4661 // in the queue to fail with telINSUF_FEE_P.
@@ -4806,7 +4806,7 @@ $(document).ready(function() { init_codefold(0); });
4672 // o The _last_ transaction should be dropped from alice's queue.
4673 // o The first failing transaction should be dropped from bob's queue.
4674 env.close();
-
4675 checkMetrics(*this, env, 46, 50, 0, 10);
+
4675 checkMetrics(*this, env, 46, 50, 0, 10);
4676
4677 // Run the local fee back down.
4678 while (env.app().getFeeTrack().lowerLocalFee())
@@ -4814,7 +4814,7 @@ $(document).ready(function() { init_codefold(0); });
4680
4681 // bob fills the ledger so it's easier to probe the TxQ.
4682 fillQueue(env, bob);
-
4683 checkMetrics(*this, env, 46, 50, 11, 10);
+
4683 checkMetrics(*this, env, 46, 50, 11, 10);
4684
4685 // Before the close() alice had two transactions in her queue.
4686 // We now expect her to have one. Here's the state of alice's queue.
@@ -4934,7 +4934,7 @@ $(document).ready(function() { init_codefold(0); });
4798
4799 env.close();
4800
-
4801 checkMetrics(*this, env, 0, 50, 4, 6);
+
4801 checkMetrics(*this, env, 0, 50, 4, 6);
4802 }
4803
4804 {
@@ -4995,7 +4995,7 @@ $(document).ready(function() { init_codefold(0); });
4859 // The ticket transactions that didn't succeed or get queued succeed
4860 // this time because the tickets got consumed when the offers came
4861 // out of the queue
-
4862 checkMetrics(*this, env, 0, 50, 8, 7);
+
4862 checkMetrics(*this, env, 0, 50, 8, 7);
4863 }
4864 }
@@ -5018,7 +5018,7 @@ $(document).ready(function() { init_codefold(0); });
4880 {"account_reserve", "0"},
4881 {"owner_reserve", "0"}}));
4882
-
4883 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
+
4883 checkMetrics(*this, env, 0, std::nullopt, 0, 3);
4884
4885 // ledgers in queue is 2 because of makeConfig
4886 auto const initQueueMax = initFee(env, 3, 2, 0, 0, 0);
@@ -5064,34 +5064,34 @@ $(document).ready(function() { init_codefold(0); });
4926 }
4927 }
4928
-
4929 checkMetrics(*this, env, 0, initQueueMax, 0, 3);
+
4929 checkMetrics(*this, env, 0, initQueueMax, 0, 3);
4930
4931 // The noripple is to reduce the number of transactions required to
4932 // fund the accounts. There is no rippling in this test.
4933 env.fund(XRP(100000), noripple(alice));
4934
-
4935 checkMetrics(*this, env, 0, initQueueMax, 1, 3);
+
4935 checkMetrics(*this, env, 0, initQueueMax, 1, 3);
4936
4937 env.close();
4938
-
4939 checkMetrics(*this, env, 0, 6, 0, 3);
+
4939 checkMetrics(*this, env, 0, 6, 0, 3);
4940
4941 fillQueue(env, alice);
4942
-
4943 checkMetrics(*this, env, 0, 6, 4, 3);
+
4943 checkMetrics(*this, env, 0, 6, 4, 3);
4944
4945 env(noop(alice), fee(openLedgerCost(env)));
4946
-
4947 checkMetrics(*this, env, 0, 6, 5, 3);
+
4947 checkMetrics(*this, env, 0, 6, 5, 3);
4948
4949 auto aliceSeq = env.seq(alice);
4950 env(noop(alice), queued);
4951
-
4952 checkMetrics(*this, env, 1, 6, 5, 3);
+
4952 checkMetrics(*this, env, 1, 6, 5, 3);
4953
4954 env(noop(alice), seq(aliceSeq + 1), fee(10), queued);
4955
-
4956 checkMetrics(*this, env, 2, 6, 5, 3);
+
4956 checkMetrics(*this, env, 2, 6, 5, 3);
4957
4958 {
4959 auto const fee = env.rpc("fee");
@@ -5134,7 +5134,7 @@ $(document).ready(function() { init_codefold(0); });
4996
4997 env.close();
4998
-
4999 checkMetrics(*this, env, 0, 10, 2, 5);
+
4999 checkMetrics(*this, env, 0, 10, 2, 5);
5000 }
5001
@@ -5314,22 +5314,22 @@ $(document).ready(function() { init_codefold(0); });
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
std::size_t numUpVotedAmendments()
Amendments that this server will vote for by default.
Definition Feature.cpp:355
Json::Value create(Account const &account, std::uint32_t count)
Create one of more tickets.
Definition ticket.cpp:12
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:13
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
+
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), std::source_location const location=std::source_location::current())
static increment_t const increment
Definition tags.h:41
Json::Value offer_cancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition offer.cpp:27
static none_t const none
Definition tags.h:15
-
auto const amount
+
auto const amount
Json::Value regkey(Account const &account, disabled_t)
Disable the regular key.
Definition regkey.cpp:10
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition flags.cpp:10
owner_count< ltTICKET > tickets
Match the number of tickets on the account.
Definition ticket.h:45
owner_count< ltRIPPLE_STATE > lines
Match the number of trust lines in the account's owner directory.
Definition owners.h:70
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
-
void checkMetrics(Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), source_location const location=source_location::current())
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:10
static XRPAmount reserve(jtx::Env &env, std::uint32_t count)
diff --git a/ValidatorList__test_8cpp_source.html b/ValidatorList__test_8cpp_source.html index 2711b79def..9b1a7a609e 100644 --- a/ValidatorList__test_8cpp_source.html +++ b/ValidatorList__test_8cpp_source.html @@ -4350,7 +4350,7 @@ $(document).ready(function() { init_codefold(0); });
T max(T... args)
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
void sign(Json::Value &jv, Account const &account, Json::Value &sigObject)
Sign automatically into a specific Json field of the jv object.
Definition utility.cpp:27
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
diff --git a/XChain__test_8cpp_source.html b/XChain__test_8cpp_source.html index 7b46657d80..ed673d865e 100644 --- a/XChain__test_8cpp_source.html +++ b/XChain__test_8cpp_source.html @@ -5510,7 +5510,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value xchain_commit(Account const &acc, Json::Value const &bridge, std::uint32_t claimID, AnyAmount const &amt, std::optional< Account > const &dst)
Json::Value bridge(Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)
Json::Value create_account_attestation(jtx::Account const &submittingAccount, Json::Value const &jvBridge, jtx::Account const &sendingAccount, jtx::AnyAmount const &sendingAmount, jtx::AnyAmount const &rewardAmount, jtx::Account const &rewardAccount, bool wasLockingChainSend, std::uint64_t createCount, jtx::Account const &dst, jtx::signer const &signer)
-
auto const amount
+
auto const amount
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
constexpr std::size_t UT_XCHAIN_DEFAULT_QUORUM
Json::Value regkey(Account const &account, disabled_t)
Disable the regular key.
Definition regkey.cpp:10
diff --git a/amount_8cpp_source.html b/amount_8cpp_source.html index d2276c2f84..41b7b887ba 100644 --- a/amount_8cpp_source.html +++ b/amount_8cpp_source.html @@ -232,7 +232,7 @@ $(document).ready(function() { init_codefold(0); });
std::ostream & operator<<(std::ostream &os, PrettyAmount const &amount)
Definition amount.cpp:54
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
constexpr XRPAmount dropsPerXRP
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
diff --git a/antithesis__sdk_8h_source.html b/antithesis__sdk_8h_source.html index d533a46e7e..6e2aa3407e 100644 --- a/antithesis__sdk_8h_source.html +++ b/antithesis__sdk_8h_source.html @@ -1252,7 +1252,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet line(AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
The index of a trust line for a given currency.
Definition Indexes.cpp:226
Json::Value create(jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:13
auto const condition
Definition escrow.h:84
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition base_uint.h:628
diff --git a/balance_8cpp_source.html b/balance_8cpp_source.html index af482d8af7..dfd093770f 100644 --- a/balance_8cpp_source.html +++ b/balance_8cpp_source.html @@ -185,7 +185,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Definition Indexes.cpp:522
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:166
static none_t const none
Definition tags.h:15
-
auto const amount
+
auto const amount
void doBalance(Env &env, AccountID const &account, bool none, STAmount const &value, Issue const &issue)
Definition balance.cpp:8
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
bool isXRP(AccountID const &c)
Definition AccountID.h:71
diff --git a/base58__test_8cpp_source.html b/base58__test_8cpp_source.html index cba112d7e9..da96606a30 100644 --- a/base58__test_8cpp_source.html +++ b/base58__test_8cpp_source.html @@ -559,7 +559,7 @@ $(document).ready(function() { init_codefold(0); });
std::string encodeBase58(void const *message, std::size_t size, void *temp, std::size_t temp_size)
Definition tokens.cpp:205
std::string encodeBase58Token(TokenType type, void const *token, std::size_t size)
Definition tokens.cpp:307
std::string decodeBase58Token(std::string const &s, TokenType type)
Definition tokens.cpp:331
-
auto const data
General field definitions, or fields used in multiple transaction namespaces.
+
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
int run(int argc, char **argv)
Definition Main.cpp:330
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:29
diff --git a/check_8cpp_source.html b/check_8cpp_source.html index 9069bf7e49..be6ffaac99 100644 --- a/check_8cpp_source.html +++ b/check_8cpp_source.html @@ -150,7 +150,7 @@ $(document).ready(function() { init_codefold(0); });
void check(bool condition, std::string const &message)
Json::Value cash(jtx::Account const &dest, uint256 const &checkId, STAmount const &amount)
Cash a check requiring that a specific amount be delivered.
Definition check.cpp:14
Json::Value cancel(jtx::Account const &dest, uint256 const &checkId)
Cancel a check.
Definition check.cpp:41
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
diff --git a/check_8h_source.html b/check_8h_source.html index 84eb041737..0151081067 100644 --- a/check_8h_source.html +++ b/check_8h_source.html @@ -137,7 +137,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value cash(jtx::Account const &dest, uint256 const &checkId, STAmount const &amount)
Cash a check requiring that a specific amount be delivered.
Definition check.cpp:14
Json::Value cancel(jtx::Account const &dest, uint256 const &checkId)
Cancel a check.
Definition check.cpp:41
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Type used to specify DeliverMin for cashing a check.
Definition check.h:21
DeliverMin(STAmount const &deliverMin)
Definition check.h:23
diff --git a/classxrpl_1_1test_1_1LedgerEntry__XChain__test.html b/classxrpl_1_1test_1_1LedgerEntry__XChain__test.html index c53024e2b5..5bfab05a32 100644 --- a/classxrpl_1_1test_1_1LedgerEntry__XChain__test.html +++ b/classxrpl_1_1test_1_1LedgerEntry__XChain__test.html @@ -428,7 +428,7 @@ Private Attributes

Detailed Description

-

Definition at line 2868 of file LedgerEntry_test.cpp.

+

Definition at line 2862 of file LedgerEntry_test.cpp.

Member Function Documentation

◆ checkErrorValue()

@@ -470,7 +470,7 @@ Private Attributes
-

Definition at line 2872 of file LedgerEntry_test.cpp.

+

Definition at line 2866 of file LedgerEntry_test.cpp.

@@ -497,7 +497,7 @@ Private Attributes
-

Definition at line 2892 of file LedgerEntry_test.cpp.

+

Definition at line 2886 of file LedgerEntry_test.cpp.

@@ -524,7 +524,7 @@ Private Attributes
-

Definition at line 2983 of file LedgerEntry_test.cpp.

+

Definition at line 2977 of file LedgerEntry_test.cpp.

@@ -551,7 +551,7 @@ Private Attributes
-

Definition at line 3041 of file LedgerEntry_test.cpp.

+

Definition at line 3035 of file LedgerEntry_test.cpp.

@@ -582,7 +582,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 3166 of file LedgerEntry_test.cpp.

+

Definition at line 3160 of file LedgerEntry_test.cpp.

diff --git a/classxrpl_1_1test_1_1LedgerEntry__test-members.html b/classxrpl_1_1test_1_1LedgerEntry__test-members.html index eaacd3b9df..32f88430fe 100644 --- a/classxrpl_1_1test_1_1LedgerEntry__test-members.html +++ b/classxrpl_1_1test_1_1LedgerEntry__test-members.html @@ -82,7 +82,7 @@ $(function() { abort_beast::unit_test::suiteprivate aborted_beast::unit_test::suiteprivate arg() constbeast::unit_test::suite - checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg, source_location const location=source_location::current())xrpl::test::LedgerEntry_testprivate + checkErrorValue(Json::Value const &jv, std::string const &err, std::string const &msg, std::source_location const location=std::source_location::current())xrpl::test::LedgerEntry_testprivate except(F &&f, String const &reason)beast::unit_test::suite except(F &&f)beast::unit_test::suite except(F &&f, String const &reason)beast::unit_test::suite @@ -102,8 +102,8 @@ $(function() { pass()beast::unit_test::suite propagate_abort()beast::unit_test::suiteprivate run() overridexrpl::test::LedgerEntry_testvirtual - runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, source_location const location=source_location::current())xrpl::test::LedgerEntry_testprivate - runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, source_location const location=source_location::current())xrpl::test::LedgerEntry_testprivate + runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::source_location const location=std::source_location::current())xrpl::test::LedgerEntry_testprivate + runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, std::source_location const location=std::source_location::current())xrpl::test::LedgerEntry_testprivate runner_beast::unit_test::suiteprivate suite()beast::unit_test::suite suite(suite const &)=deletebeast::unit_test::suite @@ -126,8 +126,8 @@ $(function() { testInvalid()xrpl::test::LedgerEntry_testprivate testInvalidOracleLedgerEntry()xrpl::test::LedgerEntry_testprivate testLedgerHashes()xrpl::test::LedgerEntry_testprivate - testMalformedField(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())xrpl::test::LedgerEntry_testprivate - testMalformedSubfield(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())xrpl::test::LedgerEntry_testprivate + testMalformedField(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())xrpl::test::LedgerEntry_testprivate + testMalformedSubfield(test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())xrpl::test::LedgerEntry_testprivate testMPT()xrpl::test::LedgerEntry_testprivate testNegativeUNL()xrpl::test::LedgerEntry_testprivate testNFTokenOffer()xrpl::test::LedgerEntry_testprivate diff --git a/classxrpl_1_1test_1_1LedgerEntry__test.html b/classxrpl_1_1test_1_1LedgerEntry__test.html index a3b791d9ff..ce00b6d843 100644 --- a/classxrpl_1_1test_1_1LedgerEntry__test.html +++ b/classxrpl_1_1test_1_1LedgerEntry__test.html @@ -227,20 +227,20 @@ Public Attributes - - + + - - - - - - - - + + + + + + + + @@ -319,10 +319,10 @@ Private Attributes

Private Member Functions

void checkErrorValue (Json::Value const &jv, std::string const &err, std::string const &msg, source_location const location=source_location::current())
 
void checkErrorValue (Json::Value const &jv, std::string const &err, std::string const &msg, std::source_location const location=std::source_location::current())
 
std::vector< Json::ValuegetBadValues (FieldType fieldType)
 
Json::Value getCorrectValue (Json::StaticString fieldName)
 
void testMalformedField (test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())
 
void testMalformedSubfield (test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, source_location const location=source_location::current())
 
void runLedgerEntryTest (test::jtx::Env &env, Json::StaticString const &parentField, source_location const location=source_location::current())
 
void runLedgerEntryTest (test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, source_location const location=source_location::current())
 
void testMalformedField (test::jtx::Env &env, Json::Value correctRequest, Json::StaticString const fieldName, FieldType const typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())
 
void testMalformedSubfield (test::jtx::Env &env, Json::Value correctRequest, Json::StaticString parentFieldName, Json::StaticString fieldName, FieldType typeID, std::string const &expectedError, bool required=true, std::source_location const location=std::source_location::current())
 
void runLedgerEntryTest (test::jtx::Env &env, Json::StaticString const &parentField, std::source_location const location=std::source_location::current())
 
void runLedgerEntryTest (test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, std::source_location const location=std::source_location::current())
 
void testInvalid ()
 
void testAccountRoot ()

Detailed Description

-

Definition at line 110 of file LedgerEntry_test.cpp.

+

Definition at line 104 of file LedgerEntry_test.cpp.

Member Function Documentation

- -

◆ checkErrorValue()

+ +

◆ checkErrorValue()

@@ -351,8 +351,8 @@ Private Attributes - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -367,7 +367,7 @@ Private Attributes
-

Definition at line 113 of file LedgerEntry_test.cpp.

+

Definition at line 107 of file LedgerEntry_test.cpp.

@@ -395,7 +395,7 @@ Private Attributes
-

Definition at line 149 of file LedgerEntry_test.cpp.

+

Definition at line 143 of file LedgerEntry_test.cpp.

@@ -423,12 +423,12 @@ Private Attributes
-

Definition at line 246 of file LedgerEntry_test.cpp.

+

Definition at line 240 of file LedgerEntry_test.cpp.

- -

◆ testMalformedField()

+ +

◆ testMalformedField()

@@ -475,8 +475,8 @@ Private Attributes - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -491,12 +491,12 @@ Private Attributes
-

Definition at line 293 of file LedgerEntry_test.cpp.

+

Definition at line 287 of file LedgerEntry_test.cpp.

- -

◆ testMalformedSubfield()

+ +

◆ testMalformedSubfield()

@@ -549,8 +549,8 @@ Private Attributes - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -565,12 +565,12 @@ Private Attributes
-

Definition at line 345 of file LedgerEntry_test.cpp.

+

Definition at line 339 of file LedgerEntry_test.cpp.

- -

◆ runLedgerEntryTest() [1/2]

+ +

◆ runLedgerEntryTest() [1/2]

@@ -593,8 +593,8 @@ Private Attributes - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -609,12 +609,12 @@ Private Attributes
-

Definition at line 407 of file LedgerEntry_test.cpp.

+

Definition at line 401 of file LedgerEntry_test.cpp.

- -

◆ runLedgerEntryTest() [2/2]

+ +

◆ runLedgerEntryTest() [2/2]

@@ -643,8 +643,8 @@ Private Attributes - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -659,7 +659,7 @@ Private Attributes
-

Definition at line 430 of file LedgerEntry_test.cpp.

+

Definition at line 424 of file LedgerEntry_test.cpp.

@@ -686,7 +686,7 @@ Private Attributes
-

Definition at line 469 of file LedgerEntry_test.cpp.

+

Definition at line 463 of file LedgerEntry_test.cpp.

@@ -713,7 +713,7 @@ Private Attributes
-

Definition at line 551 of file LedgerEntry_test.cpp.

+

Definition at line 545 of file LedgerEntry_test.cpp.

@@ -740,7 +740,7 @@ Private Attributes
-

Definition at line 657 of file LedgerEntry_test.cpp.

+

Definition at line 651 of file LedgerEntry_test.cpp.

@@ -767,7 +767,7 @@ Private Attributes
-

Definition at line 736 of file LedgerEntry_test.cpp.

+

Definition at line 730 of file LedgerEntry_test.cpp.

@@ -794,7 +794,7 @@ Private Attributes
-

Definition at line 802 of file LedgerEntry_test.cpp.

+

Definition at line 796 of file LedgerEntry_test.cpp.

@@ -821,7 +821,7 @@ Private Attributes
-

Definition at line 854 of file LedgerEntry_test.cpp.

+

Definition at line 848 of file LedgerEntry_test.cpp.

@@ -848,7 +848,7 @@ Private Attributes
-

Definition at line 922 of file LedgerEntry_test.cpp.

+

Definition at line 916 of file LedgerEntry_test.cpp.

@@ -875,7 +875,7 @@ Private Attributes
-

Definition at line 977 of file LedgerEntry_test.cpp.

+

Definition at line 971 of file LedgerEntry_test.cpp.

@@ -902,7 +902,7 @@ Private Attributes
-

Definition at line 1038 of file LedgerEntry_test.cpp.

+

Definition at line 1032 of file LedgerEntry_test.cpp.

@@ -929,7 +929,7 @@ Private Attributes
-

Definition at line 1319 of file LedgerEntry_test.cpp.

+

Definition at line 1313 of file LedgerEntry_test.cpp.

@@ -956,7 +956,7 @@ Private Attributes
-

Definition at line 1473 of file LedgerEntry_test.cpp.

+

Definition at line 1467 of file LedgerEntry_test.cpp.

@@ -983,7 +983,7 @@ Private Attributes
-

Definition at line 1535 of file LedgerEntry_test.cpp.

+

Definition at line 1529 of file LedgerEntry_test.cpp.

@@ -1010,7 +1010,7 @@ Private Attributes
-

Definition at line 1562 of file LedgerEntry_test.cpp.

+

Definition at line 1556 of file LedgerEntry_test.cpp.

@@ -1037,7 +1037,7 @@ Private Attributes
-

Definition at line 1590 of file LedgerEntry_test.cpp.

+

Definition at line 1584 of file LedgerEntry_test.cpp.

@@ -1064,7 +1064,7 @@ Private Attributes
-

Definition at line 1629 of file LedgerEntry_test.cpp.

+

Definition at line 1623 of file LedgerEntry_test.cpp.

@@ -1091,7 +1091,7 @@ Private Attributes
-

Definition at line 1659 of file LedgerEntry_test.cpp.

+

Definition at line 1653 of file LedgerEntry_test.cpp.

@@ -1118,7 +1118,7 @@ Private Attributes
-

Definition at line 1720 of file LedgerEntry_test.cpp.

+

Definition at line 1714 of file LedgerEntry_test.cpp.

@@ -1145,7 +1145,7 @@ Private Attributes
-

Definition at line 1768 of file LedgerEntry_test.cpp.

+

Definition at line 1762 of file LedgerEntry_test.cpp.

@@ -1172,7 +1172,7 @@ Private Attributes
-

Definition at line 1830 of file LedgerEntry_test.cpp.

+

Definition at line 1824 of file LedgerEntry_test.cpp.

@@ -1199,7 +1199,7 @@ Private Attributes
-

Definition at line 1981 of file LedgerEntry_test.cpp.

+

Definition at line 1975 of file LedgerEntry_test.cpp.

@@ -1226,7 +1226,7 @@ Private Attributes
-

Definition at line 1990 of file LedgerEntry_test.cpp.

+

Definition at line 1984 of file LedgerEntry_test.cpp.

@@ -1253,7 +1253,7 @@ Private Attributes
-

Definition at line 2075 of file LedgerEntry_test.cpp.

+

Definition at line 2069 of file LedgerEntry_test.cpp.

@@ -1280,7 +1280,7 @@ Private Attributes
-

Definition at line 2136 of file LedgerEntry_test.cpp.

+

Definition at line 2130 of file LedgerEntry_test.cpp.

@@ -1307,7 +1307,7 @@ Private Attributes
-

Definition at line 2163 of file LedgerEntry_test.cpp.

+

Definition at line 2157 of file LedgerEntry_test.cpp.

@@ -1334,7 +1334,7 @@ Private Attributes
-

Definition at line 2212 of file LedgerEntry_test.cpp.

+

Definition at line 2206 of file LedgerEntry_test.cpp.

@@ -1361,7 +1361,7 @@ Private Attributes
-

Definition at line 2295 of file LedgerEntry_test.cpp.

+

Definition at line 2289 of file LedgerEntry_test.cpp.

@@ -1410,7 +1410,7 @@ Private Attributes -

Definition at line 2375 of file LedgerEntry_test.cpp.

+

Definition at line 2369 of file LedgerEntry_test.cpp.

@@ -1457,7 +1457,7 @@ Private Attributes -

Definition at line 2585 of file LedgerEntry_test.cpp.

+

Definition at line 2579 of file LedgerEntry_test.cpp.

@@ -1484,7 +1484,7 @@ Private Attributes
-

Definition at line 2806 of file LedgerEntry_test.cpp.

+

Definition at line 2800 of file LedgerEntry_test.cpp.

@@ -1515,7 +1515,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 2834 of file LedgerEntry_test.cpp.

+

Definition at line 2828 of file LedgerEntry_test.cpp.

diff --git a/delivermin_8h_source.html b/delivermin_8h_source.html index 4774d338a0..6e02eb90b6 100644 --- a/delivermin_8h_source.html +++ b/delivermin_8h_source.html @@ -121,7 +121,7 @@ $(document).ready(function() { init_codefold(0); });
STAmount amount_
Definition delivermin.h:16
void operator()(Env &, JTx &jtx) const
deliver_min(STAmount const &amount)
Definition delivermin.h:19
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Execution context for applying a JSON transaction.
Definition JTx.h:26
diff --git a/escrow_8cpp_source.html b/escrow_8cpp_source.html index 45d2892c76..62821fd9f6 100644 --- a/escrow_8cpp_source.html +++ b/escrow_8cpp_source.html @@ -164,7 +164,7 @@ $(document).ready(function() { init_codefold(0); });
Rate rate(Env &env, Account const &account, std::uint32_t const &seq)
Definition escrow.cpp:50
Json::Value cancel(AccountID const &account, Account const &from, std::uint32_t seq)
Definition escrow.cpp:38
Json::Value finish(AccountID const &account, AccountID const &from, std::uint32_t seq)
Definition escrow.cpp:26
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
constexpr std::uint32_t tfFullyCanonicalSig
Transaction flags.
Definition TxFlags.h:41
diff --git a/escrow_8h_source.html b/escrow_8h_source.html index 00c3824990..4847beee11 100644 --- a/escrow_8h_source.html +++ b/escrow_8h_source.html @@ -213,10 +213,10 @@ $(document).ready(function() { init_codefold(0); });
Json::Value finish(AccountID const &account, AccountID const &from, std::uint32_t seq)
Definition escrow.cpp:26
std::array< std::uint8_t, 8 > const fb3
Definition escrow.h:69
std::array< std::uint8_t, 4 > const fb1
Definition escrow.h:50
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Represents a transfer rate.
Definition Rate.h:21
-
+
Set the sequence number on a JTx.
Definition seq.h:15
diff --git a/fee_8h_source.html b/fee_8h_source.html index e5b9df1b30..ae20b584c5 100644 --- a/fee_8h_source.html +++ b/fee_8h_source.html @@ -161,7 +161,7 @@ $(document).ready(function() { init_codefold(0); });
fee(STAmount const &amount)
Definition fee.h:37
bool manual_
Definition fee.h:20
-
auto const amount
+
auto const amount
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
bool isXRP(AccountID const &c)
Definition AccountID.h:71
diff --git a/functions_c.html b/functions_c.html index c4e1ec0009..4320cf36eb 100644 --- a/functions_c.html +++ b/functions_c.html @@ -192,7 +192,7 @@ $(function() {
  • checkEmplaceHint() : beast::aged_associative_container_test_base
  • Checker() : xrpl::PeerFinder::Checker< Protocol >
  • checker_ : xrpl::PeerFinder::Checker< Protocol >::async_op< Handler >, xrpl::PeerFinder::ManagerImp
  • -
  • checkErrorValue() : xrpl::test::LedgerEntry_test, xrpl::test::LedgerEntry_XChain_test, xrpl::test::LedgerRPC_test
  • +
  • checkErrorValue() : xrpl::test::LedgerEntry_test, xrpl::test::LedgerEntry_XChain_test, xrpl::test::LedgerRPC_test
  • checkExpectedCounters() : xrpl::test::CheckDeliveredAmount
  • checkExtraFeatures() : xrpl::AMMBid, xrpl::AMMCreate, xrpl::AMMDelete, xrpl::AMMDeposit, xrpl::AMMVote, xrpl::AMMWithdraw, xrpl::CreateOffer, xrpl::DeleteAccount, xrpl::DepositPreauth, xrpl::EscrowFinish, xrpl::LoanBrokerCoverClawback, xrpl::LoanBrokerCoverDeposit, xrpl::LoanBrokerCoverWithdraw, xrpl::LoanBrokerDelete, xrpl::LoanBrokerSet, xrpl::LoanDelete, xrpl::LoanManage, xrpl::LoanPay, xrpl::LoanSet, xrpl::MPTokenIssuanceCreate, xrpl::MPTokenIssuanceSet, xrpl::NFTokenMint, xrpl::PayChanClaim, xrpl::Payment, xrpl::PermissionedDomainSet, xrpl::Transactor, xrpl::VaultCreate, xrpl::VaultSet
  • checkFail() : beast::SemanticVersion_test
  • diff --git a/functions_func_c.html b/functions_func_c.html index 7dab428177..2f4af633bc 100644 --- a/functions_func_c.html +++ b/functions_func_c.html @@ -164,7 +164,7 @@ $(function() {
  • checkEmplace() : beast::aged_associative_container_test_base
  • checkEmplaceHint() : beast::aged_associative_container_test_base
  • Checker() : xrpl::PeerFinder::Checker< Protocol >
  • -
  • checkErrorValue() : xrpl::test::LedgerEntry_test, xrpl::test::LedgerEntry_XChain_test, xrpl::test::LedgerRPC_test
  • +
  • checkErrorValue() : xrpl::test::LedgerEntry_test, xrpl::test::LedgerEntry_XChain_test, xrpl::test::LedgerRPC_test
  • checkExpectedCounters() : xrpl::test::CheckDeliveredAmount
  • checkExtraFeatures() : xrpl::AMMBid, xrpl::AMMCreate, xrpl::AMMDelete, xrpl::AMMDeposit, xrpl::AMMVote, xrpl::AMMWithdraw, xrpl::CreateOffer, xrpl::DeleteAccount, xrpl::DepositPreauth, xrpl::EscrowFinish, xrpl::LoanBrokerCoverClawback, xrpl::LoanBrokerCoverDeposit, xrpl::LoanBrokerCoverWithdraw, xrpl::LoanBrokerDelete, xrpl::LoanBrokerSet, xrpl::LoanDelete, xrpl::LoanManage, xrpl::LoanPay, xrpl::LoanSet, xrpl::MPTokenIssuanceCreate, xrpl::MPTokenIssuanceSet, xrpl::NFTokenMint, xrpl::PayChanClaim, xrpl::Payment, xrpl::PermissionedDomainSet, xrpl::Transactor, xrpl::VaultCreate, xrpl::VaultSet
  • checkFail() : beast::SemanticVersion_test
  • diff --git a/functions_func_r.html b/functions_func_r.html index 6d9e045a80..6aa17b5196 100644 --- a/functions_func_r.html +++ b/functions_func_r.html @@ -243,7 +243,7 @@ $(function() {
  • run_if() : beast::unit_test::runner
  • run_multi() : xrpl::test::multi_runner_child
  • runData() : xrpl::InboundLedger
  • -
  • runLedgerEntryTest() : xrpl::test::LedgerEntry_test
  • +
  • runLedgerEntryTest() : xrpl::test::LedgerEntry_test
  • runLoan() : xrpl::test::Loan_test
  • runMetaInfo() : xrpl::test::TxQPosNegFlows_test
  • runnable() : xrpl::JobQueue::Coro
  • diff --git a/functions_func_t.html b/functions_func_t.html index 2f6efb7bd8..e14aeae179 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -783,10 +783,10 @@ $(function() {
  • testLowBalanceDestroy() : xrpl::test::Regression_test
  • testLPTokenBalance() : xrpl::test::AMM_test
  • testMalformed() : xrpl::STObject_test, xrpl::test::AMM_test, xrpl::test::OfferBaseUtil_test
  • -
  • testMalformedField() : xrpl::test::LedgerEntry_test
  • +
  • testMalformedField() : xrpl::test::LedgerEntry_test
  • testMalformedPK() : xrpl::test::PayChan_test
  • testMalformedSerializedForm() : xrpl::STTx_test
  • -
  • testMalformedSubfield() : xrpl::test::LedgerEntry_test
  • +
  • testMalformedSubfield() : xrpl::test::LedgerEntry_test
  • testMalformedTransaction() : xrpl::test::SetTrust_test
  • testManifestDeserialization() : xrpl::test::Manifest_test
  • testManifestDomainNames() : xrpl::test::Manifest_test
  • diff --git a/functions_r.html b/functions_r.html index 819cb3054d..9de1c1a178 100644 --- a/functions_r.html +++ b/functions_r.html @@ -409,7 +409,7 @@ $(function() {
  • run_type : beast::unit_test::suite_info
  • runAsValidator : xrpl::test::csf::Peer
  • runData() : xrpl::InboundLedger
  • -
  • runLedgerEntryTest() : xrpl::test::LedgerEntry_test
  • +
  • runLedgerEntryTest() : xrpl::test::LedgerEntry_test
  • runLoan() : xrpl::test::Loan_test
  • runMetaInfo() : xrpl::test::TxQPosNegFlows_test
  • runnable() : xrpl::JobQueue::Coro
  • diff --git a/functions_t.html b/functions_t.html index 46e73d9f3a..46e1af22e7 100644 --- a/functions_t.html +++ b/functions_t.html @@ -817,10 +817,10 @@ $(function() {
  • testLowBalanceDestroy() : xrpl::test::Regression_test
  • testLPTokenBalance() : xrpl::test::AMM_test
  • testMalformed() : xrpl::STObject_test, xrpl::test::AMM_test, xrpl::test::OfferBaseUtil_test
  • -
  • testMalformedField() : xrpl::test::LedgerEntry_test
  • +
  • testMalformedField() : xrpl::test::LedgerEntry_test
  • testMalformedPK() : xrpl::test::PayChan_test
  • testMalformedSerializedForm() : xrpl::STTx_test
  • -
  • testMalformedSubfield() : xrpl::test::LedgerEntry_test
  • +
  • testMalformedSubfield() : xrpl::test::LedgerEntry_test
  • testMalformedTransaction() : xrpl::test::SetTrust_test
  • testManifestDeserialization() : xrpl::test::Manifest_test
  • testManifestDomainNames() : xrpl::test::Manifest_test
  • diff --git a/import__test_8cpp_source.html b/import__test_8cpp_source.html index d4aa2d4dc8..3d583c311e 100644 --- a/import__test_8cpp_source.html +++ b/import__test_8cpp_source.html @@ -701,7 +701,7 @@ $(document).ready(function() { init_codefold(0); });
    std::map< std::string, std::string, boost::beast::iless > parse_args(std::string const &s)
    std::string fmtdur(std::chrono::duration< Period, Rep > const &d)
    std::ostream & pretty_time(std::ostream &os, std::chrono::duration< Rep, Period > d)
    -
    auto const data
    General field definitions, or fields used in multiple transaction namespaces.
    +
    auto const data
    General field definitions, or fields used in multiple transaction namespaces.
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    int run(int argc, char **argv)
    Definition Main.cpp:330
    @ out
    diff --git a/md__2____w_2rippled_2rippled_2BUILD.html b/md__2____w_2rippled_2rippled_2BUILD.html index b11d8eefcc..bddd8bfe08 100644 --- a/md__2____w_2rippled_2rippled_2BUILD.html +++ b/md__2____w_2rippled_2rippled_2BUILD.html @@ -162,8 +162,8 @@ Patched recipes
    }
    # Define which recipes to export.
    -
    recipes=('ed25519' 'grpc' 'openssl' 'secp256k1' 'snappy' 'soci')
    -
    folders=('all' 'all' '3.x.x' 'all' 'all' 'all')
    +
    recipes=('ed25519' 'grpc' 'nudb' 'openssl' 'secp256k1' 'snappy' 'soci')
    +
    folders=('all' 'all' 'all' '3.x.x' 'all' 'all' 'all')
    # Selectively check out the recipes from our CCI fork.
    cd external
    diff --git a/memo_8h_source.html b/memo_8h_source.html index 6d32440a9d..950b677671 100644 --- a/memo_8h_source.html +++ b/memo_8h_source.html @@ -193,7 +193,7 @@ $(document).ready(function() { init_codefold(0); });
    std::string format_
    Definition memo.h:19
    void operator()(Env &, JTx &jt) const
    Definition memo.cpp:8
    memo(std::string const &data, std::string const &format, std::string const &type)
    Definition memo.h:23
    -
    auto const data
    General field definitions, or fields used in multiple transaction namespaces.
    +
    auto const data
    General field definitions, or fields used in multiple transaction namespaces.
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    Execution context for applying a JSON transaction.
    Definition JTx.h:26
    diff --git a/mpt_8cpp_source.html b/mpt_8cpp_source.html index d046a26b82..8941202fea 100644 --- a/mpt_8cpp_source.html +++ b/mpt_8cpp_source.html @@ -898,7 +898,7 @@ $(document).ready(function() { init_codefold(0); });
    static MPTCreate makeMPTCreate(MPTInitDef const &arg)
    Definition mpt.cpp:84
    void fund(jtx::Env &env, jtx::Account const &gw, std::vector< jtx::Account > const &accounts, std::vector< STAmount > const &amts, Fund how)
    Definition AMMTest.cpp:18
    Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
    Create a payment.
    Definition pay.cpp:11
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    constexpr std::uint32_t const tmfMPTClearCanTransfer
    Definition TxFlags.h:173
    constexpr std::uint32_t const tmfMPTClearCanLock
    Definition TxFlags.h:165
    diff --git a/mpt_8h_source.html b/mpt_8h_source.html index b8ecfcff73..461da528ac 100644 --- a/mpt_8h_source.html +++ b/mpt_8h_source.html @@ -505,7 +505,7 @@ $(document).ready(function() { init_codefold(0); });
    static MPTInit const mptInitNoFund
    Definition mpt.h:108
    std::vector< Account > Holders
    Definition mpt.h:72
    XRP_t const XRP
    Converts to XRP Issue or STAmount.
    Definition amount.cpp:92
    -
    auto const amount
    +
    auto const amount
    auto const MPTDEXFlags
    Definition mpt.h:17
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    constexpr std::uint32_t const tfMPTCanTransfer
    Definition TxFlags.h:133
    diff --git a/namespacemembers_c.html b/namespacemembers_c.html index f9d96287f2..96f967761a 100644 --- a/namespacemembers_c.html +++ b/namespacemembers_c.html @@ -130,7 +130,7 @@ $(function() {
  • checkIdlePeers : xrpl::Tuning
  • checkLendingProtocolDependencies() : xrpl
  • checkLoanGuards() : xrpl
  • -
  • checkMetrics() : xrpl::test::jtx
  • +
  • checkMetrics() : xrpl::test::jtx
  • checkMultiSignFields() : xrpl::RPC::detail
  • checkNear() : xrpl
  • checkNoRipple() : xrpl
  • diff --git a/namespacemembers_func_c.html b/namespacemembers_func_c.html index 24283682a8..771e8a3596 100644 --- a/namespacemembers_func_c.html +++ b/namespacemembers_func_c.html @@ -119,7 +119,7 @@ $(function() {
  • checkFrozen() : xrpl
  • checkLendingProtocolDependencies() : xrpl
  • checkLoanGuards() : xrpl
  • -
  • checkMetrics() : xrpl::test::jtx
  • +
  • checkMetrics() : xrpl::test::jtx
  • checkMultiSignFields() : xrpl::RPC::detail
  • checkNear() : xrpl
  • checkNoRipple() : xrpl
  • diff --git a/namespacexrpl_1_1test.html b/namespacexrpl_1_1test.html index 732e4984f3..7e10087193 100644 --- a/namespacexrpl_1_1test.html +++ b/namespacexrpl_1_1test.html @@ -1336,7 +1336,7 @@ Variables UInt64Field  -

    Definition at line 28 of file LedgerEntry_test.cpp.

    +

    Definition at line 22 of file LedgerEntry_test.cpp.

    @@ -7351,7 +7351,7 @@ template<typename PreVote = decltype(defaultPreVote)>
    -

    Definition at line 62 of file LedgerEntry_test.cpp.

    +

    Definition at line 56 of file LedgerEntry_test.cpp.

    @@ -7371,7 +7371,7 @@ template<typename PreVote = decltype(defaultPreVote)>
    -

    Definition at line 79 of file LedgerEntry_test.cpp.

    +

    Definition at line 73 of file LedgerEntry_test.cpp.

    @@ -8352,7 +8352,7 @@ template<class TIn , class TOut , class TDerived >
    {jss::ticket_seq, FieldType::UInt32Field},
    }
    -

    Definition at line 44 of file LedgerEntry_test.cpp.

    +

    Definition at line 38 of file LedgerEntry_test.cpp.

    diff --git a/namespacexrpl_1_1test_1_1jtx.html b/namespacexrpl_1_1test_1_1jtx.html index 47a4bebd14..3a284e4eff 100644 --- a/namespacexrpl_1_1test_1_1jtx.html +++ b/namespacexrpl_1_1test_1_1jtx.html @@ -660,9 +660,9 @@ requires requires(Input& v) { template<typename... Amts> bool expectHolding (Env &env, AccountID const &account, STAmount const &value, Amts const &... amts)   -template<class Suite > -void checkMetrics (Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), source_location const location=source_location::current()) -  +template<class Suite > +void checkMetrics (Suite &test, jtx::Env &env, std::size_t expectedCount, std::optional< std::size_t > expectedMaxCount, std::size_t expectedInLedger, std::size_t expectedPerLedger, std::uint64_t expectedMinFeeLevel=baseFeeLevel.fee(), std::uint64_t expectedMedFeeLevel=minEscalationFeeLevel.fee(), std::source_location const location=std::source_location::current()) +  Json::Value sidechain_xchain_account_claim (Account const &acc, Json::Value const &bridge, Account const &dst, AnyAmount const &amt)   @@ -841,7 +841,7 @@ template<class SField , cla
    -

    Definition at line 291 of file TestHelpers.h.

    +

    Definition at line 284 of file TestHelpers.h.

    @@ -859,7 +859,7 @@ template<class SField , cla
    -

    Definition at line 295 of file TestHelpers.h.

    +

    Definition at line 288 of file TestHelpers.h.

    @@ -4448,7 +4448,7 @@ requires requires(Input& v) { -

    Definition at line 309 of file TestHelpers.h.

    +

    Definition at line 302 of file TestHelpers.h.

    @@ -4484,7 +4484,7 @@ requires requires(Input& v) { -

    Definition at line 323 of file TestHelpers.h.

    +

    Definition at line 316 of file TestHelpers.h.

    @@ -4514,7 +4514,7 @@ requires requires(Input& v) { -

    Definition at line 332 of file TestHelpers.h.

    +

    Definition at line 325 of file TestHelpers.h.

    @@ -4552,7 +4552,7 @@ template<typename... IOU>
    -

    Definition at line 339 of file TestHelpers.h.

    +

    Definition at line 332 of file TestHelpers.h.

    @@ -4582,7 +4582,7 @@ template<typename... IOU>
    -

    Definition at line 372 of file TestHelpers.h.

    +

    Definition at line 365 of file TestHelpers.h.

    @@ -4618,7 +4618,7 @@ template<typename... IOU>
    -

    Definition at line 381 of file TestHelpers.h.

    +

    Definition at line 374 of file TestHelpers.h.

    @@ -4650,7 +4650,7 @@ template<class T >
    -

    Definition at line 396 of file TestHelpers.h.

    +

    Definition at line 389 of file TestHelpers.h.

    @@ -4688,7 +4688,7 @@ template<class T , class... Args>
    -

    Definition at line 406 of file TestHelpers.h.

    +

    Definition at line 399 of file TestHelpers.h.

    @@ -4726,7 +4726,7 @@ template<class... Args>
    -

    Definition at line 415 of file TestHelpers.h.

    +

    Definition at line 408 of file TestHelpers.h.

    @@ -4748,7 +4748,7 @@ template<class... Args>
    -

    Definition at line 431 of file TestHelpers.h.

    +

    Definition at line 424 of file TestHelpers.h.

    @@ -4780,7 +4780,7 @@ template<class... Args>
    -

    Definition at line 440 of file TestHelpers.h.

    +

    Definition at line 433 of file TestHelpers.h.

    @@ -4824,12 +4824,12 @@ template<typename... Amts>
    -

    Definition at line 472 of file TestHelpers.h.

    +

    Definition at line 465 of file TestHelpers.h.

    - -

    ◆ checkMetrics()

    + +

    ◆ checkMetrics()

    @@ -4887,8 +4887,8 @@ template<class Suite >
    - source_location const  - location = source_location::current()  + std::source_location const  + location = std::source_location::current()  @@ -4898,7 +4898,7 @@ template<class Suite >
    -

    Definition at line 634 of file TestHelpers.h.

    +

    Definition at line 627 of file TestHelpers.h.

    @@ -5203,7 +5203,7 @@ template<class Suite >

    General field definitions, or fields used in multiple transaction namespaces.

    -

    Definition at line 299 of file TestHelpers.h.

    +

    Definition at line 292 of file TestHelpers.h.

    @@ -5219,7 +5219,7 @@ template<class Suite >
    -

    Definition at line 301 of file TestHelpers.h.

    +

    Definition at line 294 of file TestHelpers.h.

    @@ -5243,7 +5243,7 @@ template<class Suite >
    -

    Definition at line 629 of file TestHelpers.h.

    +

    Definition at line 622 of file TestHelpers.h.

    @@ -5267,7 +5267,7 @@ template<class Suite >
    -

    Definition at line 630 of file TestHelpers.h.

    +

    Definition at line 623 of file TestHelpers.h.

    diff --git a/namespacexrpl_1_1test_1_1jtx_1_1check.html b/namespacexrpl_1_1test_1_1jtx_1_1check.html index a275b1d7bd..6566ab0d37 100644 --- a/namespacexrpl_1_1test_1_1jtx_1_1check.html +++ b/namespacexrpl_1_1test_1_1jtx_1_1check.html @@ -256,7 +256,7 @@ requires Definition at line 607 of file TestHelpers.h.

    +

    Definition at line 600 of file TestHelpers.h.

    @@ -292,7 +292,7 @@ requires -

    Definition at line 619 of file TestHelpers.h.

    +

    Definition at line 612 of file TestHelpers.h.

    diff --git a/namespacexrpl_1_1test_1_1jtx_1_1loan.html b/namespacexrpl_1_1test_1_1jtx_1_1loan.html index 6689d247a8..e2c87b901b 100644 --- a/namespacexrpl_1_1test_1_1jtx_1_1loan.html +++ b/namespacexrpl_1_1test_1_1jtx_1_1loan.html @@ -290,7 +290,7 @@ Variables
    -

    Definition at line 782 of file TestHelpers.h.

    +

    Definition at line 775 of file TestHelpers.h.

    @@ -306,7 +306,7 @@ Variables
    -

    Definition at line 786 of file TestHelpers.h.

    +

    Definition at line 779 of file TestHelpers.h.

    @@ -322,7 +322,7 @@ Variables
    -

    Definition at line 788 of file TestHelpers.h.

    +

    Definition at line 781 of file TestHelpers.h.

    @@ -338,7 +338,7 @@ Variables
    -

    Definition at line 790 of file TestHelpers.h.

    +

    Definition at line 783 of file TestHelpers.h.

    @@ -354,7 +354,7 @@ Variables
    -

    Definition at line 792 of file TestHelpers.h.

    +

    Definition at line 785 of file TestHelpers.h.

    @@ -372,7 +372,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfOverpaymentFee)
    -

    Definition at line 794 of file TestHelpers.h.

    +

    Definition at line 787 of file TestHelpers.h.

    @@ -390,7 +390,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfInterestRate)
    -

    Definition at line 797 of file TestHelpers.h.

    +

    Definition at line 790 of file TestHelpers.h.

    @@ -408,7 +408,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfLateInterestRate)
    -

    Definition at line 800 of file TestHelpers.h.

    +

    Definition at line 793 of file TestHelpers.h.

    @@ -426,7 +426,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfCloseInterestRate)
    -

    Definition at line 803 of file TestHelpers.h.

    +

    Definition at line 796 of file TestHelpers.h.

    @@ -444,7 +444,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfOverpaymentInterestRate)
    -

    Definition at line 806 of file TestHelpers.h.

    +

    Definition at line 799 of file TestHelpers.h.

    @@ -460,7 +460,7 @@ Variables
    -

    Definition at line 809 of file TestHelpers.h.

    +

    Definition at line 802 of file TestHelpers.h.

    @@ -476,7 +476,7 @@ Variables
    -

    Definition at line 811 of file TestHelpers.h.

    +

    Definition at line 804 of file TestHelpers.h.

    @@ -492,7 +492,7 @@ Variables
    -

    Definition at line 813 of file TestHelpers.h.

    +

    Definition at line 806 of file TestHelpers.h.

    diff --git a/namespacexrpl_1_1test_1_1jtx_1_1loanBroker.html b/namespacexrpl_1_1test_1_1jtx_1_1loanBroker.html index 5d65aad338..978086d50d 100644 --- a/namespacexrpl_1_1test_1_1jtx_1_1loanBroker.html +++ b/namespacexrpl_1_1test_1_1jtx_1_1loanBroker.html @@ -464,7 +464,7 @@ Variables
    -

    Definition at line 755 of file TestHelpers.h.

    +

    Definition at line 748 of file TestHelpers.h.

    @@ -482,7 +482,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT16, unit::TenthBipsTag>(sfManagementFeeRate)
    -

    Definition at line 757 of file TestHelpers.h.

    +

    Definition at line 750 of file TestHelpers.h.

    @@ -498,7 +498,7 @@ Variables
    -

    Definition at line 760 of file TestHelpers.h.

    +

    Definition at line 753 of file TestHelpers.h.

    @@ -516,7 +516,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfCoverRateMinimum)
    -

    Definition at line 762 of file TestHelpers.h.

    +

    Definition at line 755 of file TestHelpers.h.

    @@ -534,7 +534,7 @@ Variables Initial value:
    =
    valueUnitWrapper<SF_UINT32, unit::TenthBipsTag>(sfCoverRateLiquidation)
    -

    Definition at line 765 of file TestHelpers.h.

    +

    Definition at line 758 of file TestHelpers.h.

    @@ -550,7 +550,7 @@ Variables
    -

    Definition at line 768 of file TestHelpers.h.

    +

    Definition at line 761 of file TestHelpers.h.

    diff --git a/namespacexrpl_1_1test_1_1jtx_1_1paychan.html b/namespacexrpl_1_1test_1_1jtx_1_1paychan.html index 4d7c4282b8..895118c56e 100644 --- a/namespacexrpl_1_1test_1_1jtx_1_1paychan.html +++ b/namespacexrpl_1_1test_1_1jtx_1_1paychan.html @@ -407,7 +407,7 @@ Functions
    -

    Definition at line 526 of file TestHelpers.h.

    +

    Definition at line 519 of file TestHelpers.h.

    @@ -443,7 +443,7 @@ Functions
    -

    Definition at line 562 of file TestHelpers.h.

    +

    Definition at line 555 of file TestHelpers.h.

    diff --git a/paths_8cpp_source.html b/paths_8cpp_source.html index 5afdd37367..6eb20a8ca6 100644 --- a/paths_8cpp_source.html +++ b/paths_8cpp_source.html @@ -227,7 +227,7 @@ $(document).ready(function() { init_codefold(0); });
    unsigned int limit_
    Definition paths.h:20
    T is_same_v
    @ objectValue
    object value (collection of name/value pairs).
    Definition json_value.h:27
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    STAmount amountFromJson(SField const &name, Json::Value const &v)
    std::string to_string(base_uint< Bits, Tag > const &a)
    Definition base_uint.h:611
    diff --git a/pay_8cpp_source.html b/pay_8cpp_source.html index 2ceacb0bd8..b4006db87d 100644 --- a/pay_8cpp_source.html +++ b/pay_8cpp_source.html @@ -120,7 +120,7 @@ $(document).ready(function() { init_codefold(0); });
    Immutable cryptographic account descriptor.
    Definition Account.h:20
    AccountID id() const
    Returns the Account ID.
    Definition Account.h:92
    Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
    Create a payment.
    Definition pay.cpp:11
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    std::string to_string(base_uint< Bits, Tag > const &a)
    Definition base_uint.h:611
    constexpr std::uint32_t tfFullyCanonicalSig
    Transaction flags.
    Definition TxFlags.h:41
    diff --git a/pay_8h_source.html b/pay_8h_source.html index df2b620600..30057fec47 100644 --- a/pay_8h_source.html +++ b/pay_8h_source.html @@ -105,7 +105,7 @@ $(document).ready(function() { init_codefold(0); });
    23#endif
    Represents a JSON value.
    Definition json_value.h:131
    Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
    Create a payment.
    Definition pay.cpp:11
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    base_uint< 160, detail::AccountIDTag > AccountID
    A 160-bit unsigned that uniquely identifies an account.
    Definition AccountID.h:29
    diff --git a/search/all_19.js b/search/all_19.js index 9af5a55d18..69c4d22b90 100644 --- a/search/all_19.js +++ b/search/all_19.js @@ -693,7 +693,7 @@ var searchData= ['run_5ftype_690',['run_type',['../classbeast_1_1unit__test_1_1suite__info.html#ac71d20d51ab7f49cc22add5607b8c12e',1,'beast::unit_test::suite_info']]], ['runasvalidator_691',['runAsValidator',['../structxrpl_1_1test_1_1csf_1_1Peer.html#a464fb3abc3c622d60f496f96b03bc0db',1,'xrpl::test::csf::Peer']]], ['rundata_692',['runData',['../classxrpl_1_1InboundLedger.html#a295ce52f66d709028497fee499a10220',1,'xrpl::InboundLedger']]], - ['runledgerentrytest_693',['runledgerentrytest',['../classxrpl_1_1test_1_1LedgerEntry__test.html#ad455d1538582565210d3360a577474b4',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, source_location const location=source_location::current())'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#acb4ef91f3ef1de7edbe726c903b90e76',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, source_location const location=source_location::current())']]], + ['runledgerentrytest_693',['runledgerentrytest',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a6f5902264b038c62644461eaca1989f6',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::source_location const location=std::source_location::current())'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#a8b6ae4d10e6478ef9a6093f128b66644',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, std::source_location const location=std::source_location::current())']]], ['runloan_694',['runLoan',['../classxrpl_1_1test_1_1Loan__test.html#a9900c15511e2509ba55a9709f59fbea9',1,'xrpl::test::Loan_test']]], ['runmetainfo_695',['runMetaInfo',['../classxrpl_1_1test_1_1TxQPosNegFlows__test.html#a22b99937fdf565297aa3951ce256772f',1,'xrpl::test::TxQPosNegFlows_test']]], ['runnable_696',['runnable',['../classxrpl_1_1JobQueue_1_1Coro.html#a5fb6ab581c7ef0d58dade01ef183004f',1,'xrpl::JobQueue::Coro']]], diff --git a/search/all_1b.js b/search/all_1b.js index b1a009c24d..4f698eeb06 100644 --- a/search/all_1b.js +++ b/search/all_1b.js @@ -1012,10 +1012,10 @@ var searchData= ['testlowbalancedestroy_1009',['testLowBalanceDestroy',['../structxrpl_1_1test_1_1Regression__test.html#ab0047f220ac135ce0ae0c35433caa99f',1,'xrpl::test::Regression_test']]], ['testlptokenbalance_1010',['testLPTokenBalance',['../structxrpl_1_1test_1_1AMM__test.html#ad4cf53482a3843e0a6c7594008f638cb',1,'xrpl::test::AMM_test']]], ['testmalformed_1011',['testmalformed',['../classxrpl_1_1STObject__test.html#ab842611782e7725ca5448ee1fe5c0bac',1,'xrpl::STObject_test::testMalformed()'],['../structxrpl_1_1test_1_1AMM__test.html#a04c076c365f72bdb69e53519680fd65e',1,'xrpl::test::AMM_test::testMalformed()'],['../classxrpl_1_1test_1_1OfferBaseUtil__test.html#a9417882f0811249fc3614348a628fb8c',1,'xrpl::test::OfferBaseUtil_test::testMalformed()']]], - ['testmalformedfield_1012',['testMalformedField',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a3fd84ffbbfb497e9ec4bfb24b73b26f1',1,'xrpl::test::LedgerEntry_test']]], + ['testmalformedfield_1012',['testMalformedField',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a4512146fe48be1291118f983246987d3',1,'xrpl::test::LedgerEntry_test']]], ['testmalformedpk_1013',['testMalformedPK',['../structxrpl_1_1test_1_1PayChan__test.html#af71ad74e2902de1435b16ca79d8afd74',1,'xrpl::test::PayChan_test']]], ['testmalformedserializedform_1014',['testMalformedSerializedForm',['../classxrpl_1_1STTx__test.html#a293698300af01239f6ac8a2e348ddb49',1,'xrpl::STTx_test']]], - ['testmalformedsubfield_1015',['testMalformedSubfield',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a262476a1842d2c988e77da28f79359d4',1,'xrpl::test::LedgerEntry_test']]], + ['testmalformedsubfield_1015',['testMalformedSubfield',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a13c00b14f303b80b58dd879f83f6c960',1,'xrpl::test::LedgerEntry_test']]], ['testmalformedtransaction_1016',['testMalformedTransaction',['../classxrpl_1_1test_1_1SetTrust__test.html#a7a488c3ceda0517e31d28df6905b3d83',1,'xrpl::test::SetTrust_test']]], ['testmanifestdeserialization_1017',['testManifestDeserialization',['../classxrpl_1_1test_1_1Manifest__test.html#a2425c5830f569486feaec9966e892904',1,'xrpl::test::Manifest_test']]], ['testmanifestdomainnames_1018',['testManifestDomainNames',['../classxrpl_1_1test_1_1Manifest__test.html#a6ce0ccd07d91555d139fca01cbf5c89f',1,'xrpl::test::Manifest_test']]], diff --git a/search/all_a.js b/search/all_a.js index 0ebce5e6a2..00c5c5789a 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -219,7 +219,7 @@ var searchData= ['checker_216',['checker',['../classxrpl_1_1PeerFinder_1_1Checker.html#ac3e276ca34c1db1a394da739bfc39900',1,'xrpl::PeerFinder::Checker::Checker()'],['../classxrpl_1_1PeerFinder_1_1Checker.html',1,'xrpl::PeerFinder::Checker< Protocol >']]], ['checker_3c_20boost_3a_3aasio_3a_3aip_3a_3atcp_20_3e_217',['Checker< boost::asio::ip::tcp >',['../classxrpl_1_1PeerFinder_1_1Checker.html',1,'xrpl::PeerFinder']]], ['checker_5f_218',['checker_',['../classxrpl_1_1PeerFinder_1_1ManagerImp.html#a473786f2abd8ef8415f9cc65972a4a91',1,'xrpl::PeerFinder::ManagerImp::checker_'],['../structxrpl_1_1PeerFinder_1_1Checker_1_1async__op.html#a05291edc60314c6a1e08a1fcae8713b7',1,'xrpl::PeerFinder::Checker::async_op::checker_']]], - ['checkerrorvalue_219',['checkerrorvalue',['../classxrpl_1_1test_1_1LedgerRPC__test.html#ac783d6e5742852466896d7d3bf1927c3',1,'xrpl::test::LedgerRPC_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__XChain__test.html#a391f7c9b26c6ec1b582965a880078805',1,'xrpl::test::LedgerEntry_XChain_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#af2a84d8c4a7d2236ca47397ddc23dc57',1,'xrpl::test::LedgerEntry_test::checkErrorValue()']]], + ['checkerrorvalue_219',['checkerrorvalue',['../classxrpl_1_1test_1_1LedgerRPC__test.html#ac783d6e5742852466896d7d3bf1927c3',1,'xrpl::test::LedgerRPC_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__XChain__test.html#a391f7c9b26c6ec1b582965a880078805',1,'xrpl::test::LedgerEntry_XChain_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#a0663312664bb9a0effa64082f964cbd1',1,'xrpl::test::LedgerEntry_test::checkErrorValue()']]], ['checkexpectedcounters_220',['checkExpectedCounters',['../classxrpl_1_1test_1_1CheckDeliveredAmount.html#a45c224cedd55531c09e458eec0eda09b',1,'xrpl::test::CheckDeliveredAmount']]], ['checkexpired_221',['checkExpired',['../namespacexrpl_1_1credentials.html#a3f935c38fe97b2a280a9e31376f17da0',1,'xrpl::credentials']]], ['checkextrafeatures_222',['checkextrafeatures',['../classxrpl_1_1LoanBrokerDelete.html#af20cc7f804fea24c13d1984e28bf2160',1,'xrpl::LoanBrokerDelete::checkExtraFeatures()'],['../classxrpl_1_1VaultCreate.html#ab0d90f9893e664e57ae8f803e7a288dc',1,'xrpl::VaultCreate::checkExtraFeatures()'],['../classxrpl_1_1Transactor.html#a92e0755f0a59856a11279fddfc2c92e1',1,'xrpl::Transactor::checkExtraFeatures()'],['../classxrpl_1_1PermissionedDomainSet.html#a8eb5ff1eb6df28a57f276938d0195483',1,'xrpl::PermissionedDomainSet::checkExtraFeatures()'],['../classxrpl_1_1Payment.html#a6fb08232e8d68b85a3426f6f119263bb',1,'xrpl::Payment::checkExtraFeatures()'],['../classxrpl_1_1PayChanClaim.html#a719d908994a9a7d07b3c101e61f3a2b6',1,'xrpl::PayChanClaim::checkExtraFeatures()'],['../classxrpl_1_1NFTokenMint.html#afbd9cb8300b4d348b32dba14ed55a685',1,'xrpl::NFTokenMint::checkExtraFeatures()'],['../classxrpl_1_1MPTokenIssuanceSet.html#a78e86251d79137a166c4a7fe7a272dd9',1,'xrpl::MPTokenIssuanceSet::checkExtraFeatures()'],['../classxrpl_1_1MPTokenIssuanceCreate.html#a3e4ab04c1115db63cc1a4768602026a6',1,'xrpl::MPTokenIssuanceCreate::checkExtraFeatures()'],['../classxrpl_1_1LoanSet.html#ad41fd8ca03cdd37cf532390e584e3c62',1,'xrpl::LoanSet::checkExtraFeatures()'],['../classxrpl_1_1LoanPay.html#abce798f17c467cb56f9f15a2f6017bf4',1,'xrpl::LoanPay::checkExtraFeatures()'],['../classxrpl_1_1LoanManage.html#ae863824a4fd909f91591f30654ee20b7',1,'xrpl::LoanManage::checkExtraFeatures()'],['../classxrpl_1_1LoanDelete.html#a2491f350ddad0f9ca63d37e60264a822',1,'xrpl::LoanDelete::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerSet.html#ae2bfc4cc7c1c7d077782dce877ce6c16',1,'xrpl::LoanBrokerSet::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerCoverWithdraw.html#a229904227bfa64389acd14a8e346f0d8',1,'xrpl::LoanBrokerCoverWithdraw::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerCoverDeposit.html#a9bb49466137bc0d2fdaf8ff025240f7d',1,'xrpl::LoanBrokerCoverDeposit::checkExtraFeatures()'],['../classxrpl_1_1EscrowFinish.html#a7c0ebead81a04ff6838cd6115a84e34d',1,'xrpl::EscrowFinish::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerCoverClawback.html#aec06bdf9c63ec8e27222a7afd0ac36a4',1,'xrpl::LoanBrokerCoverClawback::checkExtraFeatures()'],['../classxrpl_1_1AMMBid.html#aa656a8c507929dfb2af7ab5515afdd54',1,'xrpl::AMMBid::checkExtraFeatures()'],['../classxrpl_1_1AMMCreate.html#aa029a436c320aeb085f56eba8f5d8636',1,'xrpl::AMMCreate::checkExtraFeatures()'],['../classxrpl_1_1DepositPreauth.html#a9c4cfc0c36e479638286a1df4c4d607d',1,'xrpl::DepositPreauth::checkExtraFeatures()'],['../classxrpl_1_1DeleteAccount.html#ad1d20e279b1d6a22d11d8d8929d426b8',1,'xrpl::DeleteAccount::checkExtraFeatures()'],['../classxrpl_1_1CreateOffer.html#a6d086cc40ac4c849b13125814e8aaea9',1,'xrpl::CreateOffer::checkExtraFeatures()'],['../classxrpl_1_1VaultSet.html#a1bfb04bb183217d6ecfa51f01ef14913',1,'xrpl::VaultSet::checkExtraFeatures()'],['../classxrpl_1_1AMMDelete.html#a6b78a2e966fa15ea69417c3c537a74e4',1,'xrpl::AMMDelete::checkExtraFeatures()'],['../classxrpl_1_1AMMWithdraw.html#ae1508802cac815d257c5c9ac46775a09',1,'xrpl::AMMWithdraw::checkExtraFeatures()'],['../classxrpl_1_1AMMVote.html#ac27318b31d12379a0cc3b74221b1d0cf',1,'xrpl::AMMVote::checkExtraFeatures()'],['../classxrpl_1_1AMMDeposit.html#a365fc61306235d582f2741a653f88f4b',1,'xrpl::AMMDeposit::checkExtraFeatures()']]], @@ -255,7 +255,7 @@ var searchData= ['checkmeta_252',['checkMeta',['../classbeast_1_1SemanticVersion__test.html#a698c693bbbfc1b6d024419c1c7e573bc',1,'beast::SemanticVersion_test']]], ['checkmetadata_253',['checkMetadata',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#a3d4eac7e9a79c16aef8545b8825cdecf',1,'xrpl::test::jtx::MPTTester']]], ['checkmetafail_254',['checkMetaFail',['../classbeast_1_1SemanticVersion__test.html#a7f0a21be8c8c3e2dbc7fb1078e5f0459',1,'beast::SemanticVersion_test']]], - ['checkmetrics_255',['checkMetrics',['../namespacexrpl_1_1test_1_1jtx.html#aece1354283ab3acc6983eaef5ee6d339',1,'xrpl::test::jtx']]], + ['checkmetrics_255',['checkMetrics',['../namespacexrpl_1_1test_1_1jtx.html#a6df2151ed3ba367ef5882bf2ed8bf101',1,'xrpl::test::jtx']]], ['checkmptokenamount_256',['checkMPTokenAmount',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#a1c2fc35542e87537166092ad15f44a9b',1,'xrpl::test::jtx::MPTTester']]], ['checkmptokenoutstandingamount_257',['checkMPTokenOutstandingAmount',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#aef2af41185972701621a11d96f9d5bce',1,'xrpl::test::jtx::MPTTester']]], ['checkmultisign_258',['checkmultisign',['../classxrpl_1_1STTx.html#a1bead6be8a6687a8ba8410d08282337b',1,'xrpl::STTx::checkMultiSign()'],['../classxrpl_1_1Transactor.html#ac09157050e2393fcb951284069a88ed5',1,'xrpl::Transactor::checkMultiSign()']]], diff --git a/search/functions_12.js b/search/functions_12.js index b2d78465a2..093b72a819 100644 --- a/search/functions_12.js +++ b/search/functions_12.js @@ -325,7 +325,7 @@ var searchData= ['run_5fif_322',['run_if',['../classbeast_1_1unit__test_1_1runner.html#ac192a12be06a2c2eebdeeaa5f835b0ed',1,'beast::unit_test::runner']]], ['run_5fmulti_323',['run_multi',['../classxrpl_1_1test_1_1multi__runner__child.html#a02739879fb16cb9bc125ca5ee34e240c',1,'xrpl::test::multi_runner_child']]], ['rundata_324',['runData',['../classxrpl_1_1InboundLedger.html#a295ce52f66d709028497fee499a10220',1,'xrpl::InboundLedger']]], - ['runledgerentrytest_325',['runledgerentrytest',['../classxrpl_1_1test_1_1LedgerEntry__test.html#acb4ef91f3ef1de7edbe726c903b90e76',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, source_location const location=source_location::current())'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#ad455d1538582565210d3360a577474b4',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, source_location const location=source_location::current())']]], + ['runledgerentrytest_325',['runledgerentrytest',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a8b6ae4d10e6478ef9a6093f128b66644',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::vector< Subfield > const &subfields, std::source_location const location=std::source_location::current())'],['../classxrpl_1_1test_1_1LedgerEntry__test.html#a6f5902264b038c62644461eaca1989f6',1,'xrpl::test::LedgerEntry_test::runLedgerEntryTest(test::jtx::Env &env, Json::StaticString const &parentField, std::source_location const location=std::source_location::current())']]], ['runloan_326',['runLoan',['../classxrpl_1_1test_1_1Loan__test.html#a9900c15511e2509ba55a9709f59fbea9',1,'xrpl::test::Loan_test']]], ['runmetainfo_327',['runMetaInfo',['../classxrpl_1_1test_1_1TxQPosNegFlows__test.html#a22b99937fdf565297aa3951ce256772f',1,'xrpl::test::TxQPosNegFlows_test']]], ['runnable_328',['runnable',['../classxrpl_1_1JobQueue_1_1Coro.html#a5fb6ab581c7ef0d58dade01ef183004f',1,'xrpl::JobQueue::Coro']]], diff --git a/search/functions_14.js b/search/functions_14.js index ecc75aba6d..c3f2251139 100644 --- a/search/functions_14.js +++ b/search/functions_14.js @@ -724,10 +724,10 @@ var searchData= ['testlowbalancedestroy_721',['testLowBalanceDestroy',['../structxrpl_1_1test_1_1Regression__test.html#ab0047f220ac135ce0ae0c35433caa99f',1,'xrpl::test::Regression_test']]], ['testlptokenbalance_722',['testLPTokenBalance',['../structxrpl_1_1test_1_1AMM__test.html#ad4cf53482a3843e0a6c7594008f638cb',1,'xrpl::test::AMM_test']]], ['testmalformed_723',['testmalformed',['../structxrpl_1_1test_1_1AMM__test.html#a04c076c365f72bdb69e53519680fd65e',1,'xrpl::test::AMM_test::testMalformed()'],['../classxrpl_1_1test_1_1OfferBaseUtil__test.html#a9417882f0811249fc3614348a628fb8c',1,'xrpl::test::OfferBaseUtil_test::testMalformed()'],['../classxrpl_1_1STObject__test.html#ab842611782e7725ca5448ee1fe5c0bac',1,'xrpl::STObject_test::testMalformed()']]], - ['testmalformedfield_724',['testMalformedField',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a3fd84ffbbfb497e9ec4bfb24b73b26f1',1,'xrpl::test::LedgerEntry_test']]], + ['testmalformedfield_724',['testMalformedField',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a4512146fe48be1291118f983246987d3',1,'xrpl::test::LedgerEntry_test']]], ['testmalformedpk_725',['testMalformedPK',['../structxrpl_1_1test_1_1PayChan__test.html#af71ad74e2902de1435b16ca79d8afd74',1,'xrpl::test::PayChan_test']]], ['testmalformedserializedform_726',['testMalformedSerializedForm',['../classxrpl_1_1STTx__test.html#a293698300af01239f6ac8a2e348ddb49',1,'xrpl::STTx_test']]], - ['testmalformedsubfield_727',['testMalformedSubfield',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a262476a1842d2c988e77da28f79359d4',1,'xrpl::test::LedgerEntry_test']]], + ['testmalformedsubfield_727',['testMalformedSubfield',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a13c00b14f303b80b58dd879f83f6c960',1,'xrpl::test::LedgerEntry_test']]], ['testmalformedtransaction_728',['testMalformedTransaction',['../classxrpl_1_1test_1_1SetTrust__test.html#a7a488c3ceda0517e31d28df6905b3d83',1,'xrpl::test::SetTrust_test']]], ['testmanifestdeserialization_729',['testManifestDeserialization',['../classxrpl_1_1test_1_1Manifest__test.html#a2425c5830f569486feaec9966e892904',1,'xrpl::test::Manifest_test']]], ['testmanifestdomainnames_730',['testManifestDomainNames',['../classxrpl_1_1test_1_1Manifest__test.html#a6ce0ccd07d91555d139fca01cbf5c89f',1,'xrpl::test::Manifest_test']]], diff --git a/search/functions_3.js b/search/functions_3.js index 7874c6f0fc..2548c675e1 100644 --- a/search/functions_3.js +++ b/search/functions_3.js @@ -140,7 +140,7 @@ var searchData= ['checkemplace_137',['checkEmplace',['../classbeast_1_1aged__associative__container__test__base.html#a2352949988b8d29af8285f223c65a5e8',1,'beast::aged_associative_container_test_base']]], ['checkemplacehint_138',['checkEmplaceHint',['../classbeast_1_1aged__associative__container__test__base.html#af331354f095d23187ada9be4a416bb82',1,'beast::aged_associative_container_test_base']]], ['checker_139',['Checker',['../classxrpl_1_1PeerFinder_1_1Checker.html#ac3e276ca34c1db1a394da739bfc39900',1,'xrpl::PeerFinder::Checker']]], - ['checkerrorvalue_140',['checkerrorvalue',['../classxrpl_1_1test_1_1LedgerEntry__test.html#af2a84d8c4a7d2236ca47397ddc23dc57',1,'xrpl::test::LedgerEntry_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__XChain__test.html#a391f7c9b26c6ec1b582965a880078805',1,'xrpl::test::LedgerEntry_XChain_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerRPC__test.html#ac783d6e5742852466896d7d3bf1927c3',1,'xrpl::test::LedgerRPC_test::checkErrorValue()']]], + ['checkerrorvalue_140',['checkerrorvalue',['../classxrpl_1_1test_1_1LedgerEntry__test.html#a0663312664bb9a0effa64082f964cbd1',1,'xrpl::test::LedgerEntry_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerEntry__XChain__test.html#a391f7c9b26c6ec1b582965a880078805',1,'xrpl::test::LedgerEntry_XChain_test::checkErrorValue()'],['../classxrpl_1_1test_1_1LedgerRPC__test.html#ac783d6e5742852466896d7d3bf1927c3',1,'xrpl::test::LedgerRPC_test::checkErrorValue()']]], ['checkexpectedcounters_141',['checkExpectedCounters',['../classxrpl_1_1test_1_1CheckDeliveredAmount.html#a45c224cedd55531c09e458eec0eda09b',1,'xrpl::test::CheckDeliveredAmount']]], ['checkexpired_142',['checkExpired',['../namespacexrpl_1_1credentials.html#a3f935c38fe97b2a280a9e31376f17da0',1,'xrpl::credentials']]], ['checkextrafeatures_143',['checkextrafeatures',['../classxrpl_1_1LoanBrokerCoverWithdraw.html#a229904227bfa64389acd14a8e346f0d8',1,'xrpl::LoanBrokerCoverWithdraw::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerDelete.html#af20cc7f804fea24c13d1984e28bf2160',1,'xrpl::LoanBrokerDelete::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerCoverDeposit.html#a9bb49466137bc0d2fdaf8ff025240f7d',1,'xrpl::LoanBrokerCoverDeposit::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerCoverClawback.html#aec06bdf9c63ec8e27222a7afd0ac36a4',1,'xrpl::LoanBrokerCoverClawback::checkExtraFeatures()'],['../classxrpl_1_1EscrowFinish.html#a7c0ebead81a04ff6838cd6115a84e34d',1,'xrpl::EscrowFinish::checkExtraFeatures()'],['../classxrpl_1_1DepositPreauth.html#a9c4cfc0c36e479638286a1df4c4d607d',1,'xrpl::DepositPreauth::checkExtraFeatures()'],['../classxrpl_1_1DeleteAccount.html#ad1d20e279b1d6a22d11d8d8929d426b8',1,'xrpl::DeleteAccount::checkExtraFeatures()'],['../classxrpl_1_1CreateOffer.html#a6d086cc40ac4c849b13125814e8aaea9',1,'xrpl::CreateOffer::checkExtraFeatures()'],['../classxrpl_1_1AMMWithdraw.html#ae1508802cac815d257c5c9ac46775a09',1,'xrpl::AMMWithdraw::checkExtraFeatures()'],['../classxrpl_1_1AMMVote.html#ac27318b31d12379a0cc3b74221b1d0cf',1,'xrpl::AMMVote::checkExtraFeatures()'],['../classxrpl_1_1AMMDeposit.html#a365fc61306235d582f2741a653f88f4b',1,'xrpl::AMMDeposit::checkExtraFeatures()'],['../classxrpl_1_1AMMDelete.html#a6b78a2e966fa15ea69417c3c537a74e4',1,'xrpl::AMMDelete::checkExtraFeatures()'],['../classxrpl_1_1AMMCreate.html#aa029a436c320aeb085f56eba8f5d8636',1,'xrpl::AMMCreate::checkExtraFeatures()'],['../classxrpl_1_1AMMBid.html#aa656a8c507929dfb2af7ab5515afdd54',1,'xrpl::AMMBid::checkExtraFeatures()'],['../classxrpl_1_1LoanBrokerSet.html#ae2bfc4cc7c1c7d077782dce877ce6c16',1,'xrpl::LoanBrokerSet::checkExtraFeatures()'],['../classxrpl_1_1LoanDelete.html#a2491f350ddad0f9ca63d37e60264a822',1,'xrpl::LoanDelete::checkExtraFeatures()'],['../classxrpl_1_1LoanManage.html#ae863824a4fd909f91591f30654ee20b7',1,'xrpl::LoanManage::checkExtraFeatures()'],['../classxrpl_1_1LoanPay.html#abce798f17c467cb56f9f15a2f6017bf4',1,'xrpl::LoanPay::checkExtraFeatures()'],['../classxrpl_1_1LoanSet.html#ad41fd8ca03cdd37cf532390e584e3c62',1,'xrpl::LoanSet::checkExtraFeatures()'],['../classxrpl_1_1MPTokenIssuanceCreate.html#a3e4ab04c1115db63cc1a4768602026a6',1,'xrpl::MPTokenIssuanceCreate::checkExtraFeatures()'],['../classxrpl_1_1MPTokenIssuanceSet.html#a78e86251d79137a166c4a7fe7a272dd9',1,'xrpl::MPTokenIssuanceSet::checkExtraFeatures()'],['../classxrpl_1_1NFTokenMint.html#afbd9cb8300b4d348b32dba14ed55a685',1,'xrpl::NFTokenMint::checkExtraFeatures()'],['../classxrpl_1_1PayChanClaim.html#a719d908994a9a7d07b3c101e61f3a2b6',1,'xrpl::PayChanClaim::checkExtraFeatures()'],['../classxrpl_1_1VaultSet.html#a1bfb04bb183217d6ecfa51f01ef14913',1,'xrpl::VaultSet::checkExtraFeatures()'],['../classxrpl_1_1VaultCreate.html#ab0d90f9893e664e57ae8f803e7a288dc',1,'xrpl::VaultCreate::checkExtraFeatures()'],['../classxrpl_1_1Transactor.html#a92e0755f0a59856a11279fddfc2c92e1',1,'xrpl::Transactor::checkExtraFeatures()'],['../classxrpl_1_1PermissionedDomainSet.html#a8eb5ff1eb6df28a57f276938d0195483',1,'xrpl::PermissionedDomainSet::checkExtraFeatures()'],['../classxrpl_1_1Payment.html#a6fb08232e8d68b85a3426f6f119263bb',1,'xrpl::Payment::checkExtraFeatures()']]], @@ -173,7 +173,7 @@ var searchData= ['checkmeta_170',['checkMeta',['../classbeast_1_1SemanticVersion__test.html#a698c693bbbfc1b6d024419c1c7e573bc',1,'beast::SemanticVersion_test']]], ['checkmetadata_171',['checkMetadata',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#a3d4eac7e9a79c16aef8545b8825cdecf',1,'xrpl::test::jtx::MPTTester']]], ['checkmetafail_172',['checkMetaFail',['../classbeast_1_1SemanticVersion__test.html#a7f0a21be8c8c3e2dbc7fb1078e5f0459',1,'beast::SemanticVersion_test']]], - ['checkmetrics_173',['checkMetrics',['../namespacexrpl_1_1test_1_1jtx.html#aece1354283ab3acc6983eaef5ee6d339',1,'xrpl::test::jtx']]], + ['checkmetrics_173',['checkMetrics',['../namespacexrpl_1_1test_1_1jtx.html#a6df2151ed3ba367ef5882bf2ed8bf101',1,'xrpl::test::jtx']]], ['checkmptokenamount_174',['checkMPTokenAmount',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#a1c2fc35542e87537166092ad15f44a9b',1,'xrpl::test::jtx::MPTTester']]], ['checkmptokenoutstandingamount_175',['checkMPTokenOutstandingAmount',['../classxrpl_1_1test_1_1jtx_1_1MPTTester.html#aef2af41185972701621a11d96f9d5bce',1,'xrpl::test::jtx::MPTTester']]], ['checkmultisign_176',['checkmultisign',['../classxrpl_1_1STTx.html#a1bead6be8a6687a8ba8410d08282337b',1,'xrpl::STTx::checkMultiSign()'],['../classxrpl_1_1Transactor.html#ac09157050e2393fcb951284069a88ed5',1,'xrpl::Transactor::checkMultiSign()']]], diff --git a/sendmax_8h_source.html b/sendmax_8h_source.html index d69b4822ef..fc3e5ead4b 100644 --- a/sendmax_8h_source.html +++ b/sendmax_8h_source.html @@ -121,7 +121,7 @@ $(document).ready(function() { init_codefold(0); });
    void operator()(Env &, JTx &jtx) const
    Definition sendmax.cpp:10
    sendmax(STAmount const &amount)
    Definition sendmax.h:19
    STAmount amount_
    Definition sendmax.h:16
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    Execution context for applying a JSON transaction.
    Definition JTx.h:26
    diff --git a/src_2test_2csf_2Scheduler_8h_source.html b/src_2test_2csf_2Scheduler_8h_source.html index d09a5981c5..9efd389c06 100644 --- a/src_2test_2csf_2Scheduler_8h_source.html +++ b/src_2test_2csf_2Scheduler_8h_source.html @@ -535,7 +535,7 @@ $(document).ready(function() { init_codefold(0); });
    T is_same_v
    STL namespace.
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    @ forward
    constexpr auto kilobytes(T value) noexcept
    diff --git a/src_2test_2jtx_2amount_8h_source.html b/src_2test_2jtx_2amount_8h_source.html index 38194ec006..024a4e8101 100644 --- a/src_2test_2jtx_2amount_8h_source.html +++ b/src_2test_2jtx_2amount_8h_source.html @@ -811,7 +811,7 @@ $(document).ready(function() { init_codefold(0); });
    XRP_t const XRP
    Converts to XRP Issue or STAmount.
    Definition amount.cpp:92
    constexpr XRPAmount dropsPerXRP
    bool operator!=(PrettyAmount const &lhs, PrettyAmount const &rhs)
    -
    auto const amount
    +
    auto const amount
    bool operator==(Account const &lhs, Account const &rhs) noexcept
    Definition Account.h:135
    PrettyAmount drops(Integer i)
    Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    diff --git a/structxrpl_1_1test_1_1LedgerEntry__test_1_1Subfield.html b/structxrpl_1_1test_1_1LedgerEntry__test_1_1Subfield.html index 34242ff9db..a0c44c0343 100644 --- a/structxrpl_1_1test_1_1LedgerEntry__test_1_1Subfield.html +++ b/structxrpl_1_1test_1_1LedgerEntry__test_1_1Subfield.html @@ -105,7 +105,7 @@ Public Attributes

    Detailed Description

    -

    Definition at line 422 of file LedgerEntry_test.cpp.

    +

    Definition at line 416 of file LedgerEntry_test.cpp.

    Member Data Documentation

    ◆ fieldName

    @@ -119,7 +119,7 @@ Public Attributes
    -

    Definition at line 424 of file LedgerEntry_test.cpp.

    +

    Definition at line 418 of file LedgerEntry_test.cpp.

    @@ -135,7 +135,7 @@ Public Attributes
    -

    Definition at line 425 of file LedgerEntry_test.cpp.

    +

    Definition at line 419 of file LedgerEntry_test.cpp.

    @@ -151,7 +151,7 @@ Public Attributes
    -

    Definition at line 426 of file LedgerEntry_test.cpp.

    +

    Definition at line 420 of file LedgerEntry_test.cpp.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1JTxField.html b/structxrpl_1_1test_1_1jtx_1_1JTxField.html index fcdbfc2004..e2282d0f0f 100644 --- a/structxrpl_1_1test_1_1jtx_1_1JTxField.html +++ b/structxrpl_1_1test_1_1jtx_1_1JTxField.html @@ -142,7 +142,7 @@ Protected Attributes struct xrpl::test::jtx::JTxField< SField, StoredValue, OutputValue >

    Generic helper class for helper classes that set a field on a JTx.

    Not every helper will be able to use this because of conversions and other issues, but for classes where it's straightforward, this can simplify things.

    -

    Definition at line 41 of file TestHelpers.h.

    +

    Definition at line 34 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -158,7 +158,7 @@ template<class SField , cla
    -

    Definition at line 43 of file TestHelpers.h.

    +

    Definition at line 36 of file TestHelpers.h.

    @@ -176,7 +176,7 @@ template<class SField , cla
    -

    Definition at line 44 of file TestHelpers.h.

    +

    Definition at line 37 of file TestHelpers.h.

    @@ -194,7 +194,7 @@ template<class SField , cla
    -

    Definition at line 45 of file TestHelpers.h.

    +

    Definition at line 38 of file TestHelpers.h.

    @@ -235,7 +235,7 @@ template<class SField , cla
    -

    Definition at line 52 of file TestHelpers.h.

    +

    Definition at line 45 of file TestHelpers.h.

    @@ -332,7 +332,7 @@ template<class SField , cla
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -359,7 +359,7 @@ template<class SField , cla
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    @@ -385,7 +385,7 @@ template<class SField , cla
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper.html b/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper.html index 61172d59b6..8d4d9c4b0e 100644 --- a/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper.html +++ b/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper.html @@ -108,7 +108,7 @@ Protected Attributes

    Detailed Description

    template<class JTxField>
    struct xrpl::test::jtx::JTxFieldWrapper< JTxField >
    -

    Definition at line 231 of file TestHelpers.h.

    +

    Definition at line 224 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ JF

    @@ -124,7 +124,7 @@ template<class -

    Definition at line 233 of file TestHelpers.h.

    +

    Definition at line 226 of file TestHelpers.h.

    @@ -142,7 +142,7 @@ template<class -

    Definition at line 234 of file TestHelpers.h.

    +

    Definition at line 227 of file TestHelpers.h.

    @@ -160,7 +160,7 @@ template<class -

    Definition at line 235 of file TestHelpers.h.

    +

    Definition at line 228 of file TestHelpers.h.

    @@ -191,7 +191,7 @@ template<class -

    Definition at line 241 of file TestHelpers.h.

    +

    Definition at line 234 of file TestHelpers.h.

    @@ -214,7 +214,7 @@ template<class -

    Definition at line 246 of file TestHelpers.h.

    +

    Definition at line 239 of file TestHelpers.h.

    @@ -241,7 +241,7 @@ template<class -

    Definition at line 238 of file TestHelpers.h.

    +

    Definition at line 231 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper_3_01blobField_01_4.html b/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper_3_01blobField_01_4.html index 63345b7128..0eafc3cc04 100644 --- a/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper_3_01blobField_01_4.html +++ b/structxrpl_1_1test_1_1jtx_1_1JTxFieldWrapper_3_01blobField_01_4.html @@ -137,7 +137,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 253 of file TestHelpers.h.

    +

    Definition at line 246 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ JF

    @@ -151,7 +151,7 @@ Protected Attributes
    -

    Definition at line 255 of file TestHelpers.h.

    +

    Definition at line 248 of file TestHelpers.h.

    @@ -167,7 +167,7 @@ Protected Attributes
    -

    Definition at line 256 of file TestHelpers.h.

    +

    Definition at line 249 of file TestHelpers.h.

    @@ -183,7 +183,7 @@ Protected Attributes
    -

    Definition at line 257 of file TestHelpers.h.

    +

    Definition at line 250 of file TestHelpers.h.

    @@ -212,7 +212,7 @@ Protected Attributes
    -

    Definition at line 263 of file TestHelpers.h.

    +

    Definition at line 256 of file TestHelpers.h.

    @@ -233,7 +233,7 @@ Protected Attributes
    -

    Definition at line 268 of file TestHelpers.h.

    +

    Definition at line 261 of file TestHelpers.h.

    @@ -253,7 +253,7 @@ Protected Attributes
    -

    Definition at line 274 of file TestHelpers.h.

    +

    Definition at line 267 of file TestHelpers.h.

    @@ -275,7 +275,7 @@ template<size_t N>
    -

    Definition at line 281 of file TestHelpers.h.

    +

    Definition at line 274 of file TestHelpers.h.

    @@ -300,7 +300,7 @@ template<size_t N>
    -

    Definition at line 260 of file TestHelpers.h.

    +

    Definition at line 253 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1JTxField_3_01SField_00_01StoredValue_00_01StoredValue_01_4.html b/structxrpl_1_1test_1_1jtx_1_1JTxField_3_01SField_00_01StoredValue_00_01StoredValue_01_4.html index 04e379522a..d43b4be42a 100644 --- a/structxrpl_1_1test_1_1jtx_1_1JTxField_3_01SField_00_01StoredValue_00_01StoredValue_01_4.html +++ b/structxrpl_1_1test_1_1jtx_1_1JTxField_3_01SField_00_01StoredValue_00_01StoredValue_01_4.html @@ -133,7 +133,7 @@ Protected Attributes

    Detailed Description

    template<class SField, class StoredValue>
    struct xrpl::test::jtx::JTxField< SField, StoredValue, StoredValue >
    -

    Definition at line 70 of file TestHelpers.h.

    +

    Definition at line 63 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -149,7 +149,7 @@ template<class SField , cla
    -

    Definition at line 72 of file TestHelpers.h.

    +

    Definition at line 65 of file TestHelpers.h.

    @@ -167,7 +167,7 @@ template<class SField , cla
    -

    Definition at line 73 of file TestHelpers.h.

    +

    Definition at line 66 of file TestHelpers.h.

    @@ -185,7 +185,7 @@ template<class SField , cla
    -

    Definition at line 74 of file TestHelpers.h.

    +

    Definition at line 67 of file TestHelpers.h.

    @@ -226,7 +226,7 @@ template<class SField , cla
    -

    Definition at line 81 of file TestHelpers.h.

    +

    Definition at line 74 of file TestHelpers.h.

    @@ -259,7 +259,7 @@ template<class SField , cla
    -

    Definition at line 87 of file TestHelpers.h.

    +

    Definition at line 80 of file TestHelpers.h.

    @@ -286,7 +286,7 @@ template<class SField , cla
    -

    Definition at line 77 of file TestHelpers.h.

    +

    Definition at line 70 of file TestHelpers.h.

    @@ -312,7 +312,7 @@ template<class SField , cla
    -

    Definition at line 78 of file TestHelpers.h.

    +

    Definition at line 71 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1accountIDField.html b/structxrpl_1_1test_1_1jtx_1_1accountIDField.html index 42b1b90607..4761403633 100644 --- a/structxrpl_1_1test_1_1jtx_1_1accountIDField.html +++ b/structxrpl_1_1test_1_1jtx_1_1accountIDField.html @@ -156,7 +156,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 140 of file TestHelpers.h.

    +

    Definition at line 133 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -170,7 +170,7 @@ Protected Attributes
    -

    Definition at line 142 of file TestHelpers.h.

    +

    Definition at line 135 of file TestHelpers.h.

    @@ -186,7 +186,7 @@ Protected Attributes
    -

    Definition at line 143 of file TestHelpers.h.

    +

    Definition at line 136 of file TestHelpers.h.

    @@ -202,7 +202,7 @@ Protected Attributes
    -

    Definition at line 144 of file TestHelpers.h.

    +

    Definition at line 137 of file TestHelpers.h.

    @@ -218,7 +218,7 @@ Protected Attributes
    -

    Definition at line 145 of file TestHelpers.h.

    +

    Definition at line 138 of file TestHelpers.h.

    @@ -257,7 +257,7 @@ Protected Attributes
    -

    Definition at line 151 of file TestHelpers.h.

    +

    Definition at line 144 of file TestHelpers.h.

    @@ -287,7 +287,7 @@ Protected Attributes

    Implements xrpl::test::jtx::JTxField< SF_ACCOUNT, AccountID, std::string >.

    -

    Definition at line 157 of file TestHelpers.h.

    +

    Definition at line 150 of file TestHelpers.h.

    @@ -325,7 +325,7 @@ Protected Attributes
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -350,7 +350,7 @@ Protected Attributes
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    @@ -374,7 +374,7 @@ Protected Attributes
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1blobField.html b/structxrpl_1_1test_1_1jtx_1_1blobField.html index 5a7f12e81f..f3cb17373a 100644 --- a/structxrpl_1_1test_1_1jtx_1_1blobField.html +++ b/structxrpl_1_1test_1_1jtx_1_1blobField.html @@ -154,7 +154,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 186 of file TestHelpers.h.

    +

    Definition at line 179 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -168,7 +168,7 @@ Protected Attributes
    -

    Definition at line 188 of file TestHelpers.h.

    +

    Definition at line 181 of file TestHelpers.h.

    @@ -184,7 +184,7 @@ Protected Attributes
    -

    Definition at line 189 of file TestHelpers.h.

    +

    Definition at line 182 of file TestHelpers.h.

    @@ -200,7 +200,7 @@ Protected Attributes
    -

    Definition at line 190 of file TestHelpers.h.

    +

    Definition at line 183 of file TestHelpers.h.

    @@ -224,7 +224,7 @@ Protected Attributes
    -

    Definition at line 45 of file TestHelpers.h.

    +

    Definition at line 38 of file TestHelpers.h.

    @@ -263,7 +263,7 @@ Protected Attributes
    -

    Definition at line 194 of file TestHelpers.h.

    +

    Definition at line 187 of file TestHelpers.h.

    @@ -303,7 +303,7 @@ template<size_t N>
    -

    Definition at line 200 of file TestHelpers.h.

    +

    Definition at line 193 of file TestHelpers.h.

    @@ -342,7 +342,7 @@ template<size_t N>
    -

    Definition at line 52 of file TestHelpers.h.

    +

    Definition at line 45 of file TestHelpers.h.

    @@ -405,7 +405,7 @@ template<size_t N>
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -430,7 +430,7 @@ template<size_t N>
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    @@ -454,7 +454,7 @@ template<size_t N>
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1stAmountField.html b/structxrpl_1_1test_1_1jtx_1_1stAmountField.html index aaece2b3de..496cdda84c 100644 --- a/structxrpl_1_1test_1_1jtx_1_1stAmountField.html +++ b/structxrpl_1_1test_1_1jtx_1_1stAmountField.html @@ -161,7 +161,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 163 of file TestHelpers.h.

    +

    Definition at line 156 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -175,7 +175,7 @@ Protected Attributes
    -

    Definition at line 165 of file TestHelpers.h.

    +

    Definition at line 158 of file TestHelpers.h.

    @@ -191,7 +191,7 @@ Protected Attributes
    -

    Definition at line 166 of file TestHelpers.h.

    +

    Definition at line 159 of file TestHelpers.h.

    @@ -207,7 +207,7 @@ Protected Attributes
    -

    Definition at line 167 of file TestHelpers.h.

    +

    Definition at line 160 of file TestHelpers.h.

    @@ -223,7 +223,7 @@ Protected Attributes
    -

    Definition at line 168 of file TestHelpers.h.

    +

    Definition at line 161 of file TestHelpers.h.

    @@ -262,7 +262,7 @@ Protected Attributes
    -

    Definition at line 174 of file TestHelpers.h.

    +

    Definition at line 167 of file TestHelpers.h.

    @@ -292,7 +292,7 @@ Protected Attributes

    Implements xrpl::test::jtx::JTxField< SF_AMOUNT, STAmount, Json::Value >.

    -

    Definition at line 180 of file TestHelpers.h.

    +

    Definition at line 173 of file TestHelpers.h.

    @@ -330,7 +330,7 @@ Protected Attributes
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -355,7 +355,7 @@ Protected Attributes
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    @@ -379,7 +379,7 @@ Protected Attributes
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1timePointField.html b/structxrpl_1_1test_1_1jtx_1_1timePointField.html index da0956bb8f..917cd57d2c 100644 --- a/structxrpl_1_1test_1_1jtx_1_1timePointField.html +++ b/structxrpl_1_1test_1_1jtx_1_1timePointField.html @@ -150,7 +150,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 93 of file TestHelpers.h.

    +

    Definition at line 86 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -164,7 +164,7 @@ Protected Attributes
    -

    Definition at line 96 of file TestHelpers.h.

    +

    Definition at line 89 of file TestHelpers.h.

    @@ -180,7 +180,7 @@ Protected Attributes
    -

    Definition at line 97 of file TestHelpers.h.

    +

    Definition at line 90 of file TestHelpers.h.

    @@ -196,7 +196,7 @@ Protected Attributes
    -

    Definition at line 98 of file TestHelpers.h.

    +

    Definition at line 91 of file TestHelpers.h.

    @@ -212,7 +212,7 @@ Protected Attributes
    -

    Definition at line 99 of file TestHelpers.h.

    +

    Definition at line 92 of file TestHelpers.h.

    @@ -251,7 +251,7 @@ Protected Attributes
    -

    Definition at line 105 of file TestHelpers.h.

    +

    Definition at line 98 of file TestHelpers.h.

    @@ -281,7 +281,7 @@ Protected Attributes

    Implements xrpl::test::jtx::JTxField< SF_UINT32, NetClock::time_point, NetClock::rep >.

    -

    Definition at line 111 of file TestHelpers.h.

    +

    Definition at line 104 of file TestHelpers.h.

    @@ -319,7 +319,7 @@ Protected Attributes
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -344,7 +344,7 @@ Protected Attributes
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    @@ -368,7 +368,7 @@ Protected Attributes
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1uint256Field.html b/structxrpl_1_1test_1_1jtx_1_1uint256Field.html index 2831286261..a979808382 100644 --- a/structxrpl_1_1test_1_1jtx_1_1uint256Field.html +++ b/structxrpl_1_1test_1_1jtx_1_1uint256Field.html @@ -156,7 +156,7 @@ Protected Attributes

    Detailed Description

    -

    Definition at line 117 of file TestHelpers.h.

    +

    Definition at line 110 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -170,7 +170,7 @@ Protected Attributes
    -

    Definition at line 119 of file TestHelpers.h.

    +

    Definition at line 112 of file TestHelpers.h.

    @@ -186,7 +186,7 @@ Protected Attributes
    -

    Definition at line 120 of file TestHelpers.h.

    +

    Definition at line 113 of file TestHelpers.h.

    @@ -202,7 +202,7 @@ Protected Attributes
    -

    Definition at line 121 of file TestHelpers.h.

    +

    Definition at line 114 of file TestHelpers.h.

    @@ -218,7 +218,7 @@ Protected Attributes
    -

    Definition at line 122 of file TestHelpers.h.

    +

    Definition at line 115 of file TestHelpers.h.

    @@ -257,7 +257,7 @@ Protected Attributes
    -

    Definition at line 128 of file TestHelpers.h.

    +

    Definition at line 121 of file TestHelpers.h.

    @@ -287,7 +287,7 @@ Protected Attributes

    Implements xrpl::test::jtx::JTxField< SF_UINT256, uint256, std::string >.

    -

    Definition at line 134 of file TestHelpers.h.

    +

    Definition at line 127 of file TestHelpers.h.

    @@ -325,7 +325,7 @@ Protected Attributes
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -350,7 +350,7 @@ Protected Attributes
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    @@ -374,7 +374,7 @@ Protected Attributes
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    diff --git a/structxrpl_1_1test_1_1jtx_1_1valueUnitField.html b/structxrpl_1_1test_1_1jtx_1_1valueUnitField.html index ad16f22b08..e84fe0a6be 100644 --- a/structxrpl_1_1test_1_1jtx_1_1valueUnitField.html +++ b/structxrpl_1_1test_1_1jtx_1_1valueUnitField.html @@ -161,7 +161,7 @@ Protected Attributes

    Detailed Description

    template<class SField, class UnitTag, class ValueType>
    struct xrpl::test::jtx::valueUnitField< SField, UnitTag, ValueType >
    -

    Definition at line 207 of file TestHelpers.h.

    +

    Definition at line 200 of file TestHelpers.h.

    Member Typedef Documentation

    ◆ SF

    @@ -177,7 +177,7 @@ template<class SField , cla
    -

    Definition at line 210 of file TestHelpers.h.

    +

    Definition at line 203 of file TestHelpers.h.

    @@ -195,7 +195,7 @@ template<class SField , cla
    -

    Definition at line 211 of file TestHelpers.h.

    +

    Definition at line 204 of file TestHelpers.h.

    @@ -213,7 +213,7 @@ template<class SField , cla
    -

    Definition at line 212 of file TestHelpers.h.

    +

    Definition at line 205 of file TestHelpers.h.

    @@ -231,7 +231,7 @@ template<class SField , cla
    -

    Definition at line 213 of file TestHelpers.h.

    +

    Definition at line 206 of file TestHelpers.h.

    @@ -263,7 +263,7 @@ template<class SField , cla

    Implements xrpl::test::jtx::JTxField< SField, unit::ValueUnit< UnitTag, ValueType >, ValueType >.

    -

    Definition at line 224 of file TestHelpers.h.

    +

    Definition at line 217 of file TestHelpers.h.

    @@ -301,7 +301,7 @@ template<class SField , cla
    -

    Definition at line 63 of file TestHelpers.h.

    +

    Definition at line 56 of file TestHelpers.h.

    @@ -328,7 +328,7 @@ template<class SField , cla
    -

    Definition at line 49 of file TestHelpers.h.

    +

    Definition at line 42 of file TestHelpers.h.

    @@ -352,7 +352,7 @@ template<class SField , cla
    -

    Definition at line 48 of file TestHelpers.h.

    +

    Definition at line 41 of file TestHelpers.h.

    diff --git a/trust_8cpp_source.html b/trust_8cpp_source.html index 6bd1d3434f..dc80eb0e71 100644 --- a/trust_8cpp_source.html +++ b/trust_8cpp_source.html @@ -163,7 +163,7 @@ $(document).ready(function() { init_codefold(0); });
    Json::Value claw(Account const &account, STAmount const &amount, std::optional< Account > const &mptHolder)
    Definition trust.cpp:50
    Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
    Modify a trust line.
    Definition trust.cpp:13
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6
    bool isXRP(AccountID const &c)
    Definition AccountID.h:71
    diff --git a/trust_8h_source.html b/trust_8h_source.html index 56fa1d18cb..54e47a9954 100644 --- a/trust_8h_source.html +++ b/trust_8h_source.html @@ -119,7 +119,7 @@ $(document).ready(function() { init_codefold(0); });
    T is_same_v
    Json::Value claw(Account const &account, STAmount const &amount, std::optional< Account > const &mptHolder)
    Definition trust.cpp:50
    Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
    Modify a trust line.
    Definition trust.cpp:13
    -
    auto const amount
    +
    auto const amount
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition algorithm.h:6