From bb5efdeec8afe1583bc2e3baa7527ff75497343a Mon Sep 17 00:00:00 2001 From: bthomee Date: Fri, 15 Aug 2025 23:31:42 +0000 Subject: [PATCH] deploy: ceb0ce5634e57eaa5207bd13da8705cb0117ebc3 --- AMMClawback__test_8cpp_source.html | 8 +- AMMExtended__test_8cpp_source.html | 10 +- AMMInfo__test_8cpp_source.html | 4 +- AMMTest_8cpp_source.html | 6 +- AMM_8cpp_source.html | 2 +- AMM__test_8cpp_source.html | 16 +- AccountDelete__test_8cpp_source.html | 6 +- AccountObjects__test_8cpp_source.html | 8 +- AccountOffers__test_8cpp_source.html | 4 +- AccountTx__test_8cpp_source.html | 12 +- AutoSocket_8h_source.html | 2 +- Batch__test_8cpp_source.html | 8 +- BookChanges__test_8cpp_source.html | 4 +- BookDirs__test_8cpp_source.html | 6 +- BookListeners_8h_source.html | 2 +- Book__test_8cpp_source.html | 8 +- Check__test_8cpp_source.html | 4 +- Clawback__test_8cpp_source.html | 2 +- Config_8cpp_source.html | 1495 +++---- Config_8h_source.html | 10 +- Config__test_8cpp_source.html | 2 +- Context_8h_source.html | 2 +- Credentials__test_8cpp_source.html | 2 +- CrossingLimits__test_8cpp_source.html | 6 +- Delegate__test_8cpp_source.html | 14 +- DeliverMin__test_8cpp_source.html | 6 +- DeliveredAmount__test_8cpp_source.html | 6 +- DepositAuth__test_8cpp_source.html | 14 +- DepositAuthorized__test_8cpp_source.html | 4 +- Directory__test_8cpp_source.html | 14 +- Env_8cpp_source.html | 1206 +++--- Env_8h_source.html | 42 +- Env__ss_8h_source.html | 2 +- Env__test_8cpp_source.html | 16 +- EscrowToken__test_8cpp_source.html | 10 +- Escrow__test_8cpp_source.html | 14 +- FeeVote__test_8cpp_source.html | 2 +- FixNFTokenPageLinks__test_8cpp_source.html | 6 +- Flow__test_8cpp_source.html | 12 +- Freeze__test_8cpp_source.html | 6 +- GRPCServer_8h_source.html | 6 +- GatewayBalances__test_8cpp_source.html | 4 +- GetAggregatePrice__test_8cpp_source.html | 2 +- HTTPClientSSLContext_8h_source.html | 326 +- HTTPClient_8cpp_source.html | 1248 +++--- HTTPClient_8h_source.html | 160 +- InfoSub_8cpp_source.html | 4 +- InfoSub_8h_source.html | 2 +- LedgerEntry__test_8cpp_source.html | 6 +- LedgerHistory__test_8cpp_source.html | 4 +- LedgerRPC__test_8cpp_source.html | 6 +- LedgerReplay__test_8cpp_source.html | 6 +- MPToken__test_8cpp_source.html | 6 +- Main_8cpp_source.html | 4 +- MultiSign__test_8cpp_source.html | 6 +- NFTokenAuth__test_8cpp_source.html | 4 +- NFTokenBurn__test_8cpp_source.html | 4 +- NFToken__test_8cpp_source.html | 8 +- NetworkID__test_8cpp_source.html | 8 +- NetworkOPs_8cpp_source.html | 2 +- NetworkOPs_8h_source.html | 2 +- NoRipple__test_8cpp_source.html | 6 +- Node_8cpp_source.html | 2 +- Offer__test_8cpp_source.html | 14 +- Oracle_8cpp_source.html | 4 +- Oracle__test_8cpp_source.html | 8 +- OversizeMeta__test_8cpp_source.html | 6 +- PathRequest_8h_source.html | 2 +- Path__test_8cpp_source.html | 8 +- PayChan__test_8cpp_source.html | 12 +- PayStrand__test_8cpp_source.html | 8 +- PaymentSandbox__test_8cpp_source.html | 6 +- PeerFinder__test_8cpp_source.html | 2 +- PermissionedDEX__test_8cpp_source.html | 12 +- PermissionedDomains__test_8cpp_source.html | 14 +- PseudoTx__test_8cpp_source.html | 2 +- RPCCall_8cpp_source.html | 3519 ++++++++------- RPCCall_8h_source.html | 10 +- RPCCall__test_8cpp_source.html | 2 +- RPCHandler_8cpp_source.html | 6 +- RPCSub_8cpp_source.html | 8 +- RPCSub_8h_source.html | 4 +- ReducedOffer__test_8cpp_source.html | 2 +- RegisterSSLCerts_8cpp_source.html | 6 +- RegisterSSLCerts_8h_source.html | 4 +- Regression__test_8cpp_source.html | 10 +- RobustTransaction__test_8cpp_source.html | 6 +- SHAMapStoreImp_8cpp_source.html | 2 +- SHAMapStore__test_8cpp_source.html | 6 +- ServerStatus__test_8cpp_source.html | 4 +- SetAuth__test_8cpp_source.html | 6 +- SetTrust__test_8cpp_source.html | 4 +- Simulate__test_8cpp_source.html | 6 +- Subscribe_8cpp_source.html | 4 +- Subscribe__test_8cpp_source.html | 8 +- TestHelpers_8cpp_source.html | 6 +- TheoreticalQuality__test_8cpp_source.html | 6 +- Ticket__test_8cpp_source.html | 4 +- Transaction__ordering__test_8cpp_source.html | 6 +- TxQ__test_8cpp_source.html | 16 +- Version__test_8cpp_source.html | 2 +- View__test_8cpp_source.html | 8 +- WSClient__test_8cpp_source.html | 4 +- WSInfoSub_8h_source.html | 2 +- WorkSSL_8cpp_source.html | 79 +- WorkSSL_8h_source.html | 12 +- XChain__test_8cpp_source.html | 12 +- acctdelete_8cpp_source.html | 4 +- balance_8cpp_source.html | 2 +- classripple_1_1Config.html | 8 +- classripple_1_1HTTPClient-members.html | 2 +- classripple_1_1HTTPClient.html | 36 +- classripple_1_1HTTPClientImp-members.html | 2 +- classripple_1_1HTTPClientImp.html | 102 +- ...ipple_1_1HTTPClientSSLContext-members.html | 2 +- classripple_1_1HTTPClientSSLContext.html | 44 +- classripple_1_1RPCParser.html | 104 +- classripple_1_1detail_1_1WorkSSL.html | 4 +- classripple_1_1test_1_1jtx_1_1Env.html | 56 +- compression__test_8cpp_source.html | 8 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7.html | 15 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.map | 21 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.md5 | 2 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.png | Bin 5807 -> 6048 bytes dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.map | 4 - dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.md5 | 1 - dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.png | Bin 1509 -> 0 bytes dir_42b876eb66f74e25995e23a7c0222dc7.html | 6 + ... dir_61c252d8cf61dd29186d2576a961cc16.html | 30 +- dir_61c252d8cf61dd29186d2576a961cc16_dep.map | 4 + dir_61c252d8cf61dd29186d2576a961cc16_dep.md5 | 1 + dir_61c252d8cf61dd29186d2576a961cc16_dep.png | Bin 0 -> 1520 bytes ... dir_694d29d8b4364cd73747fe0bb0a9175a.html | 26 +- dir_694d29d8b4364cd73747fe0bb0a9175a_dep.map | 4 + dir_694d29d8b4364cd73747fe0bb0a9175a_dep.md5 | 1 + dir_694d29d8b4364cd73747fe0bb0a9175a_dep.png | Bin 0 -> 1520 bytes dir_8ab752db1bfd568bc49a33b42d67d397_dep.map | 5 - dir_8ab752db1bfd568bc49a33b42d67d397_dep.md5 | 1 - dir_8ab752db1bfd568bc49a33b42d67d397_dep.png | Bin 2644 -> 0 bytes dir_90ffdbabf412cfdffe6b2193e0ce938a.html | 2 + dir_a62226f9e3a6c7c5a3be455e2f87ae01.html | 2 - dir_f2000200ababdfebbc57680f92fa09d7.html | 6 + escrow_8cpp_source.html | 2 +- flags_8cpp_source.html | 2 +- functions_a.html | 8 +- functions_b.html | 2 +- functions_c.html | 28 +- functions_e.html | 2 +- functions_f.html | 4 +- functions_func.html | 14 +- functions_func_c.html | 14 +- functions_func_e.html | 16 +- functions_func_f.html | 4 +- functions_func_g.html | 2 +- functions_func_h.html | 2 +- functions_func_i.html | 4 +- functions_func_j.html | 4 +- functions_func_l.html | 6 +- functions_func_m.html | 4 +- functions_func_p.html | 4 +- functions_func_s.html | 2 +- functions_func_t.html | 2 +- functions_func_v.html | 12 +- functions_g.html | 2 +- functions_h.html | 4 +- functions_i.html | 24 +- functions_k.html | 2 +- functions_l.html | 8 +- functions_m.html | 6 +- functions_n.html | 4 +- functions_o.html | 4 +- functions_p.html | 19 +- functions_r.html | 10 +- functions_s.html | 25 +- functions_t.html | 16 +- functions_v.html | 11 +- functions_w.html | 8 +- mpt_8cpp_source.html | 8 +- mpt_8h_source.html | 2 +- namespacemembers_e.html | 2 +- namespacemembers_f.html | 2 +- namespacemembers_t.html | 2 +- namespaceripple.html | 624 +-- namespaceripple_1_1RPCCall.html | 4 +- owners_8cpp_source.html | 2 +- paths_8cpp_source.html | 2 +- permissioned__dex_8cpp_source.html | 6 +- reduce__relay__test_8cpp_source.html | 2 +- search/all_10.js | 243 +- search/all_11.js | 550 +-- search/all_13.js | 1138 +++-- search/all_14.js | 2433 ++++++----- search/all_15.js | 3769 +++++++++-------- search/all_17.js | 480 ++- search/all_18.js | 114 +- search/all_1a.js | 25 +- search/all_1b.js | 4 +- search/all_1c.js | 6 +- search/all_2.js | 1090 ++--- search/all_3.js | 708 ++-- search/all_4.js | 1947 ++++----- search/all_5.js | 858 ++-- search/all_6.js | 443 +- search/all_7.js | 757 ++-- search/all_8.js | 2 +- search/all_9.js | 365 +- search/all_a.js | 1704 ++++---- search/all_b.js | 60 +- search/all_c.js | 8 +- search/all_d.js | 799 ++-- search/all_e.js | 1411 +++--- search/all_f.js | 581 ++- search/enums_2.js | 4 +- search/enumvalues_13.js | 19 +- search/enumvalues_19.js | 6 +- search/enumvalues_3.js | 8 +- search/enumvalues_9.js | 4 +- search/enumvalues_e.js | 6 +- search/functions_1.js | 891 ++-- search/functions_10.js | 323 +- search/functions_12.js | 12 +- search/functions_13.js | 797 ++-- search/functions_14.js | 22 +- search/functions_16.js | 198 +- search/functions_17.js | 4 +- search/functions_1a.js | 13 +- search/functions_1b.js | 6 +- search/functions_2.js | 12 +- search/functions_3.js | 28 +- search/functions_4.js | 8 +- search/functions_5.js | 261 +- search/functions_6.js | 491 +-- search/functions_7.js | 2 +- search/functions_8.js | 6 +- search/functions_9.js | 887 ++-- search/functions_a.js | 10 +- search/functions_b.js | 37 +- search/functions_c.js | 12 +- search/functions_d.js | 12 +- search/functions_e.js | 157 +- search/typedefs_1.js | 4 +- search/typedefs_4.js | 4 +- search/typedefs_8.js | 57 +- search/typedefs_f.js | 2 +- search/variables_0.js | 2 +- search/variables_11.js | 2 +- search/variables_13.js | 8 +- search/variables_16.js | 6 +- search/variables_9.js | 2 +- search/variables_b.js | 2 +- search/variables_c.js | 2 +- search/variables_d.js | 8 +- structripple_1_1RPCCallImp.html | 8 +- ...le_1_1test_1_1jtx_1_1Env_1_1AppBundle.html | 2 +- token_8cpp_source.html | 4 +- tx__reduce__relay__test_8cpp_source.html | 2 +- utility_8cpp_source.html | 4 +- vault_8cpp_source.html | 2 +- xchain__bridge_8cpp_source.html | 4 +- 259 files changed, 17021 insertions(+), 16978 deletions(-) delete mode 100644 dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.map delete mode 100644 dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.md5 delete mode 100644 dir_1ee3758d44aa54e5f438bd3c269a9a22_dep.png rename dir_8ab752db1bfd568bc49a33b42d67d397.html => dir_61c252d8cf61dd29186d2576a961cc16.html (56%) create mode 100644 dir_61c252d8cf61dd29186d2576a961cc16_dep.map create mode 100644 dir_61c252d8cf61dd29186d2576a961cc16_dep.md5 create mode 100644 dir_61c252d8cf61dd29186d2576a961cc16_dep.png rename dir_1ee3758d44aa54e5f438bd3c269a9a22.html => dir_694d29d8b4364cd73747fe0bb0a9175a.html (71%) create mode 100644 dir_694d29d8b4364cd73747fe0bb0a9175a_dep.map create mode 100644 dir_694d29d8b4364cd73747fe0bb0a9175a_dep.md5 create mode 100644 dir_694d29d8b4364cd73747fe0bb0a9175a_dep.png delete mode 100644 dir_8ab752db1bfd568bc49a33b42d67d397_dep.map delete mode 100644 dir_8ab752db1bfd568bc49a33b42d67d397_dep.md5 delete mode 100644 dir_8ab752db1bfd568bc49a33b42d67d397_dep.png diff --git a/AMMClawback__test_8cpp_source.html b/AMMClawback__test_8cpp_source.html index 556289b0c9..b32d2a29f7 100644 --- a/AMMClawback__test_8cpp_source.html +++ b/AMMClawback__test_8cpp_source.html @@ -2579,10 +2579,10 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
A balance matches.
Definition: balance.h:39
Match set account flags.
Definition: flags.h:128
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:35
diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html index 63764b3355..4d720b3283 100644 --- a/AMMExtended__test_8cpp_source.html +++ b/AMMExtended__test_8cpp_source.html @@ -4008,13 +4008,13 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
ripple::Currency currency
Issue issue() const
A balance matches.
Definition: balance.h:39
diff --git a/AMMInfo__test_8cpp_source.html b/AMMInfo__test_8cpp_source.html index 61722597de..5dfe662bf9 100644 --- a/AMMInfo__test_8cpp_source.html +++ b/AMMInfo__test_8cpp_source.html @@ -487,8 +487,8 @@ $(function() {
AccountID id() const
Returns the Account ID.
Definition: Account.h:107
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Issue issue() const
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: rpc.h:35
T contains(T... args)
diff --git a/AMMTest_8cpp_source.html b/AMMTest_8cpp_source.html index 7c2a0ef9a7..9680bdf104 100644 --- a/AMMTest_8cpp_source.html +++ b/AMMTest_8cpp_source.html @@ -409,11 +409,11 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Application & app()
Definition: Env.h:261
beast::Journal const journal
Definition: Env.h:162
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Converts to IOU Issue or STAmount.
Add a path.
Definition: paths.h:58
Set Paths, SendMax on a JTx.
Definition: paths.h:35
diff --git a/AMM_8cpp_source.html b/AMM_8cpp_source.html index ba2ead2bee..c594da3f3a 100644 --- a/AMM_8cpp_source.html +++ b/AMM_8cpp_source.html @@ -992,7 +992,7 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
TER ter() const
Return the TER for the last JTx.
Definition: Env.h:595
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
bool enabled(uint256 feature) const
Definition: Env.h:635
Application & app()
Definition: Env.h:261
beast::Journal const journal
Definition: Env.h:162
diff --git a/AMM__test_8cpp_source.html b/AMM__test_8cpp_source.html index f4daf67bc0..b05d7a3c90 100644 --- a/AMM__test_8cpp_source.html +++ b/AMM__test_8cpp_source.html @@ -8104,20 +8104,20 @@ $(function() {
AccountID id() const
Returns the Account ID.
Definition: Account.h:107
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
bool enabled(uint256 feature) const
Definition: Env.h:635
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Account const & master
Definition: Env.h:125
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
beast::Journal const journal
Definition: Env.h:162
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
ripple::Currency currency
A balance matches.
Definition: balance.h:39
Set the fee on a JTx.
Definition: fee.h:37
diff --git a/AccountDelete__test_8cpp_source.html b/AccountDelete__test_8cpp_source.html index 6280e4095e..bfdb2ceac1 100644 --- a/AccountDelete__test_8cpp_source.html +++ b/AccountDelete__test_8cpp_source.html @@ -1385,10 +1385,10 @@ $(function() {
static Account const master
The master account.
Definition: Account.h:48
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
A balance matches.
Definition: balance.h:39
Definition: credentials.h:63
Set the fee on a JTx.
Definition: fee.h:37
diff --git a/AccountObjects__test_8cpp_source.html b/AccountObjects__test_8cpp_source.html index faf3936f4c..c38f0a8e12 100644 --- a/AccountObjects__test_8cpp_source.html +++ b/AccountObjects__test_8cpp_source.html @@ -1557,12 +1557,12 @@ $(function() {
static Account const master
The master account.
Definition: Account.h:48
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Set the fee on a JTx.
Definition: fee.h:37
Match set account flags.
Definition: flags.h:128
Definition: owners.h:53
diff --git a/AccountOffers__test_8cpp_source.html b/AccountOffers__test_8cpp_source.html index 7c3f0cd67b..672badbbc6 100644 --- a/AccountOffers__test_8cpp_source.html +++ b/AccountOffers__test_8cpp_source.html @@ -455,9 +455,9 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: rpc.h:35
@ nullValue
'null' value
Definition: json_value.h:38
@ arrayValue
array value (ordered list)
Definition: json_value.h:44
diff --git a/AccountTx__test_8cpp_source.html b/AccountTx__test_8cpp_source.html index cac39d9771..f06d804c78 100644 --- a/AccountTx__test_8cpp_source.html +++ b/AccountTx__test_8cpp_source.html @@ -946,15 +946,15 @@ $(function() {
void testParameters(unsigned int apiVersion)
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
Definition: mpt.h:148
Set the fee on a JTx.
Definition: fee.h:37
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: rpc.h:35
diff --git a/AutoSocket_8h_source.html b/AutoSocket_8h_source.html index bd5a36297f..ea408fbe98 100644 --- a/AutoSocket_8h_source.html +++ b/AutoSocket_8h_source.html @@ -69,7 +69,7 @@ $(function() {
diff --git a/Batch__test_8cpp_source.html b/Batch__test_8cpp_source.html index ab7db2ddbf..2fee270613 100644 --- a/Batch__test_8cpp_source.html +++ b/Batch__test_8cpp_source.html @@ -4325,14 +4325,14 @@ $(function() {
void testAccountDelete(FeatureBitset features)
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
void create(MPTCreate const &arg=MPTCreate{})
Definition: mpt.cpp:87
Adds a new Batch Txn on a JTx and autofills.
Definition: batch.h:61
diff --git a/BookChanges__test_8cpp_source.html b/BookChanges__test_8cpp_source.html index 19dc639083..f4e36de990 100644 --- a/BookChanges__test_8cpp_source.html +++ b/BookChanges__test_8cpp_source.html @@ -238,8 +238,8 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
diff --git a/BookDirs__test_8cpp_source.html b/BookDirs__test_8cpp_source.html index 2f38627a72..c3966f1716 100644 --- a/BookDirs__test_8cpp_source.html +++ b/BookDirs__test_8cpp_source.html @@ -199,9 +199,9 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
T distance(T... args)
T end(T... args)
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition: pay.cpp:30
diff --git a/BookListeners_8h_source.html b/BookListeners_8h_source.html index 93dd20eab2..20a5a38538 100644 --- a/BookListeners_8h_source.html +++ b/BookListeners_8h_source.html @@ -98,7 +98,7 @@ $(function() {
20#ifndef RIPPLE_APP_LEDGER_BOOKLISTENERS_H_INCLUDED
21#define RIPPLE_APP_LEDGER_BOOKLISTENERS_H_INCLUDED
22
-
23#include <xrpld/net/InfoSub.h>
+
23#include <xrpld/rpc/InfoSub.h>
24
25#include <xrpl/protocol/MultiApiJson.h>
26
diff --git a/Book__test_8cpp_source.html b/Book__test_8cpp_source.html index 0556a44015..5886ca273e 100644 --- a/Book__test_8cpp_source.html +++ b/Book__test_8cpp_source.html @@ -2134,14 +2134,14 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Account const & master
Definition: Env.h:125
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
diff --git a/Check__test_8cpp_source.html b/Check__test_8cpp_source.html index 65e402dbba..6177351cde 100644 --- a/Check__test_8cpp_source.html +++ b/Check__test_8cpp_source.html @@ -2852,9 +2852,9 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
Set DestinationTag on a JTx.
Definition: Check_test.cpp:68
std::uint32_t const tag_
Definition: Check_test.cpp:70
diff --git a/Clawback__test_8cpp_source.html b/Clawback__test_8cpp_source.html index 5e557495b1..73cf0fd27a 100644 --- a/Clawback__test_8cpp_source.html +++ b/Clawback__test_8cpp_source.html @@ -1061,7 +1061,7 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
AccountID id() const
Returns the Account ID.
Definition: Account.h:107
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
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:244
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html index 8f5ea03fe5..11b57108e8 100644 --- a/Config_8cpp_source.html +++ b/Config_8cpp_source.html @@ -97,14 +97,14 @@ $(function() {
19
20#include <xrpld/core/Config.h>
21#include <xrpld/core/ConfigSections.h>
-
22#include <xrpld/net/HTTPClient.h>
-
23
-
24#include <xrpl/basics/FileUtilities.h>
-
25#include <xrpl/basics/Log.h>
-
26#include <xrpl/basics/StringUtilities.h>
-
27#include <xrpl/basics/contract.h>
-
28#include <xrpl/beast/core/LexicalCast.h>
-
29#include <xrpl/json/json_reader.h>
+
22
+
23#include <xrpl/basics/FileUtilities.h>
+
24#include <xrpl/basics/Log.h>
+
25#include <xrpl/basics/StringUtilities.h>
+
26#include <xrpl/basics/contract.h>
+
27#include <xrpl/beast/core/LexicalCast.h>
+
28#include <xrpl/json/json_reader.h>
+
29#include <xrpl/net/HTTPClient.h>
30#include <xrpl/protocol/Feature.h>
31#include <xrpl/protocol/SystemParameters.h>
32
@@ -487,738 +487,739 @@ $(function() {
409 legacy("database_path", boost::filesystem::absolute(dataDir).string());
410 }
411
- -
413
-
414 if (RUN_STANDALONE)
-
415 LEDGER_HISTORY = 0;
-
416
-
417 std::string ledgerTxDbType;
-
418 Section ledgerTxTablesSection = section("ledger_tx_tables");
-
419 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
-
420
- -
422 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
-
423}
-
424
-
425// 0 ports are allowed for unit tests, but still not allowed to be present in
-
426// config file
-
427static void
-
428checkZeroPorts(Config const& config)
-
429{
-
430 if (!config.exists("server"))
-
431 return;
-
432
-
433 for (auto const& name : config.section("server").values())
-
434 {
-
435 if (!config.exists(name))
-
436 return;
-
437
-
438 auto const& section = config[name];
-
439 auto const optResult = section.get("port");
-
440 if (optResult)
-
441 {
-
442 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
-
443 if (!port)
-
444 {
- -
446 ss << "Invalid value '" << *optResult << "' for key 'port' in ["
-
447 << name << "]";
-
448 Throw<std::runtime_error>(ss.str());
-
449 }
-
450 }
-
451 }
-
452}
-
453
-
454void
- -
456{
-
457 // NOTE: this writes to cerr because we want cout to be reserved
-
458 // for the writing of the json response (so that stdout can be part of a
-
459 // pipeline, for instance)
-
460 if (!QUIET)
-
461 std::cerr << "Loading: " << CONFIG_FILE << "\n";
-
462
-
463 boost::system::error_code ec;
-
464 auto const fileContents = getFileContents(ec, CONFIG_FILE);
-
465
-
466 if (ec)
-
467 {
-
468 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
-
469 << ": " << ec.message() << std::endl;
-
470 return;
-
471 }
-
472
-
473 loadFromString(fileContents);
-
474 checkZeroPorts(*this);
-
475}
-
476
-
477void
- -
479{
-
480 IniFileSections secConfig = parseIniFile(fileContents, true);
-
481
-
482 build(secConfig);
-
483
-
484 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
-
485 IPS = *s;
-
486
-
487 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
-
488 IPS_FIXED = *s;
-
489
-
490 // if the user has specified ip:port then replace : with a space.
-
491 {
-
492 auto replaceColons = [](std::vector<std::string>& strVec) {
-
493 static std::regex const e(":([0-9]+)$");
-
494 for (auto& line : strVec)
-
495 {
-
496 // skip anything that might be an ipv6 address
-
497 if (std::count(line.begin(), line.end(), ':') != 1)
-
498 continue;
-
499
-
500 std::string result = std::regex_replace(line, e, " $1");
-
501 // sanity check the result of the replace, should be same length
-
502 // as input
-
503 if (result.size() == line.size())
-
504 line = result;
-
505 }
-
506 };
-
507
-
508 replaceColons(IPS_FIXED);
-
509 replaceColons(IPS);
-
510 }
-
511
-
512 {
-
513 std::string dbPath;
-
514 if (getSingleSection(secConfig, "database_path", dbPath, j_))
-
515 {
-
516 boost::filesystem::path p(dbPath);
-
517 legacy("database_path", boost::filesystem::absolute(p).string());
-
518 }
-
519 }
-
520
-
521 std::string strTemp;
-
522
-
523 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
-
524 {
-
525 if (strTemp == "main")
-
526 NETWORK_ID = 0;
-
527 else if (strTemp == "testnet")
-
528 NETWORK_ID = 1;
-
529 else if (strTemp == "devnet")
-
530 NETWORK_ID = 2;
-
531 else
-
532 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
-
533 }
-
534
-
535 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
-
536 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
-
537
-
538 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
-
539 {
-
540 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
-
541 }
-
542 else
-
543 {
-
544 std::optional<std::size_t> peers_in_max{};
-
545 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
-
546 {
-
547 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
548 if (*peers_in_max > 1000)
-
549 Throw<std::runtime_error>(
-
550 "Invalid value specified in [" SECTION_PEERS_IN_MAX
-
551 "] section; the value must be less or equal than 1000");
-
552 }
-
553
-
554 std::optional<std::size_t> peers_out_max{};
-
555 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
-
556 {
-
557 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
558 if (*peers_out_max < 10 || *peers_out_max > 1000)
-
559 Throw<std::runtime_error>(
-
560 "Invalid value specified in [" SECTION_PEERS_OUT_MAX
-
561 "] section; the value must be in range 10-1000");
-
562 }
-
563
-
564 // if one section is configured then the other must be configured too
-
565 if ((peers_in_max && !peers_out_max) ||
-
566 (peers_out_max && !peers_in_max))
-
567 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
-
568 "]"
-
569 "and [" SECTION_PEERS_OUT_MAX
-
570 "] must be configured");
-
571
-
572 if (peers_in_max && peers_out_max)
-
573 {
-
574 PEERS_IN_MAX = *peers_in_max;
-
575 PEERS_OUT_MAX = *peers_out_max;
-
576 }
-
577 }
-
578
-
579 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
-
580 {
-
581 if (boost::iequals(strTemp, "tiny"))
-
582 NODE_SIZE = 0;
-
583 else if (boost::iequals(strTemp, "small"))
-
584 NODE_SIZE = 1;
-
585 else if (boost::iequals(strTemp, "medium"))
-
586 NODE_SIZE = 2;
-
587 else if (boost::iequals(strTemp, "large"))
-
588 NODE_SIZE = 3;
-
589 else if (boost::iequals(strTemp, "huge"))
-
590 NODE_SIZE = 4;
-
591 else
-
592 NODE_SIZE = std::min<std::size_t>(
-
593 4, beast::lexicalCastThrow<std::size_t>(strTemp));
-
594 }
-
595
-
596 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
-
597 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
-
598
-
599 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
-
600 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
-
601
-
602 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
-
603 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
-
604
-
605 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
-
606 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
-
607
-
608 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
-
609 {
-
610 if (boost::iequals(strTemp, "all"))
- -
612 else if (boost::iequals(strTemp, "trusted"))
- -
614 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
616 else
-
617 Throw<std::runtime_error>(
-
618 "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
-
619 "] section");
-
620 }
-
621
-
622 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
-
623 {
-
624 if (boost::iequals(strTemp, "all"))
- -
626 else if (boost::iequals(strTemp, "trusted"))
- -
628 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
630 else
-
631 Throw<std::runtime_error>(
-
632 "Invalid value specified in [" SECTION_RELAY_PROPOSALS
-
633 "] section");
-
634 }
-
635
-
636 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
-
637 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
-
638 "] and [" SECTION_VALIDATOR_TOKEN
-
639 "] config sections");
-
640
-
641 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
-
642 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
-
643
-
644 FEES = setup_FeeVote(section("voting"));
-
645 /* [fee_default] is documented in the example config files as useful for
-
646 * things like offline transaction signing. Until that's completely
-
647 * deprecated, allow it to override the [voting] section. */
-
648 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
-
649 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
650
-
651 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
-
652 {
-
653 if (boost::iequals(strTemp, "full"))
- -
655 std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
-
656 else if (boost::iequals(strTemp, "none"))
-
657 LEDGER_HISTORY = 0;
-
658 else
-
659 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
660 }
-
661
-
662 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
-
663 {
-
664 if (boost::iequals(strTemp, "none"))
-
665 FETCH_DEPTH = 0;
-
666 else if (boost::iequals(strTemp, "full"))
-
667 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
-
668 else
-
669 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
670
-
671 if (FETCH_DEPTH < 10)
-
672 FETCH_DEPTH = 10;
-
673 }
-
674
-
675 // By default, validators don't have pathfinding enabled, unless it is
-
676 // explicitly requested by the server's admin.
-
677 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
-
678 PATH_SEARCH_MAX = 0;
-
679
-
680 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
-
681 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
-
682 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
-
683 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
-
684 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
-
685 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
-
686 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
-
687 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
-
688
-
689 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
-
690 DEBUG_LOGFILE = strTemp;
-
691
-
692 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
-
693 {
-
694 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
-
695
-
696 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
-
697 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
-
698 ": must be between 10 and 600 inclusive");
-
699 }
-
700
-
701 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
-
702 {
-
703 WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
704
-
705 if (WORKERS < 1 || WORKERS > 1024)
-
706 Throw<std::runtime_error>(
-
707 "Invalid " SECTION_WORKERS
-
708 ": must be between 1 and 1024 inclusive.");
-
709 }
-
710
-
711 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
-
712 {
-
713 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
714
-
715 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
-
716 Throw<std::runtime_error>(
-
717 "Invalid " SECTION_IO_WORKERS
-
718 ": must be between 1 and 1024 inclusive.");
-
719 }
-
720
-
721 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
-
722 {
-
723 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
724
-
725 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
-
726 Throw<std::runtime_error>(
-
727 "Invalid " SECTION_PREFETCH_WORKERS
-
728 ": must be between 1 and 1024 inclusive.");
-
729 }
-
730
-
731 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
-
732 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
-
733
-
734 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
-
735 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
-
736
-
737 if (exists(SECTION_REDUCE_RELAY))
-
738 {
-
739 auto sec = section(SECTION_REDUCE_RELAY);
-
740
-
742 // vp_enable config option is deprecated by vp_base_squelch_enable //
-
743 // This option is kept for backwards compatibility. When squelching //
-
744 // is the default algorithm, it must be replaced with: //
-
745 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
-
746 // sec.value_or("vp_base_squelch_enable", true); //
-
747 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
-
748 Throw<std::runtime_error>(
-
749 "Invalid " SECTION_REDUCE_RELAY
-
750 " cannot specify both vp_base_squelch_enable and vp_enable "
-
751 "options. "
-
752 "vp_enable was deprecated and replaced by "
-
753 "vp_base_squelch_enable");
-
754
-
755 if (sec.exists("vp_base_squelch_enable"))
- -
757 sec.value_or("vp_base_squelch_enable", false);
-
758 else if (sec.exists("vp_enable"))
- -
760 sec.value_or("vp_enable", false);
-
761 else
- -
764
-
766 // Temporary squelching config for the peers selected as a source of //
-
767 // validator messages. The config must be removed once squelching is //
-
768 // made the default routing algorithm. //
- -
770 sec.value_or("vp_base_squelch_max_selected_peers", 5);
- -
772 Throw<std::runtime_error>(
-
773 "Invalid " SECTION_REDUCE_RELAY
-
774 " vp_base_squelch_max_selected_peers must be "
-
775 "greater than or equal to 3");
-
777
-
778 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
-
779 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
-
780 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
-
781 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
-
782 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
- -
784 Throw<std::runtime_error>(
-
785 "Invalid " SECTION_REDUCE_RELAY
-
786 ", tx_min_peers must be greater than or equal to 10"
-
787 ", tx_relay_percentage must be greater than or equal to 10 "
-
788 "and less than or equal to 100");
-
789 }
-
790
-
791 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
-
792 {
- -
794 beast::lexicalCastThrow<int>(strTemp),
- - -
797 }
-
798
-
799 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
-
800 {
-
801 if (!isProperlyFormedTomlDomain(strTemp))
-
802 {
-
803 Throw<std::runtime_error>(
-
804 "Invalid " SECTION_SERVER_DOMAIN
-
805 ": the domain name does not appear to meet the requirements.");
-
806 }
-
807
-
808 SERVER_DOMAIN = strTemp;
-
809 }
-
810
-
811 if (exists(SECTION_OVERLAY))
-
812 {
-
813 auto const sec = section(SECTION_OVERLAY);
-
814
-
815 using namespace std::chrono;
-
816
-
817 try
-
818 {
-
819 if (auto val = sec.get("max_unknown_time"))
- -
821 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
822 }
-
823 catch (...)
-
824 {
-
825 Throw<std::runtime_error>(
-
826 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
827 ": must be of the form '<number>' representing seconds.");
-
828 }
-
829
-
830 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
-
831 Throw<std::runtime_error>(
-
832 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
833 ": the time must be between 300 and 1800 seconds, inclusive.");
-
834
-
835 try
-
836 {
-
837 if (auto val = sec.get("max_diverged_time"))
- -
839 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
840 }
-
841 catch (...)
-
842 {
-
843 Throw<std::runtime_error>(
-
844 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
845 ": must be of the form '<number>' representing seconds.");
-
846 }
-
847
- -
849 {
-
850 Throw<std::runtime_error>(
-
851 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
852 ": the time must be between 60 and 900 seconds, inclusive.");
-
853 }
-
854 }
-
855
- -
857 secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
-
858 {
-
859 using namespace std::chrono;
-
860 boost::regex const re(
-
861 "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
-
862 boost::smatch match;
-
863 if (!boost::regex_match(strTemp, match, re))
-
864 Throw<std::runtime_error>(
-
865 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
866 ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
867
- -
869 beast::lexicalCastThrow<std::uint32_t>(match[1].str());
-
870
-
871 if (boost::iequals(match[2], "minutes"))
- -
873 else if (boost::iequals(match[2], "hours"))
- -
875 else if (boost::iequals(match[2], "days"))
- -
877 else if (boost::iequals(match[2], "weeks"))
- -
879
- -
881 Throw<std::runtime_error>(
-
882 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
883 ", the minimum amount of time an amendment must hold a "
-
884 "majority is 15 minutes");
-
885 }
-
886
-
887 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
-
888 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
-
889
-
890 // Do not load trusted validator configuration for standalone mode
-
891 if (!RUN_STANDALONE)
-
892 {
-
893 // If a file was explicitly specified, then throw if the
-
894 // path is malformed or if the file does not exist or is
-
895 // not a file.
-
896 // If the specified file is not an absolute path, then look
-
897 // for it in the same directory as the config file.
-
898 // If no path was specified, then look for validators.txt
-
899 // in the same directory as the config file, but don't complain
-
900 // if we can't find it.
-
901 boost::filesystem::path validatorsFile;
-
902
-
903 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
-
904 {
-
905 validatorsFile = strTemp;
-
906
-
907 if (validatorsFile.empty())
-
908 Throw<std::runtime_error>(
-
909 "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
-
910
-
911 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
-
912 validatorsFile = CONFIG_DIR / validatorsFile;
-
913
-
914 if (!boost::filesystem::exists(validatorsFile))
-
915 Throw<std::runtime_error>(
-
916 "The file specified in [" SECTION_VALIDATORS_FILE
-
917 "] "
-
918 "does not exist: " +
-
919 validatorsFile.string());
-
920
-
921 else if (
-
922 !boost::filesystem::is_regular_file(validatorsFile) &&
-
923 !boost::filesystem::is_symlink(validatorsFile))
-
924 Throw<std::runtime_error>(
-
925 "Invalid file specified in [" SECTION_VALIDATORS_FILE
-
926 "]: " +
-
927 validatorsFile.string());
-
928 }
-
929 else if (!CONFIG_DIR.empty())
-
930 {
-
931 validatorsFile = CONFIG_DIR / validatorsFileName;
-
932
-
933 if (!validatorsFile.empty())
-
934 {
-
935 if (!boost::filesystem::exists(validatorsFile))
-
936 validatorsFile.clear();
-
937 else if (
-
938 !boost::filesystem::is_regular_file(validatorsFile) &&
-
939 !boost::filesystem::is_symlink(validatorsFile))
-
940 validatorsFile.clear();
-
941 }
-
942 }
-
943
-
944 if (!validatorsFile.empty() &&
-
945 boost::filesystem::exists(validatorsFile) &&
-
946 (boost::filesystem::is_regular_file(validatorsFile) ||
-
947 boost::filesystem::is_symlink(validatorsFile)))
-
948 {
-
949 boost::system::error_code ec;
-
950 auto const data = getFileContents(ec, validatorsFile);
-
951 if (ec)
-
952 {
-
953 Throw<std::runtime_error>(
-
954 "Failed to read '" + validatorsFile.string() + "'." +
-
955 std::to_string(ec.value()) + ": " + ec.message());
-
956 }
-
957
-
958 auto iniFile = parseIniFile(data, true);
-
959
-
960 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
-
961
-
962 if (entries)
-
963 section(SECTION_VALIDATORS).append(*entries);
-
964
-
965 auto valKeyEntries =
-
966 getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
-
967
-
968 if (valKeyEntries)
-
969 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
-
970
-
971 auto valSiteEntries =
-
972 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
-
973
-
974 if (valSiteEntries)
-
975 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
-
976
-
977 auto valListKeys =
-
978 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
-
979
-
980 if (valListKeys)
-
981 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
-
982
-
983 auto valListThreshold =
-
984 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
-
985
-
986 if (valListThreshold)
-
987 section(SECTION_VALIDATOR_LIST_THRESHOLD)
-
988 .append(*valListThreshold);
-
989
-
990 if (!entries && !valKeyEntries && !valListKeys)
-
991 Throw<std::runtime_error>(
-
992 "The file specified in [" SECTION_VALIDATORS_FILE
-
993 "] "
-
994 "does not contain a [" SECTION_VALIDATORS
-
995 "], "
-
996 "[" SECTION_VALIDATOR_KEYS
-
997 "] or "
-
998 "[" SECTION_VALIDATOR_LIST_KEYS
-
999 "]"
-
1000 " section: " +
-
1001 validatorsFile.string());
-
1002 }
-
1003
- -
1005 auto const& listThreshold =
-
1006 section(SECTION_VALIDATOR_LIST_THRESHOLD);
-
1007 if (listThreshold.lines().empty())
-
1008 return std::nullopt;
-
1009 else if (listThreshold.values().size() == 1)
-
1010 {
-
1011 auto strTemp = listThreshold.values()[0];
-
1012 auto const listThreshold =
-
1013 beast::lexicalCastThrow<std::size_t>(strTemp);
-
1014 if (listThreshold == 0)
-
1015 return std::nullopt; // NOTE: Explicitly ask for computed
-
1016 else if (
-
1017 listThreshold >
-
1018 section(SECTION_VALIDATOR_LIST_KEYS).values().size())
-
1019 {
-
1020 Throw<std::runtime_error>(
-
1021 "Value in config section "
-
1022 "[" SECTION_VALIDATOR_LIST_THRESHOLD
-
1023 "] exceeds the number of configured list keys");
-
1024 }
-
1025 return listThreshold;
-
1026 }
-
1027 else
-
1028 {
-
1029 Throw<std::runtime_error>(
-
1030 "Config section "
-
1031 "[" SECTION_VALIDATOR_LIST_THRESHOLD
-
1032 "] should contain single value only");
-
1033 }
-
1034 }();
-
1035
-
1036 // Consolidate [validator_keys] and [validators]
-
1037 section(SECTION_VALIDATORS)
-
1038 .append(section(SECTION_VALIDATOR_KEYS).lines());
-
1039
-
1040 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
-
1041 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
1042 {
-
1043 Throw<std::runtime_error>(
-
1044 "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
-
1045 "] config section is missing");
-
1046 }
-
1047 }
-
1048
-
1049 {
-
1050 auto const part = section("features");
-
1051 for (auto const& s : part.values())
-
1052 {
-
1053 if (auto const f = getRegisteredFeature(s))
-
1054 features.insert(*f);
-
1055 else
-
1056 Throw<std::runtime_error>(
-
1057 "Unknown feature: " + s + " in config file.");
-
1058 }
-
1059 }
-
1060
-
1061 // This doesn't properly belong here, but check to make sure that the
-
1062 // value specified for network_quorum is achievable:
-
1063 {
-
1064 auto pm = PEERS_MAX;
-
1065
-
1066 // FIXME this apparently magic value is actually defined as a constant
-
1067 // elsewhere (see defaultMaxPeers) but we handle this check here.
-
1068 if (pm == 0)
-
1069 pm = 21;
-
1070
-
1071 if (NETWORK_QUORUM > pm)
-
1072 {
-
1073 Throw<std::runtime_error>(
-
1074 "The minimum number of required peers (network_quorum) exceeds "
-
1075 "the maximum number of allowed peers (peers_max)");
-
1076 }
-
1077 }
-
1078}
-
1079
-
1080boost::filesystem::path
- -
1082{
-
1083 auto log_file = DEBUG_LOGFILE;
-
1084
-
1085 if (!log_file.empty() && !log_file.is_absolute())
-
1086 {
-
1087 // Unless an absolute path for the log file is specified, the
-
1088 // path is relative to the config file directory.
-
1089 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
-
1090 }
-
1091
-
1092 if (!log_file.empty())
-
1093 {
-
1094 auto log_dir = log_file.parent_path();
-
1095
-
1096 if (!boost::filesystem::is_directory(log_dir))
-
1097 {
-
1098 boost::system::error_code ec;
-
1099 boost::filesystem::create_directories(log_dir, ec);
-
1100
-
1101 // If we fail, we warn but continue so that the calling code can
-
1102 // decide how to handle this situation.
-
1103 if (ec)
-
1104 {
-
1105 std::cerr << "Unable to create log file path " << log_dir
-
1106 << ": " << ec.message() << '\n';
-
1107 }
-
1108 }
-
1109 }
-
1110
-
1111 return log_file;
-
1112}
-
1113
-
1114int
- -
1116{
-
1117 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
-
1118 XRPL_ASSERT(
-
1119 index < sizedItems.size(),
-
1120 "ripple::Config::getValueFor : valid index input");
-
1121 XRPL_ASSERT(
-
1122 !node || *node <= 4,
-
1123 "ripple::Config::getValueFor : unset or valid node");
-
1124 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
-
1125}
-
1126
- -
1128setup_FeeVote(Section const& section)
-
1129{
-
1130 FeeSetup setup;
-
1131 {
-
1132 std::uint64_t temp;
-
1133 if (set(temp, "reference_fee", section) &&
- -
1135 setup.reference_fee = temp;
-
1136 }
-
1137 {
-
1138 std::uint32_t temp;
-
1139 if (set(temp, "account_reserve", section))
-
1140 setup.account_reserve = temp;
-
1141 if (set(temp, "owner_reserve", section))
-
1142 setup.owner_reserve = temp;
-
1143 }
-
1144 return setup;
-
1145}
-
1146
-
1147} // namespace ripple
+ +
413 this->SSL_VERIFY_DIR, this->SSL_VERIFY_FILE, this->SSL_VERIFY, j_);
+
414
+
415 if (RUN_STANDALONE)
+
416 LEDGER_HISTORY = 0;
+
417
+
418 std::string ledgerTxDbType;
+
419 Section ledgerTxTablesSection = section("ledger_tx_tables");
+
420 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
+
421
+ +
423 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
+
424}
+
425
+
426// 0 ports are allowed for unit tests, but still not allowed to be present in
+
427// config file
+
428static void
+
429checkZeroPorts(Config const& config)
+
430{
+
431 if (!config.exists("server"))
+
432 return;
+
433
+
434 for (auto const& name : config.section("server").values())
+
435 {
+
436 if (!config.exists(name))
+
437 return;
+
438
+
439 auto const& section = config[name];
+
440 auto const optResult = section.get("port");
+
441 if (optResult)
+
442 {
+
443 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
+
444 if (!port)
+
445 {
+ +
447 ss << "Invalid value '" << *optResult << "' for key 'port' in ["
+
448 << name << "]";
+
449 Throw<std::runtime_error>(ss.str());
+
450 }
+
451 }
+
452 }
+
453}
+
454
+
455void
+ +
457{
+
458 // NOTE: this writes to cerr because we want cout to be reserved
+
459 // for the writing of the json response (so that stdout can be part of a
+
460 // pipeline, for instance)
+
461 if (!QUIET)
+
462 std::cerr << "Loading: " << CONFIG_FILE << "\n";
+
463
+
464 boost::system::error_code ec;
+
465 auto const fileContents = getFileContents(ec, CONFIG_FILE);
+
466
+
467 if (ec)
+
468 {
+
469 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
+
470 << ": " << ec.message() << std::endl;
+
471 return;
+
472 }
+
473
+
474 loadFromString(fileContents);
+
475 checkZeroPorts(*this);
+
476}
+
477
+
478void
+ +
480{
+
481 IniFileSections secConfig = parseIniFile(fileContents, true);
+
482
+
483 build(secConfig);
+
484
+
485 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
+
486 IPS = *s;
+
487
+
488 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
+
489 IPS_FIXED = *s;
+
490
+
491 // if the user has specified ip:port then replace : with a space.
+
492 {
+
493 auto replaceColons = [](std::vector<std::string>& strVec) {
+
494 static std::regex const e(":([0-9]+)$");
+
495 for (auto& line : strVec)
+
496 {
+
497 // skip anything that might be an ipv6 address
+
498 if (std::count(line.begin(), line.end(), ':') != 1)
+
499 continue;
+
500
+
501 std::string result = std::regex_replace(line, e, " $1");
+
502 // sanity check the result of the replace, should be same length
+
503 // as input
+
504 if (result.size() == line.size())
+
505 line = result;
+
506 }
+
507 };
+
508
+
509 replaceColons(IPS_FIXED);
+
510 replaceColons(IPS);
+
511 }
+
512
+
513 {
+
514 std::string dbPath;
+
515 if (getSingleSection(secConfig, "database_path", dbPath, j_))
+
516 {
+
517 boost::filesystem::path p(dbPath);
+
518 legacy("database_path", boost::filesystem::absolute(p).string());
+
519 }
+
520 }
+
521
+
522 std::string strTemp;
+
523
+
524 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
+
525 {
+
526 if (strTemp == "main")
+
527 NETWORK_ID = 0;
+
528 else if (strTemp == "testnet")
+
529 NETWORK_ID = 1;
+
530 else if (strTemp == "devnet")
+
531 NETWORK_ID = 2;
+
532 else
+
533 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
+
534 }
+
535
+
536 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
+
537 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
+
538
+
539 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
+
540 {
+
541 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
+
542 }
+
543 else
+
544 {
+
545 std::optional<std::size_t> peers_in_max{};
+
546 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
+
547 {
+
548 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
549 if (*peers_in_max > 1000)
+
550 Throw<std::runtime_error>(
+
551 "Invalid value specified in [" SECTION_PEERS_IN_MAX
+
552 "] section; the value must be less or equal than 1000");
+
553 }
+
554
+
555 std::optional<std::size_t> peers_out_max{};
+
556 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
+
557 {
+
558 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
559 if (*peers_out_max < 10 || *peers_out_max > 1000)
+
560 Throw<std::runtime_error>(
+
561 "Invalid value specified in [" SECTION_PEERS_OUT_MAX
+
562 "] section; the value must be in range 10-1000");
+
563 }
+
564
+
565 // if one section is configured then the other must be configured too
+
566 if ((peers_in_max && !peers_out_max) ||
+
567 (peers_out_max && !peers_in_max))
+
568 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
+
569 "]"
+
570 "and [" SECTION_PEERS_OUT_MAX
+
571 "] must be configured");
+
572
+
573 if (peers_in_max && peers_out_max)
+
574 {
+
575 PEERS_IN_MAX = *peers_in_max;
+
576 PEERS_OUT_MAX = *peers_out_max;
+
577 }
+
578 }
+
579
+
580 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
+
581 {
+
582 if (boost::iequals(strTemp, "tiny"))
+
583 NODE_SIZE = 0;
+
584 else if (boost::iequals(strTemp, "small"))
+
585 NODE_SIZE = 1;
+
586 else if (boost::iequals(strTemp, "medium"))
+
587 NODE_SIZE = 2;
+
588 else if (boost::iequals(strTemp, "large"))
+
589 NODE_SIZE = 3;
+
590 else if (boost::iequals(strTemp, "huge"))
+
591 NODE_SIZE = 4;
+
592 else
+
593 NODE_SIZE = std::min<std::size_t>(
+
594 4, beast::lexicalCastThrow<std::size_t>(strTemp));
+
595 }
+
596
+
597 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
+
598 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
+
599
+
600 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
+
601 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
+
602
+
603 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
+
604 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
+
605
+
606 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
+
607 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
+
608
+
609 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
+
610 {
+
611 if (boost::iequals(strTemp, "all"))
+ +
613 else if (boost::iequals(strTemp, "trusted"))
+ +
615 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
617 else
+
618 Throw<std::runtime_error>(
+
619 "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
+
620 "] section");
+
621 }
+
622
+
623 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
+
624 {
+
625 if (boost::iequals(strTemp, "all"))
+ +
627 else if (boost::iequals(strTemp, "trusted"))
+ +
629 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
631 else
+
632 Throw<std::runtime_error>(
+
633 "Invalid value specified in [" SECTION_RELAY_PROPOSALS
+
634 "] section");
+
635 }
+
636
+
637 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
+
638 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
+
639 "] and [" SECTION_VALIDATOR_TOKEN
+
640 "] config sections");
+
641
+
642 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
+
643 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
+
644
+
645 FEES = setup_FeeVote(section("voting"));
+
646 /* [fee_default] is documented in the example config files as useful for
+
647 * things like offline transaction signing. Until that's completely
+
648 * deprecated, allow it to override the [voting] section. */
+
649 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
+
650 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
651
+
652 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
+
653 {
+
654 if (boost::iequals(strTemp, "full"))
+ +
656 std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
+
657 else if (boost::iequals(strTemp, "none"))
+
658 LEDGER_HISTORY = 0;
+
659 else
+
660 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
661 }
+
662
+
663 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
+
664 {
+
665 if (boost::iequals(strTemp, "none"))
+
666 FETCH_DEPTH = 0;
+
667 else if (boost::iequals(strTemp, "full"))
+
668 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
+
669 else
+
670 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
671
+
672 if (FETCH_DEPTH < 10)
+
673 FETCH_DEPTH = 10;
+
674 }
+
675
+
676 // By default, validators don't have pathfinding enabled, unless it is
+
677 // explicitly requested by the server's admin.
+
678 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
+
679 PATH_SEARCH_MAX = 0;
+
680
+
681 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
+
682 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
+
683 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
+
684 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
+
685 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
+
686 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
+
687 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
+
688 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
+
689
+
690 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
+
691 DEBUG_LOGFILE = strTemp;
+
692
+
693 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
+
694 {
+
695 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
+
696
+
697 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
+
698 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
+
699 ": must be between 10 and 600 inclusive");
+
700 }
+
701
+
702 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
+
703 {
+
704 WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
705
+
706 if (WORKERS < 1 || WORKERS > 1024)
+
707 Throw<std::runtime_error>(
+
708 "Invalid " SECTION_WORKERS
+
709 ": must be between 1 and 1024 inclusive.");
+
710 }
+
711
+
712 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
+
713 {
+
714 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
715
+
716 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
+
717 Throw<std::runtime_error>(
+
718 "Invalid " SECTION_IO_WORKERS
+
719 ": must be between 1 and 1024 inclusive.");
+
720 }
+
721
+
722 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
+
723 {
+
724 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
725
+
726 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
+
727 Throw<std::runtime_error>(
+
728 "Invalid " SECTION_PREFETCH_WORKERS
+
729 ": must be between 1 and 1024 inclusive.");
+
730 }
+
731
+
732 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
+
733 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
+
734
+
735 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
+
736 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
+
737
+
738 if (exists(SECTION_REDUCE_RELAY))
+
739 {
+
740 auto sec = section(SECTION_REDUCE_RELAY);
+
741
+
743 // vp_enable config option is deprecated by vp_base_squelch_enable //
+
744 // This option is kept for backwards compatibility. When squelching //
+
745 // is the default algorithm, it must be replaced with: //
+
746 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
+
747 // sec.value_or("vp_base_squelch_enable", true); //
+
748 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
+
749 Throw<std::runtime_error>(
+
750 "Invalid " SECTION_REDUCE_RELAY
+
751 " cannot specify both vp_base_squelch_enable and vp_enable "
+
752 "options. "
+
753 "vp_enable was deprecated and replaced by "
+
754 "vp_base_squelch_enable");
+
755
+
756 if (sec.exists("vp_base_squelch_enable"))
+ +
758 sec.value_or("vp_base_squelch_enable", false);
+
759 else if (sec.exists("vp_enable"))
+ +
761 sec.value_or("vp_enable", false);
+
762 else
+ +
765
+
767 // Temporary squelching config for the peers selected as a source of //
+
768 // validator messages. The config must be removed once squelching is //
+
769 // made the default routing algorithm. //
+ +
771 sec.value_or("vp_base_squelch_max_selected_peers", 5);
+ +
773 Throw<std::runtime_error>(
+
774 "Invalid " SECTION_REDUCE_RELAY
+
775 " vp_base_squelch_max_selected_peers must be "
+
776 "greater than or equal to 3");
+
778
+
779 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
+
780 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
+
781 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
+
782 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
+
783 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
+ +
785 Throw<std::runtime_error>(
+
786 "Invalid " SECTION_REDUCE_RELAY
+
787 ", tx_min_peers must be greater than or equal to 10"
+
788 ", tx_relay_percentage must be greater than or equal to 10 "
+
789 "and less than or equal to 100");
+
790 }
+
791
+
792 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
+
793 {
+ +
795 beast::lexicalCastThrow<int>(strTemp),
+ + +
798 }
+
799
+
800 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
+
801 {
+
802 if (!isProperlyFormedTomlDomain(strTemp))
+
803 {
+
804 Throw<std::runtime_error>(
+
805 "Invalid " SECTION_SERVER_DOMAIN
+
806 ": the domain name does not appear to meet the requirements.");
+
807 }
+
808
+
809 SERVER_DOMAIN = strTemp;
+
810 }
+
811
+
812 if (exists(SECTION_OVERLAY))
+
813 {
+
814 auto const sec = section(SECTION_OVERLAY);
+
815
+
816 using namespace std::chrono;
+
817
+
818 try
+
819 {
+
820 if (auto val = sec.get("max_unknown_time"))
+ +
822 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
823 }
+
824 catch (...)
+
825 {
+
826 Throw<std::runtime_error>(
+
827 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
828 ": must be of the form '<number>' representing seconds.");
+
829 }
+
830
+
831 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
+
832 Throw<std::runtime_error>(
+
833 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
834 ": the time must be between 300 and 1800 seconds, inclusive.");
+
835
+
836 try
+
837 {
+
838 if (auto val = sec.get("max_diverged_time"))
+ +
840 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
841 }
+
842 catch (...)
+
843 {
+
844 Throw<std::runtime_error>(
+
845 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
846 ": must be of the form '<number>' representing seconds.");
+
847 }
+
848
+ +
850 {
+
851 Throw<std::runtime_error>(
+
852 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
853 ": the time must be between 60 and 900 seconds, inclusive.");
+
854 }
+
855 }
+
856
+ +
858 secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
+
859 {
+
860 using namespace std::chrono;
+
861 boost::regex const re(
+
862 "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
+
863 boost::smatch match;
+
864 if (!boost::regex_match(strTemp, match, re))
+
865 Throw<std::runtime_error>(
+
866 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
867 ", must be: [0-9]+ [minutes|hours|days|weeks]");
+
868
+ +
870 beast::lexicalCastThrow<std::uint32_t>(match[1].str());
+
871
+
872 if (boost::iequals(match[2], "minutes"))
+ +
874 else if (boost::iequals(match[2], "hours"))
+ +
876 else if (boost::iequals(match[2], "days"))
+ +
878 else if (boost::iequals(match[2], "weeks"))
+ +
880
+ +
882 Throw<std::runtime_error>(
+
883 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
884 ", the minimum amount of time an amendment must hold a "
+
885 "majority is 15 minutes");
+
886 }
+
887
+
888 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
+
889 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
+
890
+
891 // Do not load trusted validator configuration for standalone mode
+
892 if (!RUN_STANDALONE)
+
893 {
+
894 // If a file was explicitly specified, then throw if the
+
895 // path is malformed or if the file does not exist or is
+
896 // not a file.
+
897 // If the specified file is not an absolute path, then look
+
898 // for it in the same directory as the config file.
+
899 // If no path was specified, then look for validators.txt
+
900 // in the same directory as the config file, but don't complain
+
901 // if we can't find it.
+
902 boost::filesystem::path validatorsFile;
+
903
+
904 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
+
905 {
+
906 validatorsFile = strTemp;
+
907
+
908 if (validatorsFile.empty())
+
909 Throw<std::runtime_error>(
+
910 "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
+
911
+
912 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
+
913 validatorsFile = CONFIG_DIR / validatorsFile;
+
914
+
915 if (!boost::filesystem::exists(validatorsFile))
+
916 Throw<std::runtime_error>(
+
917 "The file specified in [" SECTION_VALIDATORS_FILE
+
918 "] "
+
919 "does not exist: " +
+
920 validatorsFile.string());
+
921
+
922 else if (
+
923 !boost::filesystem::is_regular_file(validatorsFile) &&
+
924 !boost::filesystem::is_symlink(validatorsFile))
+
925 Throw<std::runtime_error>(
+
926 "Invalid file specified in [" SECTION_VALIDATORS_FILE
+
927 "]: " +
+
928 validatorsFile.string());
+
929 }
+
930 else if (!CONFIG_DIR.empty())
+
931 {
+
932 validatorsFile = CONFIG_DIR / validatorsFileName;
+
933
+
934 if (!validatorsFile.empty())
+
935 {
+
936 if (!boost::filesystem::exists(validatorsFile))
+
937 validatorsFile.clear();
+
938 else if (
+
939 !boost::filesystem::is_regular_file(validatorsFile) &&
+
940 !boost::filesystem::is_symlink(validatorsFile))
+
941 validatorsFile.clear();
+
942 }
+
943 }
+
944
+
945 if (!validatorsFile.empty() &&
+
946 boost::filesystem::exists(validatorsFile) &&
+
947 (boost::filesystem::is_regular_file(validatorsFile) ||
+
948 boost::filesystem::is_symlink(validatorsFile)))
+
949 {
+
950 boost::system::error_code ec;
+
951 auto const data = getFileContents(ec, validatorsFile);
+
952 if (ec)
+
953 {
+
954 Throw<std::runtime_error>(
+
955 "Failed to read '" + validatorsFile.string() + "'." +
+
956 std::to_string(ec.value()) + ": " + ec.message());
+
957 }
+
958
+
959 auto iniFile = parseIniFile(data, true);
+
960
+
961 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
+
962
+
963 if (entries)
+
964 section(SECTION_VALIDATORS).append(*entries);
+
965
+
966 auto valKeyEntries =
+
967 getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
+
968
+
969 if (valKeyEntries)
+
970 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
+
971
+
972 auto valSiteEntries =
+
973 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
+
974
+
975 if (valSiteEntries)
+
976 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
+
977
+
978 auto valListKeys =
+
979 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
+
980
+
981 if (valListKeys)
+
982 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
+
983
+
984 auto valListThreshold =
+
985 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
986
+
987 if (valListThreshold)
+
988 section(SECTION_VALIDATOR_LIST_THRESHOLD)
+
989 .append(*valListThreshold);
+
990
+
991 if (!entries && !valKeyEntries && !valListKeys)
+
992 Throw<std::runtime_error>(
+
993 "The file specified in [" SECTION_VALIDATORS_FILE
+
994 "] "
+
995 "does not contain a [" SECTION_VALIDATORS
+
996 "], "
+
997 "[" SECTION_VALIDATOR_KEYS
+
998 "] or "
+
999 "[" SECTION_VALIDATOR_LIST_KEYS
+
1000 "]"
+
1001 " section: " +
+
1002 validatorsFile.string());
+
1003 }
+
1004
+ +
1006 auto const& listThreshold =
+
1007 section(SECTION_VALIDATOR_LIST_THRESHOLD);
+
1008 if (listThreshold.lines().empty())
+
1009 return std::nullopt;
+
1010 else if (listThreshold.values().size() == 1)
+
1011 {
+
1012 auto strTemp = listThreshold.values()[0];
+
1013 auto const listThreshold =
+
1014 beast::lexicalCastThrow<std::size_t>(strTemp);
+
1015 if (listThreshold == 0)
+
1016 return std::nullopt; // NOTE: Explicitly ask for computed
+
1017 else if (
+
1018 listThreshold >
+
1019 section(SECTION_VALIDATOR_LIST_KEYS).values().size())
+
1020 {
+
1021 Throw<std::runtime_error>(
+
1022 "Value in config section "
+
1023 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+
1024 "] exceeds the number of configured list keys");
+
1025 }
+
1026 return listThreshold;
+
1027 }
+
1028 else
+
1029 {
+
1030 Throw<std::runtime_error>(
+
1031 "Config section "
+
1032 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+
1033 "] should contain single value only");
+
1034 }
+
1035 }();
+
1036
+
1037 // Consolidate [validator_keys] and [validators]
+
1038 section(SECTION_VALIDATORS)
+
1039 .append(section(SECTION_VALIDATOR_KEYS).lines());
+
1040
+
1041 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+
1042 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
1043 {
+
1044 Throw<std::runtime_error>(
+
1045 "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
+
1046 "] config section is missing");
+
1047 }
+
1048 }
+
1049
+
1050 {
+
1051 auto const part = section("features");
+
1052 for (auto const& s : part.values())
+
1053 {
+
1054 if (auto const f = getRegisteredFeature(s))
+
1055 features.insert(*f);
+
1056 else
+
1057 Throw<std::runtime_error>(
+
1058 "Unknown feature: " + s + " in config file.");
+
1059 }
+
1060 }
+
1061
+
1062 // This doesn't properly belong here, but check to make sure that the
+
1063 // value specified for network_quorum is achievable:
+
1064 {
+
1065 auto pm = PEERS_MAX;
+
1066
+
1067 // FIXME this apparently magic value is actually defined as a constant
+
1068 // elsewhere (see defaultMaxPeers) but we handle this check here.
+
1069 if (pm == 0)
+
1070 pm = 21;
+
1071
+
1072 if (NETWORK_QUORUM > pm)
+
1073 {
+
1074 Throw<std::runtime_error>(
+
1075 "The minimum number of required peers (network_quorum) exceeds "
+
1076 "the maximum number of allowed peers (peers_max)");
+
1077 }
+
1078 }
+
1079}
+
1080
+
1081boost::filesystem::path
+ +
1083{
+
1084 auto log_file = DEBUG_LOGFILE;
+
1085
+
1086 if (!log_file.empty() && !log_file.is_absolute())
+
1087 {
+
1088 // Unless an absolute path for the log file is specified, the
+
1089 // path is relative to the config file directory.
+
1090 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
+
1091 }
+
1092
+
1093 if (!log_file.empty())
+
1094 {
+
1095 auto log_dir = log_file.parent_path();
+
1096
+
1097 if (!boost::filesystem::is_directory(log_dir))
+
1098 {
+
1099 boost::system::error_code ec;
+
1100 boost::filesystem::create_directories(log_dir, ec);
+
1101
+
1102 // If we fail, we warn but continue so that the calling code can
+
1103 // decide how to handle this situation.
+
1104 if (ec)
+
1105 {
+
1106 std::cerr << "Unable to create log file path " << log_dir
+
1107 << ": " << ec.message() << '\n';
+
1108 }
+
1109 }
+
1110 }
+
1111
+
1112 return log_file;
+
1113}
+
1114
+
1115int
+ +
1117{
+
1118 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
+
1119 XRPL_ASSERT(
+
1120 index < sizedItems.size(),
+
1121 "ripple::Config::getValueFor : valid index input");
+
1122 XRPL_ASSERT(
+
1123 !node || *node <= 4,
+
1124 "ripple::Config::getValueFor : unset or valid node");
+
1125 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
+
1126}
+
1127
+ +
1129setup_FeeVote(Section const& section)
+
1130{
+
1131 FeeSetup setup;
+
1132 {
+
1133 std::uint64_t temp;
+
1134 if (set(temp, "reference_fee", section) &&
+ +
1136 setup.reference_fee = temp;
+
1137 }
+
1138 {
+
1139 std::uint32_t temp;
+
1140 if (set(temp, "account_reserve", section))
+
1141 setup.account_reserve = temp;
+
1142 if (set(temp, "owner_reserve", section))
+
1143 setup.owner_reserve = temp;
+
1144 }
+
1145 return setup;
+
1146}
+
1147
+
1148} // namespace ripple
@@ -1262,8 +1263,8 @@ $(function() {
int PATH_SEARCH_FAST
Definition: Config.h:197
int RELAY_UNTRUSTED_PROPOSALS
Definition: Config.h:170
bool TX_REDUCE_RELAY_ENABLE
Definition: Config.h:258
-
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:1081
-
void load()
Definition: Config.cpp:455
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:1082
+
void load()
Definition: Config.cpp:456
bool FAST_LOAD
Definition: Config.h:290
bool TX_REDUCE_RELAY_METRICS
Definition: Config.h:265
@@ -1278,13 +1279,13 @@ $(function() {
bool SSL_VERIFY
Definition: Config.h:215
boost::filesystem::path CONFIG_FILE
Definition: Config.h:98
bool USE_TX_TABLES
Definition: Config.h:123
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:1115
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:1116
FeeSetup FEES
Definition: Config.h:204
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition: Config.h:131
boost::filesystem::path DEBUG_LOGFILE
Definition: Config.h:104
std::string SSL_VERIFY_FILE
Definition: Config.h:216
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:269
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:478
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:479
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:276
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition: Config.h:231
bool COMPRESSION
Definition: Config.h:220
@@ -1296,7 +1297,7 @@ $(function() {
int RELAY_UNTRUSTED_VALIDATIONS
Definition: Config.h:169
std::string SSL_VERIFY_DIR
Definition: Config.h:217
std::size_t PEERS_MAX
Definition: Config.h:179
-
static void initializeSSLContext(Config const &config, beast::Journal j)
Definition: HTTPClient.cpp:39
+
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
Definition: HTTPClient.cpp:38
Holds a collection of configuration values.
Definition: BasicConfig.h:45
void append(std::vector< std::string > const &lines)
Append a set of lines to this section.
Definition: BasicConfig.cpp:47
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition: BasicConfig.h:79
@@ -1333,7 +1334,7 @@ $(function() { -
static void checkZeroPorts(Config const &config)
Definition: Config.cpp:428
+
static void checkZeroPorts(Config const &config)
Definition: Config.cpp:429
IniFileSections parseIniFile(std::string const &strInput, bool const bTrim)
Definition: Config.cpp:161
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > days
Definition: chrono.h:40
bool get_if_exists(Section const &section, std::string const &name, T &v)
Definition: BasicConfig.h:386
@@ -1342,7 +1343,7 @@ $(function() {
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition: Feature.cpp:382
std::string getFileContents(boost::system::error_code &ec, boost::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
-
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1128
+
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1129
bool isProperlyFormedTomlDomain(std::string_view domain)
Determines if the given string looks like a TOML-file hosting domain.
std::unordered_map< std::string, std::vector< std::string > > IniFileSections
Definition: BasicConfig.h:37
constexpr std::array< std::pair< SizedItem, std::array< int, 5 > >, 13 > sizedItems
Definition: Config.cpp:114
diff --git a/Config_8h_source.html b/Config_8h_source.html index 867cd5df2a..4e880c1ac1 100644 --- a/Config_8h_source.html +++ b/Config_8h_source.html @@ -465,8 +465,8 @@ $(function() {
beast::Journal journal() const
Definition: Config.h:375
bool TX_REDUCE_RELAY_ENABLE
Definition: Config.h:258
-
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:1081
-
void load()
Definition: Config.cpp:455
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:1082
+
void load()
Definition: Config.cpp:456
bool FAST_LOAD
Definition: Config.h:290
bool quiet() const
Definition: Config.h:326
@@ -485,13 +485,13 @@ $(function() {
boost::filesystem::path CONFIG_FILE
Definition: Config.h:98
bool USE_TX_TABLES
Definition: Config.h:123
bool doImport
Definition: Config.h:137
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:1115
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:1116
FeeSetup FEES
Definition: Config.h:204
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition: Config.h:131
boost::filesystem::path DEBUG_LOGFILE
Definition: Config.h:104
std::string SSL_VERIFY_FILE
Definition: Config.h:216
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:269
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:478
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:479
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:276
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition: Config.h:231
bool COMPRESSION
Definition: Config.h:220
@@ -526,7 +526,7 @@ $(function() {
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
-
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1128
+
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1129
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition: XRPAmount.h:259
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html index f347e7f088..6620a89b5e 100644 --- a/Config__test_8cpp_source.html +++ b/Config__test_8cpp_source.html @@ -1635,7 +1635,7 @@ $(function() {
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition: Config.h:300
bool quiet() const
Definition: Config.h:326
std::chrono::seconds MAX_DIVERGED_TIME
Definition: Config.h:284
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:478
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:479
std::vector< std::string > const & lines() const
Returns all the lines in the section.
Definition: BasicConfig.h:70
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition: BasicConfig.h:79
diff --git a/Context_8h_source.html b/Context_8h_source.html index f3e2d60aaa..984f3f3613 100644 --- a/Context_8h_source.html +++ b/Context_8h_source.html @@ -99,7 +99,7 @@ $(function() {
21#define RIPPLE_RPC_CONTEXT_H_INCLUDED
22
23#include <xrpld/core/JobQueue.h>
-
24#include <xrpld/net/InfoSub.h>
+
24#include <xrpld/rpc/InfoSub.h>
25#include <xrpld/rpc/Role.h>
26
27#include <xrpl/beast/utility/Journal.h>
diff --git a/Credentials__test_8cpp_source.html b/Credentials__test_8cpp_source.html index 53d4e6bc2b..5b1b1395da 100644 --- a/Credentials__test_8cpp_source.html +++ b/Credentials__test_8cpp_source.html @@ -1194,7 +1194,7 @@ $(function() {
Identifies fields.
Definition: SField.h:143
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Set the fee on a JTx.
Definition: fee.h:37
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:35
diff --git a/CrossingLimits__test_8cpp_source.html b/CrossingLimits__test_8cpp_source.html index 347d10c425..5d43d3020f 100644 --- a/CrossingLimits__test_8cpp_source.html +++ b/CrossingLimits__test_8cpp_source.html @@ -627,9 +627,9 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
A balance matches.
Definition: balance.h:39
Match the number of items in the account's owner directory.
Definition: owners.h:73
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:35
diff --git a/Delegate__test_8cpp_source.html b/Delegate__test_8cpp_source.html index c0da573444..3452fefa8a 100644 --- a/Delegate__test_8cpp_source.html +++ b/Delegate__test_8cpp_source.html @@ -1604,15 +1604,15 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
A balance matches.
Definition: balance.h:39
Sets the optional URI on a DIDSet.
Definition: did.h:60
diff --git a/DeliverMin__test_8cpp_source.html b/DeliverMin__test_8cpp_source.html index 9291d59b30..476a7f1eb4 100644 --- a/DeliverMin__test_8cpp_source.html +++ b/DeliverMin__test_8cpp_source.html @@ -240,9 +240,9 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
A balance matches.
Definition: balance.h:39
Sets the DeliverMin on a JTx.
Definition: delivermin.h:33
Set Paths, SendMax on a JTx.
Definition: paths.h:35
diff --git a/DeliveredAmount__test_8cpp_source.html b/DeliveredAmount__test_8cpp_source.html index 06b4e2ec26..333213d91c 100644 --- a/DeliveredAmount__test_8cpp_source.html +++ b/DeliveredAmount__test_8cpp_source.html @@ -534,11 +534,11 @@ $(function() {
AccountID id() const
Returns the Account ID.
Definition: Account.h:107
A transaction testing environment.
Definition: Env.h:121
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
void create(MPTCreate const &arg=MPTCreate{})
Definition: mpt.cpp:87
Converts to MPT Issue or STAmount.
diff --git a/DepositAuth__test_8cpp_source.html b/DepositAuth__test_8cpp_source.html index 70685f1e93..8a14e39eb4 100644 --- a/DepositAuth__test_8cpp_source.html +++ b/DepositAuth__test_8cpp_source.html @@ -1678,17 +1678,17 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
Converts to IOU Issue or STAmount.
Set the fee on a JTx.
Definition: fee.h:37
diff --git a/DepositAuthorized__test_8cpp_source.html b/DepositAuthorized__test_8cpp_source.html index fcf057774f..b9d8000e99 100644 --- a/DepositAuthorized__test_8cpp_source.html +++ b/DepositAuthorized__test_8cpp_source.html @@ -739,9 +739,9 @@ $(function() {
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: rpc.h:35
@ arrayValue
array value (ordered list)
Definition: json_value.h:44
diff --git a/Directory__test_8cpp_source.html b/Directory__test_8cpp_source.html index 0113b9fd59..2d3ec7d4e9 100644 --- a/Directory__test_8cpp_source.html +++ b/Directory__test_8cpp_source.html @@ -602,14 +602,14 @@ $(function() {
std::shared_ptr< SLE > peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
void enableFeature(uint256 const feature)
Definition: Env.cpp:637
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
void enableFeature(uint256 const feature)
Definition: Env.cpp:641
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
T is_sorted(T... args)
Keylet child(uint256 const &key) noexcept
Any item that can be in an owner dir.
Definition: Indexes.cpp:190
diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html index fa40bfd85c..4990364425 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -108,12 +108,12 @@ $(function() {
30
31#include <xrpld/app/ledger/LedgerMaster.h>
32#include <xrpld/app/misc/NetworkOPs.h>
-
33#include <xrpld/net/HTTPClient.h>
-
34#include <xrpld/net/RPCCall.h>
-
35
-
36#include <xrpl/basics/Slice.h>
-
37#include <xrpl/basics/contract.h>
-
38#include <xrpl/json/to_string.h>
+
33#include <xrpld/rpc/RPCCall.h>
+
34
+
35#include <xrpl/basics/Slice.h>
+
36#include <xrpl/basics/contract.h>
+
37#include <xrpl/json/to_string.h>
+
38#include <xrpl/net/HTTPClient.h>
39#include <xrpl/protocol/ErrorCodes.h>
40#include <xrpl/protocol/Indexes.h>
41#include <xrpl/protocol/Serializer.h>
@@ -152,584 +152,588 @@ $(function() {
74 auto timeKeeper_ = std::make_unique<ManualTimeKeeper>();
75 timeKeeper = timeKeeper_.get();
76 // Hack so we don't have to call Config::setup
- - -
79 std::move(config), std::move(logs), std::move(timeKeeper_));
-
80 app = owned.get();
-
81 app->logs().threshold(thresh);
-
82 if (!app->setup({}))
-
83 Throw<std::runtime_error>("Env::AppBundle: setup failed");
-
84 timeKeeper->set(app->getLedgerMaster().getClosedLedger()->info().closeTime);
-
85 app->start(false /*don't start timers*/);
-
86 thread = std::thread([&]() { app->run(); });
-
87
- -
89}
-
90
- -
92{
-
93 client.reset();
-
94 // Make sure all jobs finish, otherwise tests
-
95 // might not get the coverage they expect.
-
96 if (app)
-
97 {
- -
99 app->signalStop("~AppBundle");
-
100 }
-
101 if (thread.joinable())
-
102 thread.join();
-
103
-
104 // Remove the debugLogSink before the suite goes out of scope.
-
105 setDebugLogSink(nullptr);
-
106}
+ +
78 config->SSL_VERIFY_DIR,
+
79 config->SSL_VERIFY_FILE,
+
80 config->SSL_VERIFY,
+
81 debugLog());
+ +
83 std::move(config), std::move(logs), std::move(timeKeeper_));
+
84 app = owned.get();
+
85 app->logs().threshold(thresh);
+
86 if (!app->setup({}))
+
87 Throw<std::runtime_error>("Env::AppBundle: setup failed");
+
88 timeKeeper->set(app->getLedgerMaster().getClosedLedger()->info().closeTime);
+
89 app->start(false /*don't start timers*/);
+
90 thread = std::thread([&]() { app->run(); });
+
91
+ +
93}
+
94
+ +
96{
+
97 client.reset();
+
98 // Make sure all jobs finish, otherwise tests
+
99 // might not get the coverage they expect.
+
100 if (app)
+
101 {
+ +
103 app->signalStop("~AppBundle");
+
104 }
+
105 if (thread.joinable())
+
106 thread.join();
107
-
108//------------------------------------------------------------------------------
-
109
- - -
112{
- -
114}
-
115
-
116bool
- -
118 NetClock::time_point closeTime,
- -
120{
-
121 // Round up to next distinguishable value
-
122 using namespace std::chrono_literals;
-
123 bool res = true;
-
124 closeTime += closed()->info().closeTimeResolution - 1s;
-
125 timeKeeper().set(closeTime);
-
126 // Go through the rpc interface unless we need to simulate
-
127 // a specific consensus delay.
-
128 if (consensusDelay)
-
129 app().getOPs().acceptLedger(consensusDelay);
-
130 else
-
131 {
-
132 auto resp = rpc("ledger_accept");
-
133 if (resp["result"]["status"] != std::string("success"))
-
134 {
-
135 std::string reason = "internal error";
-
136 if (resp.isMember("error_what"))
-
137 reason = resp["error_what"].asString();
-
138 else if (resp.isMember("error_message"))
-
139 reason = resp["error_message"].asString();
-
140 else if (resp.isMember("error"))
-
141 reason = resp["error"].asString();
-
142
-
143 JLOG(journal.error()) << "Env::close() failed: " << reason;
-
144 res = false;
-
145 }
-
146 }
-
147 timeKeeper().set(closed()->info().closeTime);
-
148 return res;
-
149}
-
150
-
151void
-
152Env::memoize(Account const& account)
-
153{
-
154 map_.emplace(account.id(), account);
-
155}
-
156
-
157Account const&
-
158Env::lookup(AccountID const& id) const
-
159{
-
160 auto const iter = map_.find(id);
-
161 if (iter == map_.end())
-
162 {
-
163 std::cout << "Unknown account: " << id << "\n";
-
164 Throw<std::runtime_error>("Env::lookup:: unknown account ID");
-
165 }
-
166 return iter->second;
-
167}
-
168
-
169Account const&
-
170Env::lookup(std::string const& base58ID) const
-
171{
-
172 auto const account = parseBase58<AccountID>(base58ID);
-
173 if (!account)
-
174 Throw<std::runtime_error>("Env::lookup: invalid account ID");
-
175 return lookup(*account);
-
176}
-
177
- -
179Env::balance(Account const& account) const
-
180{
-
181 auto const sle = le(account);
-
182 if (!sle)
-
183 return XRP(0);
-
184 return {sle->getFieldAmount(sfBalance), ""};
-
185}
-
186
- -
188Env::balance(Account const& account, Issue const& issue) const
-
189{
-
190 if (isXRP(issue.currency))
-
191 return balance(account);
-
192 auto const sle = le(keylet::line(account.id(), issue));
-
193 if (!sle)
-
194 return {STAmount(issue, 0), account.name()};
-
195 auto amount = sle->getFieldAmount(sfBalance);
-
196 amount.setIssuer(issue.account);
-
197 if (account.id() > issue.account)
-
198 amount.negate();
-
199 return {amount, lookup(issue.account).name()};
-
200}
-
201
- -
203Env::balance(Account const& account, MPTIssue const& mptIssue) const
-
204{
-
205 MPTID const id = mptIssue.getMptID();
-
206 if (!id)
-
207 return {STAmount(mptIssue, 0), account.name()};
-
208
-
209 AccountID const issuer = mptIssue.getIssuer();
-
210 if (account.id() == issuer)
-
211 {
-
212 // Issuer balance
-
213 auto const sle = le(keylet::mptIssuance(id));
-
214 if (!sle)
-
215 return {STAmount(mptIssue, 0), account.name()};
-
216
-
217 STAmount const amount{mptIssue, sle->getFieldU64(sfOutstandingAmount)};
-
218 return {amount, lookup(issuer).name()};
-
219 }
-
220 else
-
221 {
-
222 // Holder balance
-
223 auto const sle = le(keylet::mptoken(id, account));
-
224 if (!sle)
-
225 return {STAmount(mptIssue, 0), account.name()};
-
226
-
227 STAmount const amount{mptIssue, sle->getFieldU64(sfMPTAmount)};
-
228 return {amount, lookup(issuer).name()};
-
229 }
-
230}
-
231
- -
233Env::limit(Account const& account, Issue const& issue) const
-
234{
-
235 auto const sle = le(keylet::line(account.id(), issue));
-
236 if (!sle)
-
237 return {STAmount(issue, 0), account.name()};
-
238 auto const aHigh = account.id() > issue.account;
-
239 if (sle && sle->isFieldPresent(aHigh ? sfLowLimit : sfHighLimit))
-
240 return {(*sle)[aHigh ? sfLowLimit : sfHighLimit], account.name()};
-
241 return {STAmount(issue, 0), account.name()};
-
242}
-
243
- -
245Env::ownerCount(Account const& account) const
-
246{
-
247 auto const sle = le(account);
-
248 if (!sle)
-
249 Throw<std::runtime_error>("missing account root");
-
250 return sle->getFieldU32(sfOwnerCount);
-
251}
-
252
- -
254Env::seq(Account const& account) const
-
255{
-
256 auto const sle = le(account);
-
257 if (!sle)
-
258 Throw<std::runtime_error>("missing account root");
-
259 return sle->getFieldU32(sfSequence);
-
260}
-
261
- -
263Env::le(Account const& account) const
-
264{
-
265 return le(keylet::account(account.id()));
-
266}
-
267
- -
269Env::le(Keylet const& k) const
-
270{
-
271 return current()->read(k);
-
272}
-
273
-
274void
-
275Env::fund(bool setDefaultRipple, STAmount const& amount, Account const& account)
-
276{
-
277 memoize(account);
-
278 if (setDefaultRipple)
-
279 {
-
280 // VFALCO NOTE Is the fee formula correct?
-
281 apply(
-
282 pay(master, account, amount + drops(current()->fees().base)),
- - - -
286 apply(
-
287 fset(account, asfDefaultRipple),
- - - -
291 require(flags(account, asfDefaultRipple));
-
292 }
-
293 else
-
294 {
-
295 apply(
-
296 pay(master, account, amount),
- - - - -
301 }
-
302 require(jtx::balance(account, amount));
-
303}
-
304
-
305void
-
306Env::trust(STAmount const& amount, Account const& account)
-
307{
-
308 auto const start = balance(account);
-
309 apply(
-
310 jtx::trust(account, amount),
- - - -
314 apply(
-
315 pay(master, account, drops(current()->fees().base)),
- - - -
319 test.expect(balance(account) == start);
-
320}
-
321
- - -
324{
-
325 auto error = [](ParsedResult& parsed, Json::Value const& object) {
-
326 // Use an error code that is not used anywhere in the transaction
-
327 // engine to distinguish this case.
-
328 parsed.ter = telENV_RPC_FAILED;
-
329 // Extract information about the error
-
330 if (!object.isObject())
-
331 return;
-
332 if (object.isMember(jss::error_code))
-
333 parsed.rpcCode =
-
334 safe_cast<error_code_i>(object[jss::error_code].asInt());
-
335 if (object.isMember(jss::error_message))
-
336 parsed.rpcMessage = object[jss::error_message].asString();
-
337 if (object.isMember(jss::error))
-
338 parsed.rpcError = object[jss::error].asString();
-
339 if (object.isMember(jss::error_exception))
-
340 parsed.rpcException = object[jss::error_exception].asString();
-
341 };
-
342 ParsedResult parsed;
-
343 if (jr.isObject() && jr.isMember(jss::result))
-
344 {
-
345 auto const& result = jr[jss::result];
-
346 if (result.isMember(jss::engine_result_code))
-
347 {
-
348 parsed.ter = TER::fromInt(result[jss::engine_result_code].asInt());
-
349 parsed.rpcCode.emplace(rpcSUCCESS);
-
350 }
-
351 else
-
352 error(parsed, result);
-
353 }
-
354 else
-
355 error(parsed, jr);
-
356
-
357 return parsed;
-
358}
-
359
-
360void
- -
362{
-
363 ParsedResult parsedResult;
-
364 auto const jr = [&]() {
-
365 if (jt.stx)
-
366 {
-
367 txid_ = jt.stx->getTransactionID();
-
368 Serializer s;
-
369 jt.stx->add(s);
-
370 auto const jr = rpc("submit", strHex(s.slice()));
-
371
-
372 parsedResult = parseResult(jr);
-
373 test.expect(parsedResult.ter, "ter uninitialized!");
-
374 ter_ = parsedResult.ter.value_or(telENV_RPC_FAILED);
+
108 // Remove the debugLogSink before the suite goes out of scope.
+
109 setDebugLogSink(nullptr);
+
110}
+
111
+
112//------------------------------------------------------------------------------
+
113
+ + +
116{
+ +
118}
+
119
+
120bool
+ +
122 NetClock::time_point closeTime,
+ +
124{
+
125 // Round up to next distinguishable value
+
126 using namespace std::chrono_literals;
+
127 bool res = true;
+
128 closeTime += closed()->info().closeTimeResolution - 1s;
+
129 timeKeeper().set(closeTime);
+
130 // Go through the rpc interface unless we need to simulate
+
131 // a specific consensus delay.
+
132 if (consensusDelay)
+
133 app().getOPs().acceptLedger(consensusDelay);
+
134 else
+
135 {
+
136 auto resp = rpc("ledger_accept");
+
137 if (resp["result"]["status"] != std::string("success"))
+
138 {
+
139 std::string reason = "internal error";
+
140 if (resp.isMember("error_what"))
+
141 reason = resp["error_what"].asString();
+
142 else if (resp.isMember("error_message"))
+
143 reason = resp["error_message"].asString();
+
144 else if (resp.isMember("error"))
+
145 reason = resp["error"].asString();
+
146
+
147 JLOG(journal.error()) << "Env::close() failed: " << reason;
+
148 res = false;
+
149 }
+
150 }
+
151 timeKeeper().set(closed()->info().closeTime);
+
152 return res;
+
153}
+
154
+
155void
+
156Env::memoize(Account const& account)
+
157{
+
158 map_.emplace(account.id(), account);
+
159}
+
160
+
161Account const&
+
162Env::lookup(AccountID const& id) const
+
163{
+
164 auto const iter = map_.find(id);
+
165 if (iter == map_.end())
+
166 {
+
167 std::cout << "Unknown account: " << id << "\n";
+
168 Throw<std::runtime_error>("Env::lookup:: unknown account ID");
+
169 }
+
170 return iter->second;
+
171}
+
172
+
173Account const&
+
174Env::lookup(std::string const& base58ID) const
+
175{
+
176 auto const account = parseBase58<AccountID>(base58ID);
+
177 if (!account)
+
178 Throw<std::runtime_error>("Env::lookup: invalid account ID");
+
179 return lookup(*account);
+
180}
+
181
+ +
183Env::balance(Account const& account) const
+
184{
+
185 auto const sle = le(account);
+
186 if (!sle)
+
187 return XRP(0);
+
188 return {sle->getFieldAmount(sfBalance), ""};
+
189}
+
190
+ +
192Env::balance(Account const& account, Issue const& issue) const
+
193{
+
194 if (isXRP(issue.currency))
+
195 return balance(account);
+
196 auto const sle = le(keylet::line(account.id(), issue));
+
197 if (!sle)
+
198 return {STAmount(issue, 0), account.name()};
+
199 auto amount = sle->getFieldAmount(sfBalance);
+
200 amount.setIssuer(issue.account);
+
201 if (account.id() > issue.account)
+
202 amount.negate();
+
203 return {amount, lookup(issue.account).name()};
+
204}
+
205
+ +
207Env::balance(Account const& account, MPTIssue const& mptIssue) const
+
208{
+
209 MPTID const id = mptIssue.getMptID();
+
210 if (!id)
+
211 return {STAmount(mptIssue, 0), account.name()};
+
212
+
213 AccountID const issuer = mptIssue.getIssuer();
+
214 if (account.id() == issuer)
+
215 {
+
216 // Issuer balance
+
217 auto const sle = le(keylet::mptIssuance(id));
+
218 if (!sle)
+
219 return {STAmount(mptIssue, 0), account.name()};
+
220
+
221 STAmount const amount{mptIssue, sle->getFieldU64(sfOutstandingAmount)};
+
222 return {amount, lookup(issuer).name()};
+
223 }
+
224 else
+
225 {
+
226 // Holder balance
+
227 auto const sle = le(keylet::mptoken(id, account));
+
228 if (!sle)
+
229 return {STAmount(mptIssue, 0), account.name()};
+
230
+
231 STAmount const amount{mptIssue, sle->getFieldU64(sfMPTAmount)};
+
232 return {amount, lookup(issuer).name()};
+
233 }
+
234}
+
235
+ +
237Env::limit(Account const& account, Issue const& issue) const
+
238{
+
239 auto const sle = le(keylet::line(account.id(), issue));
+
240 if (!sle)
+
241 return {STAmount(issue, 0), account.name()};
+
242 auto const aHigh = account.id() > issue.account;
+
243 if (sle && sle->isFieldPresent(aHigh ? sfLowLimit : sfHighLimit))
+
244 return {(*sle)[aHigh ? sfLowLimit : sfHighLimit], account.name()};
+
245 return {STAmount(issue, 0), account.name()};
+
246}
+
247
+ +
249Env::ownerCount(Account const& account) const
+
250{
+
251 auto const sle = le(account);
+
252 if (!sle)
+
253 Throw<std::runtime_error>("missing account root");
+
254 return sle->getFieldU32(sfOwnerCount);
+
255}
+
256
+ +
258Env::seq(Account const& account) const
+
259{
+
260 auto const sle = le(account);
+
261 if (!sle)
+
262 Throw<std::runtime_error>("missing account root");
+
263 return sle->getFieldU32(sfSequence);
+
264}
+
265
+ +
267Env::le(Account const& account) const
+
268{
+
269 return le(keylet::account(account.id()));
+
270}
+
271
+ +
273Env::le(Keylet const& k) const
+
274{
+
275 return current()->read(k);
+
276}
+
277
+
278void
+
279Env::fund(bool setDefaultRipple, STAmount const& amount, Account const& account)
+
280{
+
281 memoize(account);
+
282 if (setDefaultRipple)
+
283 {
+
284 // VFALCO NOTE Is the fee formula correct?
+
285 apply(
+
286 pay(master, account, amount + drops(current()->fees().base)),
+ + + +
290 apply(
+
291 fset(account, asfDefaultRipple),
+ + + +
295 require(flags(account, asfDefaultRipple));
+
296 }
+
297 else
+
298 {
+
299 apply(
+
300 pay(master, account, amount),
+ + + + +
305 }
+
306 require(jtx::balance(account, amount));
+
307}
+
308
+
309void
+
310Env::trust(STAmount const& amount, Account const& account)
+
311{
+
312 auto const start = balance(account);
+
313 apply(
+
314 jtx::trust(account, amount),
+ + + +
318 apply(
+
319 pay(master, account, drops(current()->fees().base)),
+ + + +
323 test.expect(balance(account) == start);
+
324}
+
325
+ + +
328{
+
329 auto error = [](ParsedResult& parsed, Json::Value const& object) {
+
330 // Use an error code that is not used anywhere in the transaction
+
331 // engine to distinguish this case.
+
332 parsed.ter = telENV_RPC_FAILED;
+
333 // Extract information about the error
+
334 if (!object.isObject())
+
335 return;
+
336 if (object.isMember(jss::error_code))
+
337 parsed.rpcCode =
+
338 safe_cast<error_code_i>(object[jss::error_code].asInt());
+
339 if (object.isMember(jss::error_message))
+
340 parsed.rpcMessage = object[jss::error_message].asString();
+
341 if (object.isMember(jss::error))
+
342 parsed.rpcError = object[jss::error].asString();
+
343 if (object.isMember(jss::error_exception))
+
344 parsed.rpcException = object[jss::error_exception].asString();
+
345 };
+
346 ParsedResult parsed;
+
347 if (jr.isObject() && jr.isMember(jss::result))
+
348 {
+
349 auto const& result = jr[jss::result];
+
350 if (result.isMember(jss::engine_result_code))
+
351 {
+
352 parsed.ter = TER::fromInt(result[jss::engine_result_code].asInt());
+
353 parsed.rpcCode.emplace(rpcSUCCESS);
+
354 }
+
355 else
+
356 error(parsed, result);
+
357 }
+
358 else
+
359 error(parsed, jr);
+
360
+
361 return parsed;
+
362}
+
363
+
364void
+ +
366{
+
367 ParsedResult parsedResult;
+
368 auto const jr = [&]() {
+
369 if (jt.stx)
+
370 {
+
371 txid_ = jt.stx->getTransactionID();
+
372 Serializer s;
+
373 jt.stx->add(s);
+
374 auto const jr = rpc("submit", strHex(s.slice()));
375
-
376 return jr;
-
377 }
-
378 else
-
379 {
-
380 // Parsing failed or the JTx is
-
381 // otherwise missing the stx field.
-
382 parsedResult.ter = ter_ = temMALFORMED;
-
383
-
384 return Json::Value();
-
385 }
-
386 }();
-
387 return postconditions(jt, parsedResult, jr);
-
388}
-
389
-
390void
- -
392{
-
393 auto const account = lookup(jt.jv[jss::Account].asString());
-
394 auto const& passphrase = account.name();
-
395
-
396 Json::Value jr;
-
397 if (params.isNull())
-
398 {
-
399 // Use the command line interface
-
400 auto const jv = boost::lexical_cast<std::string>(jt.jv);
-
401 jr = rpc("submit", passphrase, jv);
-
402 }
-
403 else
-
404 {
-
405 // Use the provided parameters, and go straight
-
406 // to the (RPC) client.
-
407 assert(params.isObject());
-
408 if (!params.isMember(jss::secret) && !params.isMember(jss::key_type) &&
-
409 !params.isMember(jss::seed) && !params.isMember(jss::seed_hex) &&
-
410 !params.isMember(jss::passphrase))
-
411 {
-
412 params[jss::secret] = passphrase;
-
413 }
-
414 params[jss::tx_json] = jt.jv;
-
415 jr = client().invoke("submit", params);
-
416 }
-
417
-
418 if (!txid_.parseHex(jr[jss::result][jss::tx_json][jss::hash].asString()))
-
419 txid_.zero();
-
420
-
421 ParsedResult const parsedResult = parseResult(jr);
-
422 test.expect(parsedResult.ter, "ter uninitialized!");
-
423 ter_ = parsedResult.ter.value_or(telENV_RPC_FAILED);
+
376 parsedResult = parseResult(jr);
+
377 test.expect(parsedResult.ter, "ter uninitialized!");
+
378 ter_ = parsedResult.ter.value_or(telENV_RPC_FAILED);
+
379
+
380 return jr;
+
381 }
+
382 else
+
383 {
+
384 // Parsing failed or the JTx is
+
385 // otherwise missing the stx field.
+
386 parsedResult.ter = ter_ = temMALFORMED;
+
387
+
388 return Json::Value();
+
389 }
+
390 }();
+
391 return postconditions(jt, parsedResult, jr);
+
392}
+
393
+
394void
+ +
396{
+
397 auto const account = lookup(jt.jv[jss::Account].asString());
+
398 auto const& passphrase = account.name();
+
399
+
400 Json::Value jr;
+
401 if (params.isNull())
+
402 {
+
403 // Use the command line interface
+
404 auto const jv = boost::lexical_cast<std::string>(jt.jv);
+
405 jr = rpc("submit", passphrase, jv);
+
406 }
+
407 else
+
408 {
+
409 // Use the provided parameters, and go straight
+
410 // to the (RPC) client.
+
411 assert(params.isObject());
+
412 if (!params.isMember(jss::secret) && !params.isMember(jss::key_type) &&
+
413 !params.isMember(jss::seed) && !params.isMember(jss::seed_hex) &&
+
414 !params.isMember(jss::passphrase))
+
415 {
+
416 params[jss::secret] = passphrase;
+
417 }
+
418 params[jss::tx_json] = jt.jv;
+
419 jr = client().invoke("submit", params);
+
420 }
+
421
+
422 if (!txid_.parseHex(jr[jss::result][jss::tx_json][jss::hash].asString()))
+
423 txid_.zero();
424
-
425 return postconditions(jt, parsedResult, jr);
-
426}
-
427
-
428void
- -
430 JTx const& jt,
-
431 ParsedResult const& parsed,
-
432 Json::Value const& jr)
-
433{
-
434 bool bad = !test.expect(parsed.ter, "apply: No ter result!");
-
435 bad =
-
436 (jt.ter && parsed.ter &&
-
437 !test.expect(
-
438 *parsed.ter == *jt.ter,
-
439 "apply: Got " + transToken(*parsed.ter) + " (" +
-
440 transHuman(*parsed.ter) + "); Expected " +
-
441 transToken(*jt.ter) + " (" + transHuman(*jt.ter) + ")"));
-
442 using namespace std::string_literals;
-
443 bad = (jt.rpcCode &&
-
444 !test.expect(
-
445 parsed.rpcCode == jt.rpcCode->first &&
-
446 parsed.rpcMessage == jt.rpcCode->second,
-
447 "apply: Got RPC result "s +
-
448 (parsed.rpcCode
- -
450 : "NO RESULT") +
-
451 " (" + parsed.rpcMessage + "); Expected " +
-
452 RPC::get_error_info(jt.rpcCode->first).token.c_str() + " (" +
-
453 jt.rpcCode->second + ")")) ||
-
454 bad;
-
455 // If we have an rpcCode (just checked), then the rpcException check is
-
456 // optional - the 'error' field may not be defined, but if it is, it must
-
457 // match rpcError.
-
458 bad =
-
459 (jt.rpcException &&
-
460 !test.expect(
-
461 (jt.rpcCode && parsed.rpcError.empty()) ||
-
462 (parsed.rpcError == jt.rpcException->first &&
-
463 (!jt.rpcException->second ||
-
464 parsed.rpcException == *jt.rpcException->second)),
-
465 "apply: Got RPC result "s + parsed.rpcError + " (" +
-
466 parsed.rpcException + "); Expected " + jt.rpcException->first +
-
467 " (" + jt.rpcException->second.value_or("n/a") + ")")) ||
-
468 bad;
-
469 if (bad)
-
470 {
-
471 test.log << pretty(jt.jv) << std::endl;
-
472 if (jr)
-
473 test.log << pretty(jr) << std::endl;
-
474 // Don't check postconditions if
-
475 // we didn't get the expected result.
-
476 return;
-
477 }
-
478 if (trace_)
-
479 {
-
480 if (trace_ > 0)
-
481 --trace_;
-
482 test.log << pretty(jt.jv) << std::endl;
-
483 }
-
484 for (auto const& f : jt.require)
-
485 f(*this);
-
486}
-
487
- - -
490{
-
491 if (current()->txCount() != 0)
-
492 {
-
493 // close the ledger if it has not already been closed
-
494 // (metadata is not finalized until the ledger is closed)
-
495 close();
-
496 }
-
497 auto const item = closed()->txRead(txid_);
-
498 return item.second;
-
499}
-
500
- -
502Env::tx() const
-
503{
-
504 return current()->txRead(txid_).first;
-
505}
-
506
-
507void
- -
509{
-
510 auto& jv = jt.jv;
-
511 if (jt.signer)
-
512 return jt.signer(*this, jt);
-
513 if (!jt.fill_sig)
-
514 return;
-
515 auto const account = jv.isMember(sfDelegate.jsonName)
-
516 ? lookup(jv[sfDelegate.jsonName].asString())
-
517 : lookup(jv[jss::Account].asString());
-
518 if (!app().checkSigs())
-
519 {
-
520 jv[jss::SigningPubKey] = strHex(account.pk().slice());
-
521 // dummy sig otherwise STTx is invalid
-
522 jv[jss::TxnSignature] = "00";
-
523 return;
-
524 }
-
525 auto const ar = le(account);
-
526 if (ar && ar->isFieldPresent(sfRegularKey))
-
527 jtx::sign(jv, lookup(ar->getAccountID(sfRegularKey)));
-
528 else
-
529 jtx::sign(jv, account);
-
530}
-
531
-
532void
- -
534{
-
535 auto& jv = jt.jv;
-
536 if (jt.fill_fee)
-
537 jtx::fill_fee(jv, *current());
-
538 if (jt.fill_seq)
-
539 jtx::fill_seq(jv, *current());
-
540
-
541 if (jt.fill_netid)
-
542 {
-
543 uint32_t networkID = app().config().NETWORK_ID;
-
544 if (!jv.isMember(jss::NetworkID) && networkID > 1024)
-
545 jv[jss::NetworkID] = std::to_string(networkID);
-
546 }
-
547
-
548 // Must come last
-
549 try
-
550 {
- -
552 }
-
553 catch (parse_error const&)
+
425 ParsedResult const parsedResult = parseResult(jr);
+
426 test.expect(parsedResult.ter, "ter uninitialized!");
+
427 ter_ = parsedResult.ter.value_or(telENV_RPC_FAILED);
+
428
+
429 return postconditions(jt, parsedResult, jr);
+
430}
+
431
+
432void
+ +
434 JTx const& jt,
+
435 ParsedResult const& parsed,
+
436 Json::Value const& jr)
+
437{
+
438 bool bad = !test.expect(parsed.ter, "apply: No ter result!");
+
439 bad =
+
440 (jt.ter && parsed.ter &&
+
441 !test.expect(
+
442 *parsed.ter == *jt.ter,
+
443 "apply: Got " + transToken(*parsed.ter) + " (" +
+
444 transHuman(*parsed.ter) + "); Expected " +
+
445 transToken(*jt.ter) + " (" + transHuman(*jt.ter) + ")"));
+
446 using namespace std::string_literals;
+
447 bad = (jt.rpcCode &&
+
448 !test.expect(
+
449 parsed.rpcCode == jt.rpcCode->first &&
+
450 parsed.rpcMessage == jt.rpcCode->second,
+
451 "apply: Got RPC result "s +
+
452 (parsed.rpcCode
+ +
454 : "NO RESULT") +
+
455 " (" + parsed.rpcMessage + "); Expected " +
+
456 RPC::get_error_info(jt.rpcCode->first).token.c_str() + " (" +
+
457 jt.rpcCode->second + ")")) ||
+
458 bad;
+
459 // If we have an rpcCode (just checked), then the rpcException check is
+
460 // optional - the 'error' field may not be defined, but if it is, it must
+
461 // match rpcError.
+
462 bad =
+
463 (jt.rpcException &&
+
464 !test.expect(
+
465 (jt.rpcCode && parsed.rpcError.empty()) ||
+
466 (parsed.rpcError == jt.rpcException->first &&
+
467 (!jt.rpcException->second ||
+
468 parsed.rpcException == *jt.rpcException->second)),
+
469 "apply: Got RPC result "s + parsed.rpcError + " (" +
+
470 parsed.rpcException + "); Expected " + jt.rpcException->first +
+
471 " (" + jt.rpcException->second.value_or("n/a") + ")")) ||
+
472 bad;
+
473 if (bad)
+
474 {
+
475 test.log << pretty(jt.jv) << std::endl;
+
476 if (jr)
+
477 test.log << pretty(jr) << std::endl;
+
478 // Don't check postconditions if
+
479 // we didn't get the expected result.
+
480 return;
+
481 }
+
482 if (trace_)
+
483 {
+
484 if (trace_ > 0)
+
485 --trace_;
+
486 test.log << pretty(jt.jv) << std::endl;
+
487 }
+
488 for (auto const& f : jt.require)
+
489 f(*this);
+
490}
+
491
+ + +
494{
+
495 if (current()->txCount() != 0)
+
496 {
+
497 // close the ledger if it has not already been closed
+
498 // (metadata is not finalized until the ledger is closed)
+
499 close();
+
500 }
+
501 auto const item = closed()->txRead(txid_);
+
502 return item.second;
+
503}
+
504
+ +
506Env::tx() const
+
507{
+
508 return current()->txRead(txid_).first;
+
509}
+
510
+
511void
+ +
513{
+
514 auto& jv = jt.jv;
+
515 if (jt.signer)
+
516 return jt.signer(*this, jt);
+
517 if (!jt.fill_sig)
+
518 return;
+
519 auto const account = jv.isMember(sfDelegate.jsonName)
+
520 ? lookup(jv[sfDelegate.jsonName].asString())
+
521 : lookup(jv[jss::Account].asString());
+
522 if (!app().checkSigs())
+
523 {
+
524 jv[jss::SigningPubKey] = strHex(account.pk().slice());
+
525 // dummy sig otherwise STTx is invalid
+
526 jv[jss::TxnSignature] = "00";
+
527 return;
+
528 }
+
529 auto const ar = le(account);
+
530 if (ar && ar->isFieldPresent(sfRegularKey))
+
531 jtx::sign(jv, lookup(ar->getAccountID(sfRegularKey)));
+
532 else
+
533 jtx::sign(jv, account);
+
534}
+
535
+
536void
+ +
538{
+
539 auto& jv = jt.jv;
+
540 if (jt.fill_fee)
+
541 jtx::fill_fee(jv, *current());
+
542 if (jt.fill_seq)
+
543 jtx::fill_seq(jv, *current());
+
544
+
545 if (jt.fill_netid)
+
546 {
+
547 uint32_t networkID = app().config().NETWORK_ID;
+
548 if (!jv.isMember(jss::NetworkID) && networkID > 1024)
+
549 jv[jss::NetworkID] = std::to_string(networkID);
+
550 }
+
551
+
552 // Must come last
+
553 try
554 {
- -
556 test.log << "parse failed:\n" << pretty(jv) << std::endl;
-
557 Rethrow();
-
558 }
-
559}
-
560
- - -
563{
-
564 // The parse must succeed, since we
-
565 // generated the JSON ourselves.
- -
567 try
-
568 {
-
569 obj = jtx::parse(jt.jv);
-
570 }
-
571 catch (jtx::parse_error const&)
+ +
556 }
+
557 catch (parse_error const&)
+
558 {
+ +
560 test.log << "parse failed:\n" << pretty(jv) << std::endl;
+
561 Rethrow();
+
562 }
+
563}
+
564
+ + +
567{
+
568 // The parse must succeed, since we
+
569 // generated the JSON ourselves.
+ +
571 try
572 {
-
573 test.log << "Exception: parse_error\n" << pretty(jt.jv) << std::endl;
-
574 Rethrow();
-
575 }
-
576
-
577 try
-
578 {
-
579 return sterilize(STTx{std::move(*obj)});
-
580 }
-
581 catch (std::exception const&)
+
573 obj = jtx::parse(jt.jv);
+
574 }
+
575 catch (jtx::parse_error const&)
+
576 {
+
577 test.log << "Exception: parse_error\n" << pretty(jt.jv) << std::endl;
+
578 Rethrow();
+
579 }
+
580
+
581 try
582 {
-
583 }
-
584 return nullptr;
-
585}
-
586
- - -
589{
-
590 // The parse must succeed, since we
-
591 // generated the JSON ourselves.
- -
593 try
-
594 {
-
595 obj = jtx::parse(jt.jv);
-
596 }
-
597 catch (jtx::parse_error const&)
+
583 return sterilize(STTx{std::move(*obj)});
+
584 }
+
585 catch (std::exception const&)
+
586 {
+
587 }
+
588 return nullptr;
+
589}
+
590
+ + +
593{
+
594 // The parse must succeed, since we
+
595 // generated the JSON ourselves.
+ +
597 try
598 {
-
599 test.log << "Exception: parse_error\n" << pretty(jt.jv) << std::endl;
-
600 Rethrow();
-
601 }
-
602
-
603 try
-
604 {
-
605 return std::make_shared<STTx const>(std::move(*obj));
-
606 }
-
607 catch (std::exception const&)
+
599 obj = jtx::parse(jt.jv);
+
600 }
+
601 catch (jtx::parse_error const&)
+
602 {
+
603 test.log << "Exception: parse_error\n" << pretty(jt.jv) << std::endl;
+
604 Rethrow();
+
605 }
+
606
+
607 try
608 {
-
609 }
-
610 return nullptr;
-
611}
-
612
- - -
615 unsigned apiVersion,
-
616 std::vector<std::string> const& args,
- -
618{
-
619 auto response =
-
620 rpcClient(args, app().config(), app().logs(), apiVersion, headers);
-
621
-
622 for (unsigned ctr = 0; (ctr < retries_) and (response.first == rpcINTERNAL);
-
623 ++ctr)
-
624 {
-
625 JLOG(journal.error())
-
626 << "Env::do_rpc error, retrying, attempt #" << ctr + 1 << " ...";
- -
628
-
629 response =
-
630 rpcClient(args, app().config(), app().logs(), apiVersion, headers);
-
631 }
+
609 return std::make_shared<STTx const>(std::move(*obj));
+
610 }
+
611 catch (std::exception const&)
+
612 {
+
613 }
+
614 return nullptr;
+
615}
+
616
+ + +
619 unsigned apiVersion,
+
620 std::vector<std::string> const& args,
+ +
622{
+
623 auto response =
+
624 rpcClient(args, app().config(), app().logs(), apiVersion, headers);
+
625
+
626 for (unsigned ctr = 0; (ctr < retries_) and (response.first == rpcINTERNAL);
+
627 ++ctr)
+
628 {
+
629 JLOG(journal.error())
+
630 << "Env::do_rpc error, retrying, attempt #" << ctr + 1 << " ...";
+
632
-
633 return response.second;
-
634}
-
635
-
636void
- -
638{
-
639 // Env::close() must be called for feature
-
640 // enable to take place.
-
641 app().config().features.insert(feature);
-
642}
-
643
-
644void
- -
646{
-
647 // Env::close() must be called for feature
-
648 // enable to take place.
-
649 app().config().features.erase(feature);
-
650}
-
651
-
652} // namespace jtx
-
653} // namespace test
-
654} // namespace ripple
+
633 response =
+
634 rpcClient(args, app().config(), app().logs(), apiVersion, headers);
+
635 }
+
636
+
637 return response.second;
+
638}
+
639
+
640void
+ +
642{
+
643 // Env::close() must be called for feature
+
644 // enable to take place.
+
645 app().config().features.insert(feature);
+
646}
+
647
+
648void
+ +
650{
+
651 // Env::close() must be called for feature
+
652 // enable to take place.
+
653 app().config().features.erase(feature);
+
654}
+
655
+
656} // namespace jtx
+
657} // namespace test
+
658} // namespace ripple
constexpr char const * c_str() const
Definition: json_value.h:76
Represents a JSON value.
Definition: json_value.h:149
@@ -752,7 +756,7 @@ $(function() {
virtual void signalStop(std::string msg)=0
uint32_t NETWORK_ID
Definition: Config.h:156
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:276
-
static void initializeSSLContext(Config const &config, beast::Journal j)
Definition: HTTPClient.cpp:39
+
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
Definition: HTTPClient.cpp:38
A currency issued by an account.
Definition: Issue.h:33
AccountID account
Definition: Issue.h:36
Currency currency
Definition: Issue.h:35
@@ -775,45 +779,45 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
std::string const & name() const
Return the name.
Definition: Account.h:83
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
void disableFeature(uint256 const feature)
Definition: Env.cpp:645
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
void disableFeature(uint256 const feature)
Definition: Env.cpp:649
bool parseFailureExpected_
Definition: Env.h:740
-
static ParsedResult parseResult(Json::Value const &jr)
Gets the TER result and didApply flag from a RPC Json result object.
Definition: Env.cpp:323
-
std::uint32_t ownerCount(Account const &account) const
Return the number of objects owned by an account.
Definition: Env.cpp:245
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
static ParsedResult parseResult(Json::Value const &jr)
Gets the TER result and didApply flag from a RPC Json result object.
Definition: Env.cpp:327
+
std::uint32_t ownerCount(Account const &account) const
Return the number of objects owned by an account.
Definition: Env.cpp:249
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
std::unordered_map< AccountID, Account > map_
Definition: Env.h:783
beast::unit_test::suite & test
Definition: Env.h:123
-
PrettyAmount limit(Account const &account, Issue const &issue) const
Returns the IOU limit on an account.
Definition: Env.cpp:233
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
PrettyAmount limit(Account const &account, Issue const &issue) const
Returns the IOU limit on an account.
Definition: Env.cpp:237
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
void postconditions(JTx const &jt, ParsedResult const &parsed, Json::Value const &jr=Json::Value())
Check expected postconditions of JTx submission.
Definition: Env.cpp:429
+
void postconditions(JTx const &jt, ParsedResult const &parsed, Json::Value const &jr=Json::Value())
Check expected postconditions of JTx submission.
Definition: Env.cpp:433
-
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:391
-
virtual void autofill(JTx &jt)
Definition: Env.cpp:533
+
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:395
+
virtual void autofill(JTx &jt)
Definition: Env.cpp:537
AbstractClient & client()
Returns the connected client.
Definition: Env.h:291
-
void autofill_sig(JTx &jt)
Definition: Env.cpp:508
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
-
Json::Value do_rpc(unsigned apiVersion, std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
Definition: Env.cpp:614
+
void autofill_sig(JTx &jt)
Definition: Env.cpp:512
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
+
Json::Value do_rpc(unsigned apiVersion, std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
Definition: Env.cpp:618
-
std::shared_ptr< STTx const > st(JTx const &jt)
Create a STTx from a JTx The framework requires that JSON is valid.
Definition: Env.cpp:562
-
void enableFeature(uint256 const feature)
Definition: Env.cpp:637
+
std::shared_ptr< STTx const > st(JTx const &jt)
Create a STTx from a JTx The framework requires that JSON is valid.
Definition: Env.cpp:566
+
void enableFeature(uint256 const feature)
Definition: Env.cpp:641
Account const & master
Definition: Env.h:125
-
Account const & lookup(AccountID const &id) const
Returns the Account given the AccountID.
Definition: Env.cpp:158
+
Account const & lookup(AccountID const &id) const
Returns the Account given the AccountID.
Definition: Env.cpp:162
unsigned retries_
Definition: Env.h:741
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
-
std::shared_ptr< STTx const > ust(JTx const &jt)
Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by firs...
Definition: Env.cpp:588
+
std::shared_ptr< STTx const > ust(JTx const &jt)
Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by firs...
Definition: Env.cpp:592
Application & app()
Definition: Env.h:261
beast::Journal const journal
Definition: Env.h:162
ManualTimeKeeper & timeKeeper()
Definition: Env.h:273
-
virtual void submit(JTx const &jt)
Submit an existing JTx.
Definition: Env.cpp:361
+
virtual void submit(JTx const &jt)
Submit an existing JTx.
Definition: Env.cpp:365
Env & apply(JsonValue &&jv, FN const &... fN)
Apply funclets and submit.
Definition: Env.h:579
bool close()
Close and advance the ledger.
Definition: Env.h:393
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
A balance matches.
Definition: balance.h:39
Set the fee on a JTx.
Definition: fee.h:37
Match set account flags.
Definition: flags.h:128
@@ -851,7 +855,7 @@ $(function() {
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
std::string transHuman(TER code)
Definition: TER.cpp:273
std::shared_ptr< STTx const > sterilize(STTx const &stx)
Sterilize a transaction.
Definition: STTx.cpp:811
-
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1481
+
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1480
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
@ telENV_RPC_FAILED
Definition: TER.h:68
@ rpcSUCCESS
Definition: ErrorCodes.h:44
@@ -872,7 +876,7 @@ $(function() {
std::unique_ptr< Application > owned
Definition: Env.h:145
- +
ManualTimeKeeper * timeKeeper
Definition: Env.h:146
std::unique_ptr< AbstractClient > client
Definition: Env.h:148
diff --git a/Env_8h_source.html b/Env_8h_source.html index b9ebaf47db..6199bcedd3 100644 --- a/Env_8h_source.html +++ b/Env_8h_source.html @@ -695,13 +695,13 @@ $(function() {
A transaction testing environment.
Definition: Env.h:121
void fund_arg(STAmount const &amount, std::array< Account, N > const &list)
Definition: Env.h:652
Json::Value json(JsonValue &&jv, FN const &... fN)
Create JSON from parameters.
Definition: Env.h:531
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
void trace(int howMany=-1)
Turn on JSON tracing.
Definition: Env.h:403
-
void disableFeature(uint256 const feature)
Definition: Env.cpp:645
+
void disableFeature(uint256 const feature)
Definition: Env.cpp:649
bool parseFailureExpected_
Definition: Env.h:740
-
static ParsedResult parseResult(Json::Value const &jr)
Gets the TER result and didApply flag from a RPC Json result object.
Definition: Env.cpp:323
+
static ParsedResult parseResult(Json::Value const &jr)
Gets the TER result and didApply flag from a RPC Json result object.
Definition: Env.cpp:327
Env(beast::unit_test::suite &suite_, std::unique_ptr< Config > config, std::unique_ptr< Logs > logs=nullptr, beast::severities::Severity thresh=beast::severities::kError)
Create Env using suite and Config pointer.
Definition: Env.h:233
-
std::uint32_t ownerCount(Account const &account) const
Return the number of objects owned by an account.
Definition: Env.cpp:245
+
std::uint32_t ownerCount(Account const &account) const
Return the number of objects owned by an account.
Definition: Env.cpp:249
std::unordered_map< AccountID, Account > map_
Definition: Env.h:783
void notrace()
Turn off JSON tracing.
Definition: Env.h:410
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
@@ -713,52 +713,52 @@ $(function() {
beast::unit_test::suite & test
Definition: Env.h:123
virtual ~Env()=default
bool close(std::chrono::duration< Rep, Period > const &elapsed)
Close and advance the ledger.
Definition: Env.h:379
-
PrettyAmount limit(Account const &account, Issue const &issue) const
Returns the IOU limit on an account.
Definition: Env.cpp:233
+
PrettyAmount limit(Account const &account, Issue const &issue) const
Returns the IOU limit on an account.
Definition: Env.cpp:237
AppBundle bundle_
Definition: Env.h:159
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
void invoke(JTx &jt, FN const &... fN)
Definition: Env.h:777
Env & operator=(Env const &)=delete
Env & operator()(JsonValue &&jv, FN const &... fN)
Definition: Env.h:587
Env(Env const &)=delete
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
void postconditions(JTx const &jt, ParsedResult const &parsed, Json::Value const &jr=Json::Value())
Check expected postconditions of JTx submission.
Definition: Env.cpp:429
+
void postconditions(JTx const &jt, ParsedResult const &parsed, Json::Value const &jr=Json::Value())
Check expected postconditions of JTx submission.
Definition: Env.cpp:433
bool enabled(uint256 feature) const
Definition: Env.h:635
-
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:391
+
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:395
AbstractClient & client()
Returns the connected client.
Definition: Env.h:291
-
void autofill_sig(JTx &jt)
Definition: Env.cpp:508
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
void autofill_sig(JTx &jt)
Definition: Env.cpp:512
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
void fund(STAmount const &amount, Arg const &arg, Args const &... args)
Create a new account with some XRP.
Definition: Env.h:687
-
Json::Value do_rpc(unsigned apiVersion, std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
Definition: Env.cpp:614
+
Json::Value do_rpc(unsigned apiVersion, std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
Definition: Env.cpp:618
void invoke(STTx &stx, FN const &... fN)
Definition: Env.h:769
-
std::shared_ptr< STTx const > st(JTx const &jt)
Create a STTx from a JTx The framework requires that JSON is valid.
Definition: Env.cpp:562
-
void enableFeature(uint256 const feature)
Definition: Env.cpp:637
+
std::shared_ptr< STTx const > st(JTx const &jt)
Create a STTx from a JTx The framework requires that JSON is valid.
Definition: Env.cpp:566
+
void enableFeature(uint256 const feature)
Definition: Env.cpp:641
Env(beast::unit_test::suite &suite_)
Create Env with only the current test suite.
Definition: Env.h:254
Account const & master
Definition: Env.h:125
-
Account const & lookup(AccountID const &id) const
Returns the Account given the AccountID.
Definition: Env.cpp:158
+
Account const & lookup(AccountID const &id) const
Returns the Account given the AccountID.
Definition: Env.cpp:162
unsigned retries_
Definition: Env.h:741
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
-
std::shared_ptr< STTx const > ust(JTx const &jt)
Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by firs...
Definition: Env.cpp:588
+
std::shared_ptr< STTx const > ust(JTx const &jt)
Create a STTx from a JTx without sanitizing Use to inject bogus values into test transactions by firs...
Definition: Env.cpp:592
Application & app()
Definition: Env.h:261
beast::Journal const journal
Definition: Env.h:162
ManualTimeKeeper & timeKeeper()
Definition: Env.h:273
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
virtual void submit(JTx const &jt)
Submit an existing JTx.
Definition: Env.cpp:361
+
virtual void submit(JTx const &jt)
Submit an existing JTx.
Definition: Env.cpp:365
Env & apply(JsonValue &&jv, FN const &... fN)
Apply funclets and submit.
Definition: Env.h:579
void disable_sigs()
Turn off signature checks.
Definition: Env.h:423
void set_retries(unsigned r=5)
Definition: Env.h:430
bool close()
Close and advance the ledger.
Definition: Env.h:393
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
TestStopwatch stopwatch_
Definition: Env.h:737
Application const & app() const
Definition: Env.h:267
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
JTx jtnofill(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:517
void set_parse_failure_expected(bool b)
Definition: Env.h:416
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
Env(beast::unit_test::suite &suite_, std::unique_ptr< Config > config, FeatureBitset features, std::unique_ptr< Logs > logs=nullptr, beast::severities::Severity thresh=beast::severities::kError)
Create Env using suite, Config pointer, and explicit features.
Definition: Env.h:184
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
void fund_arg(STAmount const &amount, Account const &account)
Definition: Env.h:645
Env(beast::unit_test::suite &suite_, FeatureBitset features, std::unique_ptr< Logs > logs=nullptr)
Create Env with default config and specified features.
Definition: Env.h:214
@@ -797,7 +797,7 @@ $(function() {
std::unique_ptr< Application > owned
Definition: Env.h:145
- +
ManualTimeKeeper * timeKeeper
Definition: Env.h:146
std::unique_ptr< AbstractClient > client
Definition: Env.h:148
diff --git a/Env__ss_8h_source.html b/Env__ss_8h_source.html index d9af27cfe2..35b7226720 100644 --- a/Env__ss_8h_source.html +++ b/Env__ss_8h_source.html @@ -170,7 +170,7 @@ $(function() {
Env_ss(Env_ss const &)=delete
A transaction testing environment.
Definition: Env.h:121
-
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:391
+
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:395
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
@ nullValue
'null' value
Definition: json_value.h:38
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
diff --git a/Env__test_8cpp_source.html b/Env__test_8cpp_source.html index bc7fbea247..fbb4172d37 100644 --- a/Env__test_8cpp_source.html +++ b/Env__test_8cpp_source.html @@ -1075,20 +1075,20 @@ $(function() {
A transaction testing environment wrapper.
Definition: Env_ss.h:34
A transaction testing environment.
Definition: Env.h:121
Json::Value json(JsonValue &&jv, FN const &... fN)
Create JSON from parameters.
Definition: Env.h:531
-
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:111
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:115
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
-
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:502
+
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:506
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Account const & master
Definition: Env.h:125
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
Application & app()
Definition: Env.h:261
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
A balance matches.
Definition: balance.h:39
Set the fee on a JTx.
Definition: fee.h:37
Match set account flags.
Definition: flags.h:128
diff --git a/EscrowToken__test_8cpp_source.html b/EscrowToken__test_8cpp_source.html index c4aa6c726f..2ba39310e9 100644 --- a/EscrowToken__test_8cpp_source.html +++ b/EscrowToken__test_8cpp_source.html @@ -3984,14 +3984,14 @@ $(function() {
void insert(std::shared_ptr< SLE > const &sle) override
Insert a new state SLE.
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
Converts to IOU Issue or STAmount.
void create(MPTCreate const &arg=MPTCreate{})
Definition: mpt.cpp:87
diff --git a/Escrow__test_8cpp_source.html b/Escrow__test_8cpp_source.html index e9186d94b6..64a065836d 100644 --- a/Escrow__test_8cpp_source.html +++ b/Escrow__test_8cpp_source.html @@ -1816,19 +1816,19 @@ $(function() {
An immutable linear range of bytes.
Definition: Slice.h:46
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:505
NetClock::time_point now()
Returns the current network time.
Definition: Env.h:284
Application & app()
Definition: Env.h:261
beast::Journal const journal
Definition: Env.h:162
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:152
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
A balance matches.
Definition: balance.h:39
Set the fee on a JTx.
Definition: fee.h:37
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html index 05f49afd87..bfaba7abf7 100644 --- a/FeeVote__test_8cpp_source.html +++ b/FeeVote__test_8cpp_source.html @@ -191,7 +191,7 @@ $(function() {
void run() override
Runs the suite.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1128
+
FeeSetup setup_FeeVote(Section const &section)
Definition: Config.cpp:1129
Fee schedule for startup / standalone, and to vote for.
Definition: Config.h:66
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition: Config.h:68
diff --git a/FixNFTokenPageLinks__test_8cpp_source.html b/FixNFTokenPageLinks__test_8cpp_source.html index 7498a4b325..2aeac42476 100644 --- a/FixNFTokenPageLinks__test_8cpp_source.html +++ b/FixNFTokenPageLinks__test_8cpp_source.html @@ -763,11 +763,11 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:114
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:788
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
T end(T... args)
T erase(T... args)
diff --git a/Flow__test_8cpp_source.html b/Flow__test_8cpp_source.html index 821b47695d..307504248d 100644 --- a/Flow__test_8cpp_source.html +++ b/Flow__test_8cpp_source.html @@ -1469,15 +1469,15 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
AccountID id() const
Returns the Account ID.
Definition: Account.h:107
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:544
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:306
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:310
Application & app()
Definition: Env.h:261
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
-
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:179
-
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:263
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
+
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
+
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:267
A balance matches.
Definition: balance.h:39
Set the fee on a JTx.
Definition: fee.h:37
Match the number of items in the account's owner directory.
Definition: owners.h:73
diff --git a/Freeze__test_8cpp_source.html b/Freeze__test_8cpp_source.html index c7fedba481..20a27cd736 100644 --- a/Freeze__test_8cpp_source.html +++ b/Freeze__test_8cpp_source.html @@ -2215,9 +2215,9 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:254
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
-
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:489
+
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:258
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
+
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:493
Add a path.
Definition: paths.h:58
T clear(T... args)
T end(T... args)
diff --git a/GRPCServer_8h_source.html b/GRPCServer_8h_source.html index dbc3a0cbe9..6a5268b6be 100644 --- a/GRPCServer_8h_source.html +++ b/GRPCServer_8h_source.html @@ -100,9 +100,9 @@ $(function() {
22
23#include <xrpld/app/main/Application.h>
24#include <xrpld/core/JobQueue.h>
-
25#include <xrpld/net/InfoSub.h>
-
26#include <xrpld/rpc/Context.h>
-
27#include <xrpld/rpc/GRPCHandlers.h>
+
25#include <xrpld/rpc/Context.h>
+
26#include <xrpld/rpc/GRPCHandlers.h>
+
27#include <xrpld/rpc/InfoSub.h>
28#include <xrpld/rpc/Role.h>
29#include <xrpld/rpc/detail/Handler.h>
30#include <xrpld/rpc/detail/RPCHelpers.h>
diff --git a/GatewayBalances__test_8cpp_source.html b/GatewayBalances__test_8cpp_source.html index ab1edc09d1..758b3783b5 100644 --- a/GatewayBalances__test_8cpp_source.html +++ b/GatewayBalances__test_8cpp_source.html @@ -360,9 +360,9 @@ $(function() {
void testGWB(FeatureBitset features)
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
-
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:117
+
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Application & app()
Definition: Env.h:261
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: rpc.h:35
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition: trust.cpp:32
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition: pay.cpp:30
diff --git a/GetAggregatePrice__test_8cpp_source.html b/GetAggregatePrice__test_8cpp_source.html index 32434f6449..dee0cf1683 100644 --- a/GetAggregatePrice__test_8cpp_source.html +++ b/GetAggregatePrice__test_8cpp_source.html @@ -436,7 +436,7 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:331
-
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:275
+
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:279
diff --git a/HTTPClientSSLContext_8h_source.html b/HTTPClientSSLContext_8h_source.html index ba117a0f2b..061de9db30 100644 --- a/HTTPClientSSLContext_8h_source.html +++ b/HTTPClientSSLContext_8h_source.html @@ -69,7 +69,7 @@ $(function() {
@@ -98,178 +98,176 @@ $(function() {
20#ifndef RIPPLE_NET_HTTPCLIENTSSLCONTEXT_H_INCLUDED
21#define RIPPLE_NET_HTTPCLIENTSSLCONTEXT_H_INCLUDED
22
-
23#include <xrpld/core/Config.h>
-
24#include <xrpld/net/RegisterSSLCerts.h>
-
25
-
26#include <xrpl/basics/Log.h>
-
27#include <xrpl/basics/contract.h>
-
28
-
29#include <boost/asio.hpp>
-
30#include <boost/asio/ip/tcp.hpp>
-
31#include <boost/asio/ssl.hpp>
-
32#include <boost/format.hpp>
-
33
-
34namespace ripple {
-
35
- -
37{
-
38public:
- -
40 Config const& config,
- -
42 boost::asio::ssl::context_base::method method =
-
43 boost::asio::ssl::context::sslv23)
-
44 : ssl_context_{method}, j_(j), verify_{config.SSL_VERIFY}
-
45 {
-
46 boost::system::error_code ec;
-
47
-
48 if (config.SSL_VERIFY_FILE.empty())
-
49 {
- -
51
-
52 if (ec && config.SSL_VERIFY_DIR.empty())
-
53 Throw<std::runtime_error>(boost::str(
-
54 boost::format("Failed to set_default_verify_paths: %s") %
-
55 ec.message()));
-
56 }
-
57 else
-
58 {
-
59 ssl_context_.load_verify_file(config.SSL_VERIFY_FILE);
-
60 }
-
61
-
62 if (!config.SSL_VERIFY_DIR.empty())
-
63 {
-
64 ssl_context_.add_verify_path(config.SSL_VERIFY_DIR, ec);
-
65
-
66 if (ec)
-
67 Throw<std::runtime_error>(boost::str(
-
68 boost::format("Failed to add verify path: %s") %
-
69 ec.message()));
-
70 }
-
71 }
-
72
-
73 boost::asio::ssl::context&
- -
75 {
-
76 return ssl_context_;
-
77 }
-
78
-
79 bool
-
80 sslVerify() const
-
81 {
-
82 return verify_;
-
83 }
-
84
-
97 template <
-
98 class T,
-
99 class = std::enable_if_t<
- -
101 T,
-
102 boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>::
-
103 value ||
- -
105 T,
-
106 boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>::
-
107 value>>
-
108 boost::system::error_code
-
109 preConnectVerify(T& strm, std::string const& host)
-
110 {
-
111 boost::system::error_code ec;
-
112 if (!SSL_set_tlsext_host_name(strm.native_handle(), host.c_str()))
-
113 {
-
114 ec.assign(
-
115 static_cast<int>(::ERR_get_error()),
-
116 boost::asio::error::get_ssl_category());
-
117 }
-
118 else if (!sslVerify())
-
119 {
-
120 strm.set_verify_mode(boost::asio::ssl::verify_none, ec);
-
121 }
-
122 return ec;
-
123 }
-
124
-
125 template <
-
126 class T,
-
127 class = std::enable_if_t<
- -
129 T,
-
130 boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>::
-
131 value ||
- -
133 T,
-
134 boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>::
-
135 value>>
-
143 boost::system::error_code
-
144 postConnectVerify(T& strm, std::string const& host)
-
145 {
-
146 boost::system::error_code ec;
-
147
-
148 if (sslVerify())
-
149 {
-
150 strm.set_verify_mode(boost::asio::ssl::verify_peer, ec);
-
151 if (!ec)
-
152 {
-
153 strm.set_verify_callback(
-
154 std::bind(
- -
156 host,
-
157 std::placeholders::_1,
-
158 std::placeholders::_2,
-
159 j_),
-
160 ec);
-
161 }
-
162 }
-
163
-
164 return ec;
-
165 }
-
166
-
176 static bool
- -
178 std::string const& domain,
-
179 bool preverified,
-
180 boost::asio::ssl::verify_context& ctx,
- -
182 {
-
183 if (boost::asio::ssl::rfc2818_verification(domain)(preverified, ctx))
-
184 return true;
-
185
-
186 JLOG(j.warn()) << "Outbound SSL connection to " << domain
-
187 << " fails certificate verification";
-
188 return false;
-
189 }
-
190
-
191private:
-
192 boost::asio::ssl::context ssl_context_;
- -
194 bool const verify_;
-
195};
-
196
-
197} // namespace ripple
-
198
-
199#endif
+
23#include <xrpl/basics/Log.h>
+
24#include <xrpl/basics/contract.h>
+
25#include <xrpl/beast/utility/Journal.h>
+
26#include <xrpl/net/RegisterSSLCerts.h>
+
27
+
28#include <boost/asio.hpp>
+
29#include <boost/asio/ip/tcp.hpp>
+
30#include <boost/asio/ssl.hpp>
+
31#include <boost/format.hpp>
+
32
+
33namespace ripple {
+
34
+ +
36{
+
37public:
+ +
39 std::string const& sslVerifyDir,
+
40 std::string const& sslVerifyFile,
+
41 bool sslVerify,
+ +
43 boost::asio::ssl::context_base::method method =
+
44 boost::asio::ssl::context::sslv23)
+
45 : ssl_context_{method}, j_(j), verify_{sslVerify}
+
46 {
+
47 boost::system::error_code ec;
+
48
+
49 if (sslVerifyFile.empty())
+
50 {
+ +
52
+
53 if (ec && sslVerifyDir.empty())
+
54 Throw<std::runtime_error>(boost::str(
+
55 boost::format("Failed to set_default_verify_paths: %s") %
+
56 ec.message()));
+
57 }
+
58 else
+
59 {
+
60 ssl_context_.load_verify_file(sslVerifyFile);
+
61 }
+
62
+
63 if (!sslVerifyDir.empty())
+
64 {
+
65 ssl_context_.add_verify_path(sslVerifyDir, ec);
+
66
+
67 if (ec)
+
68 Throw<std::runtime_error>(boost::str(
+
69 boost::format("Failed to add verify path: %s") %
+
70 ec.message()));
+
71 }
+
72 }
+
73
+
74 boost::asio::ssl::context&
+ +
76 {
+
77 return ssl_context_;
+
78 }
+
79
+
80 bool
+
81 sslVerify() const
+
82 {
+
83 return verify_;
+
84 }
+
85
+
98 template <
+
99 class T,
+
100 class = std::enable_if_t<
+ +
102 T,
+
103 boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>::
+
104 value ||
+ +
106 T,
+
107 boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>::
+
108 value>>
+
109 boost::system::error_code
+
110 preConnectVerify(T& strm, std::string const& host)
+
111 {
+
112 boost::system::error_code ec;
+
113 if (!SSL_set_tlsext_host_name(strm.native_handle(), host.c_str()))
+
114 {
+
115 ec.assign(
+
116 static_cast<int>(::ERR_get_error()),
+
117 boost::asio::error::get_ssl_category());
+
118 }
+
119 else if (!sslVerify())
+
120 {
+
121 strm.set_verify_mode(boost::asio::ssl::verify_none, ec);
+
122 }
+
123 return ec;
+
124 }
+
125
+
126 template <
+
127 class T,
+
128 class = std::enable_if_t<
+ +
130 T,
+
131 boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>::
+
132 value ||
+ +
134 T,
+
135 boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>::
+
136 value>>
+
144 boost::system::error_code
+
145 postConnectVerify(T& strm, std::string const& host)
+
146 {
+
147 boost::system::error_code ec;
+
148
+
149 if (sslVerify())
+
150 {
+
151 strm.set_verify_mode(boost::asio::ssl::verify_peer, ec);
+
152 if (!ec)
+
153 {
+
154 strm.set_verify_callback(
+
155 std::bind(
+ +
157 host,
+
158 std::placeholders::_1,
+
159 std::placeholders::_2,
+
160 j_),
+
161 ec);
+
162 }
+
163 }
+
164
+
165 return ec;
+
166 }
+
167
+
177 static bool
+ +
179 std::string const& domain,
+
180 bool preverified,
+
181 boost::asio::ssl::verify_context& ctx,
+ +
183 {
+
184 if (boost::asio::ssl::rfc2818_verification(domain)(preverified, ctx))
+
185 return true;
+
186
+
187 JLOG(j.warn()) << "Outbound SSL connection to " << domain
+
188 << " fails certificate verification";
+
189 return false;
+
190 }
+
191
+
192private:
+
193 boost::asio::ssl::context ssl_context_;
+ +
195 bool const verify_;
+
196};
+
197
+
198} // namespace ripple
+
199
+
200#endif
T bind(T... args)
T c_str(T... args)
A generic endpoint for log messages.
Definition: Journal.h:60
Stream warn() const
Definition: Journal.h:340
- -
std::string SSL_VERIFY_FILE
Definition: Config.h:216
-
std::string SSL_VERIFY_DIR
Definition: Config.h:217
- -
static bool rfc2818_verify(std::string const &domain, bool preverified, boost::asio::ssl::verify_context &ctx, beast::Journal j)
callback invoked for name verification - just passes through to the asio rfc2818 implementation.
-
boost::system::error_code preConnectVerify(T &strm, std::string const &host)
invoked before connect/async_connect on an ssl stream to setup name verification.
- - -
boost::asio::ssl::context ssl_context_
-
boost::system::error_code postConnectVerify(T &strm, std::string const &host)
invoked after connect/async_connect but before sending data on an ssl stream - to setup name verifica...
-
boost::asio::ssl::context & context()
- -
HTTPClientSSLContext(Config const &config, beast::Journal j, boost::asio::ssl::context_base::method method=boost::asio::ssl::context::sslv23)
+ +
static bool rfc2818_verify(std::string const &domain, bool preverified, boost::asio::ssl::verify_context &ctx, beast::Journal j)
callback invoked for name verification - just passes through to the asio rfc2818 implementation.
+
HTTPClientSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j, boost::asio::ssl::context_base::method method=boost::asio::ssl::context::sslv23)
+
boost::system::error_code preConnectVerify(T &strm, std::string const &host)
invoked before connect/async_connect on an ssl stream to setup name verification.
+ + +
boost::asio::ssl::context ssl_context_
+
boost::system::error_code postConnectVerify(T &strm, std::string const &host)
invoked after connect/async_connect but before sending data on an ssl stream - to setup name verifica...
+
boost::asio::ssl::context & context()
+
T empty(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
void registerSSLCerts(boost::asio::ssl::context &ctx, boost::system::error_code &ec, beast::Journal j)
Register default SSL certificates.
+
void registerSSLCerts(boost::asio::ssl::context &, boost::system::error_code &, beast::Journal j)
Register default SSL certificates.