diff --git a/AccountChannels_8cpp_source.html b/AccountChannels_8cpp_source.html index 55000dafd9..e03fce41d1 100644 --- a/AccountChannels_8cpp_source.html +++ b/AccountChannels_8cpp_source.html @@ -304,7 +304,7 @@ $(function() {
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
std::stringstream
STL class.
ripple::VisitData::items
std::vector< RPCTrustLine > items
Definition: AccountLines.cpp:35
-
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:582
+
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:584
ripple::VisitData
Definition: AccountLines.cpp:33
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
@@ -319,7 +319,7 @@ $(function() {
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::PublicKey
A public key.
Definition: PublicKey.h:59
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
-
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:111
+
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:113
ripple::rpcACT_NOT_FOUND
@ rpcACT_NOT_FOUND
Definition: ErrorCodes.h:70
std::to_string
T to_string(T... args)
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
@@ -328,7 +328,7 @@ $(function() {
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
std::getline
T getline(T... args)
-
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:94
+
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:96
ripple::sfDestinationTag
const SF_UINT32 sfDestinationTag
ripple::TokenType::AccountPublic
@ AccountPublic
ripple::sfBalance
const SF_AMOUNT sfBalance
@@ -344,7 +344,7 @@ $(function() {
ripple::base_uint::parseHex
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:489
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::sfPublicKey
const SF_VL sfPublicKey
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::ltPAYCHAN
@ ltPAYCHAN
A ledger object describing a single unidirectional XRP payment channel.
Definition: LedgerFormats.h:130
ripple::AccountIDCache::toBase58
std::string toBase58(AccountID const &) const
Return ripple::toBase58 for the AccountID.
Definition: AccountID.cpp:134
diff --git a/AccountCurrenciesHandler_8cpp_source.html b/AccountCurrenciesHandler_8cpp_source.html index b1054f7f7a..6c1877a937 100644 --- a/AccountCurrenciesHandler_8cpp_source.html +++ b/AccountCurrenciesHandler_8cpp_source.html @@ -164,7 +164,7 @@ $(function() {
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:582
+
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:584
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
@@ -179,7 +179,7 @@ $(function() {
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::STAmount::getCurrency
Currency const & getCurrency() const
Definition: STAmount.h:345
std::set
STL class.
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::RPCTrustLine::getItems
static std::vector< RPCTrustLine > getItems(AccountID const &accountID, ReadView const &view)
Definition: TrustLine.cpp:120
diff --git a/AccountInfo_8cpp_source.html b/AccountInfo_8cpp_source.html index 147198a971..acc17ce0c7 100644 --- a/AccountInfo_8cpp_source.html +++ b/AccountInfo_8cpp_source.html @@ -393,14 +393,14 @@ $(function() {
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
ripple::doAccountInfo
Json::Value doAccountInfo(RPC::JsonContext &context)
Definition: AccountInfo.cpp:53
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
-
ripple::RPC::injectSLE
void injectSLE(Json::Value &jv, SLE const &sle)
Inject JSON describing ledger entry.
Definition: RPCHelpers.cpp:634
+
ripple::RPC::injectSLE
void injectSLE(Json::Value &jv, SLE const &sle)
Inject JSON describing ledger entry.
Definition: RPCHelpers.cpp:636
std::pair
Json::UInt
unsigned int UInt
Definition: json_forwards.h:27
std::vector
STL class.
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
ripple::SeqProxy::sequence
static constexpr SeqProxy sequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
Definition: SeqProxy.h:76
ripple::LedgerInfo::seq
LedgerIndex seq
Definition: ReadView.h:93
-
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:582
+
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:584
ripple::error_code_i
error_code_i
Definition: ErrorCodes.h:40
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
@@ -410,7 +410,7 @@ $(function() {
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
ripple::TxQ::getAccountTxs
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1775
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
-
ripple::RPC::accountFromStringWithCode
error_code_i accountFromStringWithCode(AccountID &result, std::string const &strIdent, bool bStrict)
Decode account ID from string.
Definition: RPCHelpers.cpp:56
+
ripple::RPC::accountFromStringWithCode
error_code_i accountFromStringWithCode(AccountID &result, std::string const &strIdent, bool bStrict)
Decode account ID from string.
Definition: RPCHelpers.cpp:58
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
ripple::JsonOptions::none
@ none
ripple::RPC::GRPCContext
Definition: Context.h:70
@@ -422,7 +422,7 @@ $(function() {
std::optional::value
T value(T... args)
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:510
+
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:512
ripple::RPC::Context::apiVersion
unsigned int apiVersion
Definition: Context.h:50
ripple::SeqProxy
A type that represents either a sequence value or a ticket value.
Definition: SeqProxy.h:55
std::optional< std::uint32_t >
@@ -431,8 +431,8 @@ $(function() {
ripple::ReadView::open
virtual bool open() const =0
Returns true if this reflects an open ledger.
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
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:196
-
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:295
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:297
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
ripple::doAccountInfoGrpc
std::pair< org::xrpl::rpc::v1::GetAccountInfoResponse, grpc::Status > doAccountInfoGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetAccountInfoRequest > &context)
Definition: AccountInfo.cpp:226
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::XRPAmount
Definition: XRPAmount.h:46
diff --git a/AccountLines_8cpp_source.html b/AccountLines_8cpp_source.html index 29753f67cf..4dcad1305e 100644 --- a/AccountLines_8cpp_source.html +++ b/AccountLines_8cpp_source.html @@ -357,7 +357,7 @@ $(function() {
std::stringstream
STL class.
ripple::VisitData::ignoreDefault
bool ignoreDefault
Definition: AccountLines.cpp:40
ripple::VisitData::items
std::vector< RPCTrustLine > items
Definition: AccountLines.cpp:35
-
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:582
+
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:584
ripple::VisitData
Definition: AccountLines.cpp:33
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
@@ -370,7 +370,7 @@ $(function() {
ripple::RPC::Tuning::accountLines
static constexpr LimitRange accountLines
Limits for the account_lines command.
Definition: rpc/impl/Tuning.h:37
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
-
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:111
+
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:113
ripple::rpcACT_NOT_FOUND
@ rpcACT_NOT_FOUND
Definition: ErrorCodes.h:70
std::to_string
T to_string(T... args)
ripple::STAmount
Definition: STAmount.h:44
@@ -382,7 +382,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
std::getline
T getline(T... args)
ripple::sfFlags
const SF_UINT32 sfFlags
-
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:94
+
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:96
ripple::RPCTrustLine::makeItem
static std::optional< RPCTrustLine > makeItem(AccountID const &accountID, std::shared_ptr< SLE const > const &sle)
Definition: TrustLine.cpp:110
std::string::empty
T empty(T... args)
std::optional
@@ -393,7 +393,7 @@ $(function() {
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::lsfHighReserve
@ lsfHighReserve
Definition: LedgerFormats.h:242
ripple::STObject::getFieldAmount
STAmount const & getFieldAmount(SField const &field) const
Definition: STObject.cpp:603
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
ripple::addLine
void addLine(Json::Value &jsonLines, RPCTrustLine const &line)
Definition: AccountLines.cpp:45
ripple::doAccountLines
Json::Value doAccountLines(RPC::JsonContext &context)
Definition: AccountLines.cpp:88
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/AccountObjects_8cpp_source.html b/AccountObjects_8cpp_source.html index 4f28356801..c13c2fb628 100644 --- a/AccountObjects_8cpp_source.html +++ b/AccountObjects_8cpp_source.html @@ -363,7 +363,7 @@ $(function() {
std::stringstream
STL class.
ripple::ltCHECK
@ ltCHECK
A ledger object which describes a check.
Definition: LedgerFormats.h:136
ripple::SField::jsonName
const Json::StaticString jsonName
Definition: SField.h:136
-
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:582
+
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:584
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
ripple::sfTransferFee
const SF_UINT16 sfTransferFee
@@ -393,7 +393,7 @@ $(function() {
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::sfIssuer
const SF_ACCOUNT sfIssuer
-
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:886
+
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:888
std::getline
T getline(T... args)
Json::StaticString
Lightweight wrapper to tag static string.
Definition: json_value.h:60
ripple::sfFlags
const SF_UINT32 sfFlags
@@ -407,10 +407,10 @@ $(function() {
ripple::nft::getTaxon
Taxon getTaxon(uint256 const &id)
Definition: NFTokenUtils.h:164
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:288
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::ltPAYCHAN
@ ltPAYCHAN
A ledger object describing a single unidirectional XRP payment channel.
Definition: LedgerFormats.h:130
-
ripple::RPC::getAccountObjects
bool getAccountObjects(ReadView const &ledger, AccountID const &account, std::optional< std::vector< LedgerEntryType >> const &typeFilter, uint256 dirIndex, uint256 const &entryIndex, std::uint32_t const limit, Json::Value &jvResult)
Gathers all objects for an account in a ledger.
Definition: RPCHelpers.cpp:135
+
ripple::RPC::getAccountObjects
bool getAccountObjects(ReadView const &ledger, AccountID const &account, std::optional< std::vector< LedgerEntryType >> const &typeFilter, uint256 dirIndex, uint256 const &entryIndex, std::uint32_t const limit, Json::Value &jvResult)
Gathers all objects for an account in a ledger.
Definition: RPCHelpers.cpp:137
ripple::AccountIDCache::toBase58
std::string toBase58(AccountID const &) const
Return ripple::toBase58 for the AccountID.
Definition: AccountID.cpp:134
string
diff --git a/AccountOffers_8cpp_source.html b/AccountOffers_8cpp_source.html index 76c3ab9eff..2e2d26cd3b 100644 --- a/AccountOffers_8cpp_source.html +++ b/AccountOffers_8cpp_source.html @@ -273,7 +273,7 @@ $(function() {
ripple::sfBookDirectory
const SF_UINT256 sfBookDirectory
ripple::STAmount::getText
std::string getText() const override
Definition: STAmount.cpp:530
std::stringstream
STL class.
-
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:582
+
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:584
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
ripple::sfExpiration
const SF_UINT32 sfExpiration
@@ -283,7 +283,7 @@ $(function() {
ripple::ltOFFER
@ ltOFFER
A ledger object which describes an offer on the DEX.
Definition: LedgerFormats.h:92
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
-
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:111
+
ripple::RPC::isOwnedByAccount
bool isOwnedByAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
Definition: RPCHelpers.cpp:113
ripple::rpcACT_NOT_FOUND
@ rpcACT_NOT_FOUND
Definition: ErrorCodes.h:70
std::to_string
T to_string(T... args)
ripple::STAmount
Definition: STAmount.h:44
@@ -298,13 +298,13 @@ $(function() {
ripple::RPC::Tuning::accountOffers
static constexpr LimitRange accountOffers
Limits for the account_offers command.
Definition: rpc/impl/Tuning.h:46
std::getline
T getline(T... args)
ripple::sfFlags
const SF_UINT32 sfFlags
-
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:94
+
ripple::RPC::getStartHint
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
Definition: RPCHelpers.cpp:96
std::optional
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:41
ripple::base_uint::parseHex
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:489
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::getQuality
std::uint64_t getQuality(uint256 const &uBase)
Definition: Indexes.cpp:108
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::AccountIDCache::toBase58
std::string toBase58(AccountID const &) const
Return ripple::toBase58 for the AccountID.
Definition: AccountID.cpp:134
diff --git a/AccountTxOld_8cpp_source.html b/AccountTxOld_8cpp_source.html index 411146a320..4c42d8fc0a 100644 --- a/AccountTxOld_8cpp_source.html +++ b/AccountTxOld_8cpp_source.html @@ -344,7 +344,7 @@ $(function() {
ripple::LedgerInfo::seq
LedgerIndex seq
Definition: ReadView.h:93
ripple::RPC::Context::role
Role role
Definition: Context.h:47
ripple::rpcATX_DEPRECATED
@ rpcATX_DEPRECATED
Definition: ErrorCodes.h:127
-
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:582
+
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:584
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
Json::Value::asBool
bool asBool() const
Definition: json_value.cpp:619
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html index e0ea99f7a1..dac17eed93 100644 --- a/AccountTx_8cpp_source.html +++ b/AccountTx_8cpp_source.html @@ -741,7 +741,7 @@ $(function() {
ripple::RelationalDatabase::AccountTxArgs
Definition: RelationalDatabase.h:96
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
std::pair
-
ripple::RPC::LedgerShortcut
LedgerShortcut
Definition: RPCHelpers.h:128
+
ripple::RPC::LedgerShortcut
LedgerShortcut
Definition: RPCHelpers.h:129
ripple::RelationalDatabase::AccountTxArgs::binary
bool binary
Definition: RelationalDatabase.h:100
ripple::RelationalDatabase::LedgerSpecifier
std::variant< LedgerRange, LedgerShortcut, LedgerSequence, LedgerHash > LedgerSpecifier
Definition: RelationalDatabase.h:94
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
@@ -790,7 +790,7 @@ $(function() {
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::populateJsonResponse
Json::Value populateJsonResponse(std::pair< AccountTxResult, RPC::Status > const &res, AccountTxArgs const &args, RPC::JsonContext const &context)
Definition: AccountTx.cpp:460
-
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:510
+
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:512
ripple::rpcACT_MALFORMED
@ rpcACT_MALFORMED
Definition: ErrorCodes.h:90
ripple::rpcLGR_NOT_VALIDATED
@ rpcLGR_NOT_VALIDATED
Definition: ErrorCodes.h:73
ripple::doAccountTxJson
Json::Value doAccountTxJson(RPC::JsonContext &context)
Definition: AccountTx.cpp:544
diff --git a/AccountTx__test_8cpp_source.html b/AccountTx__test_8cpp_source.html index 4f8795b628..fa4d510fce 100644 --- a/AccountTx__test_8cpp_source.html +++ b/AccountTx__test_8cpp_source.html @@ -733,7 +733,7 @@ $(function() {
ripple::test::AccountTx_test::checkSanity
void checkSanity(Json::Value const &txNode, NodeSanity const &sane)
Definition: AccountTx_test.cpp:68
ripple::test::jtx::Env::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:225
ripple::sfCreatedNode
const SField sfCreatedNode
-
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
+
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:244
ripple::test::jtx::acctdelete
Json::Value acctdelete(Account const &account, Account const &dest)
Delete account.
Definition: acctdelete.cpp:29
std::chrono::duration::count
T count(T... args)
ripple::sfCancelAfter
const SF_UINT32 sfCancelAfter
diff --git a/Application_8cpp_source.html b/Application_8cpp_source.html index 531aafa6c0..ccc4f3d24a 100644 --- a/Application_8cpp_source.html +++ b/Application_8cpp_source.html @@ -2355,7 +2355,7 @@ $(function() {
ripple::ApplicationImp::signalStop
void signalStop() override
Definition: Application.cpp:1630
ripple::ApplicationImp::cluster
Cluster & cluster() override
Definition: Application.cpp:821
ripple::stopwatch
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition: chrono.h:88
-
ripple::make_NetworkOPs
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
Definition: NetworkOPs.cpp:4512
+
ripple::make_NetworkOPs
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
Definition: NetworkOPs.cpp:4555
ripple::make_InboundTransactions
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Definition: InboundTransactions.cpp:269
ripple::ApplicationImp::getLedgerMaster
LedgerMaster & getLedgerMaster() override
Definition: Application.cpp:604
Json::Reader
Unserialize a JSON document into a Value.
Definition: json_reader.h:36
@@ -2392,7 +2392,7 @@ $(function() {
ripple::ApplicationImp::hashRouter_
std::unique_ptr< HashRouter > hashRouter_
Definition: Application.cpp:214
ripple::ApplicationImp::getMasterMutex
Application::MutexType & getMasterMutex() override
Definition: Application.cpp:737
ripple::ApplicationImp::m_ledgerMaster
std::unique_ptr< LedgerMaster > m_ledgerMaster
Definition: Application.cpp:198
-
ripple::RPC::doCommand
Status doCommand(RPC::JsonContext &context, Json::Value &result)
Execute an RPC command and store the results in a Json::Value.
Definition: RPCHandler.cpp:245
+
ripple::RPC::doCommand
Status doCommand(RPC::JsonContext &context, Json::Value &result)
Execute an RPC command and store the results in a Json::Value.
Definition: RPCHandler.cpp:250
ripple::setup_Overlay
Overlay::Setup setup_Overlay(BasicConfig const &config)
Definition: OverlayImpl.cpp:1537
ripple::ApplicationImp::logs
Logs & logs() override
Definition: Application.cpp:530
ripple::Config::reporting
bool reporting() const
Definition: Config.h:316
@@ -2536,7 +2536,7 @@ $(function() {
ripple::Resource::Charge
A consumption charge.
Definition: Charge.h:30
ripple::SizedItem::sweepInterval
@ sweepInterval
ripple::DatabaseCon
Definition: DatabaseCon.h:81
-
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
+
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:244
ripple::ApplicationImp::mFeeTrack
std::unique_ptr< LoadFeeTrack > mFeeTrack
Definition: Application.cpp:213
ripple::ApplicationImp::getFeeTrack
LoadFeeTrack & getFeeTrack() override
Definition: Application.cpp:779
ripple::addJson
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.
Definition: LedgerToJson.cpp:281
diff --git a/BookChanges_8h_source.html b/BookChanges_8h_source.html new file mode 100644 index 0000000000..8b0b648c6b --- /dev/null +++ b/BookChanges_8h_source.html @@ -0,0 +1,337 @@ + + + + + + + +rippled: BookChanges.h Source File + + + + + + + + + +
+
+ + + + + + +
+
rippled +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
BookChanges.h
+
+
+
1 //------------------------------------------------------------------------------
+
2 /*
+
3  This file is part of rippled: https://github.com/ripple/rippled
+
4  Copyright (c) 2019 Ripple Labs Inc.
+
5 
+
6  Permission to use, copy, modify, and/or distribute this software for any
+
7  purpose with or without fee is hereby granted, provided that the above
+
8  copyright notice and this permission notice appear in all copies.
+
9 
+
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
17 */
+
18 //==============================================================================
+
19 
+
20 #ifndef RIPPLE_RPC_BOOKCHANGES_H_INCLUDED
+
21 #define RIPPLE_RPC_BOOKCAHNGES_H_INCLUDED
+
22 
+
23 namespace Json {
+
24 class Value;
+
25 }
+
26 
+
27 namespace ripple {
+
28 
+
29 class ReadView;
+
30 class Transaction;
+
31 class TxMeta;
+
32 class STTx;
+
33 
+
34 namespace RPC {
+
35 
+
36 template <class L>
+ + +
39 {
+
40  std::map<
+ +
42  std::tuple<
+
43  STAmount, // side A volume
+
44  STAmount, // side B volume
+
45  STAmount, // high rate
+
46  STAmount, // low rate
+
47  STAmount, // open rate
+
48  STAmount // close rate
+
49  >>
+
50  tally;
+
51 
+
52  for (auto& tx : lpAccepted->txs)
+
53  {
+
54  if (!tx.first || !tx.second ||
+
55  !tx.first->isFieldPresent(sfTransactionType))
+
56  continue;
+
57 
+
58  std::optional<uint32_t> offerCancel;
+
59  uint16_t tt = tx.first->getFieldU16(sfTransactionType);
+
60  switch (tt)
+
61  {
+
62  case ttOFFER_CANCEL:
+
63  case ttOFFER_CREATE: {
+
64  if (tx.first->isFieldPresent(sfOfferSequence))
+
65  offerCancel = tx.first->getFieldU32(sfOfferSequence);
+
66  break;
+
67  }
+
68  // in future if any other ways emerge to cancel an offer
+
69  // this switch makes them easy to add
+
70  default:
+
71  break;
+
72  }
+
73 
+
74  for (auto const& node : tx.second->getFieldArray(sfAffectedNodes))
+
75  {
+
76  SField const& metaType = node.getFName();
+
77  uint16_t nodeType = node.getFieldU16(sfLedgerEntryType);
+
78 
+
79  // we only care about ltOFFER objects being modified or
+
80  // deleted
+
81  if (nodeType != ltOFFER || metaType == sfCreatedNode)
+
82  continue;
+
83 
+
84  // if either FF or PF are missing we can't compute
+
85  // but generally these are cancelled rather than crossed
+
86  // so skipping them is consistent
+
87  if (!node.isFieldPresent(sfFinalFields) ||
+
88  !node.isFieldPresent(sfPreviousFields))
+
89  continue;
+
90 
+
91  STObject& finalFields = (const_cast<STObject&>(node))
+ +
93  .downcast<STObject>();
+
94 
+
95  STObject& previousFields = (const_cast<STObject&>(node))
+ +
97  .downcast<STObject>();
+
98 
+
99  // defensive case that should never be hit
+
100  if (!finalFields.isFieldPresent(sfTakerGets) ||
+
101  !finalFields.isFieldPresent(sfTakerPays) ||
+
102  !previousFields.isFieldPresent(sfTakerGets) ||
+
103  !previousFields.isFieldPresent(sfTakerPays))
+
104  continue;
+
105 
+
106  // filter out any offers deleted by explicit offer cancels
+
107  if (metaType == sfDeletedNode && offerCancel &&
+
108  finalFields.getFieldU32(sfSequence) == *offerCancel)
+
109  continue;
+
110 
+
111  // compute the difference in gets and pays actually
+
112  // affected onto the offer
+
113  STAmount deltaGets = finalFields.getFieldAmount(sfTakerGets) -
+
114  previousFields.getFieldAmount(sfTakerGets);
+
115  STAmount deltaPays = finalFields.getFieldAmount(sfTakerPays) -
+
116  previousFields.getFieldAmount(sfTakerPays);
+
117 
+
118  std::string g{to_string(deltaGets.issue())};
+
119  std::string p{to_string(deltaPays.issue())};
+
120 
+
121  bool const noswap =
+
122  isXRP(deltaGets) ? true : (isXRP(deltaPays) ? false : (g < p));
+
123 
+
124  STAmount first = noswap ? deltaGets : deltaPays;
+
125  STAmount second = noswap ? deltaPays : deltaGets;
+
126 
+
127  // defensively programmed, should (probably) never happen
+
128  if (second == beast::zero)
+
129  continue;
+
130 
+
131  STAmount rate = divide(first, second, noIssue());
+
132 
+
133  if (first < beast::zero)
+
134  first = -first;
+
135 
+
136  if (second < beast::zero)
+
137  second = -second;
+
138 
+ +
140  if (noswap)
+
141  ss << g << "|" << p;
+
142  else
+
143  ss << p << "|" << g;
+
144 
+
145  std::string key{ss.str()};
+
146 
+
147  if (tally.find(key) == tally.end())
+
148  tally[key] = {
+
149  first, // side A vol
+
150  second, // side B vol
+
151  rate, // high
+
152  rate, // low
+
153  rate, // open
+
154  rate // close
+
155  };
+
156  else
+
157  {
+
158  // increment volume
+
159  auto& entry = tally[key];
+
160 
+
161  std::get<0>(entry) += first; // side A vol
+
162  std::get<1>(entry) += second; // side B vol
+
163 
+
164  if (std::get<2>(entry) < rate) // high
+
165  std::get<2>(entry) = rate;
+
166 
+
167  if (std::get<3>(entry) > rate) // low
+
168  std::get<3>(entry) = rate;
+
169 
+
170  std::get<5>(entry) = rate; // close
+
171  }
+
172  }
+
173  }
+
174 
+ +
176  jvObj[jss::type] = "bookChanges";
+
177  jvObj[jss::ledger_index] = lpAccepted->info().seq;
+
178  jvObj[jss::ledger_hash] = to_string(lpAccepted->info().hash);
+
179  jvObj[jss::ledger_time] = Json::Value::UInt(
+
180  lpAccepted->info().closeTime.time_since_epoch().count());
+
181 
+
182  jvObj[jss::changes] = Json::arrayValue;
+
183 
+
184  for (auto const& entry : tally)
+
185  {
+
186  Json::Value& inner = jvObj[jss::changes].append(Json::objectValue);
+
187 
+
188  STAmount volA = std::get<0>(entry.second);
+
189  STAmount volB = std::get<1>(entry.second);
+
190 
+
191  inner[jss::currency_a] =
+
192  (isXRP(volA) ? "XRP_drops" : to_string(volA.issue()));
+
193  inner[jss::currency_b] =
+
194  (isXRP(volB) ? "XRP_drops" : to_string(volB.issue()));
+
195 
+
196  inner[jss::volume_a] =
+
197  (isXRP(volA) ? to_string(volA.xrp()) : to_string(volA.iou()));
+
198  inner[jss::volume_b] =
+
199  (isXRP(volB) ? to_string(volB.xrp()) : to_string(volB.iou()));
+
200 
+
201  inner[jss::high] = to_string(std::get<2>(entry.second).iou());
+
202  inner[jss::low] = to_string(std::get<3>(entry.second).iou());
+
203  inner[jss::open] = to_string(std::get<4>(entry.second).iou());
+
204  inner[jss::close] = to_string(std::get<5>(entry.second).iou());
+
205  }
+
206 
+
207  return jvObj;
+
208 }
+
209 
+
210 } // namespace RPC
+
211 } // namespace ripple
+
212 
+
213 #endif
+
+
ripple::sfOfferSequence
const SF_UINT32 sfOfferSequence
+
std::string
STL class.
+
std::shared_ptr
STL class.
+
ripple::STAmount::issue
Issue const & issue() const
Definition: STAmount.h:339
+
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
+
ripple::sfSequence
const SF_UINT32 sfSequence
+
ripple::ttOFFER_CANCEL
@ ttOFFER_CANCEL
This transaction type cancels existing offers to trade one asset for another.
Definition: TxFormats.h:83
+
std::stringstream
STL class.
+
ripple::RPC::computeBookChanges
Json::Value computeBookChanges(std::shared_ptr< L const > const &lpAccepted)
Definition: BookChanges.h:38
+
ripple::sfFinalFields
const SField sfFinalFields
+
ripple::noIssue
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
Definition: Issue.h:105
+
std::tuple
+
ripple::STAmount::iou
IOUAmount iou() const
Definition: STAmount.cpp:328
+
ripple::sfDeletedNode
const SField sfDeletedNode
+
ripple::STAmount::xrp
XRPAmount xrp() const
Definition: STAmount.cpp:313
+
ripple::divide
STAmount divide(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:86
+
ripple::sfTakerPays
const SF_AMOUNT sfTakerPays
+
ripple::sfTransactionType
const SF_UINT16 sfTransactionType
+
Json
JSON (JavaScript Object Notation).
Definition: json_reader.cpp:27
+
ripple::ltOFFER
@ ltOFFER
A ledger object which describes an offer on the DEX.
Definition: LedgerFormats.h:92
+
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
+
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
+
ripple::sfAffectedNodes
const SField sfAffectedNodes
+
ripple::STAmount
Definition: STAmount.h:44
+
ripple::sfTakerGets
const SF_AMOUNT sfTakerGets
+
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:89
+
std::map
STL class.
+
ripple::ttOFFER_CREATE
@ ttOFFER_CREATE
This transaction type creates an offer to trade one asset for another.
Definition: TxFormats.h:80
+
Json::Value::UInt
Json::UInt UInt
Definition: json_value.h:153
+
ripple::sfPreviousFields
const SField sfPreviousFields
+
ripple::STObject
Definition: STObject.h:51
+
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
+
ripple::sfLedgerEntryType
const SF_UINT16 sfLedgerEntryType
+
ripple::SField
Identifies fields.
Definition: SField.h:112
+
ripple::STObject::getField
STBase & getField(SField const &field)
Definition: STObject.cpp:384
+
ripple::STObject::isFieldPresent
bool isFieldPresent(SField const &field) const
Definition: STObject.cpp:428
+
ripple::sfCreatedNode
const SField sfCreatedNode
+
std::optional< uint32_t >
+
std::stringstream::str
T str(T... args)
+
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:41
+
ripple::STBase::downcast
D & downcast()
Definition: STBase.h:145
+
ripple::STObject::getFieldU32
std::uint32_t getFieldU32(SField const &field) const
Definition: STObject.cpp:559
+
ripple::STObject::getFieldAmount
STAmount const & getFieldAmount(SField const &field) const
Definition: STObject.cpp:603
+
Json::Value
Represents a JSON value.
Definition: json_value.h:145
+ + + + diff --git a/BookOffers_8cpp_source.html b/BookOffers_8cpp_source.html index dd8c5d8a9d..3b48a846a6 100644 --- a/BookOffers_8cpp_source.html +++ b/BookOffers_8cpp_source.html @@ -97,181 +97,194 @@ $(function() {
26 #include <ripple/protocol/UintTypes.h>
27 #include <ripple/protocol/jss.h>
28 #include <ripple/resource/Fees.h>
-
29 #include <ripple/rpc/Context.h>
-
30 #include <ripple/rpc/impl/RPCHelpers.h>
-
31 
-
32 namespace ripple {
-
33 
-
34 Json::Value
-
35 doBookOffers(RPC::JsonContext& context)
-
36 {
-
37  // VFALCO TODO Here is a terrible place for this kind of business
-
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);
-
42 
-
43  std::shared_ptr<ReadView const> lpLedger;
-
44  auto jvResult = RPC::lookupLedger(lpLedger, context);
-
45 
-
46  if (!lpLedger)
-
47  return jvResult;
-
48 
-
49  if (!context.params.isMember(jss::taker_pays))
-
50  return RPC::missing_field_error(jss::taker_pays);
-
51 
-
52  if (!context.params.isMember(jss::taker_gets))
-
53  return RPC::missing_field_error(jss::taker_gets);
-
54 
-
55  Json::Value const& taker_pays = context.params[jss::taker_pays];
-
56  Json::Value const& taker_gets = context.params[jss::taker_gets];
-
57 
-
58  if (!taker_pays.isObjectOrNull())
-
59  return RPC::object_field_error(jss::taker_pays);
-
60 
-
61  if (!taker_gets.isObjectOrNull())
-
62  return RPC::object_field_error(jss::taker_gets);
-
63 
-
64  if (!taker_pays.isMember(jss::currency))
-
65  return RPC::missing_field_error("taker_pays.currency");
-
66 
-
67  if (!taker_pays[jss::currency].isString())
-
68  return RPC::expected_field_error("taker_pays.currency", "string");
-
69 
-
70  if (!taker_gets.isMember(jss::currency))
-
71  return RPC::missing_field_error("taker_gets.currency");
-
72 
-
73  if (!taker_gets[jss::currency].isString())
-
74  return RPC::expected_field_error("taker_gets.currency", "string");
-
75 
-
76  Currency pay_currency;
-
77 
-
78  if (!to_currency(pay_currency, taker_pays[jss::currency].asString()))
-
79  {
-
80  JLOG(context.j.info()) << "Bad taker_pays currency.";
-
81  return RPC::make_error(
-
82  rpcSRC_CUR_MALFORMED,
-
83  "Invalid field 'taker_pays.currency', bad currency.");
-
84  }
-
85 
-
86  Currency get_currency;
-
87 
-
88  if (!to_currency(get_currency, taker_gets[jss::currency].asString()))
-
89  {
-
90  JLOG(context.j.info()) << "Bad taker_gets currency.";
-
91  return RPC::make_error(
-
92  rpcDST_AMT_MALFORMED,
-
93  "Invalid field 'taker_gets.currency', bad currency.");
-
94  }
-
95 
-
96  AccountID pay_issuer;
-
97 
-
98  if (taker_pays.isMember(jss::issuer))
-
99  {
-
100  if (!taker_pays[jss::issuer].isString())
-
101  return RPC::expected_field_error("taker_pays.issuer", "string");
-
102 
-
103  if (!to_issuer(pay_issuer, taker_pays[jss::issuer].asString()))
-
104  return RPC::make_error(
-
105  rpcSRC_ISR_MALFORMED,
-
106  "Invalid field 'taker_pays.issuer', bad issuer.");
-
107 
-
108  if (pay_issuer == noAccount())
-
109  return RPC::make_error(
-
110  rpcSRC_ISR_MALFORMED,
-
111  "Invalid field 'taker_pays.issuer', bad issuer account one.");
-
112  }
-
113  else
-
114  {
-
115  pay_issuer = xrpAccount();
-
116  }
-
117 
-
118  if (isXRP(pay_currency) && !isXRP(pay_issuer))
-
119  return RPC::make_error(
-
120  rpcSRC_ISR_MALFORMED,
-
121  "Unneeded field 'taker_pays.issuer' for "
-
122  "XRP currency specification.");
-
123 
-
124  if (!isXRP(pay_currency) && isXRP(pay_issuer))
-
125  return RPC::make_error(
-
126  rpcSRC_ISR_MALFORMED,
-
127  "Invalid field 'taker_pays.issuer', expected non-XRP issuer.");
-
128 
-
129  AccountID get_issuer;
-
130 
-
131  if (taker_gets.isMember(jss::issuer))
-
132  {
-
133  if (!taker_gets[jss::issuer].isString())
-
134  return RPC::expected_field_error("taker_gets.issuer", "string");
-
135 
-
136  if (!to_issuer(get_issuer, taker_gets[jss::issuer].asString()))
-
137  return RPC::make_error(
-
138  rpcDST_ISR_MALFORMED,
-
139  "Invalid field 'taker_gets.issuer', bad issuer.");
-
140 
-
141  if (get_issuer == noAccount())
-
142  return RPC::make_error(
-
143  rpcDST_ISR_MALFORMED,
-
144  "Invalid field 'taker_gets.issuer', bad issuer account one.");
-
145  }
-
146  else
-
147  {
-
148  get_issuer = xrpAccount();
-
149  }
-
150 
-
151  if (isXRP(get_currency) && !isXRP(get_issuer))
-
152  return RPC::make_error(
-
153  rpcDST_ISR_MALFORMED,
-
154  "Unneeded field 'taker_gets.issuer' for "
-
155  "XRP currency specification.");
-
156 
-
157  if (!isXRP(get_currency) && isXRP(get_issuer))
-
158  return RPC::make_error(
-
159  rpcDST_ISR_MALFORMED,
-
160  "Invalid field 'taker_gets.issuer', expected non-XRP issuer.");
-
161 
-
162  std::optional<AccountID> takerID;
-
163  if (context.params.isMember(jss::taker))
-
164  {
-
165  if (!context.params[jss::taker].isString())
-
166  return RPC::expected_field_error(jss::taker, "string");
-
167 
-
168  takerID = parseBase58<AccountID>(context.params[jss::taker].asString());
-
169  if (!takerID)
-
170  return RPC::invalid_field_error(jss::taker);
-
171  }
-
172 
-
173  if (pay_currency == get_currency && pay_issuer == get_issuer)
-
174  {
-
175  JLOG(context.j.info()) << "taker_gets same as taker_pays.";
-
176  return RPC::make_error(rpcBAD_MARKET);
-
177  }
-
178 
-
179  unsigned int limit;
-
180  if (auto err = readLimitField(limit, RPC::Tuning::bookOffers, context))
-
181  return *err;
-
182 
-
183  bool const bProof(context.params.isMember(jss::proof));
-
184 
-
185  Json::Value const jvMarker(
-
186  context.params.isMember(jss::marker) ? context.params[jss::marker]
-
187  : Json::Value(Json::nullValue));
-
188 
-
189  context.netOps.getBookPage(
-
190  lpLedger,
-
191  {{pay_currency, pay_issuer}, {get_currency, get_issuer}},
-
192  takerID ? *takerID : beast::zero,
-
193  bProof,
-
194  limit,
-
195  jvMarker,
-
196  jvResult);
-
197 
-
198  context.loadType = Resource::feeMediumBurdenRPC;
-
199 
-
200  return jvResult;
-
201 }
-
202 
-
203 } // namespace ripple
+
29 #include <ripple/rpc/BookChanges.h>
+
30 #include <ripple/rpc/Context.h>
+
31 #include <ripple/rpc/impl/RPCHelpers.h>
+
32 
+
33 namespace ripple {
+
34 
+
35 Json::Value
+
36 doBookOffers(RPC::JsonContext& context)
+
37 {
+
38  // VFALCO TODO Here is a terrible place for this kind of business
+
39  // logic. It needs to be moved elsewhere and documented,
+
40  // and encapsulated into a function.
+
41  if (context.app.getJobQueue().getJobCountGE(jtCLIENT) > 200)
+
42  return rpcError(rpcTOO_BUSY);
+
43 
+
44  std::shared_ptr<ReadView const> lpLedger;
+
45  auto jvResult = RPC::lookupLedger(lpLedger, context);
+
46 
+
47  if (!lpLedger)
+
48  return jvResult;
+
49 
+
50  if (!context.params.isMember(jss::taker_pays))
+
51  return RPC::missing_field_error(jss::taker_pays);
+
52 
+
53  if (!context.params.isMember(jss::taker_gets))
+
54  return RPC::missing_field_error(jss::taker_gets);
+
55 
+
56  Json::Value const& taker_pays = context.params[jss::taker_pays];
+
57  Json::Value const& taker_gets = context.params[jss::taker_gets];
+
58 
+
59  if (!taker_pays.isObjectOrNull())
+
60  return RPC::object_field_error(jss::taker_pays);
+
61 
+
62  if (!taker_gets.isObjectOrNull())
+
63  return RPC::object_field_error(jss::taker_gets);
+
64 
+
65  if (!taker_pays.isMember(jss::currency))
+
66  return RPC::missing_field_error("taker_pays.currency");
+
67 
+
68  if (!taker_pays[jss::currency].isString())
+
69  return RPC::expected_field_error("taker_pays.currency", "string");
+
70 
+
71  if (!taker_gets.isMember(jss::currency))
+
72  return RPC::missing_field_error("taker_gets.currency");
+
73 
+
74  if (!taker_gets[jss::currency].isString())
+
75  return RPC::expected_field_error("taker_gets.currency", "string");
+
76 
+
77  Currency pay_currency;
+
78 
+
79  if (!to_currency(pay_currency, taker_pays[jss::currency].asString()))
+
80  {
+
81  JLOG(context.j.info()) << "Bad taker_pays currency.";
+
82  return RPC::make_error(
+
83  rpcSRC_CUR_MALFORMED,
+
84  "Invalid field 'taker_pays.currency', bad currency.");
+
85  }
+
86 
+
87  Currency get_currency;
+
88 
+
89  if (!to_currency(get_currency, taker_gets[jss::currency].asString()))
+
90  {
+
91  JLOG(context.j.info()) << "Bad taker_gets currency.";
+
92  return RPC::make_error(
+
93  rpcDST_AMT_MALFORMED,
+
94  "Invalid field 'taker_gets.currency', bad currency.");
+
95  }
+
96 
+
97  AccountID pay_issuer;
+
98 
+
99  if (taker_pays.isMember(jss::issuer))
+
100  {
+
101  if (!taker_pays[jss::issuer].isString())
+
102  return RPC::expected_field_error("taker_pays.issuer", "string");
+
103 
+
104  if (!to_issuer(pay_issuer, taker_pays[jss::issuer].asString()))
+
105  return RPC::make_error(
+
106  rpcSRC_ISR_MALFORMED,
+
107  "Invalid field 'taker_pays.issuer', bad issuer.");
+
108 
+
109  if (pay_issuer == noAccount())
+
110  return RPC::make_error(
+
111  rpcSRC_ISR_MALFORMED,
+
112  "Invalid field 'taker_pays.issuer', bad issuer account one.");
+
113  }
+
114  else
+
115  {
+
116  pay_issuer = xrpAccount();
+
117  }
+
118 
+
119  if (isXRP(pay_currency) && !isXRP(pay_issuer))
+
120  return RPC::make_error(
+
121  rpcSRC_ISR_MALFORMED,
+
122  "Unneeded field 'taker_pays.issuer' for "
+
123  "XRP currency specification.");
+
124 
+
125  if (!isXRP(pay_currency) && isXRP(pay_issuer))
+
126  return RPC::make_error(
+
127  rpcSRC_ISR_MALFORMED,
+
128  "Invalid field 'taker_pays.issuer', expected non-XRP issuer.");
+
129 
+
130  AccountID get_issuer;
+
131 
+
132  if (taker_gets.isMember(jss::issuer))
+
133  {
+
134  if (!taker_gets[jss::issuer].isString())
+
135  return RPC::expected_field_error("taker_gets.issuer", "string");
+
136 
+
137  if (!to_issuer(get_issuer, taker_gets[jss::issuer].asString()))
+
138  return RPC::make_error(
+
139  rpcDST_ISR_MALFORMED,
+
140  "Invalid field 'taker_gets.issuer', bad issuer.");
+
141 
+
142  if (get_issuer == noAccount())
+
143  return RPC::make_error(
+
144  rpcDST_ISR_MALFORMED,
+
145  "Invalid field 'taker_gets.issuer', bad issuer account one.");
+
146  }
+
147  else
+
148  {
+
149  get_issuer = xrpAccount();
+
150  }
+
151 
+
152  if (isXRP(get_currency) && !isXRP(get_issuer))
+
153  return RPC::make_error(
+
154  rpcDST_ISR_MALFORMED,
+
155  "Unneeded field 'taker_gets.issuer' for "
+
156  "XRP currency specification.");
+
157 
+
158  if (!isXRP(get_currency) && isXRP(get_issuer))
+
159  return RPC::make_error(
+
160  rpcDST_ISR_MALFORMED,
+
161  "Invalid field 'taker_gets.issuer', expected non-XRP issuer.");
+
162 
+
163  std::optional<AccountID> takerID;
+
164  if (context.params.isMember(jss::taker))
+
165  {
+
166  if (!context.params[jss::taker].isString())
+
167  return RPC::expected_field_error(jss::taker, "string");
+
168 
+
169  takerID = parseBase58<AccountID>(context.params[jss::taker].asString());
+
170  if (!takerID)
+
171  return RPC::invalid_field_error(jss::taker);
+
172  }
+
173 
+
174  if (pay_currency == get_currency && pay_issuer == get_issuer)
+
175  {
+
176  JLOG(context.j.info()) << "taker_gets same as taker_pays.";
+
177  return RPC::make_error(rpcBAD_MARKET);
+
178  }
+
179 
+
180  unsigned int limit;
+
181  if (auto err = readLimitField(limit, RPC::Tuning::bookOffers, context))
+
182  return *err;
+
183 
+
184  bool const bProof(context.params.isMember(jss::proof));
+
185 
+
186  Json::Value const jvMarker(
+
187  context.params.isMember(jss::marker) ? context.params[jss::marker]
+
188  : Json::Value(Json::nullValue));
+
189 
+
190  context.netOps.getBookPage(
+
191  lpLedger,
+
192  {{pay_currency, pay_issuer}, {get_currency, get_issuer}},
+
193  takerID ? *takerID : beast::zero,
+
194  bProof,
+
195  limit,
+
196  jvMarker,
+
197  jvResult);
+
198 
+
199  context.loadType = Resource::feeMediumBurdenRPC;
+
200 
+
201  return jvResult;
+
202 }
+
203 
+
204 Json::Value
+
205 doBookChanges(RPC::JsonContext& context)
+
206 {
+
207  auto res = RPC::getLedgerByContext(context);
+
208 
+
209  if (std::holds_alternative<Json::Value>(res))
+
210  return std::get<Json::Value>(res);
+
211 
+
212  return RPC::computeBookChanges(
+
213  std::get<std::shared_ptr<Ledger const>>(res));
+
214 }
+
215 
+
216 } // namespace ripple
ripple::to_currency
bool to_currency(Currency &currency, std::string const &code)
Tries to convert a string to a Currency, returns true on success.
Definition: UintTypes.cpp:80
ripple::RPC::JsonContext
Definition: Context.h:53
@@ -282,9 +295,11 @@ $(function() {
ripple::jtCLIENT
@ jtCLIENT
Definition: Job.h:45
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
+
ripple::RPC::computeBookChanges
Json::Value computeBookChanges(std::shared_ptr< L const > const &lpAccepted)
Definition: BookChanges.h:38
ripple::rpcTOO_BUSY
@ rpcTOO_BUSY
Definition: ErrorCodes.h:56
ripple::RPC::Tuning::bookOffers
static constexpr LimitRange bookOffers
Limits for the book_offers command.
Definition: rpc/impl/Tuning.h:49
-
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:582
+
ripple::RPC::getLedgerByContext
std::variant< std::shared_ptr< Ledger const >, Json::Value > getLedgerByContext(RPC::JsonContext &context)
Return a ledger based on ledger_hash or ledger_index, or an RPC error.
Definition: RPCHelpers.cpp:962
+
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:584
ripple::RPC::object_field_error
Json::Value object_field_error(std::string const &name)
Definition: ErrorCodes.h:264
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
@@ -299,7 +314,7 @@ $(function() {
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:89
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::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:36
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:148
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
@@ -312,6 +327,7 @@ $(function() {
Json::Value::isObjectOrNull
bool isObjectOrNull() const
Definition: json_value.cpp:1033
ripple::noAccount
AccountID const & noAccount()
A placeholder for empty accounts.
Definition: AccountID.cpp:97
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:188
+
ripple::doBookChanges
Json::Value doBookChanges(RPC::JsonContext &context)
Definition: BookOffers.cpp:205
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::to_issuer
bool to_issuer(AccountID &, std::string const &)
Convert hex or base58 string to AccountID.
Definition: AccountID.cpp:104
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
diff --git a/DepositAuthorized_8cpp_source.html b/DepositAuthorized_8cpp_source.html index fae69a1318..de822cf8e4 100644 --- a/DepositAuthorized_8cpp_source.html +++ b/DepositAuthorized_8cpp_source.html @@ -191,7 +191,7 @@ $(function() {
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
ripple::rpcSRC_ACT_NOT_FOUND
@ rpcSRC_ACT_NOT_FOUND
Definition: ErrorCodes.h:122
-
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:582
+
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:584
ripple::lsfDepositAuth
@ lsfDepositAuth
Definition: LedgerFormats.h:234
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
@@ -206,7 +206,7 @@ $(function() {
ripple::keylet::depositPreauth
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
Definition: Indexes.cpp:287
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
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:196
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
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:188
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/Env_8cpp_source.html b/Env_8cpp_source.html index 658906f404..afda479592 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -656,7 +656,7 @@ $(function() {
ripple::test::jtx::Env::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:225
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:213
ripple::asfDefaultRipple
constexpr std::uint32_t asfDefaultRipple
Definition: TxFlags.h:79
-
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1532
+
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1533
ripple::test::jtx::Env::AppBundle::owned
std::unique_ptr< Application > owned
Definition: Env.h:127
ripple::test::jtx::Env::master
Account const & master
Definition: Env.h:121
ripple::sfBalance
const SF_AMOUNT sfBalance
diff --git a/GatewayBalances_8cpp_source.html b/GatewayBalances_8cpp_source.html index 4d77a05ee6..47b58892f4 100644 --- a/GatewayBalances_8cpp_source.html +++ b/GatewayBalances_8cpp_source.html @@ -310,7 +310,7 @@ $(function() {
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::doGatewayBalances
Json::Value doGatewayBalances(RPC::JsonContext &context)
Definition: GatewayBalances.cpp:53
ripple::PathFindTrustLine::makeItem
static std::optional< PathFindTrustLine > makeItem(AccountID const &accountID, std::shared_ptr< SLE const > const &sle)
Definition: TrustLine.cpp:52
-
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:582
+
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:584
ripple::Application::accountIDCache
virtual AccountIDCache const & accountIDCache() const =0
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
@@ -331,7 +331,7 @@ $(function() {
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
std::set
STL class.
ripple::Resource::feeHighBurdenRPC
const Charge feeHighBurdenRPC
-
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:84
+
ripple::RPC::accountFromString
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Definition: RPCHelpers.cpp:86
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::AccountIDCache::toBase58
std::string toBase58(AccountID const &) const
Return ripple::toBase58 for the AccountID.
Definition: AccountID.cpp:134
diff --git a/Handler_8cpp_source.html b/Handler_8cpp_source.html index 3aeaad0970..75c00fdd0a 100644 --- a/Handler_8cpp_source.html +++ b/Handler_8cpp_source.html @@ -142,186 +142,187 @@ $(function() {
72  {"account_offers", byRef(&doAccountOffers), Role::USER, NO_CONDITION},
73  {"account_tx", byRef(&doAccountTxJson), Role::USER, NO_CONDITION},
74  {"blacklist", byRef(&doBlackList), Role::ADMIN, NO_CONDITION},
-
75  {"book_offers", byRef(&doBookOffers), Role::USER, NO_CONDITION},
-
76  {"can_delete", byRef(&doCanDelete), Role::ADMIN, NO_CONDITION},
-
77  {"channel_authorize", byRef(&doChannelAuthorize), Role::USER, NO_CONDITION},
-
78  {"channel_verify", byRef(&doChannelVerify), Role::USER, NO_CONDITION},
-
79  {"connect", byRef(&doConnect), Role::ADMIN, NO_CONDITION},
-
80  {"consensus_info", byRef(&doConsensusInfo), Role::ADMIN, NO_CONDITION},
-
81  {"deposit_authorized",
-
82  byRef(&doDepositAuthorized),
-
83  Role::USER,
-
84  NO_CONDITION},
-
85  {"download_shard", byRef(&doDownloadShard), Role::ADMIN, NO_CONDITION},
-
86 #ifdef RIPPLED_REPORTING
-
87  {"gateway_balances", byRef(&doGatewayBalances), Role::ADMIN, NO_CONDITION},
-
88 #else
-
89  {"gateway_balances", byRef(&doGatewayBalances), Role::USER, NO_CONDITION},
-
90 #endif
-
91  {"get_counts", byRef(&doGetCounts), Role::ADMIN, NO_CONDITION},
-
92  {"feature", byRef(&doFeature), Role::ADMIN, NO_CONDITION},
-
93  {"fee", byRef(&doFee), Role::USER, NEEDS_CURRENT_LEDGER},
-
94  {"fetch_info", byRef(&doFetchInfo), Role::ADMIN, NO_CONDITION},
-
95  {"ledger_accept",
-
96  byRef(&doLedgerAccept),
-
97  Role::ADMIN,
-
98  NEEDS_CURRENT_LEDGER},
-
99  {"ledger_cleaner",
-
100  byRef(&doLedgerCleaner),
-
101  Role::ADMIN,
-
102  NEEDS_NETWORK_CONNECTION},
-
103  {"ledger_closed", byRef(&doLedgerClosed), Role::USER, NEEDS_CLOSED_LEDGER},
-
104  {"ledger_current",
-
105  byRef(&doLedgerCurrent),
-
106  Role::USER,
-
107  NEEDS_CURRENT_LEDGER},
-
108  {"ledger_data", byRef(&doLedgerData), Role::USER, NO_CONDITION},
-
109  {"ledger_entry", byRef(&doLedgerEntry), Role::USER, NO_CONDITION},
-
110  {"ledger_header", byRef(&doLedgerHeader), Role::USER, NO_CONDITION},
-
111  {"ledger_request", byRef(&doLedgerRequest), Role::ADMIN, NO_CONDITION},
-
112  {"log_level", byRef(&doLogLevel), Role::ADMIN, NO_CONDITION},
-
113  {"logrotate", byRef(&doLogRotate), Role::ADMIN, NO_CONDITION},
-
114  {"manifest", byRef(&doManifest), Role::USER, NO_CONDITION},
-
115  {"nft_buy_offers", byRef(&doNFTBuyOffers), Role::USER, NO_CONDITION},
-
116  {"nft_sell_offers", byRef(&doNFTSellOffers), Role::USER, NO_CONDITION},
-
117  {"node_to_shard", byRef(&doNodeToShard), Role::ADMIN, NO_CONDITION},
-
118  {"noripple_check", byRef(&doNoRippleCheck), Role::USER, NO_CONDITION},
-
119  {"owner_info", byRef(&doOwnerInfo), Role::USER, NEEDS_CURRENT_LEDGER},
-
120  {"peers", byRef(&doPeers), Role::ADMIN, NO_CONDITION},
-
121  {"path_find", byRef(&doPathFind), Role::USER, NEEDS_CURRENT_LEDGER},
-
122  {"ping", byRef(&doPing), Role::USER, NO_CONDITION},
-
123  {"print", byRef(&doPrint), Role::ADMIN, NO_CONDITION},
-
124  // { "profile", byRef (&doProfile), Role::USER,
-
125  // NEEDS_CURRENT_LEDGER },
-
126  {"random", byRef(&doRandom), Role::USER, NO_CONDITION},
-
127  {"peer_reservations_add",
-
128  byRef(&doPeerReservationsAdd),
-
129  Role::ADMIN,
-
130  NO_CONDITION},
-
131  {"peer_reservations_del",
-
132  byRef(&doPeerReservationsDel),
-
133  Role::ADMIN,
-
134  NO_CONDITION},
-
135  {"peer_reservations_list",
-
136  byRef(&doPeerReservationsList),
-
137  Role::ADMIN,
-
138  NO_CONDITION},
-
139  {"ripple_path_find", byRef(&doRipplePathFind), Role::USER, NO_CONDITION},
-
140  {"sign", byRef(&doSign), Role::USER, NO_CONDITION},
-
141  {"sign_for", byRef(&doSignFor), Role::USER, NO_CONDITION},
-
142  {"submit", byRef(&doSubmit), Role::USER, NEEDS_CURRENT_LEDGER},
-
143  {"submit_multisigned",
-
144  byRef(&doSubmitMultiSigned),
-
145  Role::USER,
-
146  NEEDS_CURRENT_LEDGER},
-
147  {"server_info", byRef(&doServerInfo), Role::USER, NO_CONDITION},
-
148  {"server_state", byRef(&doServerState), Role::USER, NO_CONDITION},
-
149  {"crawl_shards", byRef(&doCrawlShards), Role::ADMIN, NO_CONDITION},
-
150  {"stop", byRef(&doStop), Role::ADMIN, NO_CONDITION},
-
151  {"transaction_entry", byRef(&doTransactionEntry), Role::USER, NO_CONDITION},
-
152  {"tx", byRef(&doTxJson), Role::USER, NEEDS_NETWORK_CONNECTION},
-
153  {"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION},
-
154  {"tx_reduce_relay", byRef(&doTxReduceRelay), Role::USER, NO_CONDITION},
-
155  {"unl_list", byRef(&doUnlList), Role::ADMIN, NO_CONDITION},
-
156  {"validation_create",
-
157  byRef(&doValidationCreate),
-
158  Role::ADMIN,
-
159  NO_CONDITION},
-
160  {"validators", byRef(&doValidators), Role::ADMIN, NO_CONDITION},
-
161  {"validator_list_sites",
-
162  byRef(&doValidatorListSites),
-
163  Role::ADMIN,
-
164  NO_CONDITION},
-
165  {"validator_info", byRef(&doValidatorInfo), Role::ADMIN, NO_CONDITION},
-
166  {"wallet_propose", byRef(&doWalletPropose), Role::ADMIN, NO_CONDITION},
-
167  // Evented methods
-
168  {"subscribe", byRef(&doSubscribe), Role::USER, NO_CONDITION},
-
169  {"unsubscribe", byRef(&doUnsubscribe), Role::USER, NO_CONDITION},
-
170 };
-
171 
-
172 class HandlerTable
-
173 {
-
174 private:
-
175  template <std::size_t N>
-
176  explicit HandlerTable(const Handler (&entries)[N])
-
177  {
-
178  for (std::size_t i = 0; i < N; ++i)
-
179  {
-
180  auto const& entry = entries[i];
-
181  assert(table_.find(entry.name_) == table_.end());
-
182  table_[entry.name_] = entry;
-
183  }
-
184 
-
185  // This is where the new-style handlers are added.
-
186  addHandler<LedgerHandler>();
-
187  addHandler<VersionHandler>();
-
188  }
-
189 
-
190 public:
-
191  static HandlerTable const&
-
192  instance()
-
193  {
-
194  static HandlerTable const handlerTable(handlerArray);
-
195  return handlerTable;
-
196  }
-
197 
-
198  Handler const*
-
199  getHandler(unsigned version, bool betaEnabled, std::string const& name)
-
200  const
-
201  {
-
202  if (version < RPC::apiMinimumSupportedVersion ||
-
203  version > (betaEnabled ? RPC::apiBetaVersion
-
204  : RPC::apiMaximumSupportedVersion))
-
205  return nullptr;
-
206  auto i = table_.find(name);
-
207  return i == table_.end() ? nullptr : &i->second;
-
208  }
-
209 
-
210  std::vector<char const*>
-
211  getHandlerNames() const
-
212  {
-
213  std::vector<char const*> ret;
-
214  ret.reserve(table_.size());
-
215  for (auto const& i : table_)
-
216  ret.push_back(i.second.name_);
-
217  return ret;
-
218  }
-
219 
-
220 private:
-
221  std::map<std::string, Handler> table_;
-
222 
-
223  template <class HandlerImpl>
-
224  void
-
225  addHandler()
-
226  {
-
227  assert(table_.find(HandlerImpl::name()) == table_.end());
-
228 
-
229  Handler h;
-
230  h.name_ = HandlerImpl::name();
-
231  h.valueMethod_ = &handle<Json::Value, HandlerImpl>;
-
232  h.role_ = HandlerImpl::role();
-
233  h.condition_ = HandlerImpl::condition();
-
234 
-
235  table_[HandlerImpl::name()] = h;
-
236  }
-
237 };
-
238 
-
239 } // namespace
-
240 
-
241 Handler const*
-
242 getHandler(unsigned version, bool betaEnabled, std::string const& name)
-
243 {
-
244  return HandlerTable::instance().getHandler(version, betaEnabled, name);
-
245 }
-
246 
-
247 std::vector<char const*>
-
248 getHandlerNames()
-
249 {
-
250  return HandlerTable::instance().getHandlerNames();
-
251 };
-
252 
-
253 } // namespace RPC
-
254 } // namespace ripple
+
75  {"book_changes", byRef(&doBookChanges), Role::USER, NO_CONDITION},
+
76  {"book_offers", byRef(&doBookOffers), Role::USER, NO_CONDITION},
+
77  {"can_delete", byRef(&doCanDelete), Role::ADMIN, NO_CONDITION},
+
78  {"channel_authorize", byRef(&doChannelAuthorize), Role::USER, NO_CONDITION},
+
79  {"channel_verify", byRef(&doChannelVerify), Role::USER, NO_CONDITION},
+
80  {"connect", byRef(&doConnect), Role::ADMIN, NO_CONDITION},
+
81  {"consensus_info", byRef(&doConsensusInfo), Role::ADMIN, NO_CONDITION},
+
82  {"deposit_authorized",
+
83  byRef(&doDepositAuthorized),
+
84  Role::USER,
+
85  NO_CONDITION},
+
86  {"download_shard", byRef(&doDownloadShard), Role::ADMIN, NO_CONDITION},
+
87 #ifdef RIPPLED_REPORTING
+
88  {"gateway_balances", byRef(&doGatewayBalances), Role::ADMIN, NO_CONDITION},
+
89 #else
+
90  {"gateway_balances", byRef(&doGatewayBalances), Role::USER, NO_CONDITION},
+
91 #endif
+
92  {"get_counts", byRef(&doGetCounts), Role::ADMIN, NO_CONDITION},
+
93  {"feature", byRef(&doFeature), Role::ADMIN, NO_CONDITION},
+
94  {"fee", byRef(&doFee), Role::USER, NEEDS_CURRENT_LEDGER},
+
95  {"fetch_info", byRef(&doFetchInfo), Role::ADMIN, NO_CONDITION},
+
96  {"ledger_accept",
+
97  byRef(&doLedgerAccept),
+
98  Role::ADMIN,
+
99  NEEDS_CURRENT_LEDGER},
+
100  {"ledger_cleaner",
+
101  byRef(&doLedgerCleaner),
+
102  Role::ADMIN,
+
103  NEEDS_NETWORK_CONNECTION},
+
104  {"ledger_closed", byRef(&doLedgerClosed), Role::USER, NEEDS_CLOSED_LEDGER},
+
105  {"ledger_current",
+
106  byRef(&doLedgerCurrent),
+
107  Role::USER,
+
108  NEEDS_CURRENT_LEDGER},
+
109  {"ledger_data", byRef(&doLedgerData), Role::USER, NO_CONDITION},
+
110  {"ledger_entry", byRef(&doLedgerEntry), Role::USER, NO_CONDITION},
+
111  {"ledger_header", byRef(&doLedgerHeader), Role::USER, NO_CONDITION},
+
112  {"ledger_request", byRef(&doLedgerRequest), Role::ADMIN, NO_CONDITION},
+
113  {"log_level", byRef(&doLogLevel), Role::ADMIN, NO_CONDITION},
+
114  {"logrotate", byRef(&doLogRotate), Role::ADMIN, NO_CONDITION},
+
115  {"manifest", byRef(&doManifest), Role::USER, NO_CONDITION},
+
116  {"nft_buy_offers", byRef(&doNFTBuyOffers), Role::USER, NO_CONDITION},
+
117  {"nft_sell_offers", byRef(&doNFTSellOffers), Role::USER, NO_CONDITION},
+
118  {"node_to_shard", byRef(&doNodeToShard), Role::ADMIN, NO_CONDITION},
+
119  {"noripple_check", byRef(&doNoRippleCheck), Role::USER, NO_CONDITION},
+
120  {"owner_info", byRef(&doOwnerInfo), Role::USER, NEEDS_CURRENT_LEDGER},
+
121  {"peers", byRef(&doPeers), Role::ADMIN, NO_CONDITION},
+
122  {"path_find", byRef(&doPathFind), Role::USER, NEEDS_CURRENT_LEDGER},
+
123  {"ping", byRef(&doPing), Role::USER, NO_CONDITION},
+
124  {"print", byRef(&doPrint), Role::ADMIN, NO_CONDITION},
+
125  // { "profile", byRef (&doProfile), Role::USER,
+
126  // NEEDS_CURRENT_LEDGER },
+
127  {"random", byRef(&doRandom), Role::USER, NO_CONDITION},
+
128  {"peer_reservations_add",
+
129  byRef(&doPeerReservationsAdd),
+
130  Role::ADMIN,
+
131  NO_CONDITION},
+
132  {"peer_reservations_del",
+
133  byRef(&doPeerReservationsDel),
+
134  Role::ADMIN,
+
135  NO_CONDITION},
+
136  {"peer_reservations_list",
+
137  byRef(&doPeerReservationsList),
+
138  Role::ADMIN,
+
139  NO_CONDITION},
+
140  {"ripple_path_find", byRef(&doRipplePathFind), Role::USER, NO_CONDITION},
+
141  {"sign", byRef(&doSign), Role::USER, NO_CONDITION},
+
142  {"sign_for", byRef(&doSignFor), Role::USER, NO_CONDITION},
+
143  {"submit", byRef(&doSubmit), Role::USER, NEEDS_CURRENT_LEDGER},
+
144  {"submit_multisigned",
+
145  byRef(&doSubmitMultiSigned),
+
146  Role::USER,
+
147  NEEDS_CURRENT_LEDGER},
+
148  {"server_info", byRef(&doServerInfo), Role::USER, NO_CONDITION},
+
149  {"server_state", byRef(&doServerState), Role::USER, NO_CONDITION},
+
150  {"crawl_shards", byRef(&doCrawlShards), Role::ADMIN, NO_CONDITION},
+
151  {"stop", byRef(&doStop), Role::ADMIN, NO_CONDITION},
+
152  {"transaction_entry", byRef(&doTransactionEntry), Role::USER, NO_CONDITION},
+
153  {"tx", byRef(&doTxJson), Role::USER, NEEDS_NETWORK_CONNECTION},
+
154  {"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION},
+
155  {"tx_reduce_relay", byRef(&doTxReduceRelay), Role::USER, NO_CONDITION},
+
156  {"unl_list", byRef(&doUnlList), Role::ADMIN, NO_CONDITION},
+
157  {"validation_create",
+
158  byRef(&doValidationCreate),
+
159  Role::ADMIN,
+
160  NO_CONDITION},
+
161  {"validators", byRef(&doValidators), Role::ADMIN, NO_CONDITION},
+
162  {"validator_list_sites",
+
163  byRef(&doValidatorListSites),
+
164  Role::ADMIN,
+
165  NO_CONDITION},
+
166  {"validator_info", byRef(&doValidatorInfo), Role::ADMIN, NO_CONDITION},
+
167  {"wallet_propose", byRef(&doWalletPropose), Role::ADMIN, NO_CONDITION},
+
168  // Evented methods
+
169  {"subscribe", byRef(&doSubscribe), Role::USER, NO_CONDITION},
+
170  {"unsubscribe", byRef(&doUnsubscribe), Role::USER, NO_CONDITION},
+
171 };
+
172 
+
173 class HandlerTable
+
174 {
+
175 private:
+
176  template <std::size_t N>
+
177  explicit HandlerTable(const Handler (&entries)[N])
+
178  {
+
179  for (std::size_t i = 0; i < N; ++i)
+
180  {
+
181  auto const& entry = entries[i];
+
182  assert(table_.find(entry.name_) == table_.end());
+
183  table_[entry.name_] = entry;
+
184  }
+
185 
+
186  // This is where the new-style handlers are added.
+
187  addHandler<LedgerHandler>();
+
188  addHandler<VersionHandler>();
+
189  }
+
190 
+
191 public:
+
192  static HandlerTable const&
+
193  instance()
+
194  {
+
195  static HandlerTable const handlerTable(handlerArray);
+
196  return handlerTable;
+
197  }
+
198 
+
199  Handler const*
+
200  getHandler(unsigned version, bool betaEnabled, std::string const& name)
+
201  const
+
202  {
+
203  if (version < RPC::apiMinimumSupportedVersion ||
+
204  version > (betaEnabled ? RPC::apiBetaVersion
+
205  : RPC::apiMaximumSupportedVersion))
+
206  return nullptr;
+
207  auto i = table_.find(name);
+
208  return i == table_.end() ? nullptr : &i->second;
+
209  }
+
210 
+
211  std::vector<char const*>
+
212  getHandlerNames() const
+
213  {
+
214  std::vector<char const*> ret;
+
215  ret.reserve(table_.size());
+
216  for (auto const& i : table_)
+
217  ret.push_back(i.second.name_);
+
218  return ret;
+
219  }
+
220 
+
221 private:
+
222  std::map<std::string, Handler> table_;
+
223 
+
224  template <class HandlerImpl>
+
225  void
+
226  addHandler()
+
227  {
+
228  assert(table_.find(HandlerImpl::name()) == table_.end());
+
229 
+
230  Handler h;
+
231  h.name_ = HandlerImpl::name();
+
232  h.valueMethod_ = &handle<Json::Value, HandlerImpl>;
+
233  h.role_ = HandlerImpl::role();
+
234  h.condition_ = HandlerImpl::condition();
+
235 
+
236  table_[HandlerImpl::name()] = h;
+
237  }
+
238 };
+
239 
+
240 } // namespace
+
241 
+
242 Handler const*
+
243 getHandler(unsigned version, bool betaEnabled, std::string const& name)
+
244 {
+
245  return HandlerTable::instance().getHandler(version, betaEnabled, name);
+
246 }
+
247 
+
248 std::vector<char const*>
+
249 getHandlerNames()
+
250 {
+
251  return HandlerTable::instance().getHandlerNames();
+
252 };
+
253 
+
254 } // namespace RPC
+
255 } // namespace ripple
ripple::doAccountNFTs
Json::Value doAccountNFTs(RPC::JsonContext &context)
General RPC command that can retrieve objects in the account root.
Definition: AccountObjects.cpp:52
ripple::doFeature
Json::Value doFeature(RPC::JsonContext &context)
Definition: Feature1.cpp:35
@@ -339,7 +340,7 @@ $(function() {
ripple::doAccountInfo
Json::Value doAccountInfo(RPC::JsonContext &context)
Definition: AccountInfo.cpp:53
ripple::doRipplePathFind
Json::Value doRipplePathFind(RPC::JsonContext &)
Definition: RipplePathFind.cpp:32
ripple::doSignFor
Json::Value doSignFor(RPC::JsonContext &)
Definition: SignFor.cpp:35
-
ripple::RPC::getHandler
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
Definition: Handler.cpp:242
+
ripple::RPC::getHandler
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
Definition: Handler.cpp:243
ripple::doAccountObjects
Json::Value doAccountObjects(RPC::JsonContext &context)
Definition: AccountObjects.cpp:169
std::vector::reserve
T reserve(T... args)
std::vector
STL class.
@@ -353,7 +354,7 @@ $(function() {
ripple::doManifest
Json::Value doManifest(RPC::JsonContext &)
Definition: rpc/handlers/Manifest.cpp:30
ripple::doPeers
Json::Value doPeers(RPC::JsonContext &)
Definition: Peers.cpp:32
ripple::doSubmitMultiSigned
Json::Value doSubmitMultiSigned(RPC::JsonContext &)
Definition: SubmitMultiSigned.cpp:34
-
ripple::RPC::apiBetaVersion
constexpr unsigned int apiBetaVersion
Definition: RPCHelpers.h:244
+
ripple::RPC::apiBetaVersion
constexpr unsigned int apiBetaVersion
Definition: RPCHelpers.h:245
std::vector::push_back
T push_back(T... args)
ripple::doNFTBuyOffers
Json::Value doNFTBuyOffers(RPC::JsonContext &)
Definition: NFTOffers.cpp:167
ripple::doCrawlShards
Json::Value doCrawlShards(RPC::JsonContext &context)
RPC command that reports stored shards by nodes.
Definition: CrawlShards.cpp:44
@@ -363,7 +364,7 @@ $(function() {
ripple::Role::ADMIN
@ ADMIN
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::doPing
Json::Value doPing(RPC::JsonContext &)
Definition: Ping.cpp:32
-
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:38
+
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:40
ripple::doNFTSellOffers
Json::Value doNFTSellOffers(RPC::JsonContext &)
Definition: NFTOffers.cpp:153
ripple::Role::USER
@ USER
ripple::doChannelAuthorize
Json::Value doChannelAuthorize(RPC::JsonContext &)
Definition: PayChanClaim.cpp:44
@@ -382,20 +383,20 @@ $(function() {
ripple::RPC::NEEDS_CLOSED_LEDGER
@ NEEDS_CLOSED_LEDGER
Definition: Handler.h:43
std::map
STL class.
ripple::doLedgerClosed
Json::Value doLedgerClosed(RPC::JsonContext &)
Definition: LedgerClosed.cpp:29
-
ripple::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:35
+
ripple::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:36
std::experimental::filesystem::status
T status(T... args)
ripple::doPeerReservationsList
Json::Value doPeerReservationsList(RPC::JsonContext &)
Definition: Reservations.cpp:121
ripple::NodeStore::Status
Status
Return codes from Backend operations.
Definition: nodestore/Types.h:44
ripple::doTransactionEntry
Json::Value doTransactionEntry(RPC::JsonContext &)
Definition: TransactionEntry.cpp:36
ripple::doUnsubscribe
Json::Value doUnsubscribe(RPC::JsonContext &)
Definition: Unsubscribe.cpp:32
-
ripple::RPC::apiMinimumSupportedVersion
constexpr unsigned int apiMinimumSupportedVersion
Definition: RPCHelpers.h:242
+
ripple::RPC::apiMinimumSupportedVersion
constexpr unsigned int apiMinimumSupportedVersion
Definition: RPCHelpers.h:243
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::doBlackList
Json::Value doBlackList(RPC::JsonContext &context)
Definition: BlackList.cpp:28
ripple::doAccountTxJson
Json::Value doAccountTxJson(RPC::JsonContext &context)
Definition: AccountTx.cpp:544
ripple::doSign
Json::Value doSign(RPC::JsonContext &)
Definition: SignHandler.cpp:33
ripple::doPeerReservationsDel
Json::Value doPeerReservationsDel(RPC::JsonContext &)
Definition: Reservations.cpp:91
ripple::doTxJson
Json::Value doTxJson(RPC::JsonContext &)
Definition: Tx.cpp:402
-
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
+
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:244
ripple::doNodeToShard
Json::Value doNodeToShard(RPC::JsonContext &)
Definition: NodeToShard.cpp:33
ripple::RPC::makeObjectValue
Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Definition: Handler.h:63
std::size_t
@@ -406,9 +407,10 @@ $(function() {
ripple::doServerState
Json::Value doServerState(RPC::JsonContext &)
Definition: ServerState.cpp:31
ripple::doConnect
Json::Value doConnect(RPC::JsonContext &context)
Definition: Connect.cpp:38
ripple::doLedgerCleaner
Json::Value doLedgerCleaner(RPC::JsonContext &)
Definition: LedgerCleanerHandler.cpp:29
-
ripple::RPC::getHandlerNames
std::vector< char const * > getHandlerNames()
Return names of all methods.
Definition: Handler.cpp:248
+
ripple::RPC::getHandlerNames
std::vector< char const * > getHandlerNames()
Return names of all methods.
Definition: Handler.cpp:249
ripple::doDepositAuthorized
Json::Value doDepositAuthorized(RPC::JsonContext &context)
Definition: DepositAuthorized.cpp:37
ripple::doPeerReservationsAdd
Json::Value doPeerReservationsAdd(RPC::JsonContext &)
Definition: Reservations.cpp:35
+
ripple::doBookChanges
Json::Value doBookChanges(RPC::JsonContext &context)
Definition: BookOffers.cpp:205
ripple::doAccountLines
Json::Value doAccountLines(RPC::JsonContext &context)
Definition: AccountLines.cpp:88
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::doFee
Json::Value doFee(RPC::JsonContext &context)
Definition: Fee1.cpp:31
diff --git a/Handler_8h_source.html b/Handler_8h_source.html index af49f368cc..ed8740761a 100644 --- a/Handler_8h_source.html +++ b/Handler_8h_source.html @@ -231,7 +231,7 @@ $(function() {
ripple::rpcNO_NETWORK
@ rpcNO_NETWORK
Definition: ErrorCodes.h:66
ripple::RPC::JsonContext
Definition: Context.h:53
std::string
STL class.
-
ripple::RPC::getHandler
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
Definition: Handler.cpp:242
+
ripple::RPC::getHandler
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
Definition: Handler.cpp:243
ripple::RPC::Handler::role_
Role role_
Definition: Handler.h:53
vector
std::function
@@ -257,7 +257,7 @@ $(function() {
Json::StaticString
Lightweight wrapper to tag static string.
Definition: json_value.h:60
ripple::RPC::makeObjectValue
Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Definition: Handler.h:63
ripple::rpcNO_CLOSED
@ rpcNO_CLOSED
Definition: ErrorCodes.h:64
-
ripple::RPC::getHandlerNames
std::vector< char const * > getHandlerNames()
Return names of all methods.
Definition: Handler.cpp:248
+
ripple::RPC::getHandlerNames
std::vector< char const * > getHandlerNames()
Return names of all methods.
Definition: Handler.cpp:249
ripple::Role
Role
Indicates the level of administrative permission to grant.
Definition: Role.h:43
ripple::RPC::Tuning::maxValidatedLedgerAge
constexpr auto maxValidatedLedgerAge
Definition: rpc/impl/Tuning.h:65
ripple::rpcNOT_SYNCED
@ rpcNOT_SYNCED
Definition: ErrorCodes.h:67
diff --git a/Handlers_8h_source.html b/Handlers_8h_source.html index 53e151f89d..bc1a0053cc 100644 --- a/Handlers_8h_source.html +++ b/Handlers_8h_source.html @@ -114,128 +114,130 @@ $(function() {
43 Json::Value
44 doBookOffers(RPC::JsonContext&);
45 Json::Value
-
46 doBlackList(RPC::JsonContext&);
+
46 doBookChanges(RPC::JsonContext&);
47 Json::Value
-
48 doCanDelete(RPC::JsonContext&);
+
48 doBlackList(RPC::JsonContext&);
49 Json::Value
-
50 doChannelAuthorize(RPC::JsonContext&);
+
50 doCanDelete(RPC::JsonContext&);
51 Json::Value
-
52 doChannelVerify(RPC::JsonContext&);
+
52 doChannelAuthorize(RPC::JsonContext&);
53 Json::Value
-
54 doConnect(RPC::JsonContext&);
+
54 doChannelVerify(RPC::JsonContext&);
55 Json::Value
-
56 doConsensusInfo(RPC::JsonContext&);
+
56 doConnect(RPC::JsonContext&);
57 Json::Value
-
58 doDepositAuthorized(RPC::JsonContext&);
+
58 doConsensusInfo(RPC::JsonContext&);
59 Json::Value
-
60 doDownloadShard(RPC::JsonContext&);
+
60 doDepositAuthorized(RPC::JsonContext&);
61 Json::Value
-
62 doFeature(RPC::JsonContext&);
+
62 doDownloadShard(RPC::JsonContext&);
63 Json::Value
-
64 doFee(RPC::JsonContext&);
+
64 doFeature(RPC::JsonContext&);
65 Json::Value
-
66 doFetchInfo(RPC::JsonContext&);
+
66 doFee(RPC::JsonContext&);
67 Json::Value
-
68 doGatewayBalances(RPC::JsonContext&);
+
68 doFetchInfo(RPC::JsonContext&);
69 Json::Value
-
70 doGetCounts(RPC::JsonContext&);
+
70 doGatewayBalances(RPC::JsonContext&);
71 Json::Value
-
72 doLedgerAccept(RPC::JsonContext&);
+
72 doGetCounts(RPC::JsonContext&);
73 Json::Value
-
74 doLedgerCleaner(RPC::JsonContext&);
+
74 doLedgerAccept(RPC::JsonContext&);
75 Json::Value
-
76 doLedgerClosed(RPC::JsonContext&);
+
76 doLedgerCleaner(RPC::JsonContext&);
77 Json::Value
-
78 doLedgerCurrent(RPC::JsonContext&);
+
78 doLedgerClosed(RPC::JsonContext&);
79 Json::Value
-
80 doLedgerData(RPC::JsonContext&);
+
80 doLedgerCurrent(RPC::JsonContext&);
81 Json::Value
-
82 doLedgerEntry(RPC::JsonContext&);
+
82 doLedgerData(RPC::JsonContext&);
83 Json::Value
-
84 doLedgerHeader(RPC::JsonContext&);
+
84 doLedgerEntry(RPC::JsonContext&);
85 Json::Value
-
86 doLedgerRequest(RPC::JsonContext&);
+
86 doLedgerHeader(RPC::JsonContext&);
87 Json::Value
-
88 doLogLevel(RPC::JsonContext&);
+
88 doLedgerRequest(RPC::JsonContext&);
89 Json::Value
-
90 doLogRotate(RPC::JsonContext&);
+
90 doLogLevel(RPC::JsonContext&);
91 Json::Value
-
92 doManifest(RPC::JsonContext&);
+
92 doLogRotate(RPC::JsonContext&);
93 Json::Value
-
94 doNFTBuyOffers(RPC::JsonContext&);
+
94 doManifest(RPC::JsonContext&);
95 Json::Value
-
96 doNFTSellOffers(RPC::JsonContext&);
+
96 doNFTBuyOffers(RPC::JsonContext&);
97 Json::Value
-
98 doNodeToShard(RPC::JsonContext&);
+
98 doNFTSellOffers(RPC::JsonContext&);
99 Json::Value
-
100 doNoRippleCheck(RPC::JsonContext&);
+
100 doNodeToShard(RPC::JsonContext&);
101 Json::Value
-
102 doOwnerInfo(RPC::JsonContext&);
+
102 doNoRippleCheck(RPC::JsonContext&);
103 Json::Value
-
104 doPathFind(RPC::JsonContext&);
+
104 doOwnerInfo(RPC::JsonContext&);
105 Json::Value
-
106 doPause(RPC::JsonContext&);
+
106 doPathFind(RPC::JsonContext&);
107 Json::Value
-
108 doPeers(RPC::JsonContext&);
+
108 doPause(RPC::JsonContext&);
109 Json::Value
-
110 doPing(RPC::JsonContext&);
+
110 doPeers(RPC::JsonContext&);
111 Json::Value
-
112 doPrint(RPC::JsonContext&);
+
112 doPing(RPC::JsonContext&);
113 Json::Value
-
114 doRandom(RPC::JsonContext&);
+
114 doPrint(RPC::JsonContext&);
115 Json::Value
-
116 doResume(RPC::JsonContext&);
+
116 doRandom(RPC::JsonContext&);
117 Json::Value
-
118 doPeerReservationsAdd(RPC::JsonContext&);
+
118 doResume(RPC::JsonContext&);
119 Json::Value
-
120 doPeerReservationsDel(RPC::JsonContext&);
+
120 doPeerReservationsAdd(RPC::JsonContext&);
121 Json::Value
-
122 doPeerReservationsList(RPC::JsonContext&);
+
122 doPeerReservationsDel(RPC::JsonContext&);
123 Json::Value
-
124 doRipplePathFind(RPC::JsonContext&);
+
124 doPeerReservationsList(RPC::JsonContext&);
125 Json::Value
-
126 doServerInfo(RPC::JsonContext&); // for humans
+
126 doRipplePathFind(RPC::JsonContext&);
127 Json::Value
-
128 doServerState(RPC::JsonContext&); // for machines
+
128 doServerInfo(RPC::JsonContext&); // for humans
129 Json::Value
-
130 doSign(RPC::JsonContext&);
+
130 doServerState(RPC::JsonContext&); // for machines
131 Json::Value
-
132 doSignFor(RPC::JsonContext&);
+
132 doSign(RPC::JsonContext&);
133 Json::Value
-
134 doCrawlShards(RPC::JsonContext&);
+
134 doSignFor(RPC::JsonContext&);
135 Json::Value
-
136 doStop(RPC::JsonContext&);
+
136 doCrawlShards(RPC::JsonContext&);
137 Json::Value
-
138 doSubmit(RPC::JsonContext&);
+
138 doStop(RPC::JsonContext&);
139 Json::Value
-
140 doSubmitMultiSigned(RPC::JsonContext&);
+
140 doSubmit(RPC::JsonContext&);
141 Json::Value
-
142 doSubscribe(RPC::JsonContext&);
+
142 doSubmitMultiSigned(RPC::JsonContext&);
143 Json::Value
-
144 doTransactionEntry(RPC::JsonContext&);
+
144 doSubscribe(RPC::JsonContext&);
145 Json::Value
-
146 doTxJson(RPC::JsonContext&);
+
146 doTransactionEntry(RPC::JsonContext&);
147 Json::Value
-
148 doTxHistory(RPC::JsonContext&);
+
148 doTxJson(RPC::JsonContext&);
149 Json::Value
-
150 doTxReduceRelay(RPC::JsonContext&);
+
150 doTxHistory(RPC::JsonContext&);
151 Json::Value
-
152 doUnlList(RPC::JsonContext&);
+
152 doTxReduceRelay(RPC::JsonContext&);
153 Json::Value
-
154 doUnsubscribe(RPC::JsonContext&);
+
154 doUnlList(RPC::JsonContext&);
155 Json::Value
-
156 doValidationCreate(RPC::JsonContext&);
+
156 doUnsubscribe(RPC::JsonContext&);
157 Json::Value
-
158 doWalletPropose(RPC::JsonContext&);
+
158 doValidationCreate(RPC::JsonContext&);
159 Json::Value
-
160 doValidators(RPC::JsonContext&);
+
160 doWalletPropose(RPC::JsonContext&);
161 Json::Value
-
162 doValidatorListSites(RPC::JsonContext&);
+
162 doValidators(RPC::JsonContext&);
163 Json::Value
-
164 doValidatorInfo(RPC::JsonContext&);
-
165 } // namespace ripple
-
166 
-
167 #endif
+
164 doValidatorListSites(RPC::JsonContext&);
+
165 Json::Value
+
166 doValidatorInfo(RPC::JsonContext&);
+
167 } // namespace ripple
+
168 
+
169 #endif
ripple::doResume
Json::Value doResume(RPC::JsonContext &)
ripple::doAccountNFTs
Json::Value doAccountNFTs(RPC::JsonContext &context)
General RPC command that can retrieve objects in the account root.
Definition: AccountObjects.cpp:52
@@ -269,7 +271,7 @@ $(function() {
ripple::doLogLevel
Json::Value doLogLevel(RPC::JsonContext &)
Definition: LogLevel.cpp:32
ripple::doSubmit
Json::Value doSubmit(RPC::JsonContext &)
Definition: Submit.cpp:48
ripple::doPing
Json::Value doPing(RPC::JsonContext &)
Definition: Ping.cpp:32
-
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:38
+
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:40
ripple::doNFTSellOffers
Json::Value doNFTSellOffers(RPC::JsonContext &)
Definition: NFTOffers.cpp:153
ripple::doPause
Json::Value doPause(RPC::JsonContext &)
ripple::doChannelAuthorize
Json::Value doChannelAuthorize(RPC::JsonContext &)
Definition: PayChanClaim.cpp:44
@@ -284,7 +286,7 @@ $(function() {
ripple::doLogRotate
Json::Value doLogRotate(RPC::JsonContext &)
Definition: LogRotate.cpp:28
ripple::doNoRippleCheck
Json::Value doNoRippleCheck(RPC::JsonContext &)
Definition: NoRippleCheck.cpp:61
ripple::doLedgerClosed
Json::Value doLedgerClosed(RPC::JsonContext &)
Definition: LedgerClosed.cpp:29
-
ripple::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:35
+
ripple::doBookOffers
Json::Value doBookOffers(RPC::JsonContext &context)
Definition: BookOffers.cpp:36
ripple::doPeerReservationsList
Json::Value doPeerReservationsList(RPC::JsonContext &)
Definition: Reservations.cpp:121
ripple::doTransactionEntry
Json::Value doTransactionEntry(RPC::JsonContext &)
Definition: TransactionEntry.cpp:36
ripple::doUnsubscribe
Json::Value doUnsubscribe(RPC::JsonContext &)
Definition: Unsubscribe.cpp:32
@@ -304,6 +306,7 @@ $(function() {
ripple::doLedgerCleaner
Json::Value doLedgerCleaner(RPC::JsonContext &)
Definition: LedgerCleanerHandler.cpp:29
ripple::doDepositAuthorized
Json::Value doDepositAuthorized(RPC::JsonContext &context)
Definition: DepositAuthorized.cpp:37
ripple::doPeerReservationsAdd
Json::Value doPeerReservationsAdd(RPC::JsonContext &)
Definition: Reservations.cpp:35
+
ripple::doBookChanges
Json::Value doBookChanges(RPC::JsonContext &context)
Definition: BookOffers.cpp:205
ripple::doAccountLines
Json::Value doAccountLines(RPC::JsonContext &context)
Definition: AccountLines.cpp:88
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::doFee
Json::Value doFee(RPC::JsonContext &context)
Definition: Fee1.cpp:31
diff --git a/InfoSub_8cpp_source.html b/InfoSub_8cpp_source.html index 3e30325a17..9cb1b20355 100644 --- a/InfoSub_8cpp_source.html +++ b/InfoSub_8cpp_source.html @@ -209,20 +209,20 @@ $(function() {
138 
139 } // namespace ripple
-
ripple::InfoSub::m_consumer
Consumer m_consumer
Definition: InfoSub.h:231
+
ripple::InfoSub::m_consumer
Consumer m_consumer
Definition: InfoSub.h:236
ripple::InfoSub::~InfoSub
virtual ~InfoSub()
Definition: InfoSub.cpp:45
ripple::InfoSub::getRequest
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition: InfoSub.cpp:134
std::shared_ptr
STL class.
-
ripple::InfoSub::realTimeSubscriptions_
hash_set< AccountID > realTimeSubscriptions_
Definition: InfoSub.h:233
+
ripple::InfoSub::realTimeSubscriptions_
hash_set< AccountID > realTimeSubscriptions_
Definition: InfoSub.h:238
ripple::InfoSub::Source::unsubTransactions
virtual bool unsubTransactions(std::uint64_t uListener)=0
ripple::InfoSub::Source::unsubConsensus
virtual bool unsubConsensus(std::uint64_t uListener)=0
ripple::InfoSub::insertSubAccountInfo
void insertSubAccountInfo(AccountID const &account, bool rt)
Definition: InfoSub.cpp:86
std::lock_guard
STL class.
-
ripple::InfoSub::normalSubscriptions_
hash_set< AccountID > normalSubscriptions_
Definition: InfoSub.h:234
+
ripple::InfoSub::normalSubscriptions_
hash_set< AccountID > normalSubscriptions_
Definition: InfoSub.h:239
ripple::InfoSub::clearRequest
void clearRequest()
Definition: InfoSub.cpp:122
ripple::InfoSub::Source::unsubAccountInternal
virtual void unsubAccountInternal(std::uint64_t uListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
ripple::InfoSub::Source::unsubValidations
virtual bool unsubValidations(std::uint64_t uListener)=0
-
ripple::InfoSub::mLock
std::mutex mLock
Definition: InfoSub.h:228
+
ripple::InfoSub::mLock
std::mutex mLock
Definition: InfoSub.h:233
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:75
ripple::InfoSub::Source::unsubAccountHistoryInternal
virtual void unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const &account, bool historyOnly)=0
ripple::InfoSub::Source
Abstracts the source of subscription data.
Definition: InfoSub.h:67
@@ -238,12 +238,12 @@ $(function() {
ripple::InfoSub::insertSubAccountHistory
bool insertSubAccountHistory(AccountID const &account)
Definition: InfoSub.cpp:108
ripple::InfoSub::getSeq
std::uint64_t getSeq()
Definition: InfoSub.cpp:75
ripple::InfoSub::Source::unsubManifests
virtual bool unsubManifests(std::uint64_t uListener)=0
-
ripple::InfoSub::m_source
Source & m_source
Definition: InfoSub.h:232
+
ripple::InfoSub::m_source
Source & m_source
Definition: InfoSub.h:237
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition: Consumer.h:34
-
ripple::InfoSub::mSeq
std::uint64_t mSeq
Definition: InfoSub.h:236
+
ripple::InfoSub::mSeq
std::uint64_t mSeq
Definition: InfoSub.h:241
ripple::InfoSub::getConsumer
Consumer & getConsumer()
Definition: InfoSub.cpp:69
-
ripple::InfoSub::accountHistorySubscriptions_
hash_set< AccountID > accountHistorySubscriptions_
Definition: InfoSub.h:237
-
ripple::InfoSub::request_
std::shared_ptr< InfoSubRequest > request_
Definition: InfoSub.h:235
+
ripple::InfoSub::accountHistorySubscriptions_
hash_set< AccountID > accountHistorySubscriptions_
Definition: InfoSub.h:242
+
ripple::InfoSub::request_
std::shared_ptr< InfoSubRequest > request_
Definition: InfoSub.h:240
ripple::InfoSub::onSendEmpty
void onSendEmpty()
Definition: InfoSub.cpp:81
ripple::InfoSub::InfoSub
InfoSub(Source &source)
Definition: InfoSub.cpp:36
ripple::InfoSub::Source::unsubLedger
virtual bool unsubLedger(std::uint64_t uListener)=0
diff --git a/InfoSub_8h_source.html b/InfoSub_8h_source.html index 9429428d00..f3f6faccdb 100644 --- a/InfoSub_8h_source.html +++ b/InfoSub_8h_source.html @@ -183,132 +183,137 @@ $(function() {
129  unsubLedger(std::uint64_t uListener) = 0;
130 
131  virtual bool
-
132  subManifests(ref ispListener) = 0;
+
132  subBookChanges(ref ispListener) = 0;
133  virtual bool
-
134  unsubManifests(std::uint64_t uListener) = 0;
-
135  virtual void
-
136  pubManifest(Manifest const&) = 0;
-
137 
+
134  unsubBookChanges(std::uint64_t uListener) = 0;
+
135 
+
136  virtual bool
+
137  subManifests(ref ispListener) = 0;
138  virtual bool
-
139  subServer(ref ispListener, Json::Value& jvResult, bool admin) = 0;
-
140  virtual bool
-
141  unsubServer(std::uint64_t uListener) = 0;
+
139  unsubManifests(std::uint64_t uListener) = 0;
+
140  virtual void
+
141  pubManifest(Manifest const&) = 0;
142 
143  virtual bool
-
144  subBook(ref ispListener, Book const&) = 0;
+
144  subServer(ref ispListener, Json::Value& jvResult, bool admin) = 0;
145  virtual bool
-
146  unsubBook(std::uint64_t uListener, Book const&) = 0;
+
146  unsubServer(std::uint64_t uListener) = 0;
147 
148  virtual bool
-
149  subTransactions(ref ispListener) = 0;
+
149  subBook(ref ispListener, Book const&) = 0;
150  virtual bool
-
151  unsubTransactions(std::uint64_t uListener) = 0;
+
151  unsubBook(std::uint64_t uListener, Book const&) = 0;
152 
153  virtual bool
-
154  subRTTransactions(ref ispListener) = 0;
+
154  subTransactions(ref ispListener) = 0;
155  virtual bool
-
156  unsubRTTransactions(std::uint64_t uListener) = 0;
+
156  unsubTransactions(std::uint64_t uListener) = 0;
157 
158  virtual bool
-
159  subValidations(ref ispListener) = 0;
+
159  subRTTransactions(ref ispListener) = 0;
160  virtual bool
-
161  unsubValidations(std::uint64_t uListener) = 0;
+
161  unsubRTTransactions(std::uint64_t uListener) = 0;
162 
163  virtual bool
-
164  subPeerStatus(ref ispListener) = 0;
+
164  subValidations(ref ispListener) = 0;
165  virtual bool
-
166  unsubPeerStatus(std::uint64_t uListener) = 0;
-
167  virtual void
-
168  pubPeerStatus(std::function<Json::Value(void)> const&) = 0;
-
169 
+
166  unsubValidations(std::uint64_t uListener) = 0;
+
167 
+
168  virtual bool
+
169  subPeerStatus(ref ispListener) = 0;
170  virtual bool
-
171  subConsensus(ref ispListener) = 0;
-
172  virtual bool
-
173  unsubConsensus(std::uint64_t uListener) = 0;
+
171  unsubPeerStatus(std::uint64_t uListener) = 0;
+
172  virtual void
+
173  pubPeerStatus(std::function<Json::Value(void)> const&) = 0;
174 
-
175  // VFALCO TODO Remove
-
176  // This was added for one particular partner, it
-
177  // "pushes" subscription data to a particular URL.
-
178  //
-
179  virtual pointer
-
180  findRpcSub(std::string const& strUrl) = 0;
-
181  virtual pointer
-
182  addRpcSub(std::string const& strUrl, ref rspEntry) = 0;
-
183  virtual bool
-
184  tryRemoveRpcSub(std::string const& strUrl) = 0;
-
185  };
-
186 
-
187 public:
-
188  InfoSub(Source& source);
-
189  InfoSub(Source& source, Consumer consumer);
-
190 
-
191  virtual ~InfoSub();
-
192 
-
193  Consumer&
-
194  getConsumer();
+
175  virtual bool
+
176  subConsensus(ref ispListener) = 0;
+
177  virtual bool
+
178  unsubConsensus(std::uint64_t uListener) = 0;
+
179 
+
180  // VFALCO TODO Remove
+
181  // This was added for one particular partner, it
+
182  // "pushes" subscription data to a particular URL.
+
183  //
+
184  virtual pointer
+
185  findRpcSub(std::string const& strUrl) = 0;
+
186  virtual pointer
+
187  addRpcSub(std::string const& strUrl, ref rspEntry) = 0;
+
188  virtual bool
+
189  tryRemoveRpcSub(std::string const& strUrl) = 0;
+
190  };
+
191 
+
192 public:
+
193  InfoSub(Source& source);
+
194  InfoSub(Source& source, Consumer consumer);
195 
-
196  virtual void
-
197  send(Json::Value const& jvObj, bool broadcast) = 0;
-
198 
-
199  std::uint64_t
-
200  getSeq();
-
201 
-
202  void
-
203  onSendEmpty();
-
204 
-
205  void
-
206  insertSubAccountInfo(AccountID const& account, bool rt);
-
207 
-
208  void
-
209  deleteSubAccountInfo(AccountID const& account, bool rt);
-
210 
-
211  // return false if already subscribed to this account
-
212  bool
-
213  insertSubAccountHistory(AccountID const& account);
-
214 
-
215  void
-
216  deleteSubAccountHistory(AccountID const& account);
-
217 
-
218  void
-
219  clearRequest();
-
220 
-
221  void
-
222  setRequest(const std::shared_ptr<InfoSubRequest>& req);
-
223 
-
224  std::shared_ptr<InfoSubRequest> const&
-
225  getRequest();
-
226 
-
227 protected:
-
228  std::mutex mLock;
-
229 
-
230 private:
-
231  Consumer m_consumer;
-
232  Source& m_source;
-
233  hash_set<AccountID> realTimeSubscriptions_;
-
234  hash_set<AccountID> normalSubscriptions_;
-
235  std::shared_ptr<InfoSubRequest> request_;
-
236  std::uint64_t mSeq;
-
237  hash_set<AccountID> accountHistorySubscriptions_;
-
238 
-
239  static int
-
240  assign_id()
-
241  {
-
242  static std::atomic<std::uint64_t> id(0);
-
243  return ++id;
-
244  }
-
245 };
-
246 
-
247 } // namespace ripple
-
248 
-
249 #endif
+
196  virtual ~InfoSub();
+
197 
+
198  Consumer&
+
199  getConsumer();
+
200 
+
201  virtual void
+
202  send(Json::Value const& jvObj, bool broadcast) = 0;
+
203 
+
204  std::uint64_t
+
205  getSeq();
+
206 
+
207  void
+
208  onSendEmpty();
+
209 
+
210  void
+
211  insertSubAccountInfo(AccountID const& account, bool rt);
+
212 
+
213  void
+
214  deleteSubAccountInfo(AccountID const& account, bool rt);
+
215 
+
216  // return false if already subscribed to this account
+
217  bool
+
218  insertSubAccountHistory(AccountID const& account);
+
219 
+
220  void
+
221  deleteSubAccountHistory(AccountID const& account);
+
222 
+
223  void
+
224  clearRequest();
+
225 
+
226  void
+
227  setRequest(const std::shared_ptr<InfoSubRequest>& req);
+
228 
+
229  std::shared_ptr<InfoSubRequest> const&
+
230  getRequest();
+
231 
+
232 protected:
+
233  std::mutex mLock;
+
234 
+
235 private:
+
236  Consumer m_consumer;
+
237  Source& m_source;
+
238  hash_set<AccountID> realTimeSubscriptions_;
+
239  hash_set<AccountID> normalSubscriptions_;
+
240  std::shared_ptr<InfoSubRequest> request_;
+
241  std::uint64_t mSeq;
+
242  hash_set<AccountID> accountHistorySubscriptions_;
+
243 
+
244  static int
+
245  assign_id()
+
246  {
+
247  static std::atomic<std::uint64_t> id(0);
+
248  return ++id;
+
249  }
+
250 };
+
251 
+
252 } // namespace ripple
+
253 
+
254 #endif
-
ripple::InfoSub::m_consumer
Consumer m_consumer
Definition: InfoSub.h:231
+
ripple::InfoSub::m_consumer
Consumer m_consumer
Definition: InfoSub.h:236
ripple::InfoSub::~InfoSub
virtual ~InfoSub()
Definition: InfoSub.cpp:45
ripple::InfoSub::getRequest
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition: InfoSub.cpp:134
ripple::CountedObject
Tracks the number of instances of an object.
Definition: CountedObject.h:124
std::string
STL class.
std::shared_ptr
STL class.
-
ripple::InfoSub::realTimeSubscriptions_
hash_set< AccountID > realTimeSubscriptions_
Definition: InfoSub.h:233
+
ripple::InfoSub::realTimeSubscriptions_
hash_set< AccountID > realTimeSubscriptions_
Definition: InfoSub.h:238
ripple::InfoSubRequest
Definition: InfoSub.h:36
ripple::InfoSub::Source::unsubTransactions
virtual bool unsubTransactions(std::uint64_t uListener)=0
ripple::InfoSub::Source::pubManifest
virtual void pubManifest(Manifest const &)=0
@@ -319,11 +324,12 @@ $(function() {
ripple::InfoSub::send
virtual void send(Json::Value const &jvObj, bool broadcast)=0
ripple::InfoSub::Source::subValidations
virtual bool subValidations(ref ispListener)=0
ripple::InfoSub::insertSubAccountInfo
void insertSubAccountInfo(AccountID const &account, bool rt)
Definition: InfoSub.cpp:86
-
ripple::InfoSub::normalSubscriptions_
hash_set< AccountID > normalSubscriptions_
Definition: InfoSub.h:234
+
ripple::InfoSub::normalSubscriptions_
hash_set< AccountID > normalSubscriptions_
Definition: InfoSub.h:239
ripple::InfoSubRequest::doClose
virtual Json::Value doClose()=0
+
ripple::InfoSub::Source::subBookChanges
virtual bool subBookChanges(ref ispListener)=0
ripple::InfoSub::clearRequest
void clearRequest()
Definition: InfoSub.cpp:122
std::function
-
ripple::InfoSub::assign_id
static int assign_id()
Definition: InfoSub.h:240
+
ripple::InfoSub::assign_id
static int assign_id()
Definition: InfoSub.h:245
ripple::InfoSub::Source::subRTTransactions
virtual bool subRTTransactions(ref ispListener)=0
ripple::InfoSub::Source::subTransactions
virtual bool subTransactions(ref ispListener)=0
ripple::InfoSub::Source::subAccountHistory
virtual error_code_i subAccountHistory(ref ispListener, AccountID const &account)=0
subscribe an account's new transactions and retrieve the account's historical transactions
@@ -332,7 +338,7 @@ $(function() {
ripple::error_code_i
error_code_i
Definition: ErrorCodes.h:40
ripple::InfoSub::Source::subBook
virtual bool subBook(ref ispListener, Book const &)=0
ripple::InfoSub::Source::findRpcSub
virtual pointer findRpcSub(std::string const &strUrl)=0
-
ripple::InfoSub::mLock
std::mutex mLock
Definition: InfoSub.h:228
+
ripple::InfoSub::mLock
std::mutex mLock
Definition: InfoSub.h:233
ripple::InfoSub::Source::subManifests
virtual bool subManifests(ref ispListener)=0
ripple::base_uint< 160, detail::AccountIDTag >
ripple::InfoSub::Source::unsubAccountHistoryInternal
virtual void unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const &account, bool historyOnly)=0
@@ -357,19 +363,20 @@ $(function() {
ripple::InfoSubRequest::~InfoSubRequest
virtual ~InfoSubRequest()=default
ripple::InfoSub::deleteSubAccountHistory
void deleteSubAccountHistory(AccountID const &account)
Definition: InfoSub.cpp:115
ripple::InfoSub::insertSubAccountHistory
bool insertSubAccountHistory(AccountID const &account)
Definition: InfoSub.cpp:108
+
ripple::InfoSub::Source::unsubBookChanges
virtual bool unsubBookChanges(std::uint64_t uListener)=0
ripple::InfoSub::getSeq
std::uint64_t getSeq()
Definition: InfoSub.cpp:75
ripple::InfoSub::Source::unsubManifests
virtual bool unsubManifests(std::uint64_t uListener)=0
ripple::InfoSub::Source::tryRemoveRpcSub
virtual bool tryRemoveRpcSub(std::string const &strUrl)=0
-
ripple::InfoSub::m_source
Source & m_source
Definition: InfoSub.h:232
+
ripple::InfoSub::m_source
Source & m_source
Definition: InfoSub.h:237
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition: Consumer.h:34
-
ripple::InfoSub::mSeq
std::uint64_t mSeq
Definition: InfoSub.h:236
+
ripple::InfoSub::mSeq
std::uint64_t mSeq
Definition: InfoSub.h:241
mutex
ripple::InfoSub::getConsumer
Consumer & getConsumer()
Definition: InfoSub.cpp:69
ripple::Book
Specifies an order book.
Definition: Book.h:33
-
ripple::InfoSub::accountHistorySubscriptions_
hash_set< AccountID > accountHistorySubscriptions_
Definition: InfoSub.h:237
+
ripple::InfoSub::accountHistorySubscriptions_
hash_set< AccountID > accountHistorySubscriptions_
Definition: InfoSub.h:242
ripple::InfoSub::Source::subConsensus
virtual bool subConsensus(ref ispListener)=0
ripple::InfoSub::Source::subPeerStatus
virtual bool subPeerStatus(ref ispListener)=0
-
ripple::InfoSub::request_
std::shared_ptr< InfoSubRequest > request_
Definition: InfoSub.h:235
+
ripple::InfoSub::request_
std::shared_ptr< InfoSubRequest > request_
Definition: InfoSub.h:240
ripple::InfoSub::onSendEmpty
void onSendEmpty()
Definition: InfoSub.cpp:81
ripple::InfoSub::Source::subServer
virtual bool subServer(ref ispListener, Json::Value &jvResult, bool admin)=0
ripple::InfoSub::Source::subAccount
virtual void subAccount(ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
diff --git a/KeyGeneration__test_8cpp_source.html b/KeyGeneration__test_8cpp_source.html index 7c57e54e88..6e79791396 100644 --- a/KeyGeneration__test_8cpp_source.html +++ b/KeyGeneration__test_8cpp_source.html @@ -976,7 +976,7 @@ $(function() {
ripple::TestSuite
Definition: TestSuite.h:28
ripple::RPC::WalletPropose_test::testRippleLibEd25519
void testRippleLibEd25519()
Definition: KeyGeneration_test.cpp:739
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::RPC::keypairForSignature
std::pair< PublicKey, SecretKey > keypairForSignature(Json::Value const &params, Json::Value &error)
Definition: RPCHelpers.cpp:756
+
ripple::RPC::keypairForSignature
std::pair< PublicKey, SecretKey > keypairForSignature(Json::Value const &params, Json::Value &error)
Definition: RPCHelpers.cpp:758
ripple::TokenType::AccountPublic
@ AccountPublic
ripple::RPC::WalletPropose_test::testSecretWallet
Json::Value testSecretWallet(Json::Value const &params, key_strings const &s)
Definition: KeyGeneration_test.cpp:130
ripple::RPC::common::passphrase
static char const * passphrase
Definition: KeyGeneration_test.cpp:47
diff --git a/LedgerData_8cpp_source.html b/LedgerData_8cpp_source.html index 854d194670..4d1da419d7 100644 --- a/LedgerData_8cpp_source.html +++ b/LedgerData_8cpp_source.html @@ -285,7 +285,7 @@ $(function() {
ripple::LedgerInfo::seq
LedgerIndex seq
Definition: ReadView.h:93
ripple::RPC::Context::role
Role role
Definition: Context.h:47
ripple::base_uint< 256 >::fromVoidChecked
static std::optional< base_uint > fromVoidChecked(T const &from)
Definition: base_uint.h:312
-
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:582
+
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:584
ripple::RPC::expected_field_error
Json::Value expected_field_error(std::string const &name, std::string const &type)
Definition: ErrorCodes.h:312
ripple::base_uint< 256 >
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
@@ -305,7 +305,7 @@ $(function() {
ripple::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition: LedgerToJson.cpp:291
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:886
+
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:888
ripple::Serializer::peekData
Blob const & peekData() const
Definition: Serializer.h:168
Json::Value::isIntegral
bool isIntegral() const
Definition: json_value.cpp:991
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:41
@@ -315,7 +315,7 @@ $(function() {
ripple::LedgerFill
Definition: LedgerToJson.h:33
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
std::vector::data
T data(T... args)
-
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:295
+
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:297
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/LedgerDiff_8cpp_source.html b/LedgerDiff_8cpp_source.html index 656e5737a7..bb3f5d466b 100644 --- a/LedgerDiff_8cpp_source.html +++ b/LedgerDiff_8cpp_source.html @@ -165,7 +165,7 @@ $(function() {
std::map
STL class.
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::RPC::ledgerFromSpecifier
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context &context)
Definition: RPCHelpers.cpp:327
+
ripple::RPC::ledgerFromSpecifier
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context &context)
Definition: RPCHelpers.cpp:329
ripple::SHAMap::compare
bool compare(SHAMap const &otherMap, Delta &differences, int maxCount) const
Definition: SHAMapDelta.cpp:128
std::numeric_limits::max
T max(T... args)
diff --git a/LedgerEntry_8cpp_source.html b/LedgerEntry_8cpp_source.html index 16b23ddfcb..de371067c7 100644 --- a/LedgerEntry_8cpp_source.html +++ b/LedgerEntry_8cpp_source.html @@ -538,7 +538,7 @@ $(function() {
Json::Value::isNull
bool isNull() const
isNull() tests to see if this field is null.
Definition: json_value.cpp:967
ripple::ltCHECK
@ ltCHECK
A ledger object which describes a check.
Definition: LedgerFormats.h:136
ripple::base_uint< 256 >::fromVoidChecked
static std::optional< base_uint > fromVoidChecked(T const &from)
Definition: base_uint.h:312
-
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:582
+
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:584
ripple::getTicketIndex
uint256 getTicketIndex(AccountID const &account, std::uint32_t ticketSeq)
Definition: Indexes.cpp:115
ripple::ltDIR_NODE
@ ltDIR_NODE
A ledger object which contains a list of object identifiers.
Definition: LedgerFormats.h:66
Json::Value::asBool
bool asBool() const
Definition: json_value.cpp:619
@@ -579,7 +579,7 @@ $(function() {
ripple::keylet::depositPreauth
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
Definition: Indexes.cpp:287
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
std::vector::data
T data(T... args)
-
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:295
+
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:297
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::ltPAYCHAN
@ ltPAYCHAN
A ledger object describing a single unidirectional XRP payment channel.
Definition: LedgerFormats.h:130
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
diff --git a/LedgerHandler_8cpp_source.html b/LedgerHandler_8cpp_source.html index 6e8c4231e2..505a34a2d5 100644 --- a/LedgerHandler_8cpp_source.html +++ b/LedgerHandler_8cpp_source.html @@ -405,7 +405,7 @@ $(function() {
ripple::getQualityNext
uint256 getQualityNext(uint256 const &uBase)
Definition: Indexes.cpp:100
ripple::RPC::Context::role
Role role
Definition: Context.h:47
ripple::LedgerFill::expand
@ expand
Definition: LedgerToJson.h:48
-
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:582
+
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:584
ripple::Application::getFeeTrack
virtual LoadFeeTrack & getFeeTrack()=0
ripple::ltDIR_NODE
@ ltDIR_NODE
A ledger object which contains a list of object identifiers.
Definition: LedgerFormats.h:66
ripple::Serializer::data
void const * data() const noexcept
Definition: Serializer.h:75
@@ -431,11 +431,11 @@ $(function() {
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::LedgerFill::ownerFunds
@ ownerFunds
Definition: LedgerToJson.h:51
-
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:510
+
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:512
ripple::RPC::LedgerHandler::LedgerHandler
LedgerHandler(JsonContext &)
Definition: LedgerHandler.cpp:36
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:53
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:203
-
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:886
+
ripple::RPC::chooseLedgerEntryType
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const &params)
Definition: RPCHelpers.cpp:888
ripple::rpcNO_PERMISSION
@ rpcNO_PERMISSION
Definition: ErrorCodes.h:53
ripple::SHAMap::end
const_iterator end() const
Definition: SHAMap.h:744
ripple::RPC::LedgerHandler::type_
LedgerEntryType type_
Definition: LedgerHandler.h:85
@@ -451,7 +451,7 @@ $(function() {
ripple::Serializer::getLength
int getLength() const
Definition: Serializer.h:199
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
std::vector::data
T data(T... args)
-
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:295
+
ripple::RPC::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
Definition: RPCHelpers.cpp:297
ripple::Resource::feeHighBurdenRPC
const Charge feeHighBurdenRPC
ripple::RPC::LedgerHandler::result_
Json::Value result_
Definition: LedgerHandler.h:83
ripple::ReadView::txs
txs_type txs
Definition: ReadView.h:333
diff --git a/LedgerHeader_8cpp_source.html b/LedgerHeader_8cpp_source.html index 0701271848..b7c65a6eb2 100644 --- a/LedgerHeader_8cpp_source.html +++ b/LedgerHeader_8cpp_source.html @@ -126,7 +126,7 @@ $(function() {
ripple::RPC::JsonContext
Definition: Context.h:53
std::shared_ptr
STL class.
ripple::addRaw
void addRaw(LedgerInfo const &info, Serializer &s, bool includeHash)
Definition: View.cpp:162
-
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:582
+
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:584
ripple::Serializer
Definition: Serializer.h:39
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Serializer::peekData
Blob const & peekData() const
Definition: Serializer.h:168
diff --git a/LedgerRequestRPC__test_8cpp_source.html b/LedgerRequestRPC__test_8cpp_source.html index 40f27a3757..e8790fe700 100644 --- a/LedgerRequestRPC__test_8cpp_source.html +++ b/LedgerRequestRPC__test_8cpp_source.html @@ -470,7 +470,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::LedgerRequestRPC_test::testLedgerRequest
void testLedgerRequest()
Definition: LedgerRequestRPC_test.cpp:35
Json::nullValue
@ nullValue
'null' value
Definition: json_value.h:36
-
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
+
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:244
ripple::FeatureBitset
Definition: Feature.h:113
ripple::RPC::LedgerRequestRPC_test::testBadInput
void testBadInput()
Definition: LedgerRequestRPC_test.cpp:276
ripple::RPC::LedgerRequestRPC_test::testMoreThan256Closed
void testMoreThan256Closed()
Definition: LedgerRequestRPC_test.cpp:317
diff --git a/LedgerRequest_8cpp_source.html b/LedgerRequest_8cpp_source.html index 06b211561e..5718236162 100644 --- a/LedgerRequest_8cpp_source.html +++ b/LedgerRequest_8cpp_source.html @@ -97,175 +97,40 @@ $(function() {
26 #include <ripple/protocol/jss.h>
27 #include <ripple/resource/Fees.h>
28 #include <ripple/rpc/Context.h>
-
29 #include <ripple/rpc/impl/Tuning.h>
-
30 
-
31 namespace ripple {
+
29 #include <ripple/rpc/impl/RPCHelpers.h>
+
30 #include <ripple/rpc/impl/Tuning.h>
+
31 #include <variant>
32 
-
33 // {
-
34 // ledger_hash : <ledger>
-
35 // ledger_index : <ledger_index>
-
36 // }
-
37 Json::Value
-
38 doLedgerRequest(RPC::JsonContext& context)
-
39 {
-
40  if (context.app.config().reporting())
-
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);
-
45  std::uint32_t ledgerIndex = 0;
+
33 namespace ripple {
+
34 
+
35 // {
+
36 // ledger_hash : <ledger>
+
37 // ledger_index : <ledger_index>
+
38 // }
+
39 Json::Value
+
40 doLedgerRequest(RPC::JsonContext& context)
+
41 {
+
42  auto res = getLedgerByContext(context);
+
43 
+
44  if (std::holds_alternative<Json::Value>(res))
+
45  return std::get<Json::Value>(res);
46 
-
47  auto& ledgerMaster = context.app.getLedgerMaster();
-
48  LedgerHash ledgerHash;
-
49 
-
50  if ((hasHash && hasIndex) || !(hasHash || hasIndex))
-
51  {
-
52  return RPC::make_param_error(
-
53  "Exactly one of ledger_hash and ledger_index can be set.");
-
54  }
-
55 
-
56  context.loadType = Resource::feeHighBurdenRPC;
-
57 
-
58  if (hasHash)
-
59  {
-
60  auto const& jsonHash = context.params[jss::ledger_hash];
-
61  if (!jsonHash.isString() || !ledgerHash.parseHex(jsonHash.asString()))
-
62  return RPC::invalid_field_error(jss::ledger_hash);
-
63  }
-
64  else
-
65  {
-
66  auto const& jsonIndex = context.params[jss::ledger_index];
-
67  if (!jsonIndex.isInt())
-
68  return RPC::invalid_field_error(jss::ledger_index);
-
69 
-
70  // We need a validated ledger to get the hash from the sequence
-
71  if (ledgerMaster.getValidatedLedgerAge() >
-
72  RPC::Tuning::maxValidatedLedgerAge)
-
73  {
-
74  if (context.apiVersion == 1)
-
75  return rpcError(rpcNO_CURRENT);
-
76  return rpcError(rpcNOT_SYNCED);
-
77  }
-
78 
-
79  ledgerIndex = jsonIndex.asInt();
-
80  auto ledger = ledgerMaster.getValidatedLedger();
-
81 
-
82  if (ledgerIndex >= ledger->info().seq)
-
83  return RPC::make_param_error("Ledger index too large");
-
84  if (ledgerIndex <= 0)
-
85  return RPC::make_param_error("Ledger index too small");
-
86 
-
87  auto const j = context.app.journal("RPCHandler");
-
88  // Try to get the hash of the desired ledger from the validated ledger
-
89  auto neededHash = hashOfSeq(*ledger, ledgerIndex, j);
-
90  if (!neededHash)
-
91  {
-
92  // Find a ledger more likely to have the hash of the desired ledger
-
93  auto const refIndex = getCandidateLedger(ledgerIndex);
-
94  auto refHash = hashOfSeq(*ledger, refIndex, j);
-
95  assert(refHash);
-
96 
-
97  ledger = ledgerMaster.getLedgerByHash(*refHash);
-
98  if (!ledger)
-
99  {
-
100  // We don't have the ledger we need to figure out which ledger
-
101  // they want. Try to get it.
-
102 
-
103  if (auto il = context.app.getInboundLedgers().acquire(
-
104  *refHash, refIndex, InboundLedger::Reason::GENERIC))
-
105  {
-
106  Json::Value jvResult = RPC::make_error(
-
107  rpcLGR_NOT_FOUND,
-
108  "acquiring ledger containing requested index");
-
109  jvResult[jss::acquiring] =
-
110  getJson(LedgerFill(*il, &context));
-
111  return jvResult;
-
112  }
-
113 
-
114  if (auto il = context.app.getInboundLedgers().find(*refHash))
-
115  {
-
116  Json::Value jvResult = RPC::make_error(
-
117  rpcLGR_NOT_FOUND,
-
118  "acquiring ledger containing requested index");
-
119  jvResult[jss::acquiring] = il->getJson(0);
-
120  return jvResult;
-
121  }
-
122 
-
123  // Likely the app is shutting down
-
124  return Json::Value();
-
125  }
-
126 
-
127  neededHash = hashOfSeq(*ledger, ledgerIndex, j);
-
128  }
-
129  assert(neededHash);
-
130  ledgerHash = neededHash ? *neededHash : beast::zero; // kludge
-
131  }
-
132 
-
133  // Try to get the desired ledger
-
134  // Verify all nodes even if we think we have it
-
135  auto ledger = context.app.getInboundLedgers().acquire(
-
136  ledgerHash, ledgerIndex, InboundLedger::Reason::GENERIC);
-
137 
-
138  // In standalone mode, accept the ledger from the ledger cache
-
139  if (!ledger && context.app.config().standalone())
-
140  ledger = ledgerMaster.getLedgerByHash(ledgerHash);
-
141 
-
142  if (ledger)
-
143  {
-
144  // We already had the entire ledger verified/acquired
-
145  Json::Value jvResult;
-
146  jvResult[jss::ledger_index] = ledger->info().seq;
-
147  addJson(jvResult, {*ledger, &context, 0});
-
148  return jvResult;
-
149  }
-
150 
-
151  if (auto il = context.app.getInboundLedgers().find(ledgerHash))
-
152  return il->getJson(0);
-
153 
-
154  return RPC::make_error(
-
155  rpcNOT_READY, "findCreate failed to return an inbound ledger");
-
156 }
-
157 
-
158 } // namespace ripple
+
47  auto const& ledger = std::get<std::shared_ptr<Ledger const>>(res);
+
48 
+
49  Json::Value jvResult;
+
50  jvResult[jss::ledger_index] = ledger->info().seq;
+
51  addJson(jvResult, {*ledger, &context, 0});
+
52  return jvResult;
+
53 }
+
54 
+
55 } // namespace ripple
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
-
ripple::rpcLGR_NOT_FOUND
@ rpcLGR_NOT_FOUND
Definition: ErrorCodes.h:72
-
ripple::rpcREPORTING_UNSUPPORTED
@ rpcREPORTING_UNSUPPORTED
Definition: ErrorCodes.h:141
-
ripple::Application::getInboundLedgers
virtual InboundLedgers & getInboundLedgers()=0
-
ripple::base_uint< 256 >
-
ripple::Config::reporting
bool reporting() const
Definition: Config.h:316
-
ripple::Application::getLedgerMaster
virtual LedgerMaster & getLedgerMaster()=0
-
ripple::InboundLedgers::acquire
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
-
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:38
-
ripple::Application::config
virtual Config & config()=0
-
ripple::Config::standalone
bool standalone() const
Definition: Config.h:311
-
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:644
-
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::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition: LedgerToJson.cpp:291
+
ripple::doLedgerRequest
Json::Value doLedgerRequest(RPC::JsonContext &)
Definition: LedgerRequest.cpp:40
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
-
ripple::RPC::Context::apiVersion
unsigned int apiVersion
Definition: Context.h:50
ripple::addJson
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.
Definition: LedgerToJson.cpp:281
-
ripple::base_uint::parseHex
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:489
-
ripple::getCandidateLedger
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition: View.h:214
-
ripple::RPC::make_param_error
Json::Value make_param_error(std::string const &message)
Returns a new json object that indicates invalid parameters.
Definition: ErrorCodes.h:234
-
ripple::LedgerFill
Definition: LedgerToJson.h:33
-
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:288
-
ripple::Resource::feeHighBurdenRPC
const Charge feeHighBurdenRPC
-
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:188
-
ripple::RPC::Tuning::maxValidatedLedgerAge
constexpr auto maxValidatedLedgerAge
Definition: rpc/impl/Tuning.h:65
-
ripple::rpcNOT_SYNCED
@ rpcNOT_SYNCED
Definition: ErrorCodes.h:67
Json::Value
Represents a JSON value.
Definition: json_value.h:145
-
ripple::InboundLedgers::find
virtual std::shared_ptr< InboundLedger > find(LedgerHash const &hash)=0
+
variant