diff --git a/AccountChannels_8cpp_source.html b/AccountChannels_8cpp_source.html index 35fe9f98ff..6e73388246 100644 --- a/AccountChannels_8cpp_source.html +++ b/AccountChannels_8cpp_source.html @@ -154,7 +154,7 @@ $(function() {
83  return err;
84 
85  if (!ledger->exists(keylet::account(accountID)))
-
86  return rpcError(rpcACT_NOT_FOUND);
+
86  return rpcError(rpcACT_NOT_FOUND);
87 
88  std::string strDst;
89  if (params.isMember(jss::destination_account))
@@ -194,13 +194,13 @@ $(function() {
123 
124  if (!startAfter.parseHex(marker.asString()))
125  {
-
126  return rpcError(rpcINVALID_PARAMS);
+
126  return rpcError(rpcINVALID_PARAMS);
127  }
128 
129  auto const sleChannel = ledger->read({ltPAYCHAN, startAfter});
130 
131  if (!sleChannel)
-
132  return rpcError(rpcINVALID_PARAMS);
+
132  return rpcError(rpcINVALID_PARAMS);
133 
134  if (!visitData.hasDst ||
135  visitData.raDstAccount == (*sleChannel)[sfDestination])
@@ -210,7 +210,7 @@ $(function() {
139  }
140  else
141  {
-
142  return rpcError(rpcINVALID_PARAMS);
+
142  return rpcError(rpcINVALID_PARAMS);
143  }
144  }
145  else
@@ -237,7 +237,7 @@ $(function() {
166  return false;
167  }))
168  {
-
169  return rpcError(rpcINVALID_PARAMS);
+
169  return rpcError(rpcINVALID_PARAMS);
170  }
171 
172  if (visitData.items.size() == limit + 1)
@@ -267,6 +267,7 @@ $(function() {
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::sfOwnerNode
const SF_UINT64 sfOwnerNode
ripple::sfDestination
const SF_ACCOUNT sfDestination
ripple::sfAmount
const SF_AMOUNT sfAmount
@@ -291,7 +292,6 @@ $(function() {
ripple::rpcACT_NOT_FOUND
@ rpcACT_NOT_FOUND
Definition: ErrorCodes.h:70
ripple::ReadView::exists
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
std::uint64_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::sfDestinationTag
const SF_UINT32 sfDestinationTag
diff --git a/AccountCurrenciesHandler_8cpp_source.html b/AccountCurrenciesHandler_8cpp_source.html index 45d26b102e..6de37b006c 100644 --- a/AccountCurrenciesHandler_8cpp_source.html +++ b/AccountCurrenciesHandler_8cpp_source.html @@ -126,7 +126,7 @@ $(function() {
55  return jvAccepted;
56 
57  if (!ledger->exists(keylet::account(accountID)))
-
58  return rpcError(rpcACT_NOT_FOUND);
+
58  return rpcError(rpcACT_NOT_FOUND);
59 
60  std::set<Currency> send, receive;
61  for (auto const& item : getRippleStateItems(accountID, *ledger))
@@ -164,6 +164,7 @@ $(function() {
ripple::doAccountCurrencies
Json::Value doAccountCurrencies(RPC::JsonContext &context)
Definition: AccountCurrenciesHandler.cpp:32
std::string
STL class.
std::shared_ptr
STL class.
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
ripple::RPC::lookupLedger
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)
Look up a ledger from a request and fill a Json::Result with the data representing a ledger.
Definition: RPCHelpers.cpp:540
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:243
@@ -175,7 +176,6 @@ $(function() {
ripple::STAmount
Definition: STAmount.h:43
ripple::ReadView::exists
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
std::set::erase
T erase(T... args)
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::STAmount::getCurrency
Currency const & getCurrency() const
Definition: STAmount.h:205
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
std::set::insert
T insert(T... args)
diff --git a/AccountLines_8cpp_source.html b/AccountLines_8cpp_source.html index faf6df610c..976c08ea5f 100644 --- a/AccountLines_8cpp_source.html +++ b/AccountLines_8cpp_source.html @@ -173,7 +173,7 @@ $(function() {
102  }
103 
104  if (!ledger->exists(keylet::account(accountID)))
-
105  return rpcError(rpcACT_NOT_FOUND);
+
105  return rpcError(rpcACT_NOT_FOUND);
106 
107  std::string strPeer;
108  if (params.isMember(jss::peer))
@@ -211,24 +211,24 @@ $(function() {
140  return RPC::expected_field_error(jss::marker, "string");
141 
142  if (!startAfter.parseHex(marker.asString()))
-
143  return rpcError(rpcINVALID_PARAMS);
+
143  return rpcError(rpcINVALID_PARAMS);
144 
145  auto const sleLine = ledger->read({ltRIPPLE_STATE, startAfter});
146 
147  if (!sleLine)
-
148  return rpcError(rpcINVALID_PARAMS);
+
148  return rpcError(rpcINVALID_PARAMS);
149 
150  if (sleLine->getFieldAmount(sfLowLimit).getIssuer() == accountID)
151  startHint = sleLine->getFieldU64(sfLowNode);
152  else if (sleLine->getFieldAmount(sfHighLimit).getIssuer() == accountID)
153  startHint = sleLine->getFieldU64(sfHighNode);
154  else
-
155  return rpcError(rpcINVALID_PARAMS);
+
155  return rpcError(rpcINVALID_PARAMS);
156 
157  // Caller provided the first line (startAfter), add it as first result
158  auto const line = RippleState::makeItem(accountID, sleLine);
159  if (line == nullptr)
-
160  return rpcError(rpcINVALID_PARAMS);
+
160  return rpcError(rpcINVALID_PARAMS);
161 
162  addLine(jsonLines, *line);
163  visitData.items.reserve(reserve);
@@ -261,7 +261,7 @@ $(function() {
190  return false;
191  }))
192  {
-
193  return rpcError(rpcINVALID_PARAMS);
+
193  return rpcError(rpcINVALID_PARAMS);
194  }
195  }
196 
@@ -292,6 +292,7 @@ $(function() {
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
@@ -321,7 +322,6 @@ $(function() {
ripple::ReadView::exists
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
std::uint64_t
ripple::sfHighLimit
const SF_AMOUNT sfHighLimit
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple::addLine
void addLine(Json::Value &jsonLines, RippleState const &line)
Definition: AccountLines.cpp:42
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
diff --git a/AccountObjects_8cpp_source.html b/AccountObjects_8cpp_source.html index 8850909da8..f6a4525c2b 100644 --- a/AccountObjects_8cpp_source.html +++ b/AccountObjects_8cpp_source.html @@ -131,7 +131,7 @@ $(function() {
71  }
72 
73  if (!ledger->exists(keylet::account(accountID)))
-
74  return rpcError(rpcACT_NOT_FOUND);
+
74  return rpcError(rpcACT_NOT_FOUND);
75 
76  std::optional<std::vector<LedgerEntryType>> typeFilter;
77 
@@ -227,6 +227,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
std::string
STL class.
std::shared_ptr
STL class.
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:164
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
@@ -248,7 +249,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::ReadView::exists
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
ripple::RPC::Tuning::accountObjects
static constexpr LimitRange accountObjects
Limits for the account_objects command.
Definition: rpc/impl/Tuning.h:43
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:53
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:840
diff --git a/AccountOffers_8cpp_source.html b/AccountOffers_8cpp_source.html index 5eed20ff4e..65af1db148 100644 --- a/AccountOffers_8cpp_source.html +++ b/AccountOffers_8cpp_source.html @@ -151,7 +151,7 @@ $(function() {
80  result[jss::account] = context.app.accountIDCache().toBase58(accountID);
81 
82  if (!ledger->exists(keylet::account(accountID)))
-
83  return rpcError(rpcACT_NOT_FOUND);
+
83  return rpcError(rpcACT_NOT_FOUND);
84 
85  unsigned int limit;
86  if (auto err = readLimitField(limit, RPC::Tuning::accountOffers, context))
@@ -173,13 +173,13 @@ $(function() {
102  return RPC::expected_field_error(jss::marker, "string");
103 
104  if (!startAfter.parseHex(marker.asString()))
-
105  return rpcError(rpcINVALID_PARAMS);
+
105  return rpcError(rpcINVALID_PARAMS);
106 
107  auto const sleOffer = ledger->read({ltOFFER, startAfter});
108 
109  if (!sleOffer || accountID != sleOffer->getAccountID(sfAccount))
110  {
-
111  return rpcError(rpcINVALID_PARAMS);
+
111  return rpcError(rpcINVALID_PARAMS);
112  }
113 
114  startHint = sleOffer->getFieldU64(sfOwnerNode);
@@ -210,7 +210,7 @@ $(function() {
139  return false;
140  }))
141  {
-
142  return rpcError(rpcINVALID_PARAMS);
+
142  return rpcError(rpcINVALID_PARAMS);
143  }
144 
145  if (offers.size() == reserve)
@@ -236,6 +236,7 @@ $(function() {
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
ripple::appendOfferJson
void appendOfferJson(std::shared_ptr< SLE const > const &offer, Json::Value &offers)
Definition: AccountOffers.cpp:35
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::sfOwnerNode
const SF_UINT64 sfOwnerNode
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
@@ -262,7 +263,6 @@ $(function() {
ripple::doAccountOffers
Json::Value doAccountOffers(RPC::JsonContext &context)
Definition: AccountOffers.cpp:57
std::uint64_t
ripple::amountFromQuality
STAmount amountFromQuality(std::uint64_t rate)
Definition: STAmount.cpp:769
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::Tuning::accountOffers
static constexpr LimitRange accountOffers
Limits for the account_offers command.
Definition: rpc/impl/Tuning.h:46
diff --git a/AccountTxOld_8cpp_source.html b/AccountTxOld_8cpp_source.html index aaf005fab7..2337c2c519 100644 --- a/AccountTxOld_8cpp_source.html +++ b/AccountTxOld_8cpp_source.html @@ -138,15 +138,15 @@ $(function() {
67  context.ledgerMaster.getValidatedRange(uValidatedMin, uValidatedMax);
68 
69  if (!context.params.isMember(jss::account))
-
70  return rpcError(rpcINVALID_PARAMS);
+
70  return rpcError(rpcINVALID_PARAMS);
71 
72  auto const raAccount =
73  parseBase58<AccountID>(context.params[jss::account].asString());
74  if (!raAccount)
-
75  return rpcError(rpcACT_MALFORMED);
+
75  return rpcError(rpcACT_MALFORMED);
76 
77  if (offset > 3000)
-
78  return rpcError(rpcATX_DEPRECATED);
+
78  return rpcError(rpcATX_DEPRECATED);
79 
80  context.loadType = Resource::feeHighBurdenRPC;
81 
@@ -178,8 +178,8 @@ $(function() {
107  {
108  // Don't have a validated ledger range.
109  if (context.apiVersion == 1)
-
110  return rpcError(rpcLGR_IDXS_INVALID);
-
111  return rpcError(rpcNOT_SYNCED);
+
110  return rpcError(rpcLGR_IDXS_INVALID);
+
111  return rpcError(rpcNOT_SYNCED);
112  }
113 
114  uLedgerMin = iLedgerMin == -1 ? uValidatedMin : iLedgerMin;
@@ -188,8 +188,8 @@ $(function() {
117  if (uLedgerMax < uLedgerMin)
118  {
119  if (context.apiVersion == 1)
-
120  return rpcError(rpcLGR_IDXS_INVALID);
-
121  return rpcError(rpcNOT_SYNCED);
+
120  return rpcError(rpcLGR_IDXS_INVALID);
+
121  return rpcError(rpcNOT_SYNCED);
122  }
123  }
124  else
@@ -204,7 +204,7 @@ $(function() {
133  (ledger->info().seq > uValidatedMax) ||
134  (ledger->info().seq < uValidatedMin))
135  {
-
136  return rpcError(rpcLGR_NOT_VALIDATED);
+
136  return rpcError(rpcLGR_NOT_VALIDATED);
137  }
138 
139  uLedgerMin = uLedgerMax = ledger->info().seq;
@@ -317,7 +317,7 @@ $(function() {
246  }
247  catch (std::exception const&)
248  {
-
249  return rpcError(rpcINTERNAL);
+
249  return rpcError(rpcINTERNAL);
250  }
251 
252 #endif
@@ -333,6 +333,7 @@ $(function() {
ripple::rpcLGR_IDXS_INVALID
@ rpcLGR_IDXS_INVALID
Definition: ErrorCodes.h:112
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::getOldestAccountTxs
std::pair< RelationalDBInterface::AccountTxs, int > getOldestAccountTxs(soci::session &session, Application &app, LedgerMaster &ledgerMaster, RelationalDBInterface::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
getOldestAccountTxs Returns oldest transactions for given account which match given criteria starting...
Definition: RelationalDBInterface_nodes.cpp:897
std::exception
STL class.
ripple::getOldestAccountTxsB
std::pair< std::vector< RelationalDBInterface::txnMetaLedgerType >, int > getOldestAccountTxsB(soci::session &session, Application &app, RelationalDBInterface::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
getOldestAccountTxsB Returns oldest transactions in binary form for given account which match given c...
Definition: RelationalDBInterface_nodes.cpp:1018
@@ -355,7 +356,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::uint32_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition: Role.cpp:94
ripple::getNewestAccountTxsB
std::pair< std::vector< RelationalDBInterface::txnMetaLedgerType >, int > getNewestAccountTxsB(soci::session &session, Application &app, RelationalDBInterface::AccountTxOptions const &options, std::optional< int > const &limit_used, beast::Journal j)
getNewestAccountTxsB Returns newest transactions in binary form for given account which match given c...
Definition: RelationalDBInterface_nodes.cpp:1029
diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html index a179181f3a..2dd93c8e03 100644 --- a/AccountTx_8cpp_source.html +++ b/AccountTx_8cpp_source.html @@ -611,7 +611,7 @@ $(function() {
540 doAccountTxJson(RPC::JsonContext& context)
541 {
542  if (!context.app.config().useTxTables())
-
543  return rpcError(rpcNOT_ENABLED);
+
543  return rpcError(rpcNOT_ENABLED);
544 
545  auto& params = context.params;
546  AccountTxArgs args;
@@ -623,12 +623,12 @@ $(function() {
552  params.isMember(jss::forward) && params[jss::forward].asBool();
553 
554  if (!params.isMember(jss::account))
-
555  return rpcError(rpcINVALID_PARAMS);
+
555  return rpcError(rpcINVALID_PARAMS);
556 
557  auto const account =
558  parseBase58<AccountID>(params[jss::account].asString());
559  if (!account)
-
560  return rpcError(rpcACT_MALFORMED);
+
560  return rpcError(rpcACT_MALFORMED);
561 
562  args.account = *account;
563 
@@ -732,6 +732,7 @@ $(function() {
std::string
STL class.
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
std::pair
@@ -775,7 +776,6 @@ $(function() {
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::uint32_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPC::Status
Status represents the results of an operation that might fail.
Definition: Status.h:39
ripple::RelationalDBInterface::AccountTxArgs::limit
uint32_t limit
Definition: RelationalDBInterface.h:102
std::decay_t
diff --git a/BookOffers_8cpp_source.html b/BookOffers_8cpp_source.html index f946cf26ba..b54094e4cb 100644 --- a/BookOffers_8cpp_source.html +++ b/BookOffers_8cpp_source.html @@ -109,7 +109,7 @@ $(function() {
38  // logic. It needs to be moved elsewhere and documented,
39  // and encapsulated into a function.
40  if (context.app.getJobQueue().getJobCountGE(jtCLIENT) > 200)
-
41  return rpcError(rpcTOO_BUSY);
+
41  return rpcError(rpcTOO_BUSY);
42 
43  std::shared_ptr<ReadView const> lpLedger;
44  auto jvResult = RPC::lookupLedger(lpLedger, context);
@@ -278,6 +278,7 @@ $(function() {
ripple::rpcDST_AMT_MALFORMED
@ rpcDST_AMT_MALFORMED
Definition: ErrorCodes.h:106
std::shared_ptr
STL class.
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::jtCLIENT
@ jtCLIENT
Definition: Job.h:44
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
@@ -299,7 +300,6 @@ $(function() {
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::rpcDST_ISR_MALFORMED
@ rpcDST_ISR_MALFORMED
Definition: ErrorCodes.h:108
ripple::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:35
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple::JobQueue::getJobCountGE
int getJobCountGE(JobType t) const
All waiting jobs at or greater than this priority.
Definition: JobQueue.cpp:129
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
diff --git a/BuildInfo_8cpp_source.html b/BuildInfo_8cpp_source.html index 49d99f915d..51ab3c9b0f 100644 --- a/BuildInfo_8cpp_source.html +++ b/BuildInfo_8cpp_source.html @@ -104,7 +104,7 @@ $(function() {
33 // and follow the format described at http://semver.org/
34 //------------------------------------------------------------------------------
35 // clang-format off
-
36 char const* const versionString = "1.8.0-rc2"
+
36 char const* const versionString = "1.8.1"
37 // clang-format on
38 
39 #if defined(DEBUG) || defined(SANITIZER)
diff --git a/Connect_8cpp_source.html b/Connect_8cpp_source.html index bdbbdc7321..d5a6cfc49e 100644 --- a/Connect_8cpp_source.html +++ b/Connect_8cpp_source.html @@ -109,7 +109,7 @@ $(function() {
38 doConnect(RPC::JsonContext& context)
39 {
40  if (context.app.config().reporting())
-
41  return rpcError(rpcREPORTING_UNSUPPORTED);
+
41  return rpcError(rpcREPORTING_UNSUPPORTED);
42 
43  if (context.app.config().standalone())
44  return "cannot connect in standalone mode";
@@ -120,7 +120,7 @@ $(function() {
49  if (context.params.isMember(jss::port) &&
50  !context.params[jss::port].isConvertibleTo(Json::intValue))
51  {
-
52  return rpcError(rpcINVALID_PARAMS);
+
52  return rpcError(rpcINVALID_PARAMS);
53  }
54 
55  int iPort;
@@ -143,6 +143,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:243
ripple::Config::reporting
bool reporting() const
Definition: Config.h:308
@@ -151,7 +152,6 @@ $(function() {
ripple::Config::standalone
bool standalone() const
Definition: Config.h:303
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::Overlay::connect
virtual void connect(beast::IP::Endpoint const &address)=0
Establish a peer connection to the specified endpoint.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
Json::intValue
@ intValue
signed integer value
Definition: json_value.h:37
diff --git a/ConsensusInfo_8cpp_source.html b/ConsensusInfo_8cpp_source.html index 46d9166a4f..3a972eac61 100644 --- a/ConsensusInfo_8cpp_source.html +++ b/ConsensusInfo_8cpp_source.html @@ -102,7 +102,7 @@ $(function() {
31 doConsensusInfo(RPC::JsonContext& context)
32 {
33  if (context.app.config().reporting())
-
34  return rpcError(rpcREPORTING_UNSUPPORTED);
+
34  return rpcError(rpcREPORTING_UNSUPPORTED);
35 
36  Json::Value ret(Json::objectValue);
37 
@@ -114,6 +114,7 @@ $(function() {
43 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
ripple::Config::reporting
bool reporting() const
Definition: Config.h:308
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
@@ -121,7 +122,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::doConsensusInfo
Json::Value doConsensusInfo(RPC::JsonContext &context)
Definition: ConsensusInfo.cpp:31
ripple::NetworkOPs::getConsensusInfo
virtual Json::Value getConsensusInfo()=0
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/CrawlShards_8cpp_source.html b/CrawlShards_8cpp_source.html index e72e10a9fc..af9a645331 100644 --- a/CrawlShards_8cpp_source.html +++ b/CrawlShards_8cpp_source.html @@ -104,10 +104,10 @@ $(function() {
44 doCrawlShards(RPC::JsonContext& context)
45 {
46  if (context.app.config().reporting())
-
47  return rpcError(rpcREPORTING_UNSUPPORTED);
+
47  return rpcError(rpcREPORTING_UNSUPPORTED);
48 
49  if (context.role != Role::ADMIN)
-
50  return rpcError(rpcNO_PERMISSION);
+
50  return rpcError(rpcNO_PERMISSION);
51 
52  std::uint32_t relays{0};
53  if (auto const& jv = context.params[jss::limit])
@@ -133,6 +133,7 @@ $(function() {
73 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
ripple::relayLimit
static constexpr std::uint32_t relayLimit
Definition: ripple/overlay/Peer.h:36
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
@@ -147,7 +148,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::uint32_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
std::min
T min(T... args)
ripple::Overlay::crawlShards
virtual Json::Value crawlShards(bool includePublicKey, std::uint32_t hops)=0
Returns information reported to the crawl shard RPC command.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
diff --git a/DownloadShard_8cpp_source.html b/DownloadShard_8cpp_source.html index c99368af51..460c378e25 100644 --- a/DownloadShard_8cpp_source.html +++ b/DownloadShard_8cpp_source.html @@ -106,15 +106,15 @@ $(function() {
49 doDownloadShard(RPC::JsonContext& context)
50 {
51  if (context.app.config().reporting())
-
52  return rpcError(rpcREPORTING_UNSUPPORTED);
+
52  return rpcError(rpcREPORTING_UNSUPPORTED);
53 
54  if (context.role != Role::ADMIN)
-
55  return rpcError(rpcNO_PERMISSION);
+
55  return rpcError(rpcNO_PERMISSION);
56 
57  // The shard store must be configured
58  auto shardStore{context.app.getShardStore()};
59  if (!shardStore)
-
60  return rpcError(rpcNOT_ENABLED);
+
60  return rpcError(rpcNOT_ENABLED);
61 
62  // Return status update if already downloading
63  auto preShards{shardStore->getPreShards()};
@@ -220,7 +220,7 @@ $(function() {
163  if (!handler->start())
164  {
165  handler->release();
-
166  return rpcError(rpcINTERNAL);
+
166  return rpcError(rpcINTERNAL);
167  }
168 
169  std::string s{"Downloading shard"};
@@ -236,6 +236,7 @@ $(function() {
std::string
STL class.
ripple::RPC::ShardArchiveHandler::start
bool start()
Starts downloading and importing archives.
Definition: ShardArchiveHandler.cpp:235
ripple::doDownloadShard
Json::Value doDownloadShard(RPC::JsonContext &context)
RPC command that downloads and import shard archives.
Definition: DownloadShard.cpp:49
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::exception
STL class.
ripple::RPC::ShardArchiveHandler::add
bool add(std::uint32_t shardIndex, std::pair< parsedURL, std::string > &&url)
Definition: ShardArchiveHandler.cpp:199
ripple::parsedURL
Definition: StringUtilities.h:100
@@ -258,7 +259,6 @@ $(function() {
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::map
STL class.
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
Json::Value::isArray
bool isArray() const
Definition: json_value.cpp:1015
std::string::substr
T substr(T... args)
diff --git a/Feature1_8cpp_source.html b/Feature1_8cpp_source.html index 7064951dcc..5a3eba129c 100644 --- a/Feature1_8cpp_source.html +++ b/Feature1_8cpp_source.html @@ -106,7 +106,7 @@ $(function() {
35 doFeature(RPC::JsonContext& context)
36 {
37  if (context.app.config().reporting())
-
38  return rpcError(rpcREPORTING_UNSUPPORTED);
+
38  return rpcError(rpcREPORTING_UNSUPPORTED);
39 
40  // Get majority amendment status
41  majorityAmendments_t majorities;
@@ -136,7 +136,7 @@ $(function() {
65  // If the feature is not found by name, try to parse the `feature` param as
66  // a feature ID. If that fails, return an error.
67  if (!feature && !feature.parseHex(context.params[jss::feature].asString()))
-
68  return rpcError(rpcBAD_FEATURE);
+
68  return rpcError(rpcBAD_FEATURE);
69 
70  if (context.params.isMember(jss::vetoed))
71  {
@@ -160,6 +160,7 @@ $(function() {
ripple::doFeature
Json::Value doFeature(RPC::JsonContext &context)
Definition: Feature1.cpp:35
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:621
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Application::getAmendmentTable
virtual AmendmentTable & getAmendmentTable()=0
std::map::find
T find(T... args)
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
@@ -171,7 +172,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::map
STL class.
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::LedgerMaster::getValidatedLedger
std::shared_ptr< Ledger const > getValidatedLedger()
Definition: LedgerMaster.cpp:1612
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:38
diff --git a/FetchInfo_8cpp_source.html b/FetchInfo_8cpp_source.html index 6d531069d4..b2ea0dc5e5 100644 --- a/FetchInfo_8cpp_source.html +++ b/FetchInfo_8cpp_source.html @@ -102,7 +102,7 @@ $(function() {
31 doFetchInfo(RPC::JsonContext& context)
32 {
33  if (context.app.config().reporting())
-
34  return rpcError(rpcREPORTING_UNSUPPORTED);
+
34  return rpcError(rpcREPORTING_UNSUPPORTED);
35 
36  Json::Value ret(Json::objectValue);
37 
@@ -121,6 +121,7 @@ $(function() {
50 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
ripple::NetworkOPs::clearLedgerFetch
virtual void clearLedgerFetch()=0
Json::Value::asBool
bool asBool() const
Definition: json_value.cpp:619
@@ -129,7 +130,6 @@ $(function() {
ripple::Application::config
virtual Config & config()=0
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::doFetchInfo
Json::Value doFetchInfo(RPC::JsonContext &context)
Definition: FetchInfo.cpp:31
diff --git a/LedgerRequest_8cpp_source.html b/LedgerRequest_8cpp_source.html index 097aabedd2..421a52908f 100644 --- a/LedgerRequest_8cpp_source.html +++ b/LedgerRequest_8cpp_source.html @@ -109,7 +109,7 @@ $(function() {
38 doLedgerRequest(RPC::JsonContext& context)
39 {
40  if (context.app.config().reporting())
-
41  return rpcError(rpcREPORTING_UNSUPPORTED);
+
41  return rpcError(rpcREPORTING_UNSUPPORTED);
42 
43  auto const hasHash = context.params.isMember(jss::ledger_hash);
44  auto const hasIndex = context.params.isMember(jss::ledger_index);
@@ -143,8 +143,8 @@ $(function() {
72  RPC::Tuning::maxValidatedLedgerAge)
73  {
74  if (context.apiVersion == 1)
-
75  return rpcError(rpcNO_CURRENT);
-
76  return rpcError(rpcNOT_SYNCED);
+
75  return rpcError(rpcNO_CURRENT);
+
76  return rpcError(rpcNOT_SYNCED);
77  }
78 
79  ledgerIndex = jsonIndex.asInt();
@@ -230,6 +230,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::HashPrefix::ledgerMaster
@ ledgerMaster
ledger master data for signing
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::InboundLedger::Reason::GENERIC
@ GENERIC
ripple::rpcNOT_READY
@ rpcNOT_READY
Definition: ErrorCodes.h:60
@@ -248,7 +249,6 @@ $(function() {
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::rpcNO_CURRENT
@ rpcNO_CURRENT
Definition: ErrorCodes.h:65
std::uint32_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition: LedgerToJson.cpp:291
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Application::journal
virtual beast::Journal journal(std::string const &name)=0
diff --git a/LogLevel_8cpp_source.html b/LogLevel_8cpp_source.html index 32dd3c3099..5e381d52a7 100644 --- a/LogLevel_8cpp_source.html +++ b/LogLevel_8cpp_source.html @@ -125,7 +125,7 @@ $(function() {
54  Logs::fromString(context.params[jss::severity].asString()));
55 
56  if (sv == lsINVALID)
-
57  return rpcError(rpcINVALID_PARAMS);
+
57  return rpcError(rpcINVALID_PARAMS);
58 
59  auto severity = Logs::toSeverity(sv);
60  // log_level severity
@@ -150,7 +150,7 @@ $(function() {
79  return Json::objectValue;
80  }
81 
-
82  return rpcError(rpcINVALID_PARAMS);
+
82  return rpcError(rpcINVALID_PARAMS);
83 }
84 
85 } // namespace ripple
@@ -159,6 +159,7 @@ $(function() {
ripple::Logs::partition_severities
std::vector< std::pair< std::string, std::string > > partition_severities() const
Definition: Log.cpp:165
std::string
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::vector
STL class.
ripple::lsINVALID
@ lsINVALID
Definition: Log.h:36
ripple::Logs::toString
static std::string toString(LogSeverity s)
Definition: Log.cpp:263
@@ -170,7 +171,6 @@ $(function() {
ripple::Logs::fromString
static LogSeverity fromString(std::string const &s)
Definition: Log.cpp:286
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
std::map
STL class.
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::Logs::threshold
beast::severities::Severity threshold() const
Definition: Log.cpp:150
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
beast::Journal::Sink::threshold
virtual Severity threshold() const
Returns the minimum severity level this sink will report.
Definition: beast_Journal.cpp:106
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index 7984138045..91d7a01d8b 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -3335,7 +3335,7 @@ $(function() {
3333  << toBase58(subInfo.index_->accountId_) << " no database";
3334  if (auto sptr = subInfo.sinkWptr_.lock(); sptr)
3335  {
-
3336  sptr->send(rpcError(rpcINTERNAL), true);
+
3336  sptr->send(rpcError(rpcINTERNAL), true);
3337  unsubAccountHistory(sptr, subInfo.index_->accountId_, false);
3338  }
3339  return;
@@ -3521,7 +3521,7 @@ $(function() {
3519  JLOG(m_journal.debug())
3520  << "AccountHistory job for account "
3521  << toBase58(accountId) << " getMoreTxns failed.";
-
3522  send(rpcError(rpcINTERNAL), true);
+
3522  send(rpcError(rpcINTERNAL), true);
3523  return;
3524  }
3525 
@@ -3534,7 +3534,7 @@ $(function() {
3532  JLOG(m_journal.debug())
3533  << "AccountHistory job for account "
3534  << toBase58(accountId) << " empty tx or meta.";
-
3535  send(rpcError(rpcINTERNAL), true);
+
3535  send(rpcError(rpcINTERNAL), true);
3536  return;
3537  }
3538  auto curTxLedger =
@@ -3545,7 +3545,7 @@ $(function() {
3543  JLOG(m_journal.debug())
3544  << "AccountHistory job for account "
3545  << toBase58(accountId) << " no ledger.";
-
3546  send(rpcError(rpcINTERNAL), true);
+
3546  send(rpcError(rpcINTERNAL), true);
3547  return;
3548  }
3549  std::shared_ptr<STTx const> stTxn =
@@ -3556,7 +3556,7 @@ $(function() {
3554  << "AccountHistory job for account "
3555  << toBase58(accountId)
3556  << " getSTransaction failed.";
-
3557  send(rpcError(rpcINTERNAL), true);
+
3557  send(rpcError(rpcINTERNAL), true);
3558  return;
3559  }
3560  Json::Value jvTx = transJson(
@@ -4509,6 +4509,7 @@ $(function() {
ripple::RCLConsensus::getJson
Json::Value getJson(bool full) const
Definition: RCLConsensus.cpp:894
ripple::NetworkOPsImp::minPeerCount_
const std::size_t minPeerCount_
Definition: NetworkOPs.cpp:756
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::jtCLIENT
@ jtCLIENT
Definition: Job.h:44
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:52
utility
@@ -4787,7 +4788,6 @@ $(function() {
ripple::amountFromQuality
STAmount amountFromQuality(std::uint64_t rate)
Definition: STAmount.cpp:769
ripple::OrderBookDB::makeBookListeners
BookListeners::pointer makeBookListeners(Book const &)
Definition: OrderBookDB.cpp:212
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:91
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::NetworkOPsImp::subAccount
void subAccount(InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
Definition: NetworkOPs.cpp:3215
ripple::NetworkOPsImp::m_standalone
const bool m_standalone
Definition: NetworkOPs.cpp:753
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
diff --git a/NoRippleCheck_8cpp_source.html b/NoRippleCheck_8cpp_source.html index 8595102737..0705b38f3b 100644 --- a/NoRippleCheck_8cpp_source.html +++ b/NoRippleCheck_8cpp_source.html @@ -176,7 +176,7 @@ $(function() {
105 
106  auto const sle = ledger->read(keylet::account(accountID));
107  if (!sle)
-
108  return rpcError(rpcACT_NOT_FOUND);
+
108  return rpcError(rpcACT_NOT_FOUND);
109 
110  std::uint32_t seq = sle->getFieldU32(sfSequence);
111 
@@ -269,6 +269,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
std::string
STL class.
std::shared_ptr
STL class.
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
ripple::sfSequence
const SF_UINT32 sfSequence
Json::UInt
unsigned int UInt
Definition: json_forwards.h:27
@@ -297,7 +298,6 @@ $(function() {
ripple::sfHighLimit
const SF_AMOUNT sfHighLimit
ripple::tfClearNoRipple
const std::uint32_t tfClearNoRipple
Definition: TxFlags.h:93
ripple::STLedgerEntry::getType
LedgerEntryType getType() const
Definition: STLedgerEntry.h:92
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple::STAmount::getCurrency
Currency const & getCurrency() const
Definition: STAmount.h:205
ripple::STAmount::getIssuer
AccountID const & getIssuer() const
Definition: STAmount.h:210
diff --git a/NodeToShardRPC__test_8cpp_source.html b/NodeToShardRPC__test_8cpp_source.html index 88baca2ce5..c256856f6d 100644 --- a/NodeToShardRPC__test_8cpp_source.html +++ b/NodeToShardRPC__test_8cpp_source.html @@ -92,97 +92,97 @@ $(function() {
21 #include <ripple/beast/utility/temp_dir.h>
22 #include <ripple/core/ConfigSections.h>
23 #include <ripple/nodestore/DatabaseShard.h>
-
24 #include <ripple/protocol/jss.h>
-
25 #include <test/jtx/Env.h>
-
26 
-
27 namespace ripple {
-
28 namespace test {
-
29 
-
30 class NodeToShardRPC_test : public beast::unit_test::suite
-
31 {
-
32  bool
-
33  importCompleted(
-
34  NodeStore::DatabaseShard* shardStore,
-
35  std::uint8_t const numberOfShards,
-
36  Json::Value const& result)
-
37  {
-
38  auto const info = shardStore->getShardInfo();
-
39 
-
40  // Assume completed if the import isn't running
-
41  auto const completed =
-
42  result[jss::error_message] == "Database import not running";
-
43 
-
44  if (completed)
-
45  {
-
46  BEAST_EXPECT(
-
47  info->incomplete().size() + info->finalized().size() ==
-
48  numberOfShards);
-
49  }
-
50 
-
51  return completed;
-
52  }
-
53 
-
54 public:
-
55  void
-
56  testStart()
-
57  {
-
58  testcase("Start");
-
59 
-
60  beast::temp_dir tempDir;
-
61 
-
62  jtx::Env env = [&] {
-
63  auto c = jtx::envconfig();
-
64  auto& section = c->section(ConfigSection::shardDatabase());
-
65  section.set("path", tempDir.path());
-
66  section.set("max_historical_shards", "20");
-
67  section.set("ledgers_per_shard", "256");
-
68  section.set("earliest_seq", "257");
-
69  auto& sectionNode = c->section(ConfigSection::nodeDatabase());
-
70  sectionNode.set("earliest_seq", "257");
-
71  sectionNode.set("ledgers_per_shard", "256");
-
72  c->setupControl(true, true, true);
-
73 
-
74  return jtx::Env(*this, std::move(c));
-
75  }();
-
76 
-
77  std::uint8_t const numberOfShards = 10;
-
78 
-
79  // Create some ledgers so that we can initiate a
-
80  // shard store database import.
-
81  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
-
82  (numberOfShards + 1);
-
83  ++i)
-
84  {
-
85  env.close();
+
24 #include <ripple/protocol/ErrorCodes.h>
+
25 #include <ripple/protocol/jss.h>
+
26 #include <test/jtx/Env.h>
+
27 
+
28 namespace ripple {
+
29 namespace test {
+
30 
+
31 class NodeToShardRPC_test : public beast::unit_test::suite
+
32 {
+
33  bool
+
34  importCompleted(
+
35  NodeStore::DatabaseShard* shardStore,
+
36  std::uint8_t const numberOfShards,
+
37  Json::Value const& result)
+
38  {
+
39  auto const info = shardStore->getShardInfo();
+
40 
+
41  // Assume completed if the import isn't running
+
42  auto const completed =
+
43  result[jss::error_message] == "Database import not running";
+
44 
+
45  if (completed)
+
46  {
+
47  BEAST_EXPECT(
+
48  info->incomplete().size() + info->finalized().size() ==
+
49  numberOfShards);
+
50  }
+
51 
+
52  return completed;
+
53  }
+
54 
+
55 public:
+
56  void
+
57  testDisabled()
+
58  {
+
59  testcase("Disabled");
+
60 
+
61  beast::temp_dir tempDir;
+
62 
+
63  jtx::Env env = [&] {
+
64  auto c = jtx::envconfig();
+
65  auto& sectionNode = c->section(ConfigSection::nodeDatabase());
+
66  sectionNode.set("earliest_seq", "257");
+
67  sectionNode.set("ledgers_per_shard", "256");
+
68  c->setupControl(true, true, true);
+
69 
+
70  return jtx::Env(*this, std::move(c));
+
71  }();
+
72 
+
73  std::uint8_t const numberOfShards = 10;
+
74 
+
75  // Create some ledgers so that we can initiate a
+
76  // shard store database import.
+
77  for (int i = 0; i < 256 * (numberOfShards + 1); ++i)
+
78  {
+
79  env.close();
+
80  }
+
81 
+
82  {
+
83  auto shardStore = env.app().getShardStore();
+
84  if (!BEAST_EXPECT(!shardStore))
+
85  return;
86  }
87 
-
88  auto shardStore = env.app().getShardStore();
-
89  if (!BEAST_EXPECT(shardStore))
-
90  return;
-
91 
-
92  {
-
93  // Initiate a shard store import via the RPC
-
94  // interface.
-
95 
-
96  Json::Value jvParams;
-
97  jvParams[jss::action] = "start";
-
98 
-
99  auto const result = env.rpc(
-
100  "json", "node_to_shard", to_string(jvParams))[jss::result];
-
101 
-
102  BEAST_EXPECT(
-
103  result[jss::message] == "Database import initiated...");
-
104  }
-
105 
-
106  while (!shardStore->getDatabaseImportSequence())
-
107  {
-
108  // Wait until the import starts
-
109  std::this_thread::sleep_for(std::chrono::milliseconds(1));
-
110  }
-
111 
-
112  {
-
113  // Verify that the import is in progress with
-
114  // the node_to_shard status RPC command
+
88  {
+
89  // Try the node_to_shard status RPC command. Should fail.
+
90 
+
91  Json::Value jvParams;
+
92  jvParams[jss::action] = "status";
+
93 
+
94  auto const result = env.rpc(
+
95  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
96 
+
97  BEAST_EXPECT(result[jss::error_code] == rpcNOT_ENABLED);
+
98  }
+
99 
+
100  {
+
101  // Try to start a shard store import via the RPC
+
102  // interface. Should fail.
+
103 
+
104  Json::Value jvParams;
+
105  jvParams[jss::action] = "start";
+
106 
+
107  auto const result = env.rpc(
+
108  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
109 
+
110  BEAST_EXPECT(result[jss::error_code] == rpcNOT_ENABLED);
+
111  }
+
112 
+
113  {
+
114  // Try the node_to_shard status RPC command. Should fail.
115 
116  Json::Value jvParams;
117  jvParams[jss::action] = "status";
@@ -190,234 +190,308 @@ $(function() {
119  auto const result = env.rpc(
120  "json", "node_to_shard", to_string(jvParams))[jss::result];
121 
-
122  BEAST_EXPECT(
-
123  result[jss::status] == "success" ||
-
124  importCompleted(shardStore, numberOfShards, result));
+
122  BEAST_EXPECT(result[jss::error_code] == rpcNOT_ENABLED);
+
123  }
+
124  }
125 
-
126  std::chrono::seconds const maxWait{60};
-
127  auto const start = std::chrono::system_clock::now();
-
128 
-
129  while (true)
-
130  {
-
131  // Verify that the status object accurately
-
132  // reflects import progress.
-
133 
-
134  auto const completeShards =
-
135  shardStore->getShardInfo()->finalized();
-
136 
-
137  if (!completeShards.empty())
-
138  {
-
139  auto const result = env.rpc(
-
140  "json",
-
141  "node_to_shard",
-
142  to_string(jvParams))[jss::result];
-
143 
-
144  if (!importCompleted(shardStore, numberOfShards, result))
-
145  {
-
146  BEAST_EXPECT(result[jss::firstShardIndex] == 1);
-
147  BEAST_EXPECT(result[jss::lastShardIndex] == 10);
-
148  }
-
149  }
-
150 
-
151  if (boost::icl::contains(completeShards, 1))
-
152  {
-
153  auto const result = env.rpc(
-
154  "json",
-
155  "node_to_shard",
-
156  to_string(jvParams))[jss::result];
-
157 
-
158  BEAST_EXPECT(
-
159  result[jss::currentShardIndex] >= 1 ||
-
160  importCompleted(shardStore, numberOfShards, result));
-
161 
-
162  break;
-
163  }
-
164 
-
165  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
-
166  std::chrono::system_clock::now() - start > maxWait)
-
167  {
-
168  BEAST_EXPECTS(
-
169  false, "Import timeout: could just be a slow machine.");
-
170  break;
-
171  }
-
172  }
-
173 
-
174  // Wait for the import to complete
-
175  while (!boost::icl::contains(
-
176  shardStore->getShardInfo()->finalized(), 10))
-
177  {
-
178  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
-
179  std::chrono::system_clock::now() - start > maxWait)
-
180  {
-
181  BEAST_EXPECT(
-
182  importCompleted(shardStore, numberOfShards, result));
-
183  break;
-
184  }
-
185  }
-
186  }
-
187  }
-
188 
-
189  void
-
190  testStop()
-
191  {
-
192  testcase("Stop");
-
193 
-
194  beast::temp_dir tempDir;
-
195 
-
196  jtx::Env env = [&] {
-
197  auto c = jtx::envconfig();
-
198  auto& section = c->section(ConfigSection::shardDatabase());
-
199  section.set("path", tempDir.path());
-
200  section.set("max_historical_shards", "20");
-
201  section.set("ledgers_per_shard", "256");
-
202  section.set("earliest_seq", "257");
-
203  auto& sectionNode = c->section(ConfigSection::nodeDatabase());
-
204  sectionNode.set("earliest_seq", "257");
-
205  sectionNode.set("ledgers_per_shard", "256");
-
206  c->setupControl(true, true, true);
+
126  void
+
127  testStart()
+
128  {
+
129  testcase("Start");
+
130 
+
131  beast::temp_dir tempDir;
+
132 
+
133  jtx::Env env = [&] {
+
134  auto c = jtx::envconfig();
+
135  auto& section = c->section(ConfigSection::shardDatabase());
+
136  section.set("path", tempDir.path());
+
137  section.set("max_historical_shards", "20");
+
138  section.set("ledgers_per_shard", "256");
+
139  section.set("earliest_seq", "257");
+
140  auto& sectionNode = c->section(ConfigSection::nodeDatabase());
+
141  sectionNode.set("earliest_seq", "257");
+
142  sectionNode.set("ledgers_per_shard", "256");
+
143  c->setupControl(true, true, true);
+
144 
+
145  return jtx::Env(*this, std::move(c));
+
146  }();
+
147 
+
148  std::uint8_t const numberOfShards = 10;
+
149 
+
150  // Create some ledgers so that we can initiate a
+
151  // shard store database import.
+
152  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
+
153  (numberOfShards + 1);
+
154  ++i)
+
155  {
+
156  env.close();
+
157  }
+
158 
+
159  auto shardStore = env.app().getShardStore();
+
160  if (!BEAST_EXPECT(shardStore))
+
161  return;
+
162 
+
163  {
+
164  // Initiate a shard store import via the RPC
+
165  // interface.
+
166 
+
167  Json::Value jvParams;
+
168  jvParams[jss::action] = "start";
+
169 
+
170  auto const result = env.rpc(
+
171  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
172 
+
173  BEAST_EXPECT(
+
174  result[jss::message] == "Database import initiated...");
+
175  }
+
176 
+
177  while (!shardStore->getDatabaseImportSequence())
+
178  {
+
179  // Wait until the import starts
+
180  std::this_thread::sleep_for(std::chrono::milliseconds(1));
+
181  }
+
182 
+
183  {
+
184  // Verify that the import is in progress with
+
185  // the node_to_shard status RPC command
+
186 
+
187  Json::Value jvParams;
+
188  jvParams[jss::action] = "status";
+
189 
+
190  auto const result = env.rpc(
+
191  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
192 
+
193  BEAST_EXPECT(
+
194  result[jss::status] == "success" ||
+
195  importCompleted(shardStore, numberOfShards, result));
+
196 
+
197  std::chrono::seconds const maxWait{60};
+
198  auto const start = std::chrono::system_clock::now();
+
199 
+
200  while (true)
+
201  {
+
202  // Verify that the status object accurately
+
203  // reflects import progress.
+
204 
+
205  auto const completeShards =
+
206  shardStore->getShardInfo()->finalized();
207 
-
208  return jtx::Env(*this, std::move(c));
-
209  }();
-
210 
-
211  std::uint8_t const numberOfShards = 10;
-
212 
-
213  // Create some ledgers so that we can initiate a
-
214  // shard store database import.
-
215  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
-
216  (numberOfShards + 1);
-
217  ++i)
-
218  {
-
219  env.close();
-
220  }
+
208  if (!completeShards.empty())
+
209  {
+
210  auto const result = env.rpc(
+
211  "json",
+
212  "node_to_shard",
+
213  to_string(jvParams))[jss::result];
+
214 
+
215  if (!importCompleted(shardStore, numberOfShards, result))
+
216  {
+
217  BEAST_EXPECT(result[jss::firstShardIndex] == 1);
+
218  BEAST_EXPECT(result[jss::lastShardIndex] == 10);
+
219  }
+
220  }
221 
-
222  auto shardStore = env.app().getShardStore();
-
223  if (!BEAST_EXPECT(shardStore))
-
224  return;
-
225 
-
226  {
-
227  // Initiate a shard store import via the RPC
-
228  // interface.
-
229 
-
230  Json::Value jvParams;
-
231  jvParams[jss::action] = "start";
+
222  if (boost::icl::contains(completeShards, 1))
+
223  {
+
224  auto const result = env.rpc(
+
225  "json",
+
226  "node_to_shard",
+
227  to_string(jvParams))[jss::result];
+
228 
+
229  BEAST_EXPECT(
+
230  result[jss::currentShardIndex] >= 1 ||
+
231  importCompleted(shardStore, numberOfShards, result));
232 
-
233  auto const result = env.rpc(
-
234  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
233  break;
+
234  }
235 
-
236  BEAST_EXPECT(
-
237  result[jss::message] == "Database import initiated...");
-
238  }
-
239 
-
240  {
-
241  // Verify that the import is in progress with
-
242  // the node_to_shard status RPC command
-
243 
-
244  Json::Value jvParams;
-
245  jvParams[jss::action] = "status";
-
246 
-
247  auto const result = env.rpc(
-
248  "json", "node_to_shard", to_string(jvParams))[jss::result];
-
249 
-
250  BEAST_EXPECT(
-
251  result[jss::status] == "success" ||
-
252  importCompleted(shardStore, numberOfShards, result));
-
253 
-
254  std::chrono::seconds const maxWait{10};
-
255  auto const start = std::chrono::system_clock::now();
-
256 
-
257  while (shardStore->getShardInfo()->finalized().empty())
-
258  {
-
259  // Wait for at least one shard to complete
-
260 
-
261  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
-
262  std::chrono::system_clock::now() - start > maxWait)
-
263  {
-
264  BEAST_EXPECTS(
-
265  false, "Import timeout: could just be a slow machine.");
-
266  break;
-
267  }
-
268  }
-
269  }
-
270 
-
271  {
-
272  Json::Value jvParams;
-
273  jvParams[jss::action] = "stop";
-
274 
-
275  auto const result = env.rpc(
-
276  "json", "node_to_shard", to_string(jvParams))[jss::result];
-
277 
-
278  BEAST_EXPECT(
-
279  result[jss::message] == "Database import halt initiated..." ||
-
280  importCompleted(shardStore, numberOfShards, result));
-
281  }
-
282 
-
283  std::chrono::seconds const maxWait{10};
-
284  auto const start = std::chrono::system_clock::now();
-
285 
-
286  while (true)
-
287  {
-
288  // Wait until we can verify that the import has
-
289  // stopped
-
290 
-
291  Json::Value jvParams;
-
292  jvParams[jss::action] = "status";
-
293 
-
294  auto const result = env.rpc(
-
295  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
236  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
+
237  std::chrono::system_clock::now() - start > maxWait)
+
238  {
+
239  BEAST_EXPECTS(
+
240  false, "Import timeout: could just be a slow machine.");
+
241  break;
+
242  }
+
243  }
+
244 
+
245  // Wait for the import to complete
+
246  while (!boost::icl::contains(
+
247  shardStore->getShardInfo()->finalized(), 10))
+
248  {
+
249  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
+
250  std::chrono::system_clock::now() - start > maxWait)
+
251  {
+
252  BEAST_EXPECT(
+
253  importCompleted(shardStore, numberOfShards, result));
+
254  break;
+
255  }
+
256  }
+
257  }
+
258  }
+
259 
+
260  void
+
261  testStop()
+
262  {
+
263  testcase("Stop");
+
264 
+
265  beast::temp_dir tempDir;
+
266 
+
267  jtx::Env env = [&] {
+
268  auto c = jtx::envconfig();
+
269  auto& section = c->section(ConfigSection::shardDatabase());
+
270  section.set("path", tempDir.path());
+
271  section.set("max_historical_shards", "20");
+
272  section.set("ledgers_per_shard", "256");
+
273  section.set("earliest_seq", "257");
+
274  auto& sectionNode = c->section(ConfigSection::nodeDatabase());
+
275  sectionNode.set("earliest_seq", "257");
+
276  sectionNode.set("ledgers_per_shard", "256");
+
277  c->setupControl(true, true, true);
+
278 
+
279  return jtx::Env(*this, std::move(c));
+
280  }();
+
281 
+
282  std::uint8_t const numberOfShards = 10;
+
283 
+
284  // Create some ledgers so that we can initiate a
+
285  // shard store database import.
+
286  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
+
287  (numberOfShards + 1);
+
288  ++i)
+
289  {
+
290  env.close();
+
291  }
+
292 
+
293  auto shardStore = env.app().getShardStore();
+
294  if (!BEAST_EXPECT(shardStore))
+
295  return;
296 
-
297  // When the import has stopped, polling the
-
298  // status returns an error
-
299  if (result.isMember(jss::error))
-
300  {
-
301  if (BEAST_EXPECT(result.isMember(jss::error_message)))
-
302  {
-
303  BEAST_EXPECT(
-
304  result[jss::error_message] ==
-
305  "Database import not running");
-
306  }
-
307 
-
308  break;
-
309  }
+
297  {
+
298  // Initiate a shard store import via the RPC
+
299  // interface.
+
300 
+
301  Json::Value jvParams;
+
302  jvParams[jss::action] = "start";
+
303 
+
304  auto const result = env.rpc(
+
305  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
306 
+
307  BEAST_EXPECT(
+
308  result[jss::message] == "Database import initiated...");
+
309  }
310 
-
311  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
-
312  std::chrono::system_clock::now() - start > maxWait)
-
313  {
-
314  BEAST_EXPECTS(
-
315  false, "Import timeout: could just be a slow machine.");
-
316  break;
-
317  }
-
318  }
-
319  }
+
311  {
+
312  // Verify that the import is in progress with
+
313  // the node_to_shard status RPC command
+
314 
+
315  Json::Value jvParams;
+
316  jvParams[jss::action] = "status";
+
317 
+
318  auto const result = env.rpc(
+
319  "json", "node_to_shard", to_string(jvParams))[jss::result];
320 
-
321  void
-
322  run() override
-
323  {
-
324  testStart();
-
325  testStop();
-
326  }
-
327 };
-
328 
-
329 BEAST_DEFINE_TESTSUITE(NodeToShardRPC, rpc, ripple);
-
330 } // namespace test
-
331 } // namespace ripple
+
321  BEAST_EXPECT(
+
322  result[jss::status] == "success" ||
+
323  importCompleted(shardStore, numberOfShards, result));
+
324 
+
325  std::chrono::seconds const maxWait{10};
+
326  auto const start = std::chrono::system_clock::now();
+
327 
+
328  while (shardStore->getShardInfo()->finalized().empty())
+
329  {
+
330  // Wait for at least one shard to complete
+
331 
+
332  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
+
333  std::chrono::system_clock::now() - start > maxWait)
+
334  {
+
335  BEAST_EXPECTS(
+
336  false, "Import timeout: could just be a slow machine.");
+
337  break;
+
338  }
+
339  }
+
340  }
+
341 
+
342  {
+
343  Json::Value jvParams;
+
344  jvParams[jss::action] = "stop";
+
345 
+
346  auto const result = env.rpc(
+
347  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
348 
+
349  BEAST_EXPECT(
+
350  result[jss::message] == "Database import halt initiated..." ||
+
351  importCompleted(shardStore, numberOfShards, result));
+
352  }
+
353 
+
354  std::chrono::seconds const maxWait{10};
+
355  auto const start = std::chrono::system_clock::now();
+
356 
+
357  while (true)
+
358  {
+
359  // Wait until we can verify that the import has
+
360  // stopped
+
361 
+
362  Json::Value jvParams;
+
363  jvParams[jss::action] = "status";
+
364 
+
365  auto const result = env.rpc(
+
366  "json", "node_to_shard", to_string(jvParams))[jss::result];
+
367 
+
368  // When the import has stopped, polling the
+
369  // status returns an error
+
370  if (result.isMember(jss::error))
+
371  {
+
372  if (BEAST_EXPECT(result.isMember(jss::error_message)))
+
373  {
+
374  BEAST_EXPECT(
+
375  result[jss::error_message] ==
+
376  "Database import not running");
+
377  }
+
378 
+
379  break;
+
380  }
+
381 
+
382  if (std::this_thread::sleep_for(std::chrono::milliseconds{100});
+
383  std::chrono::system_clock::now() - start > maxWait)
+
384  {
+
385  BEAST_EXPECTS(
+
386  false, "Import timeout: could just be a slow machine.");
+
387  break;
+
388  }
+
389  }
+
390  }
+
391 
+
392  void
+
393  run() override
+
394  {
+
395  testDisabled();
+
396  testStart();
+
397  testStop();
+
398  }
+
399 };
+
400 
+
401 BEAST_DEFINE_TESTSUITE(NodeToShardRPC, rpc, ripple);
+
402 } // namespace test
+
403 } // namespace ripple
std::this_thread::sleep_for
T sleep_for(T... args)
-
ripple::test::NodeToShardRPC_test::testStop
void testStop()
Definition: NodeToShardRPC_test.cpp:190
+
ripple::test::NodeToShardRPC_test::testStop
void testStop()
Definition: NodeToShardRPC_test.cpp:261
ripple::ConfigSection::shardDatabase
static std::string shardDatabase()
Definition: ConfigSections.h:38
std::chrono::milliseconds
ripple::Application::getShardStore
virtual NodeStore::DatabaseShard * getShardStore()=0
ripple::test::jtx::Env::app
Application & app()
Definition: Env.h:241
ripple::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:49
-
ripple::test::NodeToShardRPC_test::testStart
void testStart()
Definition: NodeToShardRPC_test.cpp:56
+
ripple::test::NodeToShardRPC_test::testStart
void testStart()
Definition: NodeToShardRPC_test.cpp:127
ripple::NodeStore::DatabaseShard
A collection of historical shards.
Definition: DatabaseShard.h:37
ripple::test::jtx::Env::close
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
-
ripple::test::NodeToShardRPC_test
Definition: NodeToShardRPC_test.cpp:30
+
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
+
ripple::test::NodeToShardRPC_test
Definition: NodeToShardRPC_test.cpp:31
std::uint8_t
+
ripple::test::NodeToShardRPC_test::testDisabled
void testDisabled()
Definition: NodeToShardRPC_test.cpp:57
beast::temp_dir::path
std::string path() const
Get the native path for the temporary directory.
Definition: temp_dir.h:66
-
ripple::test::NodeToShardRPC_test::importCompleted
bool importCompleted(NodeStore::DatabaseShard *shardStore, std::uint8_t const numberOfShards, Json::Value const &result)
Definition: NodeToShardRPC_test.cpp:33
+
ripple::test::NodeToShardRPC_test::importCompleted
bool importCompleted(NodeStore::DatabaseShard *shardStore, std::uint8_t const numberOfShards, Json::Value const &result)
Definition: NodeToShardRPC_test.cpp:34
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:38
-
ripple::test::NodeToShardRPC_test::run
void run() override
Definition: NodeToShardRPC_test.cpp:322
+
ripple::test::NodeToShardRPC_test::run
void run() override
Definition: NodeToShardRPC_test.cpp:393
ripple::NodeStore::DatabaseShard::getShardInfo
virtual std::unique_ptr< ShardInfo > getShardInfo() const =0
Query information about shards held.
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
ripple::ConfigSection::nodeDatabase
static std::string nodeDatabase()
Definition: ConfigSections.h:33
diff --git a/NodeToShard_8cpp_source.html b/NodeToShard_8cpp_source.html index f2a2237bd4..b7f5f38504 100644 --- a/NodeToShard_8cpp_source.html +++ b/NodeToShard_8cpp_source.html @@ -104,12 +104,12 @@ $(function() {
33 doNodeToShard(RPC::JsonContext& context)
34 {
35  if (context.app.config().reporting())
-
36  return rpcError(rpcREPORTING_UNSUPPORTED);
+
36  return rpcError(rpcREPORTING_UNSUPPORTED);
37 
38  // Shard store must be enabled
39  auto const shardStore = context.app.getShardStore();
40  if (!shardStore)
-
41  return rpcError(rpcINTERNAL, "No shard store");
+
41  return RPC::make_error(rpcNOT_ENABLED);
42 
43  if (!context.params.isMember(jss::action))
44  return RPC::missing_field_error(jss::action);
@@ -150,13 +150,14 @@ $(function() {
79  {
80  // Shouldn't happen
81  assert(false);
-
82  return rpcError(rpcINTERNAL);
+
82  return rpcError(rpcINTERNAL);
83  }
84 }
85 
86 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::vector< std::string >
std::find
T find(T... args)
ripple::Application::getShardStore
virtual NodeStore::DatabaseShard * getShardStore()=0
@@ -165,8 +166,8 @@ $(function() {
ripple::Config::reporting
bool reporting() const
Definition: Config.h:308
ripple::Application::config
virtual Config & config()=0
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
+
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
std::vector::begin
T begin(T... args)
@@ -174,6 +175,7 @@ $(function() {
std::vector::end
T end(T... args)
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::RPC::invalid_field_error
Json::Value invalid_field_error(std::string const &name)
Definition: ErrorCodes.h:285
+
ripple::RPC::make_error
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
Definition: ErrorCodes.cpp:209
Json::Value
Represents a JSON value.
Definition: json_value.h:145
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
diff --git a/PathFind_8cpp_source.html b/PathFind_8cpp_source.html index f56bb46bde..50c636d35d 100644 --- a/PathFind_8cpp_source.html +++ b/PathFind_8cpp_source.html @@ -104,18 +104,18 @@ $(function() {
33 doPathFind(RPC::JsonContext& context)
34 {
35  if (context.app.config().PATH_SEARCH_MAX == 0)
-
36  return rpcError(rpcNOT_SUPPORTED);
+
36  return rpcError(rpcNOT_SUPPORTED);
37 
38  auto lpLedger = context.ledgerMaster.getClosedLedger();
39 
40  if (!context.params.isMember(jss::subcommand) ||
41  !context.params[jss::subcommand].isString())
42  {
-
43  return rpcError(rpcINVALID_PARAMS);
+
43  return rpcError(rpcINVALID_PARAMS);
44  }
45 
46  if (!context.infoSub)
-
47  return rpcError(rpcNO_EVENTS);
+
47  return rpcError(rpcNO_EVENTS);
48 
49  auto sSubCommand = context.params[jss::subcommand].asString();
50 
@@ -132,7 +132,7 @@ $(function() {
61  PathRequest::pointer request = context.infoSub->getPathRequest();
62 
63  if (!request)
-
64  return rpcError(rpcNO_PF_REQUEST);
+
64  return rpcError(rpcNO_PF_REQUEST);
65 
66  context.infoSub->clearPathRequest();
67  return request->doClose(context.params);
@@ -143,12 +143,12 @@ $(function() {
72  PathRequest::pointer request = context.infoSub->getPathRequest();
73 
74  if (!request)
-
75  return rpcError(rpcNO_PF_REQUEST);
+
75  return rpcError(rpcNO_PF_REQUEST);
76 
77  return request->doStatus(context.params);
78  }
79 
-
80  return rpcError(rpcINVALID_PARAMS);
+
80  return rpcError(rpcINVALID_PARAMS);
81 }
82 
83 } // namespace ripple
@@ -161,6 +161,7 @@ $(function() {
ripple::doPathFind
Json::Value doPathFind(RPC::JsonContext &)
Definition: PathFind.cpp:33
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
ripple::Config::PATH_SEARCH_MAX
int PATH_SEARCH_MAX
Definition: Config.h:178
@@ -170,7 +171,6 @@ $(function() {
ripple::rpcNO_EVENTS
@ rpcNO_EVENTS
Definition: ErrorCodes.h:54
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::Application::getPathRequests
virtual PathRequests & getPathRequests()=0
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::LedgerMaster::getClosedLedger
std::shared_ptr< Ledger const > getClosedLedger()
Definition: LedgerMaster.h:98
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::InfoSub::getPathRequest
std::shared_ptr< PathRequest > const & getPathRequest()
Definition: InfoSub.cpp:134
diff --git a/PathRequest_8cpp_source.html b/PathRequest_8cpp_source.html index 98643892f8..8ebd6ea56f 100644 --- a/PathRequest_8cpp_source.html +++ b/PathRequest_8cpp_source.html @@ -248,7 +248,7 @@ $(function() {
177  if (!convert_all_ && (saSendMax || saDstAmount <= beast::zero))
178  {
179  // If send max specified, dst amt must be -1.
-
180  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
+
180  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
181  return false;
182  }
183 
@@ -257,7 +257,7 @@ $(function() {
186  if (!lrLedger->exists(keylet::account(*raSrcAccount)))
187  {
188  // Source account does not exist.
-
189  jvStatus = rpcError(rpcSRC_ACT_NOT_FOUND);
+
189  jvStatus = rpcError(rpcSRC_ACT_NOT_FOUND);
190  return false;
191  }
192 
@@ -272,7 +272,7 @@ $(function() {
201  if (!saDstAmount.native())
202  {
203  // Only XRP can be send to a non-existent account.
-
204  jvStatus = rpcError(rpcACT_NOT_FOUND);
+
204  jvStatus = rpcError(rpcACT_NOT_FOUND);
205  return false;
206  }
207 
@@ -280,7 +280,7 @@ $(function() {
209  saDstAmount < STAmount(lrLedger->fees().accountReserve(0)))
210  {
211  // Payment must meet reserve.
-
212  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
+
212  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
213  return false;
214  }
215  }
@@ -346,19 +346,19 @@ $(function() {
275 {
276  if (!jvParams.isMember(jss::source_account))
277  {
-
278  jvStatus = rpcError(rpcSRC_ACT_MISSING);
+
278  jvStatus = rpcError(rpcSRC_ACT_MISSING);
279  return PFR_PJ_INVALID;
280  }
281 
282  if (!jvParams.isMember(jss::destination_account))
283  {
-
284  jvStatus = rpcError(rpcDST_ACT_MISSING);
+
284  jvStatus = rpcError(rpcDST_ACT_MISSING);
285  return PFR_PJ_INVALID;
286  }
287 
288  if (!jvParams.isMember(jss::destination_amount))
289  {
-
290  jvStatus = rpcError(rpcDST_AMT_MISSING);
+
290  jvStatus = rpcError(rpcDST_AMT_MISSING);
291  return PFR_PJ_INVALID;
292  }
293 
@@ -366,7 +366,7 @@ $(function() {
295  parseBase58<AccountID>(jvParams[jss::source_account].asString());
296  if (!raSrcAccount)
297  {
-
298  jvStatus = rpcError(rpcSRC_ACT_MALFORMED);
+
298  jvStatus = rpcError(rpcSRC_ACT_MALFORMED);
299  return PFR_PJ_INVALID;
300  }
301 
@@ -374,13 +374,13 @@ $(function() {
303  parseBase58<AccountID>(jvParams[jss::destination_account].asString());
304  if (!raDstAccount)
305  {
-
306  jvStatus = rpcError(rpcDST_ACT_MALFORMED);
+
306  jvStatus = rpcError(rpcDST_ACT_MALFORMED);
307  return PFR_PJ_INVALID;
308  }
309 
310  if (!amountFromJsonNoThrow(saDstAmount, jvParams[jss::destination_amount]))
311  {
-
312  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
+
312  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
313  return PFR_PJ_INVALID;
314  }
315 
@@ -391,7 +391,7 @@ $(function() {
320  (saDstAmount.getCurrency() == badCurrency()) ||
321  (!convert_all_ && saDstAmount <= beast::zero))
322  {
-
323  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
+
323  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
324  return PFR_PJ_INVALID;
325  }
326 
@@ -400,7 +400,7 @@ $(function() {
329  // Send_max requires destination amount to be -1.
330  if (!convert_all_)
331  {
-
332  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
+
332  jvStatus = rpcError(rpcDST_AMT_MALFORMED);
333  return PFR_PJ_INVALID;
334  }
335 
@@ -412,7 +412,7 @@ $(function() {
341  (*saSendMax <= beast::zero &&
342  *saSendMax != STAmount(saSendMax->issue(), 1u, 0, true)))
343  {
-
344  jvStatus = rpcError(rpcSENDMAX_MALFORMED);
+
344  jvStatus = rpcError(rpcSENDMAX_MALFORMED);
345  return PFR_PJ_INVALID;
346  }
347  }
@@ -423,7 +423,7 @@ $(function() {
352  if (!jvSrcCurrencies.isArray() || jvSrcCurrencies.size() == 0 ||
353  jvSrcCurrencies.size() > RPC::Tuning::max_src_cur)
354  {
-
355  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
+
355  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
356  return PFR_PJ_INVALID;
357  }
358 
@@ -437,7 +437,7 @@ $(function() {
366  !c[jss::currency].isString() ||
367  !to_currency(srcCurrencyID, c[jss::currency].asString()))
368  {
-
369  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
+
369  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
370  return PFR_PJ_INVALID;
371  }
372 
@@ -447,7 +447,7 @@ $(function() {
376  (!c[jss::issuer].isString() ||
377  !to_issuer(srcIssuerID, c[jss::issuer].asString())))
378  {
-
379  jvStatus = rpcError(rpcSRC_ISR_MALFORMED);
+
379  jvStatus = rpcError(rpcSRC_ISR_MALFORMED);
380  return PFR_PJ_INVALID;
381  }
382 
@@ -455,7 +455,7 @@ $(function() {
384  {
385  if (srcIssuerID.isNonZero())
386  {
-
387  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
+
387  jvStatus = rpcError(rpcSRC_CUR_MALFORMED);
388  return PFR_PJ_INVALID;
389  }
390  }
@@ -475,7 +475,7 @@ $(function() {
404  saSendMax->getIssuer() != *raSrcAccount &&
405  srcIssuerID != saSendMax->getIssuer())
406  {
-
407  jvStatus = rpcError(rpcSRC_ISR_MALFORMED);
+
407  jvStatus = rpcError(rpcSRC_ISR_MALFORMED);
408  return PFR_PJ_INVALID;
409  }
410 
@@ -778,7 +778,7 @@ $(function() {
707  else
708  {
709  bLastSuccess = false;
-
710  newStatus = rpcError(rpcINTERNAL);
+
710  newStatus = rpcError(rpcINTERNAL);
711  }
712 
713  if (fast && quick_reply_ == steady_clock::time_point{})
@@ -819,6 +819,7 @@ $(function() {
std::string
STL class.
std::shared_ptr< InfoSub >
ripple::PathRequest::mContext
std::map< Issue, STPathSet > mContext
Definition: PathRequest.h:148
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::PathRequest::getPathFinder
std::unique_ptr< Pathfinder > const & getPathFinder(std::shared_ptr< RippleLineCache > const &, hash_map< Currency, std::unique_ptr< Pathfinder >> &, Currency const &, STAmount const &, int const)
Definition: PathRequest.cpp:461
ripple::Config::PATH_SEARCH
int PATH_SEARCH
Definition: Config.h:176
ripple::base_uint::isNonZero
bool isNonZero() const
Definition: base_uint.h:516
@@ -886,7 +887,6 @@ $(function() {
ripple::PathRequest::raSrcAccount
std::optional< AccountID > raSrcAccount
Definition: PathRequest.h:142
ripple::rpcDST_ACT_MALFORMED
@ rpcDST_ACT_MALFORMED
Definition: ErrorCodes.h:103
ripple::PathRequest::isValid
bool isValid(std::shared_ptr< RippleLineCache > const &crCache)
Definition: PathRequest.cpp:172
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::transHuman
std::string transHuman(TER code)
Definition: TER.cpp:205
ripple::STAmount::getCurrency
Currency const & getCurrency() const
Definition: STAmount.h:205
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:212
diff --git a/PathRequests_8cpp_source.html b/PathRequests_8cpp_source.html index 02f4c03a9f..18867ba948 100644 --- a/PathRequests_8cpp_source.html +++ b/PathRequests_8cpp_source.html @@ -314,7 +314,7 @@ $(function() {
246  if (!app_.getLedgerMaster().newPathRequest())
247  {
248  // The newPathRequest failed. Tell the caller.
-
249  jvRes = rpcError(rpcTOO_BUSY);
+
249  jvRes = rpcError(rpcTOO_BUSY);
250  req.reset();
251  }
252  }
@@ -344,6 +344,7 @@ $(function() {
ripple::PathRequests::doLegacyPathRequest
Json::Value doLegacyPathRequest(Resource::Consumer &consumer, std::shared_ptr< ReadView const > const &inLedger, Json::Value const &request)
Definition: PathRequests.cpp:258
std::shared_ptr
STL class.
ripple::PathRequests::makePathRequest
Json::Value makePathRequest(std::shared_ptr< InfoSub > const &subscriber, std::shared_ptr< ReadView const > const &ledger, Json::Value const &request)
Definition: PathRequests.cpp:203
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
beast::Journal::trace
Stream trace() const
Severity stream access functions.
Definition: Journal.h:309
ripple::jtPATH_FIND
@ jtPATH_FIND
Definition: Job.h:76
std::vector
STL class.
@@ -367,7 +368,6 @@ $(function() {
std::uint32_t
std::remove_if
T remove_if(T... args)
ripple::PathRequests::mLock
std::recursive_mutex mLock
Definition: PathRequests.h:119
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition: Consumer.h:33
ripple::PathRequests::mLineCache
std::shared_ptr< RippleLineCache > mLineCache
Definition: PathRequests.h:115
diff --git a/PayChanClaim_8cpp_source.html b/PayChanClaim_8cpp_source.html index c6213ccd35..1d46fbded3 100644 --- a/PayChanClaim_8cpp_source.html +++ b/PayChanClaim_8cpp_source.html @@ -132,14 +132,14 @@ $(function() {
61 
62  uint256 channelId;
63  if (!channelId.parseHex(params[jss::channel_id].asString()))
-
64  return rpcError(rpcCHANNEL_MALFORMED);
+
64  return rpcError(rpcCHANNEL_MALFORMED);
65 
66  std::optional<std::uint64_t> const optDrops = params[jss::amount].isString()
67  ? to_uint64(params[jss::amount].asString())
68  : std::nullopt;
69 
70  if (!optDrops)
-
71  return rpcError(rpcCHANNEL_AMT_MALFORMED);
+
71  return rpcError(rpcCHANNEL_AMT_MALFORMED);
72 
73  std::uint64_t const drops = *optDrops;
74 
@@ -183,30 +183,30 @@ $(function() {
112  {
113  auto pkHex = strUnHex(strPk);
114  if (!pkHex)
-
115  return rpcError(rpcPUBLIC_MALFORMED);
+
115  return rpcError(rpcPUBLIC_MALFORMED);
116  auto const pkType = publicKeyType(makeSlice(*pkHex));
117  if (!pkType)
-
118  return rpcError(rpcPUBLIC_MALFORMED);
+
118  return rpcError(rpcPUBLIC_MALFORMED);
119  pk.emplace(makeSlice(*pkHex));
120  }
121  }
122 
123  uint256 channelId;
124  if (!channelId.parseHex(params[jss::channel_id].asString()))
-
125  return rpcError(rpcCHANNEL_MALFORMED);
+
125  return rpcError(rpcCHANNEL_MALFORMED);
126 
127  std::optional<std::uint64_t> const optDrops = params[jss::amount].isString()
128  ? to_uint64(params[jss::amount].asString())
129  : std::nullopt;
130 
131  if (!optDrops)
-
132  return rpcError(rpcCHANNEL_AMT_MALFORMED);
+
132  return rpcError(rpcCHANNEL_AMT_MALFORMED);
133 
134  std::uint64_t const drops = *optDrops;
135 
136  auto sig = strUnHex(params[jss::signature].asString());
137  if (!sig || !sig->size())
-
138  return rpcError(rpcINVALID_PARAMS);
+
138  return rpcError(rpcINVALID_PARAMS);
139 
140  Serializer msg;
141  serializePayChanAuthorization(msg, channelId, XRPAmount(drops));
@@ -223,6 +223,7 @@ $(function() {
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:240
std::string
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::exception
STL class.
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:268
std::optional::emplace
T emplace(T... args)
@@ -237,7 +238,6 @@ $(function() {
ripple::rpcPUBLIC_MALFORMED
@ rpcPUBLIC_MALFORMED
Definition: ErrorCodes.h:117
ripple::Serializer::slice
Slice slice() const noexcept
Definition: Serializer.h:63
std::uint64_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple::rpcCHANNEL_AMT_MALFORMED
@ rpcCHANNEL_AMT_MALFORMED
Definition: ErrorCodes.h:101
ripple::Serializer
Definition: Serializer.h:39
diff --git a/Peers_8cpp_source.html b/Peers_8cpp_source.html index 2538728b9c..eb6f2b6657 100644 --- a/Peers_8cpp_source.html +++ b/Peers_8cpp_source.html @@ -103,7 +103,7 @@ $(function() {
32 doPeers(RPC::JsonContext& context)
33 {
34  if (context.app.config().reporting())
-
35  return rpcError(rpcREPORTING_UNSUPPORTED);
+
35  return rpcError(rpcREPORTING_UNSUPPORTED);
36 
37  Json::Value jvResult(Json::objectValue);
38 
@@ -160,6 +160,7 @@ $(function() {
ripple::ClusterNode
Definition: ClusterNode.h:30
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::Application::cluster
virtual Cluster & cluster()=0
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::ClusterNode::name
std::string const & name() const
Definition: ClusterNode.h:45
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
ripple::LoadFeeTrack::getLoadBase
std::uint32_t getLoadBase() const
Definition: LoadFeeTrack.h:87
@@ -174,7 +175,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
std::chrono::time_point
std::uint32_t
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Overlay::json
virtual Json::Value json()=0
Return diagnostics on the status of all peers.
ripple::RPC::Context::apiVersion
unsigned int apiVersion
Definition: Context.h:50
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html index 69ceb1a12d..69722b932e 100644 --- a/RPCCall_8cpp_source.html +++ b/RPCCall_8cpp_source.html @@ -266,7 +266,7 @@ $(function() {
195  if (boost::iequals(jvParams[0u].asString(), "novalidate"))
196  ++i;
197  else if (!boost::iequals(jvParams[--sz].asString(), "novalidate"))
-
198  return rpcError(rpcINVALID_PARAMS);
+
198  return rpcError(rpcINVALID_PARAMS);
199  }
200 
201  // Create the 'shards' array
@@ -308,14 +308,14 @@ $(function() {
237 
238  std::string const strPk = jvParams[0u].asString();
239  if (!validPublicKey(strPk, TokenType::NodePublic))
-
240  return rpcError(rpcPUBLIC_MALFORMED);
+
240  return rpcError(rpcPUBLIC_MALFORMED);
241 
242  jvRequest[jss::public_key] = strPk;
243 
244  return jvRequest;
245  }
246 
-
247  return rpcError(rpcINVALID_PARAMS);
+
247  return rpcError(rpcINVALID_PARAMS);
248  }
249 
250  // fetch_info [clear]
@@ -341,7 +341,7 @@ $(function() {
270 
271  auto const account = parseBase58<AccountID>(jvParams[0u].asString());
272  if (!account)
-
273  return rpcError(rpcACT_MALFORMED);
+
273  return rpcError(rpcACT_MALFORMED);
274 
275  jvRequest[jss::account] = toBase58(*account);
276 
@@ -388,8 +388,8 @@ $(function() {
317  {
318  // The command line always follows apiMaximumSupportedVersion
319  if (RPC::apiMaximumSupportedVersion == 1)
-
320  return rpcError(rpcLGR_IDXS_INVALID);
-
321  return rpcError(rpcNOT_SYNCED);
+
320  return rpcError(rpcLGR_IDXS_INVALID);
+
321  return rpcError(rpcNOT_SYNCED);
322  }
323 
324  jvRequest[jss::ledger_index_min] = jvParams[1u].asInt();
@@ -415,7 +415,7 @@ $(function() {
344 
345  auto const account = parseBase58<AccountID>(jvParams[0u].asString());
346  if (!account)
-
347  return rpcError(rpcACT_MALFORMED);
+
347  return rpcError(rpcACT_MALFORMED);
348 
349  jvRequest[jss::account] = toBase58(*account);
350 
@@ -461,8 +461,8 @@ $(function() {
390  {
391  // The command line always follows apiMaximumSupportedVersion
392  if (RPC::apiMaximumSupportedVersion == 1)
-
393  return rpcError(rpcLGR_IDXS_INVALID);
-
394  return rpcError(rpcNOT_SYNCED);
+
393  return rpcError(rpcLGR_IDXS_INVALID);
+
394  return rpcError(rpcNOT_SYNCED);
395  }
396 
397  jvRequest[jss::ledger_index_min] = jvParams[1u].asInt();
@@ -585,7 +585,7 @@ $(function() {
514  Json::Value
515  parseEvented(Json::Value const& jvParams)
516  {
-
517  return rpcError(rpcNO_EVENTS);
+
517  return rpcError(rpcNO_EVENTS);
518  }
519 
520  // feature [<feature>] [accept|reject]
@@ -609,7 +609,7 @@ $(function() {
538  else if (boost::iequals(action, "accept"))
539  jvRequest[jss::vetoed] = Json::Value(false);
540  else
-
541  return rpcError(rpcINVALID_PARAMS);
+
541  return rpcError(rpcINVALID_PARAMS);
542  }
543 
544  return jvRequest;
@@ -654,7 +654,7 @@ $(function() {
583  return jvRequest;
584  }
585  }
-
586  return rpcError(rpcINVALID_PARAMS);
+
586  return rpcError(rpcINVALID_PARAMS);
587  }
588 
589  // json <command> <json>
@@ -670,14 +670,14 @@ $(function() {
599  if (reader.parse(jvParams[1u].asString(), jvRequest))
600  {
601  if (!jvRequest.isObjectOrNull())
-
602  return rpcError(rpcINVALID_PARAMS);
+
602  return rpcError(rpcINVALID_PARAMS);
603 
604  jvRequest[jss::method] = jvParams[0u];
605 
606  return jvRequest;
607  }
608 
-
609  return rpcError(rpcINVALID_PARAMS);
+
609  return rpcError(rpcINVALID_PARAMS);
610  }
611 
612  bool
@@ -750,7 +750,7 @@ $(function() {
679  }
680  return jv1;
681  }
-
682  auto jv_error = rpcError(rpcINVALID_PARAMS);
+
682  auto jv_error = rpcError(rpcINVALID_PARAMS);
683  if (jv.isMember(jss::jsonrpc))
684  jv_error[jss::jsonrpc] = jv[jss::jsonrpc];
685  if (jv.isMember(jss::ripplerpc))
@@ -877,7 +877,7 @@ $(function() {
806  index++;
807 
808  if (!keyTypeFromString(jvParams[index].asString()))
-
809  return rpcError(rpcBAD_KEY_TYPE);
+
809  return rpcError(rpcBAD_KEY_TYPE);
810  jvRequest[jss::key_type] = jvParams[index];
811  index++;
812  }
@@ -891,14 +891,14 @@ $(function() {
820  // verify the channel id is a valid 256 bit number
821  uint256 channelId;
822  if (!channelId.parseHex(jvParams[index].asString()))
-
823  return rpcError(rpcCHANNEL_MALFORMED);
+
823  return rpcError(rpcCHANNEL_MALFORMED);
824  jvRequest[jss::channel_id] = to_string(channelId);
825  index++;
826  }
827 
828  if (!jvParams[index].isString() ||
829  !to_uint64(jvParams[index].asString()))
-
830  return rpcError(rpcCHANNEL_AMT_MALFORMED);
+
830  return rpcError(rpcCHANNEL_AMT_MALFORMED);
831  jvRequest[jss::amount] = jvParams[index];
832 
833  // If additional parameters are appended, be sure to increment index
@@ -914,7 +914,7 @@ $(function() {
843  std::string const strPk = jvParams[0u].asString();
844 
845  if (!validPublicKey(strPk))
-
846  return rpcError(rpcPUBLIC_MALFORMED);
+
846  return rpcError(rpcPUBLIC_MALFORMED);
847 
848  Json::Value jvRequest(Json::objectValue);
849 
@@ -923,12 +923,12 @@ $(function() {
852  // verify the channel id is a valid 256 bit number
853  uint256 channelId;
854  if (!channelId.parseHex(jvParams[1u].asString()))
-
855  return rpcError(rpcCHANNEL_MALFORMED);
+
855  return rpcError(rpcCHANNEL_MALFORMED);
856  }
857  jvRequest[jss::channel_id] = jvParams[1u].asString();
858 
859  if (!jvParams[2u].isString() || !to_uint64(jvParams[2u].asString()))
-
860  return rpcError(rpcCHANNEL_AMT_MALFORMED);
+
860  return rpcError(rpcCHANNEL_AMT_MALFORMED);
861  jvRequest[jss::amount] = jvParams[2u];
862 
863  jvRequest[jss::signature] = jvParams[3u].asString();
@@ -961,14 +961,14 @@ $(function() {
890  }
891  else
892  {
-
893  return rpcError(rpcACT_MALFORMED);
+
893  return rpcError(rpcACT_MALFORMED);
894  }
895  }
896  else
897  {
898  if (jvParseLedger(jvRequest, strParam))
899  return jvRequest;
-
900  return rpcError(rpcLGR_IDX_MALFORMED);
+
900  return rpcError(rpcLGR_IDX_MALFORMED);
901  }
902  }
903 
@@ -991,7 +991,7 @@ $(function() {
920 
921  if (!parseBase58<PublicKey>(TokenType::AccountPublic, strIdent) &&
922  !parseBase58<AccountID>(strIdent) && !parseGenericSeed(strIdent))
-
923  return rpcError(rpcACT_MALFORMED);
+
923  return rpcError(rpcACT_MALFORMED);
924 
925  // Get info on account.
926  Json::Value jvRequest(Json::objectValue);
@@ -1002,7 +1002,7 @@ $(function() {
931  jvRequest[jss::strict] = 1;
932 
933  if (iCursor == 2 && !jvParseLedger(jvRequest, jvParams[1u].asString()))
-
934  return rpcError(rpcLGR_IDX_MALFORMED);
+
934  return rpcError(rpcLGR_IDX_MALFORMED);
935 
936  return jvRequest;
937  }
@@ -1058,7 +1058,7 @@ $(function() {
987  return jvRequest;
988  }
989 
-
990  return rpcError(rpcINVALID_PARAMS);
+
990  return rpcError(rpcINVALID_PARAMS);
991  }
992 
993  // sign/submit any transaction to the network
@@ -1100,7 +1100,7 @@ $(function() {
1029  return jvRequest;
1030  }
1031 
-
1032  return rpcError(rpcINVALID_PARAMS);
+
1032  return rpcError(rpcINVALID_PARAMS);
1033  }
1034 
1035  // submit any multisigned transaction to the network
@@ -1121,7 +1121,7 @@ $(function() {
1050  }
1051  }
1052 
-
1053  return rpcError(rpcINVALID_PARAMS);
+
1053  return rpcError(rpcINVALID_PARAMS);
1054  }
1055 
1056  // transaction_entry <tx_hash> <ledger_hash/ledger_index>
@@ -1133,7 +1133,7 @@ $(function() {
1062 
1063  std::string const txHash = jvParams[0u].asString();
1064  if (txHash.length() != 64)
-
1065  return rpcError(rpcINVALID_PARAMS);
+
1065  return rpcError(rpcINVALID_PARAMS);
1066 
1067  Json::Value jvRequest{Json::objectValue};
1068  jvRequest[jss::tx_hash] = txHash;
@@ -1144,7 +1144,7 @@ $(function() {
1073  // find a match.
1074  if (jvRequest.isMember(jss::ledger_index) &&
1075  jvRequest[jss::ledger_index] == 0)
-
1076  return rpcError(rpcINVALID_PARAMS);
+
1076  return rpcError(rpcINVALID_PARAMS);
1077 
1078  return jvRequest;
1079  }
@@ -1395,7 +1395,7 @@ $(function() {
1324  << " maximum=" << command.maxParams
1325  << " actual=" << count;
1326 
-
1327  return rpcError(rpcBAD_SYNTAX);
+
1327  return rpcError(rpcBAD_SYNTAX);
1328  }
1329 
1330  return (this->*(command.parse))(jvParams);
@@ -1404,7 +1404,7 @@ $(function() {
1333 
1334  // The command could not be found
1335  if (!allowAnyCommand)
-
1336  return rpcError(rpcUNKNOWN_COMMAND);
+
1336  return rpcError(rpcUNKNOWN_COMMAND);
1337 
1338  return parseAsIs(jvParams);
1339  }
@@ -1700,7 +1700,7 @@ $(function() {
1629  // Transport error.
1630  Json::Value jvRpcError = jvOutput;
1631 
-
1632  jvOutput = rpcError(rpcJSON_RPC);
+
1632  jvOutput = rpcError(rpcJSON_RPC);
1633  jvOutput["result"] = jvRpcError;
1634  }
1635 
@@ -1731,13 +1731,13 @@ $(function() {
1660  }
1661  catch (RequestNotParseable& e)
1662  {
-
1663  jvOutput = rpcError(rpcINVALID_PARAMS);
+
1663  jvOutput = rpcError(rpcINVALID_PARAMS);
1664  jvOutput["error_what"] = e.what();
1665  nRet = rpcINVALID_PARAMS;
1666  }
1667  catch (std::exception& e)
1668  {
-
1669  jvOutput = rpcError(rpcINTERNAL);
+
1669  jvOutput = rpcError(rpcINTERNAL);
1670  jvOutput["error_what"] = e.what();
1671  nRet = rpcINTERNAL;
1672  }
@@ -1843,6 +1843,7 @@ $(function() {
std::string
STL class.
ripple::parseGenericSeed
std::optional< Seed > parseGenericSeed(std::string const &str)
Attempt to parse a string as a seed.
Definition: Seed.cpp:90
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::RPCParser::parseConnect
Json::Value parseConnect(Json::Value const &jvParams)
Definition: RPCCall.cpp:487
ripple::RPCParser::parseInternal
Json::Value parseInternal(Json::Value const &jvParams)
Definition: RPCCall.cpp:216
std::exception
STL class.
@@ -1895,7 +1896,7 @@ $(function() {
ripple::RPCCallImp::onRequest
static void onRequest(std::string const &strMethod, Json::Value const &jvParams, std::unordered_map< std::string, std::string > const &headers, std::string const &strPath, boost::asio::streambuf &sb, std::string const &strHost, beast::Journal j)
Definition: RPCCall.cpp:1438
ripple::base_uint< 256 >
ripple::RPCParser::parseGatewayBalances
Json::Value parseGatewayBalances(Json::Value const &jvParams)
Definition: RPCCall.cpp:1152
-
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:37
+
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:38
std::stoi
T stoi(T... args)
ripple::rpcSUCCESS
@ rpcSUCCESS
Definition: ErrorCodes.h:44
ripple::RPCParser::parseAccountRaw1
Json::Value parseAccountRaw1(Json::Value const &jvParams)
Definition: RPCCall.cpp:909
@@ -1928,7 +1929,6 @@ $(function() {
std::int64_t
ripple::RPCParser::parseLedger
Json::Value parseLedger(Json::Value const &jvParams)
Definition: RPCCall.cpp:694
ripple::RPCParser::parseRipplePathFind
Json::Value parseRipplePathFind(Json::Value const &jvParams)
Definition: RPCCall.cpp:972
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPCParser::parseAccountTransactions
Json::Value parseAccountTransactions(Json::Value const &jvParams)
Definition: RPCCall.cpp:266
ripple::RPCParser::parseValidationCreate
Json::Value parseValidationCreate(Json::Value const &jvParams)
Definition: RPCCall.cpp:1123
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
diff --git a/RPCErr_8cpp_source.html b/RPCErr_8cpp_source.html index 5ab689d8ab..779e0d15d9 100644 --- a/RPCErr_8cpp_source.html +++ b/RPCErr_8cpp_source.html @@ -97,25 +97,27 @@ $(function() {
26 
27 // VFALCO NOTE Deprecated function
28 Json::Value
-
29 rpcError(int iError, Json::Value jvResult)
+
29 rpcError(int iError)
30 {
-
31  RPC::inject_error(iError, jvResult);
-
32  return jvResult;
-
33 }
-
34 
-
35 // VFALCO NOTE Deprecated function
-
36 bool
-
37 isRpcError(Json::Value jvResult)
-
38 {
-
39  return jvResult.isObject() && jvResult.isMember(jss::error);
-
40 }
-
41 
-
42 } // namespace ripple
+
31  Json::Value jvResult(Json::objectValue);
+
32  RPC::inject_error(iError, jvResult);
+
33  return jvResult;
+
34 }
+
35 
+
36 // VFALCO NOTE Deprecated function
+
37 bool
+
38 isRpcError(Json::Value jvResult)
+
39 {
+
40  return jvResult.isObject() && jvResult.isMember(jss::error);
+
41 }
+
42 
+
43 } // namespace ripple
Json::Value::isObject
bool isObject() const
Definition: json_value.cpp:1027
-
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:37
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
+
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:38
+
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::inject_error
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
Definition: ErrorCodes.h:193
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/RPCErr_8h_source.html b/RPCErr_8h_source.html index bac6e5d063..fe734068ba 100644 --- a/RPCErr_8h_source.html +++ b/RPCErr_8h_source.html @@ -99,15 +99,14 @@ $(function() {
28 bool
29 isRpcError(Json::Value jvResult);
30 Json::Value
-
31 rpcError(int iError, Json::Value jvResult = Json::Value(Json::objectValue));
+
31 rpcError(int iError);
32 
33 } // namespace ripple
34 
35 #endif
-
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:37
-
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
+
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:38
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/RPCHelpers_8cpp_source.html b/RPCHelpers_8cpp_source.html index 48ebf25f94..2a49e95915 100644 --- a/RPCHelpers_8cpp_source.html +++ b/RPCHelpers_8cpp_source.html @@ -155,7 +155,7 @@ $(function() {
84 {
85  error_code_i code = accountFromStringWithCode(result, strIdent, bStrict);
86  if (code != rpcSUCCESS)
-
87  return rpcError(code);
+
87  return rpcError(code);
88  else
89  return Json::objectValue;
90 }
@@ -775,7 +775,7 @@ $(function() {
704  }
705 
706  if (!seed)
-
707  error = rpcError(rpcBAD_SEED);
+
707  error = rpcError(rpcBAD_SEED);
708 
709  return seed;
710 }
@@ -1006,6 +1006,7 @@ $(function() {
ripple::parseGenericSeed
std::optional< Seed > parseGenericSeed(std::string const &str)
Attempt to parse a string as a seed.
Definition: Seed.cpp:90
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:164
ripple::ltLEDGER_HASHES
@ ltLEDGER_HASHES
A ledger object that contains a list of ledger hashes.
Definition: LedgerFormats.h:102
ripple::Slice
An immutable linear range of bytes.
Definition: Slice.h:44
@@ -1085,7 +1086,6 @@ $(function() {
std::uint32_t
ripple::range
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition: RangeSet.h:53
ripple::STLedgerEntry::getType
LedgerEntryType getType() const
Definition: STLedgerEntry.h:92
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::LedgerMaster::getCurrentLedger
std::shared_ptr< ReadView const > getCurrentLedger()
Definition: LedgerMaster.cpp:1602
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple::RPC::Status
Status represents the results of an operation that might fail.
Definition: Status.h:39
diff --git a/Random_8cpp_source.html b/Random_8cpp_source.html index bcae219b33..dff961f526 100644 --- a/Random_8cpp_source.html +++ b/Random_8cpp_source.html @@ -122,18 +122,18 @@ $(function() {
51  }
52  catch (std::exception const&)
53  {
-
54  return rpcError(rpcINTERNAL);
+
54  return rpcError(rpcINTERNAL);
55  }
56 }
57 
58 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::exception
STL class.
ripple::crypto_prng
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.
Definition: csprng.cpp:108
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
ripple::doRandom
Json::Value doRandom(RPC::JsonContext &)
Definition: Random.cpp:39
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
beast::rngfill
void rngfill(void *buffer, std::size_t bytes, Generator &g)
Definition: rngfill.h:32
diff --git a/Reservations_8cpp_source.html b/Reservations_8cpp_source.html index 682d643a08..2b5afb1cb5 100644 --- a/Reservations_8cpp_source.html +++ b/Reservations_8cpp_source.html @@ -106,7 +106,7 @@ $(function() {
35 doPeerReservationsAdd(RPC::JsonContext& context)
36 {
37  if (context.app.config().reporting())
-
38  return rpcError(rpcREPORTING_UNSUPPORTED);
+
38  return rpcError(rpcREPORTING_UNSUPPORTED);
39 
40  auto const& params = context.params;
41 
@@ -144,7 +144,7 @@ $(function() {
73  std::optional<PublicKey> optPk = parseBase58<PublicKey>(
74  TokenType::NodePublic, params[jss::public_key].asString());
75  if (!optPk)
-
76  return rpcError(rpcPUBLIC_MALFORMED);
+
76  return rpcError(rpcPUBLIC_MALFORMED);
77  PublicKey const& nodeId = *optPk;
78 
79  auto const previous = context.app.peerReservations().insert_or_assign(
@@ -162,7 +162,7 @@ $(function() {
91 doPeerReservationsDel(RPC::JsonContext& context)
92 {
93  if (context.app.config().reporting())
-
94  return rpcError(rpcREPORTING_UNSUPPORTED);
+
94  return rpcError(rpcREPORTING_UNSUPPORTED);
95 
96  auto const& params = context.params;
97 
@@ -175,7 +175,7 @@ $(function() {
104  std::optional<PublicKey> optPk = parseBase58<PublicKey>(
105  TokenType::NodePublic, params[jss::public_key].asString());
106  if (!optPk)
-
107  return rpcError(rpcPUBLIC_MALFORMED);
+
107  return rpcError(rpcPUBLIC_MALFORMED);
108  PublicKey const& nodeId = *optPk;
109 
110  auto const previous = context.app.peerReservations().erase(nodeId);
@@ -192,7 +192,7 @@ $(function() {
121 doPeerReservationsList(RPC::JsonContext& context)
122 {
123  if (context.app.config().reporting())
-
124  return rpcError(rpcREPORTING_UNSUPPORTED);
+
124  return rpcError(rpcREPORTING_UNSUPPORTED);
125 
126  auto const& reservations = context.app.peerReservations().list();
127  // Enumerate the reservations in context.app.peerReservations()
@@ -211,6 +211,7 @@ $(function() {
ripple::PeerReservationTable::erase
std::optional< PeerReservation > erase(PublicKey const &nodeId)
Definition: PeerReservationTable.cpp:118
ripple::RPC::JsonContext
Definition: Context.h:53
std::string
STL class.
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
utility
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
ripple::Application::peerReservations
virtual PeerReservationTable & peerReservations()=0
@@ -225,7 +226,6 @@ $(function() {
ripple::rpcPUBLIC_MALFORMED
@ rpcPUBLIC_MALFORMED
Definition: ErrorCodes.h:117
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::PeerReservation
Definition: PeerReservationTable.h:43
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::doPeerReservationsList
Json::Value doPeerReservationsList(RPC::JsonContext &)
Definition: Reservations.cpp:121
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::PeerReservationTable::list
std::vector< PeerReservation > list() const
Definition: PeerReservationTable.cpp:52
diff --git a/RipplePathFind_8cpp_source.html b/RipplePathFind_8cpp_source.html index d3fa40d02e..3ffa0871a2 100644 --- a/RipplePathFind_8cpp_source.html +++ b/RipplePathFind_8cpp_source.html @@ -103,7 +103,7 @@ $(function() {
32 doRipplePathFind(RPC::JsonContext& context)
33 {
34  if (context.app.config().PATH_SEARCH_MAX == 0)
-
35  return rpcError(rpcNOT_SUPPORTED);
+
35  return rpcError(rpcNOT_SUPPORTED);
36 
37  context.loadType = Resource::feeHighBurdenRPC;
38 
@@ -121,8 +121,8 @@ $(function() {
50  RPC::Tuning::maxValidatedLedgerAge)
51  {
52  if (context.apiVersion == 1)
-
53  return rpcError(rpcNO_NETWORK);
-
54  return rpcError(rpcNOT_SYNCED);
+
53  return rpcError(rpcNO_NETWORK);
+
54  return rpcError(rpcNOT_SYNCED);
55  }
56 
57  PathRequest::pointer request;
@@ -233,7 +233,7 @@ $(function() {
162 
163  RPC::LegacyPathFind lpf(isUnlimited(context.role), context.app);
164  if (!lpf.isOk())
-
165  return rpcError(rpcTOO_BUSY);
+
165  return rpcError(rpcTOO_BUSY);
166 
167  auto result = context.app.getPathRequests().doLegacyPathRequest(
168  context.consumer, lpLedger, context.params);
@@ -251,6 +251,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::rpcNOT_SUPPORTED
@ rpcNOT_SUPPORTED
Definition: ErrorCodes.h:132
std::shared_ptr
STL class.
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::doRipplePathFind
Json::Value doRipplePathFind(RPC::JsonContext &)
Definition: RipplePathFind.cpp:32
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
@@ -267,7 +268,6 @@ $(function() {
ripple::RPC::Context::coro
std::shared_ptr< JobQueue::Coro > coro
Definition: Context.h:48
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::Application::getPathRequests
virtual PathRequests & getPathRequests()=0
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition: Role.cpp:94
ripple::LedgerMaster::getValidatedLedgerAge
std::chrono::seconds getValidatedLedgerAge()
Definition: LedgerMaster.cpp:270
ripple::LedgerMaster::getClosedLedger
std::shared_ptr< Ledger const > getClosedLedger()
Definition: LedgerMaster.h:98
diff --git a/RocksDBFactory_8cpp_source.html b/RocksDBFactory_8cpp_source.html index 0c567d94f8..412416d2c7 100644 --- a/RocksDBFactory_8cpp_source.html +++ b/RocksDBFactory_8cpp_source.html @@ -182,359 +182,377 @@ $(function() {
111  rocksdb::BlockBasedTableOptions table_options;
112  m_options.env = env;
113 
-
114  if (keyValues.exists("cache_mb"))
-
115  table_options.block_cache = rocksdb::NewLRUCache(
-
116  get<int>(keyValues, "cache_mb") * megabytes(1));
-
117 
-
118  if (auto const v = get<int>(keyValues, "filter_bits"))
-
119  {
-
120  bool const filter_blocks = !keyValues.exists("filter_full") ||
-
121  (get<int>(keyValues, "filter_full") == 0);
-
122  table_options.filter_policy.reset(
-
123  rocksdb::NewBloomFilterPolicy(v, filter_blocks));
-
124  }
-
125 
-
126  if (get_if_exists(keyValues, "open_files", m_options.max_open_files))
-
127  fdRequired_ = m_options.max_open_files;
-
128 
-
129  if (keyValues.exists("file_size_mb"))
-
130  {
-
131  m_options.target_file_size_base =
-
132  megabytes(1) * get<int>(keyValues, "file_size_mb");
-
133  m_options.max_bytes_for_level_base =
-
134  5 * m_options.target_file_size_base;
-
135  m_options.write_buffer_size = 2 * m_options.target_file_size_base;
-
136  }
-
137 
-
138  get_if_exists(
-
139  keyValues, "file_size_mult", m_options.target_file_size_multiplier);
-
140 
-
141  if (keyValues.exists("bg_threads"))
-
142  {
-
143  m_options.env->SetBackgroundThreads(
-
144  get<int>(keyValues, "bg_threads"), rocksdb::Env::LOW);
-
145  }
+
114  bool hard_set =
+
115  keyValues.exists("hard_set") && get<bool>(keyValues, "hard_set");
+
116 
+
117  if (keyValues.exists("cache_mb"))
+
118  {
+
119  auto size = get<int>(keyValues, "cache_mb");
+
120 
+
121  if (!hard_set && size == 256)
+
122  size = 1024;
+
123 
+
124  table_options.block_cache = rocksdb::NewLRUCache(megabytes(size));
+
125  }
+
126 
+
127  if (auto const v = get<int>(keyValues, "filter_bits"))
+
128  {
+
129  bool const filter_blocks = !keyValues.exists("filter_full") ||
+
130  (get<int>(keyValues, "filter_full") == 0);
+
131  table_options.filter_policy.reset(
+
132  rocksdb::NewBloomFilterPolicy(v, filter_blocks));
+
133  }
+
134 
+
135  if (get_if_exists(keyValues, "open_files", m_options.max_open_files))
+
136  {
+
137  if (!hard_set && m_options.max_open_files == 2000)
+
138  m_options.max_open_files = 8000;
+
139 
+
140  fdRequired_ = m_options.max_open_files + 128;
+
141  }
+
142 
+
143  if (keyValues.exists("file_size_mb"))
+
144  {
+
145  auto file_size_mb = get<int>(keyValues, "file_size_mb");
146 
-
147  if (keyValues.exists("high_threads"))
-
148  {
-
149  auto const highThreads = get<int>(keyValues, "high_threads");
-
150  m_options.env->SetBackgroundThreads(
-
151  highThreads, rocksdb::Env::HIGH);
-
152 
-
153  // If we have high-priority threads, presumably we want to
-
154  // use them for background flushes
-
155  if (highThreads > 0)
-
156  m_options.max_background_flushes = highThreads;
-
157  }
+
147  if (!hard_set && file_size_mb == 8)
+
148  file_size_mb = 256;
+
149 
+
150  m_options.target_file_size_base = megabytes(file_size_mb);
+
151  m_options.max_bytes_for_level_base =
+
152  5 * m_options.target_file_size_base;
+
153  m_options.write_buffer_size = 2 * m_options.target_file_size_base;
+
154  }
+
155 
+
156  get_if_exists(
+
157  keyValues, "file_size_mult", m_options.target_file_size_multiplier);
158 
-
159  m_options.compression = rocksdb::kSnappyCompression;
-
160 
-
161  get_if_exists(keyValues, "block_size", table_options.block_size);
-
162 
-
163  if (keyValues.exists("universal_compaction") &&
-
164  (get<int>(keyValues, "universal_compaction") != 0))
-
165  {
-
166  m_options.compaction_style = rocksdb::kCompactionStyleUniversal;
-
167  m_options.min_write_buffer_number_to_merge = 2;
-
168  m_options.max_write_buffer_number = 6;
-
169  m_options.write_buffer_size = 6 * m_options.target_file_size_base;
-
170  }
-
171 
-
172  if (keyValues.exists("bbt_options"))
-
173  {
-
174  auto const s = rocksdb::GetBlockBasedTableOptionsFromString(
-
175  table_options, get(keyValues, "bbt_options"), &table_options);
-
176  if (!s.ok())
-
177  Throw<std::runtime_error>(
-
178  std::string("Unable to set RocksDB bbt_options: ") +
-
179  s.ToString());
-
180  }
-
181 
-
182  m_options.table_factory.reset(NewBlockBasedTableFactory(table_options));
-
183 
-
184  if (keyValues.exists("options"))
-
185  {
-
186  auto const s = rocksdb::GetOptionsFromString(
-
187  m_options, get(keyValues, "options"), &m_options);
-
188  if (!s.ok())
-
189  Throw<std::runtime_error>(
-
190  std::string("Unable to set RocksDB options: ") +
-
191  s.ToString());
-
192  }
-
193 
-
194  std::string s1, s2;
-
195  rocksdb::GetStringFromDBOptions(&s1, m_options, "; ");
-
196  rocksdb::GetStringFromColumnFamilyOptions(&s2, m_options, "; ");
-
197  JLOG(m_journal.debug()) << "RocksDB DBOptions: " << s1;
-
198  JLOG(m_journal.debug()) << "RocksDB CFOptions: " << s2;
-
199  }
-
200 
-
201  ~RocksDBBackend() override
-
202  {
-
203  close();
-
204  }
-
205 
-
206  void
-
207  open(bool createIfMissing) override
-
208  {
-
209  if (m_db)
-
210  {
-
211  assert(false);
-
212  JLOG(m_journal.error()) << "database is already open";
-
213  return;
-
214  }
-
215  rocksdb::DB* db = nullptr;
-
216  m_options.create_if_missing = createIfMissing;
-
217  rocksdb::Status status = rocksdb::DB::Open(m_options, m_name, &db);
-
218  if (!status.ok() || !db)
-
219  Throw<std::runtime_error>(
-
220  std::string("Unable to open/create RocksDB: ") +
-
221  status.ToString());
-
222  m_db.reset(db);
-
223  }
-
224 
-
225  bool
-
226  isOpen() override
-
227  {
-
228  return static_cast<bool>(m_db);
-
229  }
-
230 
-
231  void
-
232  close() override
-
233  {
-
234  if (m_db)
-
235  {
-
236  m_db.reset();
-
237  if (m_deletePath)
-
238  {
-
239  boost::filesystem::path dir = m_name;
-
240  boost::filesystem::remove_all(dir);
-
241  }
-
242  }
-
243  }
-
244 
-
245  std::string
-
246  getName() override
-
247  {
-
248  return m_name;
-
249  }
-
250 
-
251  //--------------------------------------------------------------------------
-
252 
-
253  Status
-
254  fetch(void const* key, std::shared_ptr<NodeObject>* pObject) override
-
255  {
-
256  assert(m_db);
-
257  pObject->reset();
-
258 
-
259  Status status(ok);
-
260 
-
261  rocksdb::ReadOptions const options;
-
262  rocksdb::Slice const slice(static_cast<char const*>(key), m_keyBytes);
-
263 
-
264  std::string string;
-
265 
-
266  rocksdb::Status getStatus = m_db->Get(options, slice, &string);
-
267 
-
268  if (getStatus.ok())
-
269  {
-
270  DecodedBlob decoded(key, string.data(), string.size());
-
271 
-
272  if (decoded.wasOk())
-
273  {
-
274  *pObject = decoded.createObject();
-
275  }
-
276  else
-
277  {
-
278  // Decoding failed, probably corrupted!
-
279  //
-
280  status = dataCorrupt;
-
281  }
-
282  }
-
283  else
-
284  {
-
285  if (getStatus.IsCorruption())
-
286  {
-
287  status = dataCorrupt;
-
288  }
-
289  else if (getStatus.IsNotFound())
-
290  {
-
291  status = notFound;
-
292  }
-
293  else
-
294  {
-
295  status = Status(customCode + getStatus.code());
-
296 
-
297  JLOG(m_journal.error()) << getStatus.ToString();
-
298  }
-
299  }
-
300 
-
301  return status;
-
302  }
-
303 
-
304  std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
-
305  fetchBatch(std::vector<uint256 const*> const& hashes) override
-
306  {
-
307  std::vector<std::shared_ptr<NodeObject>> results;
-
308  results.reserve(hashes.size());
-
309  for (auto const& h : hashes)
-
310  {
-
311  std::shared_ptr<NodeObject> nObj;
-
312  Status status = fetch(h->begin(), &nObj);
-
313  if (status != ok)
-
314  results.push_back({});
-
315  else
-
316  results.push_back(nObj);
+
159  if (keyValues.exists("bg_threads"))
+
160  {
+
161  m_options.env->SetBackgroundThreads(
+
162  get<int>(keyValues, "bg_threads"), rocksdb::Env::LOW);
+
163  }
+
164 
+
165  if (keyValues.exists("high_threads"))
+
166  {
+
167  auto const highThreads = get<int>(keyValues, "high_threads");
+
168  m_options.env->SetBackgroundThreads(
+
169  highThreads, rocksdb::Env::HIGH);
+
170 
+
171  // If we have high-priority threads, presumably we want to
+
172  // use them for background flushes
+
173  if (highThreads > 0)
+
174  m_options.max_background_flushes = highThreads;
+
175  }
+
176 
+
177  m_options.compression = rocksdb::kSnappyCompression;
+
178 
+
179  get_if_exists(keyValues, "block_size", table_options.block_size);
+
180 
+
181  if (keyValues.exists("universal_compaction") &&
+
182  (get<int>(keyValues, "universal_compaction") != 0))
+
183  {
+
184  m_options.compaction_style = rocksdb::kCompactionStyleUniversal;
+
185  m_options.min_write_buffer_number_to_merge = 2;
+
186  m_options.max_write_buffer_number = 6;
+
187  m_options.write_buffer_size = 6 * m_options.target_file_size_base;
+
188  }
+
189 
+
190  if (keyValues.exists("bbt_options"))
+
191  {
+
192  auto const s = rocksdb::GetBlockBasedTableOptionsFromString(
+
193  table_options, get(keyValues, "bbt_options"), &table_options);
+
194  if (!s.ok())
+
195  Throw<std::runtime_error>(
+
196  std::string("Unable to set RocksDB bbt_options: ") +
+
197  s.ToString());
+
198  }
+
199 
+
200  m_options.table_factory.reset(NewBlockBasedTableFactory(table_options));
+
201 
+
202  if (keyValues.exists("options"))
+
203  {
+
204  auto const s = rocksdb::GetOptionsFromString(
+
205  m_options, get(keyValues, "options"), &m_options);
+
206  if (!s.ok())
+
207  Throw<std::runtime_error>(
+
208  std::string("Unable to set RocksDB options: ") +
+
209  s.ToString());
+
210  }
+
211 
+
212  std::string s1, s2;
+
213  rocksdb::GetStringFromDBOptions(&s1, m_options, "; ");
+
214  rocksdb::GetStringFromColumnFamilyOptions(&s2, m_options, "; ");
+
215  JLOG(m_journal.debug()) << "RocksDB DBOptions: " << s1;
+
216  JLOG(m_journal.debug()) << "RocksDB CFOptions: " << s2;
+
217  }
+
218 
+
219  ~RocksDBBackend() override
+
220  {
+
221  close();
+
222  }
+
223 
+
224  void
+
225  open(bool createIfMissing) override
+
226  {
+
227  if (m_db)
+
228  {
+
229  assert(false);
+
230  JLOG(m_journal.error()) << "database is already open";
+
231  return;
+
232  }
+
233  rocksdb::DB* db = nullptr;
+
234  m_options.create_if_missing = createIfMissing;
+
235  rocksdb::Status status = rocksdb::DB::Open(m_options, m_name, &db);
+
236  if (!status.ok() || !db)
+
237  Throw<std::runtime_error>(
+
238  std::string("Unable to open/create RocksDB: ") +
+
239  status.ToString());
+
240  m_db.reset(db);
+
241  }
+
242 
+
243  bool
+
244  isOpen() override
+
245  {
+
246  return static_cast<bool>(m_db);
+
247  }
+
248 
+
249  void
+
250  close() override
+
251  {
+
252  if (m_db)
+
253  {
+
254  m_db.reset();
+
255  if (m_deletePath)
+
256  {
+
257  boost::filesystem::path dir = m_name;
+
258  boost::filesystem::remove_all(dir);
+
259  }
+
260  }
+
261  }
+
262 
+
263  std::string
+
264  getName() override
+
265  {
+
266  return m_name;
+
267  }
+
268 
+
269  //--------------------------------------------------------------------------
+
270 
+
271  Status
+
272  fetch(void const* key, std::shared_ptr<NodeObject>* pObject) override
+
273  {
+
274  assert(m_db);
+
275  pObject->reset();
+
276 
+
277  Status status(ok);
+
278 
+
279  rocksdb::ReadOptions const options;
+
280  rocksdb::Slice const slice(static_cast<char const*>(key), m_keyBytes);
+
281 
+
282  std::string string;
+
283 
+
284  rocksdb::Status getStatus = m_db->Get(options, slice, &string);
+
285 
+
286  if (getStatus.ok())
+
287  {
+
288  DecodedBlob decoded(key, string.data(), string.size());
+
289 
+
290  if (decoded.wasOk())
+
291  {
+
292  *pObject = decoded.createObject();
+
293  }
+
294  else
+
295  {
+
296  // Decoding failed, probably corrupted!
+
297  //
+
298  status = dataCorrupt;
+
299  }
+
300  }
+
301  else
+
302  {
+
303  if (getStatus.IsCorruption())
+
304  {
+
305  status = dataCorrupt;
+
306  }
+
307  else if (getStatus.IsNotFound())
+
308  {
+
309  status = notFound;
+
310  }
+
311  else
+
312  {
+
313  status = Status(customCode + getStatus.code());
+
314 
+
315  JLOG(m_journal.error()) << getStatus.ToString();
+
316  }
317  }
318 
-
319  return {results, ok};
+
319  return status;
320  }
321 
-
322  void
-
323  store(std::shared_ptr<NodeObject> const& object) override
+
322  std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
+
323  fetchBatch(std::vector<uint256 const*> const& hashes) override
324  {
-
325  m_batch.store(object);
-
326  }
-
327 
-
328  void
-
329  storeBatch(Batch const& batch) override
-
330  {
-
331  assert(m_db);
-
332  rocksdb::WriteBatch wb;
-
333 
-
334  EncodedBlob encoded;
-
335 
-
336  for (auto const& e : batch)
-
337  {
-
338  encoded.prepare(e);
+
325  std::vector<std::shared_ptr<NodeObject>> results;
+
326  results.reserve(hashes.size());
+
327  for (auto const& h : hashes)
+
328  {
+
329  std::shared_ptr<NodeObject> nObj;
+
330  Status status = fetch(h->begin(), &nObj);
+
331  if (status != ok)
+
332  results.push_back({});
+
333  else
+
334  results.push_back(nObj);
+
335  }
+
336 
+
337  return {results, ok};
+
338  }
339 
-
340  wb.Put(
-
341  rocksdb::Slice(
-
342  reinterpret_cast<char const*>(encoded.getKey()),
-
343  m_keyBytes),
-
344  rocksdb::Slice(
-
345  reinterpret_cast<char const*>(encoded.getData()),
-
346  encoded.getSize()));
-
347  }
-
348 
-
349  rocksdb::WriteOptions const options;
-
350 
-
351  auto ret = m_db->Write(options, &wb);
-
352 
-
353  if (!ret.ok())
-
354  Throw<std::runtime_error>("storeBatch failed: " + ret.ToString());
-
355  }
-
356 
-
357  void
-
358  sync() override
-
359  {
-
360  }
-
361 
-
362  void
-
363  for_each(std::function<void(std::shared_ptr<NodeObject>)> f) override
-
364  {
-
365  assert(m_db);
-
366  rocksdb::ReadOptions const options;
-
367 
-
368  std::unique_ptr<rocksdb::Iterator> it(m_db->NewIterator(options));
-
369 
-
370  for (it->SeekToFirst(); it->Valid(); it->Next())
-
371  {
-
372  if (it->key().size() == m_keyBytes)
-
373  {
-
374  DecodedBlob decoded(
-
375  it->key().data(), it->value().data(), it->value().size());
-
376 
-
377  if (decoded.wasOk())
-
378  {
-
379  f(decoded.createObject());
-
380  }
-
381  else
-
382  {
-
383  // Uh oh, corrupted data!
-
384  JLOG(m_journal.fatal())
-
385  << "Corrupt NodeObject #" << it->key().ToString(true);
-
386  }
-
387  }
-
388  else
-
389  {
-
390  // VFALCO NOTE What does it mean to find an
-
391  // incorrectly sized key? Corruption?
-
392  JLOG(m_journal.fatal())
-
393  << "Bad key size = " << it->key().size();
-
394  }
-
395  }
-
396  }
-
397 
-
398  int
-
399  getWriteLoad() override
-
400  {
-
401  return m_batch.getWriteLoad();
-
402  }
-
403 
-
404  void
-
405  setDeletePath() override
-
406  {
-
407  m_deletePath = true;
-
408  }
-
409 
-
410  //--------------------------------------------------------------------------
-
411 
-
412  void
-
413  writeBatch(Batch const& batch) override
-
414  {
-
415  storeBatch(batch);
-
416  }
-
417 
-
419  int
-
420  fdRequired() const override
-
421  {
-
422  return fdRequired_;
-
423  }
-
424 };
-
425 
-
426 //------------------------------------------------------------------------------
+
340  void
+
341  store(std::shared_ptr<NodeObject> const& object) override
+
342  {
+
343  m_batch.store(object);
+
344  }
+
345 
+
346  void
+
347  storeBatch(Batch const& batch) override
+
348  {
+
349  assert(m_db);
+
350  rocksdb::WriteBatch wb;
+
351 
+
352  EncodedBlob encoded;
+
353 
+
354  for (auto const& e : batch)
+
355  {
+
356  encoded.prepare(e);
+
357 
+
358  wb.Put(
+
359  rocksdb::Slice(
+
360  reinterpret_cast<char const*>(encoded.getKey()),
+
361  m_keyBytes),
+
362  rocksdb::Slice(
+
363  reinterpret_cast<char const*>(encoded.getData()),
+
364  encoded.getSize()));
+
365  }
+
366 
+
367  rocksdb::WriteOptions const options;
+
368 
+
369  auto ret = m_db->Write(options, &wb);
+
370 
+
371  if (!ret.ok())
+
372  Throw<std::runtime_error>("storeBatch failed: " + ret.ToString());
+
373  }
+
374 
+
375  void
+
376  sync() override
+
377  {
+
378  }
+
379 
+
380  void
+
381  for_each(std::function<void(std::shared_ptr<NodeObject>)> f) override
+
382  {
+
383  assert(m_db);
+
384  rocksdb::ReadOptions const options;
+
385 
+
386  std::unique_ptr<rocksdb::Iterator> it(m_db->NewIterator(options));
+
387 
+
388  for (it->SeekToFirst(); it->Valid(); it->Next())
+
389  {
+
390  if (it->key().size() == m_keyBytes)
+
391  {
+
392  DecodedBlob decoded(
+
393  it->key().data(), it->value().data(), it->value().size());
+
394 
+
395  if (decoded.wasOk())
+
396  {
+
397  f(decoded.createObject());
+
398  }
+
399  else
+
400  {
+
401  // Uh oh, corrupted data!
+
402  JLOG(m_journal.fatal())
+
403  << "Corrupt NodeObject #" << it->key().ToString(true);
+
404  }
+
405  }
+
406  else
+
407  {
+
408  // VFALCO NOTE What does it mean to find an
+
409  // incorrectly sized key? Corruption?
+
410  JLOG(m_journal.fatal())
+
411  << "Bad key size = " << it->key().size();
+
412  }
+
413  }
+
414  }
+
415 
+
416  int
+
417  getWriteLoad() override
+
418  {
+
419  return m_batch.getWriteLoad();
+
420  }
+
421 
+
422  void
+
423  setDeletePath() override
+
424  {
+
425  m_deletePath = true;
+
426  }
427 
-
428 class RocksDBFactory : public Factory
-
429 {
-
430 public:
-
431  RocksDBEnv m_env;
-
432 
-
433  RocksDBFactory()
-
434  {
-
435  Manager::instance().insert(*this);
-
436  }
-
437 
-
438  ~RocksDBFactory() override
+
428  //--------------------------------------------------------------------------
+
429 
+
430  void
+
431  writeBatch(Batch const& batch) override
+
432  {
+
433  storeBatch(batch);
+
434  }
+
435 
+
437  int
+
438  fdRequired() const override
439  {
-
440  Manager::instance().erase(*this);
+
440  return fdRequired_;
441  }
-
442 
-
443  std::string
-
444  getName() const override
-
445  {
-
446  return "RocksDB";
-
447  }
-
448 
-
449  std::unique_ptr<Backend>
-
450  createInstance(
-
451  size_t keyBytes,
-
452  Section const& keyValues,
-
453  std::size_t,
-
454  Scheduler& scheduler,
-
455  beast::Journal journal) override
-
456  {
-
457  return std::make_unique<RocksDBBackend>(
-
458  keyBytes, keyValues, scheduler, journal, &m_env);
+
442 };
+
443 
+
444 //------------------------------------------------------------------------------
+
445 
+
446 class RocksDBFactory : public Factory
+
447 {
+
448 public:
+
449  RocksDBEnv m_env;
+
450 
+
451  RocksDBFactory()
+
452  {
+
453  Manager::instance().insert(*this);
+
454  }
+
455 
+
456  ~RocksDBFactory() override
+
457  {
+
458  Manager::instance().erase(*this);
459  }
-
460 };
-
461 
-
462 static RocksDBFactory rocksDBFactory;
-
463 
-
464 } // namespace NodeStore
-
465 } // namespace ripple
+
460 
+
461  std::string
+
462  getName() const override
+
463  {
+
464  return "RocksDB";
+
465  }
466 
-
467 #endif
+
467  std::unique_ptr<Backend>
+
468  createInstance(
+
469  size_t keyBytes,
+
470  Section const& keyValues,
+
471  std::size_t,
+
472  Scheduler& scheduler,
+
473  beast::Journal journal) override
+
474  {
+
475  return std::make_unique<RocksDBBackend>(
+
476  keyBytes, keyValues, scheduler, journal, &m_env);
+
477  }
+
478 };
+
479 
+
480 static RocksDBFactory rocksDBFactory;
+
481 
+
482 } // namespace NodeStore
+
483 } // namespace ripple
+
484 
+
485 #endif
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
std::for_each
T for_each(T... args)
diff --git a/ServerHandlerImp_8cpp_source.html b/ServerHandlerImp_8cpp_source.html index 43e13a9857..58412a9c7c 100644 --- a/ServerHandlerImp_8cpp_source.html +++ b/ServerHandlerImp_8cpp_source.html @@ -461,7 +461,7 @@ $(function() {
390  {boost::beast::websocket::policy_error, "threshold exceeded"});
391  // FIX: This rpcError is not delivered since the session
392  // was just closed.
-
393  return rpcError(rpcSLOW_DOWN);
+
393  return rpcError(rpcSLOW_DOWN);
394  }
395 
396  // Requests without "command" are invalid.
@@ -511,7 +511,7 @@ $(function() {
440  if (Role::FORBID == role)
441  {
442  loadType = Resource::feeInvalidRPC;
-
443  jr[jss::result] = rpcError(rpcFORBIDDEN);
+
443  jr[jss::result] = rpcError(rpcFORBIDDEN);
444  }
445  else
446  {
@@ -1284,6 +1284,7 @@ $(function() {
ripple::makeOutput
static Json::Output makeOutput(Session &session)
Definition: ServerHandlerImp.cpp:236
ripple::JobQueue::postCoro
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
Definition: JobQueue.h:429
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::jtCLIENT
@ jtCLIENT
Definition: Job.h:44
std::exception
STL class.
ripple::ServerHandlerImp::m_jobQueue
JobQueue & m_jobQueue
Definition: ServerHandlerImp.h:98
@@ -1407,7 +1408,6 @@ $(function() {
ripple::Session::detach
virtual std::shared_ptr< Session > detach()=0
Detach the session.
ripple::ServerHandlerImp::app_
Application & app_
Definition: ServerHandlerImp.h:92
std::transform
T transform(T... args)
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::ServerHandlerImp::m_server
std::unique_ptr< Server > m_server
Definition: ServerHandlerImp.h:96
Json::Int
int Int
Definition: json_forwards.h:26
ripple::Resource::feeInvalidRPC
const Charge feeInvalidRPC
diff --git a/Submit_8cpp_source.html b/Submit_8cpp_source.html index 031e2fce49..71dc0f92e4 100644 --- a/Submit_8cpp_source.html +++ b/Submit_8cpp_source.html @@ -150,7 +150,7 @@ $(function() {
79  auto ret = strUnHex(context.params[jss::tx_blob].asString());
80 
81  if (!ret || !ret->size())
-
82  return rpcError(rpcINVALID_PARAMS);
+
82  return rpcError(rpcINVALID_PARAMS);
83 
84  SerialIter sitTrans(makeSlice(*ret));
85 
@@ -372,6 +372,7 @@ $(function() {
std::string
STL class.
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::exception
STL class.
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
std::pair
@@ -404,7 +405,6 @@ $(function() {
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::Config::canSign
bool canSign() const
Definition: Config.h:332
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:91
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::LedgerMaster::getCurrentLedger
std::shared_ptr< ReadView const > getCurrentLedger()
Definition: LedgerMaster.cpp:1602
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple::STTx::getTransactionID
uint256 getTransactionID() const
Definition: STTx.h:118
diff --git a/Subscribe_8cpp_source.html b/Subscribe_8cpp_source.html index a98b21e159..159f834a86 100644 --- a/Subscribe_8cpp_source.html +++ b/Subscribe_8cpp_source.html @@ -114,13 +114,13 @@ $(function() {
43  {
44  // Must be a JSON-RPC call.
45  JLOG(context.j.info()) << "doSubscribe: RPC subscribe requires a url";
-
46  return rpcError(rpcINVALID_PARAMS);
+
46  return rpcError(rpcINVALID_PARAMS);
47  }
48 
49  if (context.params.isMember(jss::url))
50  {
51  if (context.role != Role::ADMIN)
-
52  return rpcError(rpcNO_PERMISSION);
+
52  return rpcError(rpcNO_PERMISSION);
53 
54  std::string strUrl = context.params[jss::url].asString();
55  std::string strUsername = context.params.isMember(jss::url_username)
@@ -187,19 +187,19 @@ $(function() {
116  if (!context.params[jss::streams].isArray())
117  {
118  JLOG(context.j.info()) << "doSubscribe: streams requires an array.";
-
119  return rpcError(rpcINVALID_PARAMS);
+
119  return rpcError(rpcINVALID_PARAMS);
120  }
121 
122  for (auto const& it : context.params[jss::streams])
123  {
124  if (!it.isString())
-
125  return rpcError(rpcSTREAM_MALFORMED);
+
125  return rpcError(rpcSTREAM_MALFORMED);
126 
127  std::string streamName = it.asString();
128  if (streamName == "server")
129  {
130  if (context.app.config().reporting())
-
131  return rpcError(rpcREPORTING_UNSUPPORTED);
+
131  return rpcError(rpcREPORTING_UNSUPPORTED);
132  context.netOps.subServer(
133  ispSub, jvResult, context.role == Role::ADMIN);
134  }
@@ -228,20 +228,20 @@ $(function() {
157  else if (streamName == "peer_status")
158  {
159  if (context.app.config().reporting())
-
160  return rpcError(rpcREPORTING_UNSUPPORTED);
+
160  return rpcError(rpcREPORTING_UNSUPPORTED);
161  if (context.role != Role::ADMIN)
-
162  return rpcError(rpcNO_PERMISSION);
+
162  return rpcError(rpcNO_PERMISSION);
163  context.netOps.subPeerStatus(ispSub);
164  }
165  else if (streamName == "consensus")
166  {
167  if (context.app.config().reporting())
-
168  return rpcError(rpcREPORTING_UNSUPPORTED);
+
168  return rpcError(rpcREPORTING_UNSUPPORTED);
169  context.netOps.subConsensus(ispSub);
170  }
171  else
172  {
-
173  return rpcError(rpcSTREAM_MALFORMED);
+
173  return rpcError(rpcSTREAM_MALFORMED);
174  }
175  }
176  }
@@ -252,22 +252,22 @@ $(function() {
181  if (context.params.isMember(accountsProposed))
182  {
183  if (!context.params[accountsProposed].isArray())
-
184  return rpcError(rpcINVALID_PARAMS);
+
184  return rpcError(rpcINVALID_PARAMS);
185 
186  auto ids = RPC::parseAccountIds(context.params[accountsProposed]);
187  if (ids.empty())
-
188  return rpcError(rpcACT_MALFORMED);
+
188  return rpcError(rpcACT_MALFORMED);
189  context.netOps.subAccount(ispSub, ids, true);
190  }
191 
192  if (context.params.isMember(jss::accounts))
193  {
194  if (!context.params[jss::accounts].isArray())
-
195  return rpcError(rpcINVALID_PARAMS);
+
195  return rpcError(rpcINVALID_PARAMS);
196 
197  auto ids = RPC::parseAccountIds(context.params[jss::accounts]);
198  if (ids.empty())
-
199  return rpcError(rpcACT_MALFORMED);
+
199  return rpcError(rpcACT_MALFORMED);
200  context.netOps.subAccount(ispSub, ids, false);
201  JLOG(context.j.debug()) << "doSubscribe: accounts: " << ids.size();
202  }
@@ -275,21 +275,21 @@ $(function() {
204  if (context.params.isMember(jss::account_history_tx_stream))
205  {
206  if (!context.app.config().useTxTables())
-
207  return rpcError(rpcNOT_ENABLED);
+
207  return rpcError(rpcNOT_ENABLED);
208 
209  context.loadType = Resource::feeMediumBurdenRPC;
210  auto const& req = context.params[jss::account_history_tx_stream];
211  if (!req.isMember(jss::account) || !req[jss::account].isString())
-
212  return rpcError(rpcINVALID_PARAMS);
+
212  return rpcError(rpcINVALID_PARAMS);
213 
214  auto const id = parseBase58<AccountID>(req[jss::account].asString());
215  if (!id)
-
216  return rpcError(rpcINVALID_PARAMS);
+
216  return rpcError(rpcINVALID_PARAMS);
217 
218  if (auto result = context.netOps.subAccountHistory(ispSub, *id);
219  result != rpcSUCCESS)
220  {
-
221  return rpcError(result);
+
221  return rpcError(result);
222  }
223 
224  jvResult[jss::warning] =
@@ -302,7 +302,7 @@ $(function() {
231  if (context.params.isMember(jss::books))
232  {
233  if (!context.params[jss::books].isArray())
-
234  return rpcError(rpcINVALID_PARAMS);
+
234  return rpcError(rpcINVALID_PARAMS);
235 
236  for (auto& j : context.params[jss::books])
237  {
@@ -310,7 +310,7 @@ $(function() {
239  !j.isMember(jss::taker_gets) ||
240  !j[jss::taker_pays].isObjectOrNull() ||
241  !j[jss::taker_gets].isObjectOrNull())
-
242  return rpcError(rpcINVALID_PARAMS);
+
242  return rpcError(rpcINVALID_PARAMS);
243 
244  Book book;
245  Json::Value taker_pays = j[jss::taker_pays];
@@ -322,7 +322,7 @@ $(function() {
251  book.in.currency, taker_pays[jss::currency].asString()))
252  {
253  JLOG(context.j.info()) << "Bad taker_pays currency.";
-
254  return rpcError(rpcSRC_CUR_MALFORMED);
+
254  return rpcError(rpcSRC_CUR_MALFORMED);
255  }
256 
257  // Parse optional issuer.
@@ -335,7 +335,7 @@ $(function() {
264  noAccount() == book.in.account)
265  {
266  JLOG(context.j.info()) << "Bad taker_pays issuer.";
-
267  return rpcError(rpcSRC_ISR_MALFORMED);
+
267  return rpcError(rpcSRC_ISR_MALFORMED);
268  }
269 
270  // Parse mandatory currency.
@@ -344,7 +344,7 @@ $(function() {
273  book.out.currency, taker_gets[jss::currency].asString()))
274  {
275  JLOG(context.j.info()) << "Bad taker_gets currency.";
-
276  return rpcError(rpcDST_AMT_MALFORMED);
+
276  return rpcError(rpcDST_AMT_MALFORMED);
277  }
278 
279  // Parse optional issuer.
@@ -357,14 +357,14 @@ $(function() {
286  noAccount() == book.out.account)
287  {
288  JLOG(context.j.info()) << "Bad taker_gets issuer.";
-
289  return rpcError(rpcDST_ISR_MALFORMED);
+
289  return rpcError(rpcDST_ISR_MALFORMED);
290  }
291 
292  if (book.in.currency == book.out.currency &&
293  book.in.account == book.out.account)
294  {
295  JLOG(context.j.info()) << "taker_gets same as taker_pays.";
-
296  return rpcError(rpcBAD_MARKET);
+
296  return rpcError(rpcBAD_MARKET);
297  }
298 
299  std::optional<AccountID> takerID;
@@ -373,13 +373,13 @@ $(function() {
302  {
303  takerID = parseBase58<AccountID>(j[jss::taker].asString());
304  if (!takerID)
-
305  return rpcError(rpcBAD_ISSUER);
+
305  return rpcError(rpcBAD_ISSUER);
306  }
307 
308  if (!isConsistent(book))
309  {
310  JLOG(context.j.warn()) << "Bad market: " << book;
-
311  return rpcError(rpcBAD_MARKET);
+
311  return rpcError(rpcBAD_MARKET);
312  }
313 
314  context.netOps.subBook(ispSub, book);
@@ -454,6 +454,7 @@ $(function() {
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::isConsistent
bool isConsistent(Book const &book)
Definition: Book.cpp:25
beast::Journal::trace
Stream trace() const
Severity stream access functions.
Definition: Journal.h:309
ripple::Book::out
Issue out
Definition: Book.h:36
@@ -497,7 +498,6 @@ $(function() {
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::rpcDST_ISR_MALFORMED
@ rpcDST_ISR_MALFORMED
Definition: ErrorCodes.h:108
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::make_RPCSub
std::shared_ptr< RPCSub > make_RPCSub(InfoSub::Source &source, boost::asio::io_service &io_service, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)
Definition: RPCSub.cpp:213
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple::Application::getIOService
virtual boost::asio::io_service & getIOService()=0
diff --git a/TransactionSign_8cpp_source.html b/TransactionSign_8cpp_source.html index fcb665bcb1..f6eaddc641 100644 --- a/TransactionSign_8cpp_source.html +++ b/TransactionSign_8cpp_source.html @@ -287,7 +287,7 @@ $(function() {
216  {
217  LegacyPathFind lpf(isUnlimited(role), app);
218  if (!lpf.isOk())
-
219  return rpcError(rpcTOO_BUSY);
+
219  return rpcError(rpcTOO_BUSY);
220 
221  STPathSet result;
222 
@@ -381,16 +381,16 @@ $(function() {
310  (validatedLedgerAge > Tuning::maxValidatedLedgerAge))
311  {
312  if (apiVersion == 1)
-
313  ret.first = rpcError(rpcNO_CURRENT);
+
313  ret.first = rpcError(rpcNO_CURRENT);
314  else
-
315  ret.first = rpcError(rpcNOT_SYNCED);
+
315  ret.first = rpcError(rpcNOT_SYNCED);
316  return ret;
317  }
318 
319  // Check for load.
320  if (feeTrack.isLoadedCluster() && !isUnlimited(role))
321  {
-
322  ret.first = rpcError(rpcTOO_BUSY);
+
322  ret.first = rpcError(rpcTOO_BUSY);
323  return ret;
324  }
325 
@@ -480,7 +480,7 @@ $(function() {
409  JLOG(j.debug()) << "transactionSign: Failed to find source account "
410  << "in current ledger: " << toBase58(srcAddressID);
411 
-
412  return rpcError(rpcSRC_ACT_NOT_FOUND);
+
412  return rpcError(rpcSRC_ACT_NOT_FOUND);
413  }
414 
415  {
@@ -520,7 +520,7 @@ $(function() {
449  << "transactionSign: Failed to find source account "
450  << "in current ledger: " << toBase58(srcAddressID);
451 
-
452  return rpcError(rpcSRC_ACT_NOT_FOUND);
+
452  return rpcError(rpcSRC_ACT_NOT_FOUND);
453  }
454  tx_json[jss::Sequence] =
455  hasTicketSeq ? 0 : app.getTxQ().nextQueuableSeq(sle).value();
@@ -534,7 +534,7 @@ $(function() {
463  if (signingArgs.isMultiSigning())
464  {
465  if (tx_json.isMember(sfTxnSignature.jsonName))
-
466  return rpcError(rpcALREADY_SINGLE_SIG);
+
466  return rpcError(rpcALREADY_SINGLE_SIG);
467 
468  // If multisigning then we need to return the public key.
469  signingArgs.setPublicKey(pk);
@@ -542,14 +542,14 @@ $(function() {
471  else if (signingArgs.isSingleSigning())
472  {
473  if (tx_json.isMember(sfSigners.jsonName))
-
474  return rpcError(rpcALREADY_MULTISIG);
+
474  return rpcError(rpcALREADY_MULTISIG);
475  }
476 
477  if (verify)
478  {
479  if (!sle)
480  // XXX Ignore transactions for accounts not created.
-
481  return rpcError(rpcSRC_ACT_NOT_FOUND);
+
481  return rpcError(rpcSRC_ACT_NOT_FOUND);
482 
483  JLOG(j.trace()) << "verify: " << toBase58(calcAccountID(pk)) << " : "
484  << toBase58(srcAddressID);
@@ -562,7 +562,7 @@ $(function() {
491  auto const err = acctMatchesPubKey(sle, srcAddressID, pk);
492 
493  if (err != rpcSUCCESS)
-
494  return rpcError(err);
+
494  return rpcError(err);
495  }
496  }
497 
@@ -1067,7 +1067,7 @@ $(function() {
999  acctMatchesPubKey(account_state, *signerAccountID, multiSignPubKey);
1000 
1001  if (err != rpcSUCCESS)
-
1002  return rpcError(err);
+
1002  return rpcError(err);
1003  }
1004 
1005  // Inject the newly generated signature into tx_json.Signers.
@@ -1148,7 +1148,7 @@ $(function() {
1081  << "transactionSubmitMultiSigned: Failed to find source account "
1082  << "in current ledger: " << toBase58(srcAddressID);
1083 
-
1084  return rpcError(rpcSRC_ACT_NOT_FOUND);
+
1084  return rpcError(rpcSRC_ACT_NOT_FOUND);
1085  }
1086 
1087  {
@@ -1219,7 +1219,7 @@ $(function() {
1152 
1153  // There may not be a TxnSignature field.
1154  if (stpTrans->isFieldPresent(sfTxnSignature))
-
1155  return rpcError(rpcSIGNING_MALFORMED);
+
1155  return rpcError(rpcSIGNING_MALFORMED);
1156 
1157  // The Fee field must be in XRP and greater than zero.
1158  auto const fee = stpTrans->getFieldAmount(sfFee);
@@ -1310,6 +1310,7 @@ $(function() {
ripple::RPC::transactionSignFor
Json::Value transactionSignFor(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:932
ripple::sfSigners
const SField sfSigners
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
std::exception
STL class.
ripple::lsfDisableMaster
@ lsfDisableMaster
Definition: LedgerFormats.h:217
ripple::RPC::missing_field_message
std::string missing_field_message(std::string const &name)
Definition: ErrorCodes.h:237
@@ -1416,7 +1417,6 @@ $(function() {
ripple::feeunit::TaggedFee
Definition: FeeUnits.h:70
ripple::rpcALREADY_MULTISIG
@ rpcALREADY_MULTISIG
Definition: ErrorCodes.h:91
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:91
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::sfSigner
const SField sfSigner
ripple::Config::PATH_SEARCH_OLD
int PATH_SEARCH_OLD
Definition: Config.h:175
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
diff --git a/TxHistory_8cpp_source.html b/TxHistory_8cpp_source.html index a2b14b0d7e..542363ccd9 100644 --- a/TxHistory_8cpp_source.html +++ b/TxHistory_8cpp_source.html @@ -113,17 +113,17 @@ $(function() {
42 doTxHistory(RPC::JsonContext& context)
43 {
44  if (!context.app.config().useTxTables())
-
45  return rpcError(rpcNOT_ENABLED);
+
45  return rpcError(rpcNOT_ENABLED);
46 
47  context.loadType = Resource::feeMediumBurdenRPC;
48 
49  if (!context.params.isMember(jss::start))
-
50  return rpcError(rpcINVALID_PARAMS);
+
50  return rpcError(rpcINVALID_PARAMS);
51 
52  unsigned int startIndex = context.params[jss::start].asUInt();
53 
54  if ((startIndex > 10000) && (!isUnlimited(context.role)))
-
55  return rpcError(rpcNO_PERMISSION);
+
55  return rpcError(rpcNO_PERMISSION);
56 
57  auto trans =
58  context.app.getRelationalDBInterface().getTxHistory(startIndex);
@@ -144,6 +144,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::Application::getRelationalDBInterface
virtual RelationalDBInterface & getRelationalDBInterface()=0
@@ -158,7 +159,6 @@ $(function() {
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::rpcNOT_ENABLED
@ rpcNOT_ENABLED
Definition: ErrorCodes.h:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition: Role.cpp:94
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::rpcNO_PERMISSION
@ rpcNO_PERMISSION
Definition: ErrorCodes.h:53
diff --git a/Tx_8cpp_source.html b/Tx_8cpp_source.html index 1f9e9f93cf..1ddfda8e06 100644 --- a/Tx_8cpp_source.html +++ b/Tx_8cpp_source.html @@ -473,17 +473,17 @@ $(function() {
402 doTxJson(RPC::JsonContext& context)
403 {
404  if (!context.app.config().useTxTables())
-
405  return rpcError(rpcNOT_ENABLED);
+
405  return rpcError(rpcNOT_ENABLED);
406 
407  // Deserialize and validate JSON arguments
408 
409  if (!context.params.isMember(jss::transaction))
-
410  return rpcError(rpcINVALID_PARAMS);
+
410  return rpcError(rpcINVALID_PARAMS);
411 
412  TxArgs args;
413 
414  if (!args.hash.parseHex(context.params[jss::transaction].asString()))
-
415  return rpcError(rpcNOT_IMPL);
+
415  return rpcError(rpcNOT_IMPL);
416 
417  args.binary = context.params.isMember(jss::binary) &&
418  context.params[jss::binary].asBool();
@@ -500,7 +500,7 @@ $(function() {
429  catch (...)
430  {
431  // One of the calls to `asUInt ()` failed.
-
432  return rpcError(rpcINVALID_LGR_RANGE);
+
432  return rpcError(rpcINVALID_LGR_RANGE);
433  }
434  }
435 
@@ -568,6 +568,7 @@ $(function() {
std::shared_ptr< Transaction >
ripple::Transaction::getJson
Json::Value getJson(JsonOptions options, bool binary=false) const
Definition: Transaction.cpp:158
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Slice
An immutable linear range of bytes.
Definition: Slice.h:44
std::pair
ripple::LedgerInfo::hash
uint256 hash
Definition: ReadView.h:100
@@ -621,7 +622,6 @@ $(function() {
ripple::SerialIter::skip
void skip(int num)
Definition: Serializer.cpp:352
ripple::NodeStore::Database::fetchNodeObject
std::shared_ptr< NodeObject > fetchNodeObject(uint256 const &hash, std::uint32_t ledgerSeq=0, FetchType fetchType=FetchType::synchronous)
Fetch a node object.
Definition: Database.cpp:158
ripple::range
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition: RangeSet.h:53
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::TxResult::validated
bool validated
Definition: Tx.cpp:56
ripple::RPC::Status
Status represents the results of an operation that might fail.
Definition: Status.h:39
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
diff --git a/UnlList_8cpp_source.html b/UnlList_8cpp_source.html index 296fa6a3c3..c8d6bc7673 100644 --- a/UnlList_8cpp_source.html +++ b/UnlList_8cpp_source.html @@ -101,7 +101,7 @@ $(function() {
30 doUnlList(RPC::JsonContext& context)
31 {
32  if (context.app.config().reporting())
-
33  return rpcError(rpcREPORTING_UNSUPPORTED);
+
33  return rpcError(rpcREPORTING_UNSUPPORTED);
34  Json::Value obj(Json::objectValue);
35 
36  context.app.validators().for_each_listed(
@@ -123,6 +123,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::doUnlList
Json::Value doUnlList(RPC::JsonContext &)
Definition: UnlList.cpp:30
ripple::ValidatorList::for_each_listed
void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
Definition: ValidatorList.cpp:1641
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
@@ -131,7 +132,6 @@ $(function() {
ripple::PublicKey
A public key.
Definition: PublicKey.h:59
ripple::Application::config
virtual Config & config()=0
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::Application::validators
virtual ValidatorList & validators()=0
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::TokenType::NodePublic
@ NodePublic
diff --git a/Unsubscribe_8cpp_source.html b/Unsubscribe_8cpp_source.html index 81e76075fd..7c36837017 100644 --- a/Unsubscribe_8cpp_source.html +++ b/Unsubscribe_8cpp_source.html @@ -109,13 +109,13 @@ $(function() {
38  if (!context.infoSub && !context.params.isMember(jss::url))
39  {
40  // Must be a JSON-RPC call.
-
41  return rpcError(rpcINVALID_PARAMS);
+
41  return rpcError(rpcINVALID_PARAMS);
42  }
43 
44  if (context.params.isMember(jss::url))
45  {
46  if (context.role != Role::ADMIN)
-
47  return rpcError(rpcNO_PERMISSION);
+
47  return rpcError(rpcNO_PERMISSION);
48 
49  std::string strUrl = context.params[jss::url].asString();
50  ispSub = context.netOps.findRpcSub(strUrl);
@@ -131,12 +131,12 @@ $(function() {
60  if (context.params.isMember(jss::streams))
61  {
62  if (!context.params[jss::streams].isArray())
-
63  return rpcError(rpcINVALID_PARAMS);
+
63  return rpcError(rpcINVALID_PARAMS);
64 
65  for (auto& it : context.params[jss::streams])
66  {
67  if (!it.isString())
-
68  return rpcError(rpcSTREAM_MALFORMED);
+
68  return rpcError(rpcSTREAM_MALFORMED);
69 
70  std::string streamName = it.asString();
71  if (streamName == "server")
@@ -175,7 +175,7 @@ $(function() {
104  }
105  else
106  {
-
107  return rpcError(rpcSTREAM_MALFORMED);
+
107  return rpcError(rpcSTREAM_MALFORMED);
108  }
109  }
110  }
@@ -186,22 +186,22 @@ $(function() {
115  if (context.params.isMember(accountsProposed))
116  {
117  if (!context.params[accountsProposed].isArray())
-
118  return rpcError(rpcINVALID_PARAMS);
+
118  return rpcError(rpcINVALID_PARAMS);
119 
120  auto ids = RPC::parseAccountIds(context.params[accountsProposed]);
121  if (ids.empty())
-
122  return rpcError(rpcACT_MALFORMED);
+
122  return rpcError(rpcACT_MALFORMED);
123  context.netOps.unsubAccount(ispSub, ids, true);
124  }
125 
126  if (context.params.isMember(jss::accounts))
127  {
128  if (!context.params[jss::accounts].isArray())
-
129  return rpcError(rpcINVALID_PARAMS);
+
129  return rpcError(rpcINVALID_PARAMS);
130 
131  auto ids = RPC::parseAccountIds(context.params[jss::accounts]);
132  if (ids.empty())
-
133  return rpcError(rpcACT_MALFORMED);
+
133  return rpcError(rpcACT_MALFORMED);
134  context.netOps.unsubAccount(ispSub, ids, false);
135  }
136 
@@ -209,17 +209,17 @@ $(function() {
138  {
139  auto const& req = context.params[jss::account_history_tx_stream];
140  if (!req.isMember(jss::account) || !req[jss::account].isString())
-
141  return rpcError(rpcINVALID_PARAMS);
+
141  return rpcError(rpcINVALID_PARAMS);
142 
143  auto const id = parseBase58<AccountID>(req[jss::account].asString());
144  if (!id)
-
145  return rpcError(rpcINVALID_PARAMS);
+
145  return rpcError(rpcINVALID_PARAMS);
146 
147  bool stopHistoryOnly = false;
148  if (req.isMember(jss::stop_history_tx_only))
149  {
150  if (!req[jss::stop_history_tx_only].isBool())
-
151  return rpcError(rpcINVALID_PARAMS);
+
151  return rpcError(rpcINVALID_PARAMS);
152  stopHistoryOnly = req[jss::stop_history_tx_only].asBool();
153  }
154  context.netOps.unsubAccountHistory(ispSub, *id, stopHistoryOnly);
@@ -232,7 +232,7 @@ $(function() {
161  if (context.params.isMember(jss::books))
162  {
163  if (!context.params[jss::books].isArray())
-
164  return rpcError(rpcINVALID_PARAMS);
+
164  return rpcError(rpcINVALID_PARAMS);
165 
166  for (auto& jv : context.params[jss::books])
167  {
@@ -241,7 +241,7 @@ $(function() {
170  !jv[jss::taker_pays].isObjectOrNull() ||
171  !jv[jss::taker_gets].isObjectOrNull())
172  {
-
173  return rpcError(rpcINVALID_PARAMS);
+
173  return rpcError(rpcINVALID_PARAMS);
174  }
175 
176  Json::Value taker_pays = jv[jss::taker_pays];
@@ -255,7 +255,7 @@ $(function() {
184  book.in.currency, taker_pays[jss::currency].asString()))
185  {
186  JLOG(context.j.info()) << "Bad taker_pays currency.";
-
187  return rpcError(rpcSRC_CUR_MALFORMED);
+
187  return rpcError(rpcSRC_CUR_MALFORMED);
188  }
189  // Parse optional issuer.
190  else if (
@@ -268,7 +268,7 @@ $(function() {
197  {
198  JLOG(context.j.info()) << "Bad taker_pays issuer.";
199 
-
200  return rpcError(rpcSRC_ISR_MALFORMED);
+
200  return rpcError(rpcSRC_ISR_MALFORMED);
201  }
202 
203  // Parse mandatory currency.
@@ -278,7 +278,7 @@ $(function() {
207  {
208  JLOG(context.j.info()) << "Bad taker_gets currency.";
209 
-
210  return rpcError(rpcDST_AMT_MALFORMED);
+
210  return rpcError(rpcDST_AMT_MALFORMED);
211  }
212  // Parse optional issuer.
213  else if (
@@ -291,13 +291,13 @@ $(function() {
220  {
221  JLOG(context.j.info()) << "Bad taker_gets issuer.";
222 
-
223  return rpcError(rpcDST_ISR_MALFORMED);
+
223  return rpcError(rpcDST_ISR_MALFORMED);
224  }
225 
226  if (book.in == book.out)
227  {
228  JLOG(context.j.info()) << "taker_gets same as taker_pays.";
-
229  return rpcError(rpcBAD_MARKET);
+
229  return rpcError(rpcBAD_MARKET);
230  }
231 
232  context.netOps.unsubBook(ispSub->getSeq(), book);
@@ -329,6 +329,7 @@ $(function() {
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::isConsistent
bool isConsistent(Book const &book)
Definition: Book.cpp:25
ripple::InfoSub::Source::unsubTransactions
virtual bool unsubTransactions(std::uint64_t uListener)=0
ripple::Book::out
Issue out
Definition: Book.h:36
@@ -352,7 +353,6 @@ $(function() {
ripple::rpcDST_ISR_MALFORMED
@ rpcDST_ISR_MALFORMED
Definition: ErrorCodes.h:108
ripple::InfoSub::Source::unsubRTTransactions
virtual bool unsubRTTransactions(std::uint64_t uListener)=0
ripple::InfoSub::Source::unsubPeerStatus
virtual bool unsubPeerStatus(std::uint64_t uListener)=0
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
Json::Value::isArray
bool isArray() const
Definition: json_value.cpp:1015
ripple::InfoSub::Source::unsubServer
virtual bool unsubServer(std::uint64_t uListener)=0
diff --git a/ValidationCreate_8cpp_source.html b/ValidationCreate_8cpp_source.html index 31ec9c7855..ac8de961b0 100644 --- a/ValidationCreate_8cpp_source.html +++ b/ValidationCreate_8cpp_source.html @@ -120,7 +120,7 @@ $(function() {
49  auto seed = validationSeed(context.params);
50 
51  if (!seed)
-
52  return rpcError(rpcBAD_SEED);
+
52  return rpcError(rpcBAD_SEED);
53 
54  auto const private_key = generateSecretKey(KeyType::secp256k1, *seed);
55 
@@ -142,6 +142,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::doValidationCreate
Json::Value doValidationCreate(RPC::JsonContext &)
Definition: ValidationCreate.cpp:45
ripple::parseGenericSeed
std::optional< Seed > parseGenericSeed(std::string const &str)
Attempt to parse a string as a seed.
Definition: Seed.cpp:90
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:313
@@ -151,7 +152,6 @@ $(function() {
ripple::validationSeed
static std::optional< Seed > validationSeed(Json::Value const &params)
Definition: ValidationCreate.cpp:30
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:291
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::KeyType::secp256k1
@ secp256k1
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::TokenType::NodePublic
@ NodePublic
diff --git a/ValidatorListSites_8cpp_source.html b/ValidatorListSites_8cpp_source.html index c2438eb441..5d81dc4e67 100644 --- a/ValidatorListSites_8cpp_source.html +++ b/ValidatorListSites_8cpp_source.html @@ -100,7 +100,7 @@ $(function() {
29 doValidatorListSites(RPC::JsonContext& context)
30 {
31  if (context.app.config().reporting())
-
32  return rpcError(rpcREPORTING_UNSUPPORTED);
+
32  return rpcError(rpcREPORTING_UNSUPPORTED);
33 
34  return context.app.validatorSites().getJson();
35 }
@@ -108,6 +108,7 @@ $(function() {
37 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::Application::validatorSites
virtual ValidatorSite & validatorSites()=0
ripple::doValidatorListSites
Json::Value doValidatorListSites(RPC::JsonContext &)
Definition: ValidatorListSites.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
@@ -115,7 +116,6 @@ $(function() {
ripple::Application::config
virtual Config & config()=0
ripple::ValidatorSite::getJson
Json::Value getJson() const
Return JSON representation of configured validator sites.
Definition: ValidatorSite.cpp:651
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/Validators_8cpp_source.html b/Validators_8cpp_source.html index 2af5434369..79cf46e507 100644 --- a/Validators_8cpp_source.html +++ b/Validators_8cpp_source.html @@ -100,7 +100,7 @@ $(function() {
29 doValidators(RPC::JsonContext& context)
30 {
31  if (context.app.config().reporting())
-
32  return rpcError(rpcREPORTING_UNSUPPORTED);
+
32  return rpcError(rpcREPORTING_UNSUPPORTED);
33 
34  return context.app.validators().getJson();
35 }
@@ -108,12 +108,12 @@ $(function() {
37 } // namespace ripple
ripple::RPC::JsonContext
Definition: Context.h:53
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::doValidators
Json::Value doValidators(RPC::JsonContext &)
Definition: Validators.cpp:29
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
ripple::Config::reporting
bool reporting() const
Definition: Config.h:308
ripple::Application::config
virtual Config & config()=0
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::Application::validators
virtual ValidatorList & validators()=0
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::ValidatorList::getJson
Json::Value getJson() const
Return a JSON representation of the state of the validator list.
Definition: ValidatorList.cpp:1507
diff --git a/WalletPropose_8cpp_source.html b/WalletPropose_8cpp_source.html index da6cb7adfd..c5eff11e82 100644 --- a/WalletPropose_8cpp_source.html +++ b/WalletPropose_8cpp_source.html @@ -157,7 +157,7 @@ $(function() {
86  keyType = keyTypeFromString(params[jss::key_type].asString());
87 
88  if (!keyType)
-
89  return rpcError(rpcINVALID_PARAMS);
+
89  return rpcError(rpcINVALID_PARAMS);
90  }
91 
92  // ripple-lib encodes seed used to generate an Ed25519 wallet in a
@@ -176,7 +176,7 @@ $(function() {
105  // If the user *explicitly* requests a key type other than
106  // Ed25519 we return an error.
107  if (keyType.value_or(KeyType::ed25519) != KeyType::ed25519)
-
108  return rpcError(rpcBAD_SEED);
+
108  return rpcError(rpcBAD_SEED);
109 
110  keyType = KeyType::ed25519;
111  }
@@ -253,6 +253,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
std::string
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
+
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:29
ripple::keyTypeFromString
std::optional< KeyType > keyTypeFromString(std::string const &s)
Definition: KeyType.h:34
std::optional::value_or
T value_or(T... args)
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
@@ -269,7 +270,6 @@ $(function() {
ripple::randomSeed
Seed randomSeed()
Create a seed using secure random numbers.
Definition: Seed.cpp:59
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
map
-
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::KeyType::secp256k1
@ secp256k1
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::getSeedFromRPC
std::optional< Seed > getSeedFromRPC(Json::Value const &params, Json::Value &error)
Definition: RPCHelpers.cpp:655
diff --git a/classripple_1_1test_1_1NodeToShardRPC__test-members.html b/classripple_1_1test_1_1NodeToShardRPC__test-members.html index 6bb1cb972b..6835884d53 100644 --- a/classripple_1_1test_1_1NodeToShardRPC__test-members.html +++ b/classripple_1_1test_1_1NodeToShardRPC__test-members.html @@ -74,8 +74,9 @@ $(function() { - - + + +
importCompleted(NodeStore::DatabaseShard *shardStore, std::uint8_t const numberOfShards, Json::Value const &result)ripple::test::NodeToShardRPC_testprivate
run() overrideripple::test::NodeToShardRPC_test
testStart()ripple::test::NodeToShardRPC_test
testStop()ripple::test::NodeToShardRPC_test
testDisabled()ripple::test::NodeToShardRPC_test
testStart()ripple::test::NodeToShardRPC_test
testStop()ripple::test::NodeToShardRPC_test