From 42a432c5dc2af2754f4083b93f0ee0d616092681 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 10 Dec 2025 13:43:02 -0500 Subject: [PATCH 01/20] refactor: clean up `RPCHelpers` (#5684) This PR cleans up `RPCHelpers.h` and `RPCHelpers.cpp`. It splits out all the fetch-ledger functions to a new set of files, `RPCLedgerHelpers.h`/`RPCLedgerHelpers.cpp`, and moves the general-API functions to `ApiVersion.h`. There is no functionality change. --- include/xrpl/protocol/ApiVersion.h | 2 +- src/test/rpc/AccountCurrencies_test.cpp | 4 +- src/test/rpc/AccountLines_test.cpp | 38 ++- src/test/rpc/DepositAuthorized_test.cpp | 5 +- src/test/rpc/LedgerEntry_test.cpp | 8 +- src/test/rpc/LedgerRPC_test.cpp | 35 ++- ...estRPC_test.cpp => LedgerRequest_test.cpp} | 53 ++-- src/test/rpc/NoRippleCheck_test.cpp | 34 ++- src/xrpld/app/ledger/LedgerToJson.h | 4 +- src/xrpld/rpc/detail/Handler.cpp | 1 + src/xrpld/rpc/detail/RPCHelpers.cpp | 82 ------ src/xrpld/rpc/detail/RPCHelpers.h | 161 +++++++----- src/xrpld/rpc/detail/RPCLedgerHelpers.cpp | 235 +++++++++++------- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 171 +++++++++---- src/xrpld/rpc/detail/ServerHandler.cpp | 8 + src/xrpld/rpc/handlers/AMMInfo.cpp | 22 +- src/xrpld/rpc/handlers/AccountInfo.cpp | 42 +++- src/xrpld/rpc/handlers/AccountObjects.cpp | 9 + src/xrpld/rpc/handlers/AccountTx.cpp | 6 +- src/xrpld/rpc/handlers/LedgerRequest.cpp | 12 +- 20 files changed, 579 insertions(+), 353 deletions(-) rename src/test/rpc/{LedgerRequestRPC_test.cpp => LedgerRequest_test.cpp} (89%) diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index 56d607a39b..d83884008d 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -95,7 +95,7 @@ setVersion(JsonObject& parent, unsigned int apiVersion, bool betaEnabled) * 3) the version number is unspecified and * APIVersionIfUnspecified is out of the supported range * - * @param jv a Json value that may or may not specifies + * @param jv a Json value that may or may not specify * the api version number * @param betaEnabled if the beta API version is enabled * @return the api version number diff --git a/src/test/rpc/AccountCurrencies_test.cpp b/src/test/rpc/AccountCurrencies_test.cpp index dd62d2fea4..c4833d11d4 100644 --- a/src/test/rpc/AccountCurrencies_test.cpp +++ b/src/test/rpc/AccountCurrencies_test.cpp @@ -26,7 +26,9 @@ class AccountCurrencies_test : public beast::unit_test::suite auto const result = env.rpc( "json", "account_currencies", to_string(params))[jss::result]; BEAST_EXPECT(result[jss::error] == "invalidParams"); - BEAST_EXPECT(result[jss::error_message] == "ledgerHashNotString"); + BEAST_EXPECT( + result[jss::error_message] == + "Invalid field 'ledger_hash', not hex string."); } { // missing account field diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index d1bdc20687..e062959769 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -89,7 +89,7 @@ public: env.rpc("json", "account_lines", to_string(params)); BEAST_EXPECT( lines[jss::result][jss::error_message] == - "ledgerIndexMalformed"); + "Invalid field 'ledger_index', not string or number."); } { // Specify a different ledger that doesn't exist. @@ -190,16 +190,30 @@ public: testAccountLinesHistory(alice, ledger58Info, 52); { - // Surprisingly, it's valid to specify both index and hash, in - // which case the hash wins. + // Invalid to specify both index and hash Json::Value params; params[jss::account] = alice.human(); params[jss::ledger_hash] = to_string(ledger4Info.hash); params[jss::ledger_index] = ledger58Info.seq; - auto const lines = - env.rpc("json", "account_lines", to_string(params)); - BEAST_EXPECT(lines[jss::result][jss::lines].isArray()); - BEAST_EXPECT(lines[jss::result][jss::lines].size() == 26); + auto const lines = env.rpc( + "json", "account_lines", to_string(params))[jss::result]; + BEAST_EXPECT(lines[jss::error] == "invalidParams"); + BEAST_EXPECT( + lines[jss::error_message] == + "Exactly one of 'ledger_hash' or 'ledger_index' can be " + "specified."); + } + { + // Invalid index + Json::Value params; + params[jss::account] = alice.human(); + params[jss::ledger_index] = Json::objectValue; + auto const lines = env.rpc( + "json", "account_lines", to_string(params))[jss::result]; + BEAST_EXPECT(lines[jss::error] == "invalidParams"); + BEAST_EXPECT( + lines[jss::error_message] == + "Invalid field 'ledger_index', not string or number."); } { // alice should have 52 trust lines in the current ledger. @@ -839,7 +853,8 @@ public: request[jss::params] = params; auto const lines = env.rpc("json2", to_string(request)); BEAST_EXPECT( - lines[jss::error][jss::message] == "ledgerIndexMalformed"); + lines[jss::error][jss::message] == + "Invalid field 'ledger_index', not string or number."); BEAST_EXPECT( lines.isMember(jss::jsonrpc) && lines[jss::jsonrpc] == "2.0"); BEAST_EXPECT( @@ -994,8 +1009,11 @@ public: request[jss::id] = 5; request[jss::params] = params; auto const lines = env.rpc("json2", to_string(request)); - BEAST_EXPECT(lines[jss::result][jss::lines].isArray()); - BEAST_EXPECT(lines[jss::result][jss::lines].size() == 26); + BEAST_EXPECT(lines[jss::error][jss::error] == "invalidParams"); + BEAST_EXPECT( + lines[jss::error][jss::message] == + "Exactly one of 'ledger_hash' or 'ledger_index' can be " + "specified."); BEAST_EXPECT( lines.isMember(jss::jsonrpc) && lines[jss::jsonrpc] == "2.0"); BEAST_EXPECT( diff --git a/src/test/rpc/DepositAuthorized_test.cpp b/src/test/rpc/DepositAuthorized_test.cpp index b20f53592f..8ed52542d6 100644 --- a/src/test/rpc/DepositAuthorized_test.cpp +++ b/src/test/rpc/DepositAuthorized_test.cpp @@ -224,7 +224,10 @@ public: Json::Value args{depositAuthArgs(alice, becky, "-1")}; Json::Value const result{ env.rpc("json", "deposit_authorized", args.toStyledString())}; - verifyErr(result, "invalidParams", "ledgerIndexMalformed"); + verifyErr( + result, + "invalidParams", + "Invalid field 'ledger_index', not string or number."); } { // Request a ledger that doesn't exist yet as a string. diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index a0fde0f457..372f5676b0 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -477,10 +477,10 @@ class LedgerEntry_test : public beast::unit_test::suite "json", "ledger_entry", to_string(jvParams))[jss::result]; - auto const expectedErrMsg = fieldValue.isString() - ? "ledgerHashMalformed" - : "ledgerHashNotString"; - checkErrorValue(jrr, "invalidParams", expectedErrMsg); + checkErrorValue( + jrr, + "invalidParams", + "Invalid field 'ledger_hash', not hex string."); }; auto const& badValues = getBadValues(typeId); diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 57a20527d0..4a90793fa2 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -35,7 +35,10 @@ class LedgerRPC_test : public beast::unit_test::suite jv[jss::error_message] == ""); } else if (BEAST_EXPECT(jv.isMember(jss::error_message))) - BEAST_EXPECT(jv[jss::error_message] == msg); + BEAST_EXPECTS( + jv[jss::error_message] == msg, + "Expected error message \"" + msg + "\", received \"" + + jv[jss::error_message].asString() + "\""); } // Corrupt a valid address by replacing the 10th character with '!'. @@ -111,7 +114,10 @@ class LedgerRPC_test : public beast::unit_test::suite jvParams[jss::ledger_index] = "potato"; auto const jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; - checkErrorValue(jrr, "invalidParams", "ledgerIndexMalformed"); + checkErrorValue( + jrr, + "invalidParams", + "Invalid field 'ledger_index', not string or number."); } { @@ -120,7 +126,10 @@ class LedgerRPC_test : public beast::unit_test::suite jvParams[jss::ledger_index] = -1; auto const jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; - checkErrorValue(jrr, "invalidParams", "ledgerIndexMalformed"); + checkErrorValue( + jrr, + "invalidParams", + "Invalid field 'ledger_index', not string or number."); } { @@ -289,7 +298,9 @@ class LedgerRPC_test : public beast::unit_test::suite jvParams[jss::ledger] = "invalid"; jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr[jss::error] == "invalidParams"); - BEAST_EXPECT(jrr[jss::error_message] == "ledgerIndexMalformed"); + BEAST_EXPECT( + jrr[jss::error_message] == + "Invalid field 'ledger', not string or number."); // numeric index jvParams[jss::ledger] = 4; @@ -322,13 +333,17 @@ class LedgerRPC_test : public beast::unit_test::suite jvParams[jss::ledger_hash] = "DEADBEEF" + hash3; jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr[jss::error] == "invalidParams"); - BEAST_EXPECT(jrr[jss::error_message] == "ledgerHashMalformed"); + BEAST_EXPECT( + jrr[jss::error_message] == + "Invalid field 'ledger_hash', not hex string."); // request with non-string ledger_hash jvParams[jss::ledger_hash] = 2; jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr[jss::error] == "invalidParams"); - BEAST_EXPECT(jrr[jss::error_message] == "ledgerHashNotString"); + BEAST_EXPECT( + jrr[jss::error_message] == + "Invalid field 'ledger_hash', not hex string."); // malformed (non hex) hash jvParams[jss::ledger_hash] = @@ -336,7 +351,9 @@ class LedgerRPC_test : public beast::unit_test::suite "7F2775F2F7485BB37307984C3C0F2340"; jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr[jss::error] == "invalidParams"); - BEAST_EXPECT(jrr[jss::error_message] == "ledgerHashMalformed"); + BEAST_EXPECT( + jrr[jss::error_message] == + "Invalid field 'ledger_hash', not hex string."); // properly formed, but just doesn't exist jvParams[jss::ledger_hash] = @@ -374,7 +391,9 @@ class LedgerRPC_test : public beast::unit_test::suite jvParams[jss::ledger_index] = "invalid"; jrr = env.rpc("json", "ledger", to_string(jvParams))[jss::result]; BEAST_EXPECT(jrr[jss::error] == "invalidParams"); - BEAST_EXPECT(jrr[jss::error_message] == "ledgerIndexMalformed"); + BEAST_EXPECT( + jrr[jss::error_message] == + "Invalid field 'ledger_index', not string or number."); // numeric index for (auto i : {1, 2, 3, 4, 5, 6}) diff --git a/src/test/rpc/LedgerRequestRPC_test.cpp b/src/test/rpc/LedgerRequest_test.cpp similarity index 89% rename from src/test/rpc/LedgerRequestRPC_test.cpp rename to src/test/rpc/LedgerRequest_test.cpp index 0751b120aa..68d29d1901 100644 --- a/src/test/rpc/LedgerRequestRPC_test.cpp +++ b/src/test/rpc/LedgerRequest_test.cpp @@ -12,7 +12,7 @@ namespace ripple { namespace RPC { -class LedgerRequestRPC_test : public beast::unit_test::suite +class LedgerRequest_test : public beast::unit_test::suite { static constexpr char const* hash1 = "3020EB9E7BE24EF7D7A060CB051583EC117384636D1781AFB5B87F3E348DA489"; @@ -115,7 +115,7 @@ public: BEAST_EXPECT( RPC::contains_error(result[jss::result]) && result[jss::result][jss::error_message] == - "Invalid field 'ledger_hash'."); + "Invalid field 'ledger_hash', not hex string."); } { @@ -262,22 +262,43 @@ public: env.fund(XRP(100000), gw); env.close(); - Json::Value jvParams; - jvParams[jss::ledger_hash] = - "AB868A6CFEEC779C2FF845C0AF00A642259986AF40C01976A7F842B6918936C7"; - jvParams[jss::ledger_index] = "1"; - auto result = env.rpc( - "json", "ledger_request", jvParams.toStyledString())[jss::result]; - BEAST_EXPECT(result[jss::error] == "invalidParams"); - BEAST_EXPECT(result[jss::status] == "error"); - BEAST_EXPECT( - result[jss::error_message] == - "Exactly one of ledger_hash and ledger_index can be set."); + { + Json::Value jvParams; + jvParams[jss::ledger_hash] = + "AB868A6CFEEC779C2FF845C0AF00A642259986AF40C01976A7F842B6918936" + "C7"; + jvParams[jss::ledger_index] = "1"; + auto const result = env.rpc( + "json", + "ledger_request", + jvParams.toStyledString())[jss::result]; + BEAST_EXPECT(result[jss::error] == "invalidParams"); + BEAST_EXPECT(result[jss::status] == "error"); + BEAST_EXPECT( + result[jss::error_message] == + "Exactly one of 'ledger_hash' or 'ledger_index' can be " + "specified."); + } + + { + Json::Value jvParams; + jvParams[jss::ledger_index] = "index"; + auto const result = env.rpc( + "json", + "ledger_request", + jvParams.toStyledString())[jss::result]; + BEAST_EXPECT(result[jss::error] == "invalidParams"); + BEAST_EXPECT(result[jss::status] == "error"); + BEAST_EXPECT( + result[jss::error_message] == + "Invalid field 'ledger_index', not number."); + } // the purpose in this test is to force the ledger expiration/out of // date check to trigger env.timeKeeper().adjustCloseTime(weeks{3}); - result = env.rpc(apiVersion, "ledger_request", "1")[jss::result]; + auto const result = + env.rpc(apiVersion, "ledger_request", "1")[jss::result]; BEAST_EXPECT(result[jss::status] == "error"); if (apiVersion == 1) { @@ -350,13 +371,13 @@ public: testLedgerRequest(); testEvolution(); forAllApiVersions( - std::bind_front(&LedgerRequestRPC_test::testBadInput, this)); + std::bind_front(&LedgerRequest_test::testBadInput, this)); testMoreThan256Closed(); testNonAdmin(); } }; -BEAST_DEFINE_TESTSUITE(LedgerRequestRPC, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerRequest, rpc, ripple); } // namespace RPC } // namespace ripple diff --git a/src/test/rpc/NoRippleCheck_test.cpp b/src/test/rpc/NoRippleCheck_test.cpp index 81ec097181..4d9af8524f 100644 --- a/src/test/rpc/NoRippleCheck_test.cpp +++ b/src/test/rpc/NoRippleCheck_test.cpp @@ -97,7 +97,9 @@ class NoRippleCheck_test : public beast::unit_test::suite auto const result = env.rpc( "json", "noripple_check", to_string(params))[jss::result]; BEAST_EXPECT(result[jss::error] == "invalidParams"); - BEAST_EXPECT(result[jss::error_message] == "ledgerHashNotString"); + BEAST_EXPECT( + result[jss::error_message] == + "Invalid field 'ledger_hash', not hex string."); } { // account not found @@ -122,6 +124,36 @@ class NoRippleCheck_test : public beast::unit_test::suite BEAST_EXPECT(result[jss::error] == "actMalformed"); BEAST_EXPECT(result[jss::error_message] == "Account malformed."); } + + { + // ledger and ledger_hash are included + Json::Value params; + params[jss::account] = Account{"nobody"}.human(); + params[jss::role] = "user"; + params[jss::ledger] = "current"; + params[jss::ledger_hash] = "ABCDEF"; + auto const result = env.rpc( + "json", "noripple_check", to_string(params))[jss::result]; + BEAST_EXPECT(result[jss::error] == "invalidParams"); + BEAST_EXPECT( + result[jss::error_message] == + "Exactly one of 'ledger', 'ledger_hash', or 'ledger_index' can " + "be specified."); + } + + { + // invalid ledger + Json::Value params; + params[jss::account] = Account{"nobody"}.human(); + params[jss::role] = "user"; + params[jss::ledger] = Json::objectValue; + auto const result = env.rpc( + "json", "noripple_check", to_string(params))[jss::result]; + BEAST_EXPECT(result[jss::error] == "invalidParams"); + BEAST_EXPECT( + result[jss::error_message] == + "Invalid field 'ledger', not string or number."); + } } void diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index 6bc227ed43..cd3dcc9255 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -16,7 +16,7 @@ struct LedgerFill { LedgerFill( ReadView const& l, - RPC::Context* ctx, + RPC::Context const* ctx, int o = 0, std::vector q = {}) : ledger(l), options(o), txQueue(std::move(q)), context(ctx) @@ -38,7 +38,7 @@ struct LedgerFill ReadView const& ledger; int options; std::vector txQueue; - RPC::Context* context; + RPC::Context const* context; std::optional closeTime; }; diff --git a/src/xrpld/rpc/detail/Handler.cpp b/src/xrpld/rpc/detail/Handler.cpp index e05e9d0e6c..a4a1be3343 100644 --- a/src/xrpld/rpc/detail/Handler.cpp +++ b/src/xrpld/rpc/detail/Handler.cpp @@ -3,6 +3,7 @@ #include #include +#include #include diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index 6d1314ff51..a9c75a05e8 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -1,6 +1,3 @@ -#include -#include -#include #include #include #include @@ -21,60 +18,6 @@ namespace ripple { namespace RPC { -std::optional -accountFromStringStrict(std::string const& account) -{ - std::optional result; - - auto const publicKey = - parseBase58(TokenType::AccountPublic, account); - - if (publicKey) - result = calcAccountID(*publicKey); - else - result = parseBase58(account); - - return result; -} - -error_code_i -accountFromStringWithCode( - AccountID& result, - std::string const& strIdent, - bool bStrict) -{ - if (auto accountID = accountFromStringStrict(strIdent)) - { - result = *accountID; - return rpcSUCCESS; - } - - if (bStrict) - return rpcACT_MALFORMED; - - // We allow the use of the seeds which is poor practice - // and merely for debugging convenience. - auto const seed = parseGenericSeed(strIdent); - - if (!seed) - return rpcBAD_SEED; - - auto const keypair = generateKeyPair(KeyType::secp256k1, *seed); - - result = calcAccountID(keypair.first); - return rpcSUCCESS; -} - -Json::Value -accountFromString(AccountID& result, std::string const& strIdent, bool bStrict) -{ - error_code_i code = accountFromStringWithCode(result, strIdent, bStrict); - if (code != rpcSUCCESS) - return rpcError(code); - else - return Json::objectValue; -} - std::uint64_t getStartHint(std::shared_ptr const& sle, AccountID const& accountID) { @@ -146,31 +89,6 @@ parseAccountIds(Json::Value const& jvArray) return result; } -void -injectSLE(Json::Value& jv, SLE const& sle) -{ - jv = sle.getJson(JsonOptions::none); - if (sle.getType() == ltACCOUNT_ROOT) - { - if (sle.isFieldPresent(sfEmailHash)) - { - auto const& hash = sle.getFieldH128(sfEmailHash); - Blob const b(hash.begin(), hash.end()); - std::string md5 = strHex(makeSlice(b)); - boost::to_lower(md5); - // VFALCO TODO Give a name and move this constant - // to a more visible location. Also - // shouldn't this be https? - jv[jss::urlgravatar] = - str(boost::format("http://www.gravatar.com/avatar/%s") % md5); - } - } - else - { - jv[jss::Invalid] = true; - } -} - std::optional readLimitField( unsigned int& limit, diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index 808b975de3..3fa652d93b 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -7,65 +7,45 @@ #include #include -#include #include #include #include #include -#include - -namespace Json { -class Value; -} namespace ripple { class ReadView; -class Transaction; namespace RPC { struct JsonContext; -/** Get an AccountID from an account ID or public key. */ -std::optional -accountFromStringStrict(std::string const&); - -// --> strIdent: public key, account ID, or regular seed. -// --> bStrict: Only allow account id or public key. -// -// Returns a Json::objectValue, containing error information if there was one. -Json::Value -accountFromString( - AccountID& result, - std::string const& strIdent, - bool bStrict = false); - -/** Decode account ID from string - @param[out] result account ID decoded from string - @param strIdent public key, account ID, or regular seed. - @param bStrict Only allow account id or public key. - @return code representing error, or rpcSUCCES on success -*/ -error_code_i -accountFromStringWithCode( - AccountID& result, - std::string const& strIdent, - bool bStrict = false); - -/** Gets the start hint for traversing account objects - * @param sle - Ledger entry defined by the marker passed into the RPC. - * @param accountID - The ID of the account whose objects you are traversing. +/** + * @brief Gets the start hint for traversing account objects. + * + * This function retrieves a hint value from the specified ledger entry (SLE) + * that can be used to optimize traversal of account objects for the given + * account ID. + * + * @param sle Shared pointer to the ledger entry (SLE) defined by the marker + * passed into the RPC. + * @param accountID The ID of the account whose objects are being traversed. + * @return A 64-bit unsigned integer representing the start hint for traversal. */ std::uint64_t getStartHint(std::shared_ptr const& sle, AccountID const& accountID); /** - * Tests if a SLE is owned by accountID. - * @param ledger - The ledger used to search for the sle. - * @param sle - The SLE to test for ownership. - * @param account - The account being tested for SLE ownership. + * @brief Tests if a ledger entry (SLE) is owned by the specified account. + * + * Determines whether the given SLE is related to or owned by the provided + * account ID within the context of the specified ledger. + * + * @param ledger The ledger view used to search for the SLE. + * @param sle Shared pointer to the SLE to test for ownership. + * @param accountID The account being tested for SLE ownership. + * @return true if the SLE is owned by the account, false otherwise. */ bool isRelatedToAccount( @@ -73,52 +53,105 @@ isRelatedToAccount( std::shared_ptr const& sle, AccountID const& accountID); +/** + * @brief Parses an array of account IDs from a JSON value. + * + * Extracts and returns a set of AccountID objects from the provided JSON array. + * + * @param jvArray The JSON value containing an array of account IDs. + * @return A hash_set containing the parsed AccountID objects. + */ hash_set parseAccountIds(Json::Value const& jvArray); -bool -isHexTxID(std::string const& txid); - -/** Inject JSON describing ledger entry - - Effects: - Adds the JSON description of `sle` to `jv`. - - If `sle` holds an account root, also adds the - urlgravatar field JSON if sfEmailHash is present. -*/ -void -injectSLE(Json::Value& jv, SLE const& sle); - -/** Retrieve the limit value from a JsonContext, or set a default - - then restrict the limit by max and min if not an ADMIN request. - - If there is an error, return it as JSON. -*/ +/** + * @brief Retrieves the limit value from a JsonContext or sets a default. + * + * Reads the "limit" field from the given JsonContext, applies default, minimum, + * and maximum constraints as appropriate, and returns an error as JSON if + * validation fails. + * + * @param limit Reference to the variable where the limit value will be stored. + * @param range The allowed range for the limit value. + * @param context The JSON context from which to read the limit. + * @return An optional JSON value containing an error if one occurred, or + * std::nullopt on success. + */ std::optional readLimitField( unsigned int& limit, - Tuning::LimitRange const&, - JsonContext const&); + Tuning::LimitRange const& range, + JsonContext const& context); +/** + * @brief Extracts a Seed from RPC parameters. + * + * Attempts to parse and return a Seed from the provided JSON RPC parameters. + * If parsing fails, an error is set in the provided error JSON value. + * + * @param params The JSON value containing RPC parameters. + * @param error Reference to a JSON value to be set with error information if + * parsing fails. + * @return An optional Seed if parsing is successful, or std::nullopt otherwise. + */ std::optional getSeedFromRPC(Json::Value const& params, Json::Value& error); +/** + * @brief Parses a RippleLib seed from RPC parameters. + * + * Attempts to extract and return a Seed from the provided JSON parameters using + * RippleLib conventions. + * + * @param params The JSON value containing RPC parameters. + * @return An optional Seed if parsing is successful, or std::nullopt otherwise. + */ std::optional parseRippleLibSeed(Json::Value const& params); +/** + * @brief Chooses the ledger entry type based on RPC parameters. + * + * Determines the appropriate LedgerEntryType to use based on the provided JSON + * parameters, and returns a pair containing the RPC status and the selected + * type. + * + * @param params The JSON value containing RPC parameters. + * @return A pair consisting of the RPC status and the chosen LedgerEntryType. + */ std::pair chooseLedgerEntryType(Json::Value const& params); /** - * Check if the type is a valid filtering type for account_objects method + * @brief Checks if the type is a valid filtering type for the account_objects + * method. * - * Since Amendments, DirectoryNode, FeeSettings, LedgerHashes can not be - * owned by an account, this function will return false in these situations. + * Determines whether the specified LedgerEntryType is valid for filtering in + * the account_objects RPC method. Types such as Amendments, DirectoryNode, + * FeeSettings, and LedgerHashes are not considered valid as they cannot be + * owned by an account. + * + * @param type The ledger entry type to check. + * @return true if the type is valid for account_objects filtering, false + * otherwise. */ bool isAccountObjectsValidType(LedgerEntryType const& type); +/** + * @brief Generates a keypair for signature from RPC parameters. + * + * Attempts to derive a public and secret key pair from the provided JSON RPC + * parameters. If an error occurs, it is set in the provided error JSON value. + * + * @param params The JSON value containing RPC parameters. + * @param error Reference to a JSON value to be set with error information if + * keypair generation fails. + * @param apiVersion The API version to use for keypair derivation (defaults to + * apiVersionIfUnspecified). + * @return An optional pair containing the public and secret keys if successful, + * or std::nullopt otherwise. + */ std::optional> keypairForSignature( Json::Value const& params, diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp index 8ba7eeddcd..144378a1ec 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp @@ -1,22 +1,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include #include -#include -#include #include -#include namespace ripple { namespace RPC { @@ -34,63 +24,123 @@ isValidatedOld(LedgerMaster& ledgerMaster, bool standalone) template Status -ledgerFromRequest(T& ledger, JsonContext& context) +ledgerFromHash( + T& ledger, + Json::Value hash, + Context const& context, + Json::StaticString const fieldName) +{ + uint256 ledgerHash; + if (!ledgerHash.parseHex(hash.asString())) + return { + rpcINVALID_PARAMS, expected_field_message(fieldName, "hex string")}; + return getLedger(ledger, ledgerHash, context); +} + +template +Status +ledgerFromIndex( + T& ledger, + Json::Value indexValue, + Context const& context, + Json::StaticString const fieldName) +{ + auto const index = indexValue.asString(); + + if (index == "current" || index.empty()) + return getLedger(ledger, LedgerShortcut::Current, context); + + if (index == "validated") + return getLedger(ledger, LedgerShortcut::Validated, context); + + if (index == "closed") + return getLedger(ledger, LedgerShortcut::Closed, context); + + std::uint32_t iVal; + if (!beast::lexicalCastChecked(iVal, index)) + return { + rpcINVALID_PARAMS, + expected_field_message(fieldName, "string or number")}; + + return getLedger(ledger, iVal, context); +} + +template +Status +ledgerFromRequest(T& ledger, JsonContext const& context) { ledger.reset(); auto& params = context.params; + auto const hasLedger = context.params.isMember(jss::ledger); + auto const hasHash = context.params.isMember(jss::ledger_hash); + auto const hasIndex = context.params.isMember(jss::ledger_index); - auto indexValue = params[jss::ledger_index]; - auto hashValue = params[jss::ledger_hash]; + if ((hasLedger + hasHash + hasIndex) > 1) + { + // while `ledger` is still supported, it is deprecated + // and therefore shouldn't be mentioned in the error message + if (hasLedger) + return { + rpcINVALID_PARAMS, + "Exactly one of 'ledger', 'ledger_hash', or " + "'ledger_index' can be specified."}; + return { + rpcINVALID_PARAMS, + "Exactly one of 'ledger_hash' or " + "'ledger_index' can be specified."}; + } // We need to support the legacy "ledger" field. - auto& legacyLedger = params[jss::ledger]; - if (legacyLedger) + if (hasLedger) { - if (legacyLedger.asString().size() > 12) - hashValue = legacyLedger; + auto& legacyLedger = params[jss::ledger]; + if (!legacyLedger.isString() && !legacyLedger.isUInt() && + !legacyLedger.isInt()) + { + return { + rpcINVALID_PARAMS, + expected_field_message(jss::ledger, "string or number")}; + } + if (legacyLedger.isString() && legacyLedger.asString().size() == 64) + return ledgerFromHash(ledger, legacyLedger, context, jss::ledger); else - indexValue = legacyLedger; + return ledgerFromIndex(ledger, legacyLedger, context, jss::ledger); } - if (!hashValue.isNull()) + if (hasHash) { - if (!hashValue.isString()) - return {rpcINVALID_PARAMS, "ledgerHashNotString"}; - - uint256 ledgerHash; - if (!ledgerHash.parseHex(hashValue.asString())) - return {rpcINVALID_PARAMS, "ledgerHashMalformed"}; - return getLedger(ledger, ledgerHash, context); + auto const& ledgerHash = params[jss::ledger_hash]; + if (!ledgerHash.isString()) + return { + rpcINVALID_PARAMS, + expected_field_message(jss::ledger_hash, "hex string")}; + return ledgerFromHash(ledger, ledgerHash, context, jss::ledger_hash); } - if (!indexValue.isConvertibleTo(Json::stringValue)) - return {rpcINVALID_PARAMS, "ledgerIndexMalformed"}; + if (hasIndex) + { + auto const& ledgerIndex = params[jss::ledger_index]; + if (!ledgerIndex.isString() && !ledgerIndex.isUInt() && + !ledgerIndex.isInt()) + { + return { + rpcINVALID_PARAMS, + expected_field_message(jss::ledger_index, "string or number")}; + } + return ledgerFromIndex(ledger, ledgerIndex, context, jss::ledger_index); + } - auto const index = indexValue.asString(); - - if (index == "current" || index.empty()) - return getLedger(ledger, LedgerShortcut::CURRENT, context); - - if (index == "validated") - return getLedger(ledger, LedgerShortcut::VALIDATED, context); - - if (index == "closed") - return getLedger(ledger, LedgerShortcut::CLOSED, context); - - std::uint32_t val; - if (!beast::lexicalCastChecked(val, index)) - return {rpcINVALID_PARAMS, "ledgerIndexMalformed"}; - - return getLedger(ledger, val, context); + // nothing specified, `index` has a default setting + return getLedger(ledger, LedgerShortcut::Current, context); } } // namespace template Status -ledgerFromRequest(T& ledger, GRPCContext& context) +ledgerFromRequest(T& ledger, GRPCContext const& context) { - R& request = context.params; + R const& request = context.params; return ledgerFromSpecifier(ledger, request.ledger(), context); } @@ -98,26 +148,26 @@ ledgerFromRequest(T& ledger, GRPCContext& context) template Status ledgerFromRequest<>( std::shared_ptr&, - GRPCContext&); + GRPCContext const&); // explicit instantiation of above function template Status ledgerFromRequest<>( std::shared_ptr&, - GRPCContext&); + GRPCContext const&); // explicit instantiation of above function template Status ledgerFromRequest<>( std::shared_ptr&, - GRPCContext&); + GRPCContext const&); template Status ledgerFromSpecifier( T& ledger, org::xrpl::rpc::v1::LedgerSpecifier const& specifier, - Context& context) + Context const& context) { ledger.reset(); @@ -141,7 +191,7 @@ ledgerFromSpecifier( if (shortcut == org::xrpl::rpc::v1::LedgerSpecifier::SHORTCUT_VALIDATED) { - return getLedger(ledger, LedgerShortcut::VALIDATED, context); + return getLedger(ledger, LedgerShortcut::Validated, context); } else { @@ -151,13 +201,13 @@ ledgerFromSpecifier( org::xrpl::rpc::v1::LedgerSpecifier:: SHORTCUT_UNSPECIFIED) { - return getLedger(ledger, LedgerShortcut::CURRENT, context); + return getLedger(ledger, LedgerShortcut::Current, context); } else if ( shortcut == org::xrpl::rpc::v1::LedgerSpecifier::SHORTCUT_CLOSED) { - return getLedger(ledger, LedgerShortcut::CLOSED, context); + return getLedger(ledger, LedgerShortcut::Closed, context); } } } @@ -168,7 +218,7 @@ ledgerFromSpecifier( template Status -getLedger(T& ledger, uint256 const& ledgerHash, Context& context) +getLedger(T& ledger, uint256 const& ledgerHash, Context const& context) { ledger = context.ledgerMaster.getLedgerByHash(ledgerHash); if (ledger == nullptr) @@ -178,7 +228,7 @@ getLedger(T& ledger, uint256 const& ledgerHash, Context& context) template Status -getLedger(T& ledger, uint32_t ledgerIndex, Context& context) +getLedger(T& ledger, uint32_t ledgerIndex, Context const& context) { ledger = context.ledgerMaster.getLedgerBySeq(ledgerIndex); if (ledger == nullptr) @@ -207,7 +257,7 @@ getLedger(T& ledger, uint32_t ledgerIndex, Context& context) template Status -getLedger(T& ledger, LedgerShortcut shortcut, Context& context) +getLedger(T& ledger, LedgerShortcut shortcut, Context const& context) { if (isValidatedOld(context.ledgerMaster, context.app.config().standalone())) { @@ -216,7 +266,7 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context& context) return {rpcNOT_SYNCED, "notSynced"}; } - if (shortcut == LedgerShortcut::VALIDATED) + if (shortcut == LedgerShortcut::Validated) { ledger = context.ledgerMaster.getValidatedLedger(); if (ledger == nullptr) @@ -231,13 +281,13 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context& context) } else { - if (shortcut == LedgerShortcut::CURRENT) + if (shortcut == LedgerShortcut::Current) { ledger = context.ledgerMaster.getCurrentLedger(); XRPL_ASSERT( ledger->open(), "ripple::RPC::getLedger : current is open"); } - else if (shortcut == LedgerShortcut::CLOSED) + else if (shortcut == LedgerShortcut::Closed) { ledger = context.ledgerMaster.getClosedLedger(); XRPL_ASSERT( @@ -271,16 +321,16 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context& context) // Explicit instantiation of above three functions template Status -getLedger<>(std::shared_ptr&, uint32_t, Context&); +getLedger<>(std::shared_ptr&, uint32_t, Context const&); template Status getLedger<>( std::shared_ptr&, LedgerShortcut shortcut, - Context&); + Context const&); template Status -getLedger<>(std::shared_ptr&, uint256 const&, Context&); +getLedger<>(std::shared_ptr&, uint256 const&, Context const&); // The previous version of the lookupLedger command would accept the // "ledger_index" argument as a string and silently treat it as a request to @@ -304,7 +354,7 @@ getLedger<>(std::shared_ptr&, uint256 const&, Context&); Status lookupLedger( std::shared_ptr& ledger, - JsonContext& context, + JsonContext const& context, Json::Value& result) { if (auto status = ledgerFromRequest(ledger, context)) @@ -327,7 +377,9 @@ lookupLedger( } Json::Value -lookupLedger(std::shared_ptr& ledger, JsonContext& context) +lookupLedger( + std::shared_ptr& ledger, + JsonContext const& context) { Json::Value result; if (auto status = lookupLedger(ledger, context, result)) @@ -336,8 +388,8 @@ lookupLedger(std::shared_ptr& ledger, JsonContext& context) return result; } -std::variant, Json::Value> -getLedgerByContext(RPC::JsonContext& context) +Expected, Json::Value> +getOrAcquireLedger(RPC::JsonContext const& context) { auto const hasHash = context.params.isMember(jss::ledger_hash); auto const hasIndex = context.params.isMember(jss::ledger_index); @@ -346,42 +398,45 @@ getLedgerByContext(RPC::JsonContext& context) auto& ledgerMaster = context.app.getLedgerMaster(); LedgerHash ledgerHash; - if ((hasHash && hasIndex) || !(hasHash || hasIndex)) + if ((hasHash + hasIndex) != 1) { - return RPC::make_param_error( - "Exactly one of ledger_hash and ledger_index can be set."); + return Unexpected( + RPC::make_param_error("Exactly one of 'ledger_hash' or " + "'ledger_index' can be specified.")); } - context.loadType = Resource::feeHeavyBurdenRPC; - if (hasHash) { - auto const& jsonHash = context.params[jss::ledger_hash]; + auto const& jsonHash = + context.params.get(jss::ledger_hash, Json::nullValue); if (!jsonHash.isString() || !ledgerHash.parseHex(jsonHash.asString())) - return RPC::invalid_field_error(jss::ledger_hash); + return Unexpected( + RPC::expected_field_error(jss::ledger_hash, "hex string")); } else { - auto const& jsonIndex = context.params[jss::ledger_index]; - if (!jsonIndex.isInt()) - return RPC::invalid_field_error(jss::ledger_index); + auto const& jsonIndex = + context.params.get(jss::ledger_index, Json::nullValue); + if (!jsonIndex.isInt() && !jsonIndex.isUInt()) + return Unexpected( + RPC::expected_field_error(jss::ledger_index, "number")); // We need a validated ledger to get the hash from the sequence if (ledgerMaster.getValidatedLedgerAge() > RPC::Tuning::maxValidatedLedgerAge) { if (context.apiVersion == 1) - return rpcError(rpcNO_CURRENT); - return rpcError(rpcNOT_SYNCED); + return Unexpected(rpcError(rpcNO_CURRENT)); + return Unexpected(rpcError(rpcNOT_SYNCED)); } ledgerIndex = jsonIndex.asInt(); auto ledger = ledgerMaster.getValidatedLedger(); if (ledgerIndex >= ledger->info().seq) - return RPC::make_param_error("Ledger index too large"); + return Unexpected(RPC::make_param_error("Ledger index too large")); if (ledgerIndex <= 0) - return RPC::make_param_error("Ledger index too small"); + return Unexpected(RPC::make_param_error("Ledger index too small")); auto const j = context.app.journal("RPCHandler"); // Try to get the hash of the desired ledger from the validated @@ -395,7 +450,7 @@ getLedgerByContext(RPC::JsonContext& context) auto refHash = hashOfSeq(*ledger, refIndex, j); XRPL_ASSERT( refHash, - "ripple::RPC::getLedgerByContext : nonzero ledger hash"); + "ripple::RPC::getOrAcquireLedger : nonzero ledger hash"); ledger = ledgerMaster.getLedgerByHash(*refHash); if (!ledger) @@ -411,7 +466,7 @@ getLedgerByContext(RPC::JsonContext& context) "acquiring ledger containing requested index"); jvResult[jss::acquiring] = getJson(LedgerFill(*il, &context)); - return jvResult; + return Unexpected(jvResult); } if (auto il = context.app.getInboundLedgers().find(*refHash)) @@ -420,18 +475,18 @@ getLedgerByContext(RPC::JsonContext& context) rpcLGR_NOT_FOUND, "acquiring ledger containing requested index"); jvResult[jss::acquiring] = il->getJson(0); - return jvResult; + return Unexpected(jvResult); } // Likely the app is shutting down - return Json::Value(); + return Unexpected(Json::Value()); } neededHash = hashOfSeq(*ledger, ledgerIndex, j); } XRPL_ASSERT( neededHash, - "ripple::RPC::getLedgerByContext : nonzero needed hash"); + "ripple::RPC::getOrAcquireLedger : nonzero needed hash"); ledgerHash = neededHash ? *neededHash : beast::zero; // kludge } @@ -448,10 +503,10 @@ getLedgerByContext(RPC::JsonContext& context) return ledger; if (auto il = context.app.getInboundLedgers().find(ledgerHash)) - return il->getJson(0); + return Unexpected(il->getJson(0)); - return RPC::make_error( - rpcNOT_READY, "findCreate failed to return an inbound ledger"); + return Unexpected(RPC::make_error( + rpcNOT_READY, "findCreate failed to return an inbound ledger")); } } // namespace RPC diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 17382d3c53..0a070a16ab 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -7,17 +7,9 @@ #include #include -#include #include -#include -#include #include -#include - -namespace Json { -class Value; -} namespace ripple { @@ -28,66 +20,159 @@ namespace RPC { struct JsonContext; -/** Get ledger by hash - If there is no error in the return value, the ledger pointer will have - been filled -*/ +enum class LedgerShortcut { Current, Closed, Validated }; + +/** + * @brief Retrieves a ledger by its hash. + * + * This function attempts to find and fill the provided ledger pointer with the + * ledger corresponding to the specified hash. If the operation is successful, + * the ledger pointer will be set; otherwise, an error status is returned. + * + * @tparam T Type of the ledger pointer to be filled. + * @param ledger Reference to the ledger pointer to be filled. + * @param ledgerHash The hash of the ledger to retrieve. + * @param context The RPC context containing request parameters and environment. + * @return Status indicating success or failure of the operation. + */ template Status -getLedger(T& ledger, uint256 const& ledgerHash, Context& context); +getLedger(T& ledger, uint256 const& ledgerHash, Context const& context); -/** Get ledger by sequence - If there is no error in the return value, the ledger pointer will have - been filled -*/ +/** + * @brief Retrieves a ledger by its sequence index. + * + * This function attempts to find and fill the provided ledger pointer with the + * ledger corresponding to the specified sequence index. If the operation is + * successful, the ledger pointer will be set; otherwise, an error status is + * returned. + * + * @tparam T Type of the ledger pointer to be filled. + * @param ledger Reference to the ledger pointer to be filled. + * @param ledgerIndex The sequence index of the ledger to retrieve. + * @param context The RPC context containing request parameters and environment. + * @return Status indicating success or failure of the operation. + */ template Status -getLedger(T& ledger, uint32_t ledgerIndex, Context& context); +getLedger(T& ledger, uint32_t ledgerIndex, Context const& context); -enum LedgerShortcut { CURRENT, CLOSED, VALIDATED }; -/** Get ledger specified in shortcut. - If there is no error in the return value, the ledger pointer will have - been filled -*/ +/** + * @brief Retrieves a ledger specified by a `LedgerShortcut`. + * + * This function attempts to find and fill the provided ledger pointer with the + * ledger corresponding to the specified shortcut. If the operation is + * successful, the ledger pointer will be set; otherwise, an error status is + * returned. + * + * @tparam T Type of the ledger pointer to be filled. + * @param ledger Reference to the ledger pointer to be filled. + * @param shortcut The shortcut specifying which ledger to retrieve. + * @param context The RPC context containing request parameters and environment. + * @return Status indicating success or failure of the operation. + */ template Status -getLedger(T& ledger, LedgerShortcut shortcut, Context& context); +getLedger(T& ledger, LedgerShortcut shortcut, Context const& context); -/** Look up a ledger from a request and fill a Json::Result with either - an error, or data representing a ledger. - - If there is no error in the return value, then the ledger pointer will have - been filled. -*/ +/** + * @brief Looks up a ledger from a request and returns a Json::Value with either + * an error or ledger data. + * + * This function attempts to find a ledger based on the parameters in the given + * JsonContext. On success, the ledger pointer is filled and a Json::Value + * representing the ledger is returned. On failure, a Json::Value describing the + * error is returned. + * + * @param ledger Reference to a shared pointer to the ledger to be filled. + * @param context The RPC JsonContext containing request parameters and + * environment. + * @return Json::Value containing either the ledger data or an error + * description. + */ Json::Value -lookupLedger(std::shared_ptr&, JsonContext&); +lookupLedger(std::shared_ptr&, JsonContext const&); -/** Look up a ledger from a request and fill a Json::Result with the data - representing a ledger. - - If the returned Status is OK, the ledger pointer will have been filled. -*/ +/** + * @brief Looks up a ledger from a request and fills a Json::Value with ledger + * data. + * + * This function attempts to find a ledger based on the parameters in the given + * JsonContext. On success, the ledger pointer is filled and the result + * parameter is populated with ledger data. On failure, an error status is + * returned. + * + * @param ledger Reference to a shared pointer to the ledger to be filled. + * @param context The RPC JsonContext containing request parameters and + * environment. + * @param result Reference to a Json::Value to be filled with ledger data. + * @return Status indicating success or failure of the operation. + */ Status lookupLedger( std::shared_ptr&, - JsonContext&, + JsonContext const&, Json::Value& result); +/** + * @brief Retrieves a ledger from a gRPC request context. + * + * This function attempts to find and fill the provided ledger pointer based on + * the parameters in the given gRPC context. On success, the ledger pointer is + * filled. + * + * @tparam T Type of the ledger pointer to be filled. + * @tparam R Type of the gRPC request. + * @param ledger Reference to the ledger pointer to be filled. + * @param context The gRPC context containing request parameters and + * environment. + * @return Status indicating success or failure of the operation. + */ template Status -ledgerFromRequest(T& ledger, GRPCContext& context); +ledgerFromRequest(T& ledger, GRPCContext const& context); +/** + * @brief Retrieves a ledger based on a LedgerSpecifier. + * + * This function attempts to find and fill the provided ledger pointer based on + * the specified LedgerSpecifier. On success, the ledger pointer is filled. + * + * @tparam T Type of the ledger pointer to be filled. + * @param ledger Reference to the ledger pointer to be filled. + * @param specifier The LedgerSpecifier describing which ledger to retrieve. + * @param context The RPC context containing request parameters and environment. + * @return Status indicating success or failure of the operation. + */ template Status ledgerFromSpecifier( T& ledger, org::xrpl::rpc::v1::LedgerSpecifier const& specifier, - Context& context); + Context const& context); -/** Return a ledger based on ledger_hash or ledger_index, - or an RPC error */ -std::variant, Json::Value> -getLedgerByContext(RPC::JsonContext& context); +/** + * @brief Retrieves or acquires a ledger based on the parameters provided in the + * given JsonContext. + * + * This function differs from the other ledger getter functions in this file in + * that it attempts to either retrieve an existing ledger or acquire it if it is + * not already available, based on the context of the RPC request. It returns an + * Expected containing either a shared pointer to the requested immutable Ledger + * object or a Json::Value describing an error. Unlike the other getLedger or + * lookupLedger functions, which typically fill a provided ledger pointer or + * result object and return a Status, this function encapsulates both the result + * and error in a single return value, making it easier to handle success and + * failure cases in a unified way. + * + * @param context The RPC JsonContext containing request parameters and + * environment. + * @return Expected, Json::Value> + * On success, contains a shared pointer to the requested Ledger. + * On failure, contains a Json::Value describing the error. + */ +Expected, Json::Value> +getOrAcquireLedger(RPC::JsonContext const& context); } // namespace RPC diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index 4a7f1d9b7d..8a42153105 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -31,10 +32,17 @@ #include #include +#include #include namespace ripple { +class Peer; +class LedgerMaster; +class Transaction; +class ValidatorKeys; +class CanonicalTXSet; + static bool isStatusRequest(http_request_type const& request) { diff --git a/src/xrpld/rpc/handlers/AMMInfo.cpp b/src/xrpld/rpc/handlers/AMMInfo.cpp index dda30fcfa7..0504adca02 100644 --- a/src/xrpld/rpc/handlers/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/AMMInfo.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -13,22 +12,6 @@ namespace ripple { -std::optional -getAccount(Json::Value const& v, Json::Value& result) -{ - std::string strIdent(v.asString()); - AccountID accountID; - - if (auto jv = RPC::accountFromString(accountID, strIdent)) - { - for (auto it = jv.begin(); it != jv.end(); ++it) - result[it.memberName()] = (*it); - - return std::nullopt; - } - return std::optional(accountID); -} - Expected getIssue(Json::Value const& v, beast::Journal j) { @@ -109,7 +92,8 @@ doAMMInfo(RPC::JsonContext& context) if (params.isMember(jss::amm_account)) { - auto const id = getAccount(params[jss::amm_account], result); + auto const id = + parseBase58((params[jss::amm_account].asString())); if (!id) return Unexpected(rpcACT_MALFORMED); auto const sle = ledger->read(keylet::account(*id)); @@ -122,7 +106,7 @@ doAMMInfo(RPC::JsonContext& context) if (params.isMember(jss::account)) { - accountID = getAccount(params[jss::account], result); + accountID = parseBase58(params[jss::account].asString()); if (!accountID || !ledger->read(keylet::account(*accountID))) return Unexpected(rpcACT_MALFORMED); } diff --git a/src/xrpld/rpc/handlers/AccountInfo.cpp b/src/xrpld/rpc/handlers/AccountInfo.cpp index e9f95d450b..1bf05276f2 100644 --- a/src/xrpld/rpc/handlers/AccountInfo.cpp +++ b/src/xrpld/rpc/handlers/AccountInfo.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include @@ -12,8 +11,47 @@ #include #include +#include + namespace ripple { +/** + * @brief Injects JSON describing a ledger entry. + * + * @param jv The JSON value to populate. + * @param sle The ledger entry to describe. + * + * @details + * Populates the provided JSON value with the description of the specified + * ledger entry. If the entry is an account root and contains an email hash, + * adds a 'urlgravatar' field with the corresponding Gravatar URL. + * If the entry is not an account root, sets the 'Invalid' field to true. + */ +void +injectSLE(Json::Value& jv, SLE const& sle) +{ + jv = sle.getJson(JsonOptions::none); + if (sle.getType() == ltACCOUNT_ROOT) + { + if (sle.isFieldPresent(sfEmailHash)) + { + auto const& hash = sle.getFieldH128(sfEmailHash); + Blob const b(hash.begin(), hash.end()); + std::string md5 = strHex(makeSlice(b)); + boost::to_lower(md5); + // VFALCO TODO Give a name and move this constant + // to a more visible location. Also + // shouldn't this be https? + jv[jss::urlgravatar] = + str(boost::format("http://www.gravatar.com/avatar/%s") % md5); + } + } + else + { + jv[jss::Invalid] = true; + } +} + // { // account: , // ledger_hash : @@ -109,7 +147,7 @@ doAccountInfo(RPC::JsonContext& context) } Json::Value jvAccepted(Json::objectValue); - RPC::injectSLE(jvAccepted, *sleAccepted); + injectSLE(jvAccepted, *sleAccepted); result[jss::account_data] = jvAccepted; Json::Value acctFlags{Json::objectValue}; diff --git a/src/xrpld/rpc/handlers/AccountObjects.cpp b/src/xrpld/rpc/handlers/AccountObjects.cpp index 82ff1782e4..669d96a44f 100644 --- a/src/xrpld/rpc/handlers/AccountObjects.cpp +++ b/src/xrpld/rpc/handlers/AccountObjects.cpp @@ -159,6 +159,15 @@ doAccountNFTs(RPC::JsonContext& context) return result; } +/** Gathers all objects for an account in a ledger. + @param ledger Ledger to search account objects. + @param account AccountID to find objects for. + @param typeFilter Gathers objects of these types. empty gathers all types. + @param dirIndex Begin gathering account objects from this directory. + @param entryIndex Begin gathering objects from this directory node. + @param limit Maximum number of objects to find. + @param jvResult A JSON result that holds the request objects. +*/ bool getAccountObjects( ReadView const& ledger, diff --git a/src/xrpld/rpc/handlers/AccountTx.cpp b/src/xrpld/rpc/handlers/AccountTx.cpp index b3f1ec65ef..e248764194 100644 --- a/src/xrpld/rpc/handlers/AccountTx.cpp +++ b/src/xrpld/rpc/handlers/AccountTx.cpp @@ -92,11 +92,11 @@ parseLedgerArgs(RPC::Context& context, Json::Value const& params) std::string ledgerStr = params[jss::ledger_index].asString(); if (ledgerStr == "current" || ledgerStr.empty()) - ledger = LedgerShortcut::CURRENT; + ledger = LedgerShortcut::Current; else if (ledgerStr == "closed") - ledger = LedgerShortcut::CLOSED; + ledger = LedgerShortcut::Closed; else if (ledgerStr == "validated") - ledger = LedgerShortcut::VALIDATED; + ledger = LedgerShortcut::Validated; else { RPC::Status status{ diff --git a/src/xrpld/rpc/handlers/LedgerRequest.cpp b/src/xrpld/rpc/handlers/LedgerRequest.cpp index fd06ab30ba..2846bb9f08 100644 --- a/src/xrpld/rpc/handlers/LedgerRequest.cpp +++ b/src/xrpld/rpc/handlers/LedgerRequest.cpp @@ -4,8 +4,7 @@ #include #include - -#include +#include namespace ripple { @@ -16,12 +15,13 @@ namespace ripple { Json::Value doLedgerRequest(RPC::JsonContext& context) { - auto res = getLedgerByContext(context); + context.loadType = Resource::feeHeavyBurdenRPC; + auto res = RPC::getOrAcquireLedger(context); - if (std::holds_alternative(res)) - return std::get(res); + if (!res.has_value()) + return res.error(); - auto const& ledger = std::get>(res); + auto const& ledger = res.value(); Json::Value jvResult; jvResult[jss::ledger_index] = ledger->info().seq; From bff5954acf09bdbea6d89ad79c04ca6646d10b9f Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 10 Dec 2025 14:12:14 -0500 Subject: [PATCH 02/20] refactor: rename `LedgerInfo` to `LedgerHeader` (#6136) This PR renames `LedgerInfo` to `LedgerHeader`. Namely, `LedgerInfo` was already an alias for `LedgerHeader`, and the comments next to the alias suggested that it would make sense to rename it, since that makes it clearer what it is. --- include/xrpl/ledger/CachedView.h | 2 +- include/xrpl/ledger/OpenView.h | 6 +++--- include/xrpl/ledger/ReadView.h | 2 +- include/xrpl/ledger/detail/ApplyViewBase.h | 2 +- include/xrpl/protocol/LedgerHeader.h | 6 ------ src/libxrpl/ledger/ApplyViewBase.cpp | 2 +- src/libxrpl/ledger/OpenView.cpp | 2 +- src/test/app/SHAMapStore_test.cpp | 4 ++-- src/test/overlay/compression_test.cpp | 4 ++-- src/test/rpc/AccountLines_test.cpp | 16 +++++++-------- src/xrpld/app/ledger/Ledger.cpp | 16 +++++++-------- src/xrpld/app/ledger/Ledger.h | 14 ++++++------- src/xrpld/app/ledger/LedgerReplayer.h | 4 ++-- .../app/ledger/detail/LedgerDeltaAcquire.cpp | 2 +- .../app/ledger/detail/LedgerDeltaAcquire.h | 2 +- .../app/ledger/detail/LedgerReplayer.cpp | 4 ++-- src/xrpld/app/ledger/detail/LedgerToJson.cpp | 4 ++-- src/xrpld/app/rdb/RelationalDatabase.h | 6 +++--- src/xrpld/app/rdb/backend/SQLiteDatabase.h | 4 ++-- src/xrpld/app/rdb/backend/detail/Node.cpp | 14 ++++++------- src/xrpld/app/rdb/backend/detail/Node.h | 10 +++++----- .../app/rdb/backend/detail/SQLiteDatabase.cpp | 20 +++++++++---------- src/xrpld/overlay/detail/PeerImp.cpp | 2 +- 23 files changed, 71 insertions(+), 77 deletions(-) diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index 5e924d8bca..ad1125637b 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -47,7 +47,7 @@ public: return base_.open(); } - LedgerInfo const& + LedgerHeader const& info() const override { return base_.info(); diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index a1e9c201e8..9027f57b97 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -82,7 +82,7 @@ private: monotonic_resource_; txs_map txs_; Rules rules_; - LedgerInfo info_; + LedgerHeader info_; ReadView const* base_; detail::RawStateTable items_; std::shared_ptr hold_; @@ -158,7 +158,7 @@ public: Effects: - The LedgerInfo is copied from the base. + The LedgerHeader is copied from the base. The rules are inherited from the base. @@ -188,7 +188,7 @@ public: // ReadView - LedgerInfo const& + LedgerHeader const& info() const override; Fees const& diff --git a/include/xrpl/ledger/ReadView.h b/include/xrpl/ledger/ReadView.h index e8344ac4e2..4108b19967 100644 --- a/include/xrpl/ledger/ReadView.h +++ b/include/xrpl/ledger/ReadView.h @@ -80,7 +80,7 @@ public: } /** Returns information about the ledger. */ - virtual LedgerInfo const& + virtual LedgerHeader const& info() const = 0; /** Returns true if this reflects an open ledger. */ diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index e5564d1e33..7bf490cd9c 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -27,7 +27,7 @@ public: bool open() const override; - LedgerInfo const& + LedgerHeader const& info() const override; Fees const& diff --git a/include/xrpl/protocol/LedgerHeader.h b/include/xrpl/protocol/LedgerHeader.h index 69368f9e5e..80a481f7d1 100644 --- a/include/xrpl/protocol/LedgerHeader.h +++ b/include/xrpl/protocol/LedgerHeader.h @@ -53,12 +53,6 @@ struct LedgerHeader NetClock::time_point closeTime = {}; }; -// We call them "headers" in conversation -// but "info" in code. Unintuitive. -// This alias lets us give the "correct" name to the class -// without yet disturbing existing uses. -using LedgerInfo = LedgerHeader; - // ledger close flags static std::uint32_t const sLCF_NoConsensusTime = 0x01; diff --git a/src/libxrpl/ledger/ApplyViewBase.cpp b/src/libxrpl/ledger/ApplyViewBase.cpp index bb5e316669..f296c3cef2 100644 --- a/src/libxrpl/ledger/ApplyViewBase.cpp +++ b/src/libxrpl/ledger/ApplyViewBase.cpp @@ -16,7 +16,7 @@ ApplyViewBase::open() const return base_->open(); } -LedgerInfo const& +LedgerHeader const& ApplyViewBase::info() const { return base_->info(); diff --git a/src/libxrpl/ledger/OpenView.cpp b/src/libxrpl/ledger/OpenView.cpp index 36cde12f82..25b2ba8a0c 100644 --- a/src/libxrpl/ledger/OpenView.cpp +++ b/src/libxrpl/ledger/OpenView.cpp @@ -115,7 +115,7 @@ OpenView::apply(TxsRawView& to) const //--- -LedgerInfo const& +LedgerHeader const& OpenView::info() const { return info_; diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index e472685ec0..8ec5a6fd23 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -49,11 +49,11 @@ class SHAMapStore_test : public beast::unit_test::suite auto const seq = json[jss::result][jss::ledger_index].asUInt(); - std::optional oinfo = + std::optional oinfo = env.app().getRelationalDatabase().getLedgerInfoByIndex(seq); if (!oinfo) return false; - LedgerInfo const& info = oinfo.value(); + LedgerHeader const& info = oinfo.value(); std::string const outHash = to_string(info.hash); LedgerIndex const outSeq = info.seq; diff --git a/src/test/overlay/compression_test.cpp b/src/test/overlay/compression_test.cpp index 4cee6f8034..4e001115d1 100644 --- a/src/test/overlay/compression_test.cpp +++ b/src/test/overlay/compression_test.cpp @@ -38,7 +38,7 @@ using namespace ripple::test; using namespace ripple::test::jtx; static uint256 -ledgerHash(LedgerInfo const& info) +ledgerHash(LedgerHeader const& info) { return ripple::sha512Half( HashPrefix::ledgerMaster, @@ -252,7 +252,7 @@ public: for (int i = 0; i < n; i++) { - LedgerInfo info; + LedgerHeader info; info.seq = i; info.parentCloseTime = ct; info.hash = ripple::sha512Half(i); diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index e062959769..2bc6c38779 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -68,7 +68,7 @@ public: } env.fund(XRP(10000), alice); env.close(); - LedgerInfo const ledger3Info = env.closed()->info(); + LedgerHeader const ledger3Info = env.closed()->info(); BEAST_EXPECT(ledger3Info.seq == 3); { @@ -118,7 +118,7 @@ public: env(pay(gw1, alice, gw1Currency(50 + c))); } env.close(); - LedgerInfo const ledger4Info = env.closed()->info(); + LedgerHeader const ledger4Info = env.closed()->info(); BEAST_EXPECT(ledger4Info.seq == 4); // Add another set of trust lines in another ledger so we can see @@ -153,13 +153,13 @@ public: tfSetNoRipple | tfSetFreeze | tfSetDeepFreeze)); } env.close(); - LedgerInfo const ledger58Info = env.closed()->info(); + LedgerHeader const ledger58Info = env.closed()->info(); BEAST_EXPECT(ledger58Info.seq == 58); // A re-usable test for historic ledgers. auto testAccountLinesHistory = [this, &env]( Account const& account, - LedgerInfo const& info, + LedgerHeader const& info, int count) { // Get account_lines by ledger index. Json::Value paramsSeq; @@ -817,7 +817,7 @@ public: } env.fund(XRP(10000), alice); env.close(); - LedgerInfo const ledger3Info = env.closed()->info(); + LedgerHeader const ledger3Info = env.closed()->info(); BEAST_EXPECT(ledger3Info.seq == 3); { @@ -899,7 +899,7 @@ public: env(pay(gw1, alice, gw1Currency(50 + c))); } env.close(); - LedgerInfo const ledger4Info = env.closed()->info(); + LedgerHeader const ledger4Info = env.closed()->info(); BEAST_EXPECT(ledger4Info.seq == 4); // Add another set of trust lines in another ledger so we can see @@ -934,13 +934,13 @@ public: tfSetNoRipple | tfSetFreeze | tfSetDeepFreeze)); } env.close(); - LedgerInfo const ledger58Info = env.closed()->info(); + LedgerHeader const ledger58Info = env.closed()->info(); BEAST_EXPECT(ledger58Info.seq == 58); // A re-usable test for historic ledgers. auto testAccountLinesHistory = [this, &env]( Account const& account, - LedgerInfo const& info, + LedgerHeader const& info, int count) { // Get account_lines by ledger index. Json::Value paramsSeq; diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index 6bf3170f18..aaf71b2dc3 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -32,7 +32,7 @@ namespace ripple { create_genesis_t const create_genesis{}; uint256 -calculateLedgerHash(LedgerInfo const& info) +calculateLedgerHash(LedgerHeader const& info) { // VFALCO This has to match addRaw in View.h. return sha512Half( @@ -210,7 +210,7 @@ Ledger::Ledger( } Ledger::Ledger( - LedgerInfo const& info, + LedgerHeader const& info, bool& loaded, bool acquire, Config const& config, @@ -285,7 +285,7 @@ Ledger::Ledger(Ledger const& prevLedger, NetClock::time_point closeTime) } } -Ledger::Ledger(LedgerInfo const& info, Config const& config, Family& family) +Ledger::Ledger(LedgerHeader const& info, Config const& config, Family& family) : mImmutable(true) , txMap_(SHAMapType::TRANSACTION, info.txHash, family) , stateMap_(SHAMapType::STATE, info.accountHash, family) @@ -1042,13 +1042,13 @@ Ledger::invariants() const /* * Make ledger using info loaded from database. * - * @param LedgerInfo: Ledger information. + * @param LedgerHeader: Ledger information. * @param app: Link to the Application. * @param acquire: Acquire the ledger if not found locally. * @return Shared pointer to the ledger. */ std::shared_ptr -loadLedgerHelper(LedgerInfo const& info, Application& app, bool acquire) +loadLedgerHelper(LedgerHeader const& info, Application& app, bool acquire) { bool loaded; auto ledger = std::make_shared( @@ -1088,7 +1088,7 @@ finishLoadByIndexOrHash( std::tuple, std::uint32_t, uint256> getLatestLedger(Application& app) { - std::optional const info = + std::optional const info = app.getRelationalDatabase().getNewestLedgerInfo(); if (!info) return {std::shared_ptr(), {}, {}}; @@ -1098,7 +1098,7 @@ getLatestLedger(Application& app) std::shared_ptr loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire) { - if (std::optional info = + if (std::optional info = app.getRelationalDatabase().getLedgerInfoByIndex(ledgerIndex)) { std::shared_ptr ledger = loadLedgerHelper(*info, app, acquire); @@ -1111,7 +1111,7 @@ loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire) std::shared_ptr loadByHash(uint256 const& ledgerHash, Application& app, bool acquire) { - if (std::optional info = + if (std::optional info = app.getRelationalDatabase().getLedgerInfoByHash(ledgerHash)) { std::shared_ptr ledger = loadLedgerHelper(*info, app, acquire); diff --git a/src/xrpld/app/ledger/Ledger.h b/src/xrpld/app/ledger/Ledger.h index 30bedc0447..cc3bc43c50 100644 --- a/src/xrpld/app/ledger/Ledger.h +++ b/src/xrpld/app/ledger/Ledger.h @@ -88,14 +88,14 @@ public: std::vector const& amendments, Family& family); - Ledger(LedgerInfo const& info, Config const& config, Family& family); + Ledger(LedgerHeader const& info, Config const& config, Family& family); /** Used for ledgers loaded from JSON files @param acquire If true, acquires the ledger if not found locally */ Ledger( - LedgerInfo const& info, + LedgerHeader const& info, bool& loaded, bool acquire, Config const& config, @@ -129,14 +129,14 @@ public: return false; } - LedgerInfo const& + LedgerHeader const& info() const override { return info_; } void - setLedgerInfo(LedgerInfo const& info) + setLedgerInfo(LedgerHeader const& info) { info_ = info; } @@ -397,7 +397,7 @@ private: Fees fees_; Rules rules_; - LedgerInfo info_; + LedgerHeader info_; beast::Journal j_; }; @@ -423,7 +423,7 @@ pendSaveValidated( bool isCurrent); std::shared_ptr -loadLedgerHelper(LedgerInfo const& sinfo, Application& app, bool acquire); +loadLedgerHelper(LedgerHeader const& sinfo, Application& app, bool acquire); std::shared_ptr loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire = true); @@ -457,7 +457,7 @@ std::pair, std::shared_ptr> deserializeTxPlusMeta(SHAMapItem const& item); uint256 -calculateLedgerHash(LedgerInfo const& info); +calculateLedgerHash(LedgerHeader const& info); } // namespace ripple diff --git a/src/xrpld/app/ledger/LedgerReplayer.h b/src/xrpld/app/ledger/LedgerReplayer.h index b05d92d05d..68a1c0da1d 100644 --- a/src/xrpld/app/ledger/LedgerReplayer.h +++ b/src/xrpld/app/ledger/LedgerReplayer.h @@ -85,7 +85,7 @@ public: */ void gotSkipList( - LedgerInfo const& info, + LedgerHeader const& info, boost::intrusive_ptr const& data); /** @@ -96,7 +96,7 @@ public: */ void gotReplayDelta( - LedgerInfo const& info, + LedgerHeader const& info, std::map>&& txns); /** Remove completed tasks */ diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index 4a91c597d5..91b1dca5e2 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -118,7 +118,7 @@ LedgerDeltaAcquire::pmDowncast() void LedgerDeltaAcquire::processData( - LedgerInfo const& info, + LedgerHeader const& info, std::map>&& orderedTxns) { ScopedLockType sl(mtx_); diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h index ece0ba44d5..a2c300c546 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h @@ -69,7 +69,7 @@ public: */ void processData( - LedgerInfo const& info, + LedgerHeader const& info, std::map>&& orderedTxns); /** diff --git a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp index 04a3d21b8f..1f89b6c044 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp @@ -152,7 +152,7 @@ LedgerReplayer::createDeltas(std::shared_ptr task) void LedgerReplayer::gotSkipList( - LedgerInfo const& info, + LedgerHeader const& info, boost::intrusive_ptr const& item) { std::shared_ptr skipList = {}; @@ -175,7 +175,7 @@ LedgerReplayer::gotSkipList( void LedgerReplayer::gotReplayDelta( - LedgerInfo const& info, + LedgerHeader const& info, std::map>&& txns) { std::shared_ptr delta = {}; diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index 85eb3feaf1..7e8ff9e541 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -37,7 +37,7 @@ void fillJson( Object& json, bool closed, - LedgerInfo const& info, + LedgerHeader const& info, bool bFull, unsigned apiVersion) { @@ -80,7 +80,7 @@ fillJson( template void -fillJsonBinary(Object& json, bool closed, LedgerInfo const& info) +fillJsonBinary(Object& json, bool closed, LedgerHeader const& info) { if (!closed) json[jss::closed] = false; diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index 18a5536cf6..102479544b 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -127,14 +127,14 @@ public: * @param ledgerSeq Ledger sequence. * @return The ledger if found, otherwise no value. */ - virtual std::optional + virtual std::optional getLedgerInfoByIndex(LedgerIndex ledgerSeq) = 0; /** * @brief getNewestLedgerInfo Returns the info of the newest saved ledger. * @return Ledger info if found, otherwise no value. */ - virtual std::optional + virtual std::optional getNewestLedgerInfo() = 0; /** @@ -143,7 +143,7 @@ public: * @param ledgerHash Hash of the ledger. * @return Ledger if found, otherwise no value. */ - virtual std::optional + virtual std::optional getLedgerInfoByHash(uint256 const& ledgerHash) = 0; /** diff --git a/src/xrpld/app/rdb/backend/SQLiteDatabase.h b/src/xrpld/app/rdb/backend/SQLiteDatabase.h index 4ebcb4390e..cf668137ea 100644 --- a/src/xrpld/app/rdb/backend/SQLiteDatabase.h +++ b/src/xrpld/app/rdb/backend/SQLiteDatabase.h @@ -100,7 +100,7 @@ public: * @param ledgerFirstIndex Minimum ledger sequence. * @return Ledger info if found, otherwise no value. */ - virtual std::optional + virtual std::optional getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; /** @@ -110,7 +110,7 @@ public: * @param ledgerFirstIndex Minimum ledger sequence. * @return Ledger info if found, otherwise no value. */ - virtual std::optional + virtual std::optional getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) = 0; /** diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index 04f328390d..a7b35a5305 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -391,7 +391,7 @@ saveValidatedLedger( * @param j Journal. * @return Ledger info or no value if the ledger was not found. */ -static std::optional +static std::optional getLedgerInfo( soci::session& session, std::string const& sqlSuffix, @@ -425,7 +425,7 @@ getLedgerInfo( using time_point = NetClock::time_point; using duration = NetClock::duration; - LedgerInfo info; + LedgerHeader info; if (hash && !info.hash.parseHex(*hash)) { @@ -461,7 +461,7 @@ getLedgerInfo( return info; } -std::optional +std::optional getLedgerInfoByIndex( soci::session& session, LedgerIndex ledgerSeq, @@ -472,7 +472,7 @@ getLedgerInfoByIndex( return getLedgerInfo(session, s.str(), j); } -std::optional +std::optional getNewestLedgerInfo(soci::session& session, beast::Journal j) { std::ostringstream s; @@ -480,7 +480,7 @@ getNewestLedgerInfo(soci::session& session, beast::Journal j) return getLedgerInfo(session, s.str(), j); } -std::optional +std::optional getLimitedOldestLedgerInfo( soci::session& session, LedgerIndex ledgerFirstIndex, @@ -492,7 +492,7 @@ getLimitedOldestLedgerInfo( return getLedgerInfo(session, s.str(), j); } -std::optional +std::optional getLimitedNewestLedgerInfo( soci::session& session, LedgerIndex ledgerFirstIndex, @@ -504,7 +504,7 @@ getLimitedNewestLedgerInfo( return getLedgerInfo(session, s.str(), j); } -std::optional +std::optional getLedgerInfoByHash( soci::session& session, uint256 const& ledgerHash, diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index 2c0fd69445..fbf06083d6 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -123,7 +123,7 @@ saveValidatedLedger( * @param j Journal. * @return Ledger or none if ledger not found. */ -std::optional +std::optional getLedgerInfoByIndex( soci::session& session, LedgerIndex ledgerSeq, @@ -135,7 +135,7 @@ getLedgerInfoByIndex( * @param j Journal. * @return Ledger info or none if ledger not found. */ -std::optional +std::optional getNewestLedgerInfo(soci::session& session, beast::Journal j); /** @@ -146,7 +146,7 @@ getNewestLedgerInfo(soci::session& session, beast::Journal j); * @param j Journal. * @return Ledger info or none if ledger not found. */ -std::optional +std::optional getLimitedOldestLedgerInfo( soci::session& session, LedgerIndex ledgerFirstIndex, @@ -160,7 +160,7 @@ getLimitedOldestLedgerInfo( * @param j Journal. * @return Ledger info or none if ledger not found. */ -std::optional +std::optional getLimitedNewestLedgerInfo( soci::session& session, LedgerIndex ledgerFirstIndex, @@ -173,7 +173,7 @@ getLimitedNewestLedgerInfo( * @param j Journal. * @return Ledger or none if ledger not found. */ -std::optional +std::optional getLedgerInfoByHash( soci::session& session, uint256 const& ledgerHash, diff --git a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp index 944ed814f5..b789685211 100644 --- a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp +++ b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp @@ -73,19 +73,19 @@ public: std::shared_ptr const& ledger, bool current) override; - std::optional + std::optional getLedgerInfoByIndex(LedgerIndex ledgerSeq) override; - std::optional + std::optional getNewestLedgerInfo() override; - std::optional + std::optional getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override; - std::optional + std::optional getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override; - std::optional + std::optional getLedgerInfoByHash(uint256 const& ledgerHash) override; uint256 @@ -399,7 +399,7 @@ SQLiteDatabaseImp::saveValidatedLedger( return true; } -std::optional +std::optional SQLiteDatabaseImp::getLedgerInfoByIndex(LedgerIndex ledgerSeq) { if (existsLedger()) @@ -414,7 +414,7 @@ SQLiteDatabaseImp::getLedgerInfoByIndex(LedgerIndex ledgerSeq) return {}; } -std::optional +std::optional SQLiteDatabaseImp::getNewestLedgerInfo() { if (existsLedger()) @@ -429,7 +429,7 @@ SQLiteDatabaseImp::getNewestLedgerInfo() return {}; } -std::optional +std::optional SQLiteDatabaseImp::getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) { if (existsLedger()) @@ -445,7 +445,7 @@ SQLiteDatabaseImp::getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) return {}; } -std::optional +std::optional SQLiteDatabaseImp::getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) { if (existsLedger()) @@ -461,7 +461,7 @@ SQLiteDatabaseImp::getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) return {}; } -std::optional +std::optional SQLiteDatabaseImp::getLedgerInfoByHash(uint256 const& ledgerHash) { if (existsLedger()) diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 0a973a9218..1a0995442b 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -3227,7 +3227,7 @@ PeerImp::sendLedgerBase( { JLOG(p_journal_.trace()) << "sendLedgerBase: Base data"; - Serializer s(sizeof(LedgerInfo)); + Serializer s(sizeof(LedgerHeader)); addRaw(ledger->info(), s); ledgerData.add_nodes()->set_nodedata(s.getDataPtr(), s.getLength()); From 62efecbfb11bf5892c679692be8e98a6a45d92e8 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 10 Dec 2025 16:04:37 -0500 Subject: [PATCH 03/20] refactor: rename info() to header() (#6138) This change renames all the `info()` functions to `header()`, since they return `LedgerHeader` structs. It also renames the underlying variables from `info_` to `header_`. --- include/xrpl/ledger/CachedView.h | 4 +- include/xrpl/ledger/OpenView.h | 4 +- include/xrpl/ledger/ReadView.h | 6 +- include/xrpl/ledger/detail/ApplyViewBase.h | 2 +- src/libxrpl/ledger/ApplyViewBase.cpp | 4 +- src/libxrpl/ledger/CredentialHelpers.cpp | 4 +- src/libxrpl/ledger/OpenView.cpp | 22 +-- src/libxrpl/ledger/View.cpp | 43 ++--- src/test/app/AMM_test.cpp | 2 +- src/test/app/AccountDelete_test.cpp | 2 +- src/test/app/Credentials_test.cpp | 8 +- src/test/app/DepositAuth_test.cpp | 8 +- src/test/app/LedgerHistory_test.cpp | 6 +- src/test/app/LedgerMaster_test.cpp | 4 +- src/test/app/LedgerReplay_test.cpp | 50 ++--- src/test/app/Loan_test.cpp | 4 +- src/test/app/NFToken_test.cpp | 5 +- src/test/app/NetworkID_test.cpp | 2 +- src/test/app/Offer_test.cpp | 5 +- src/test/app/Oracle_test.cpp | 6 +- src/test/app/PayChan_test.cpp | 16 +- src/test/app/PermissionedDEX_test.cpp | 4 +- src/test/app/RCLValidations_test.cpp | 4 +- src/test/app/Regression_test.cpp | 6 +- src/test/app/TxQ_test.cpp | 12 +- src/test/app/Vault_test.cpp | 2 +- src/test/consensus/NegativeUNL_test.cpp | 4 +- src/test/jtx/impl/Env.cpp | 7 +- src/test/jtx/impl/Oracle.cpp | 2 +- src/test/ledger/Directory_test.cpp | 2 +- src/test/ledger/SkipList_test.cpp | 29 +-- src/test/ledger/View_test.cpp | 4 +- src/test/rpc/AccountLines_test.cpp | 12 +- src/test/rpc/AccountTx_test.cpp | 24 +-- src/test/rpc/DepositAuthorized_test.cpp | 2 +- src/test/rpc/LedgerData_test.cpp | 2 +- src/test/rpc/LedgerEntry_test.cpp | 29 +-- src/test/rpc/LedgerRPC_test.cpp | 18 +- src/test/rpc/LedgerRequest_test.cpp | 2 +- src/test/rpc/Simulate_test.cpp | 2 +- src/test/rpc/Subscribe_test.cpp | 8 +- src/test/rpc/Transaction_test.cpp | 16 +- src/test/server/ServerStatus_test.cpp | 4 +- src/xrpld/app/consensus/RCLConsensus.cpp | 22 +-- src/xrpld/app/consensus/RCLCxLedger.h | 14 +- src/xrpld/app/consensus/RCLValidations.cpp | 4 +- src/xrpld/app/ledger/Ledger.cpp | 131 +++++++------- src/xrpld/app/ledger/Ledger.h | 18 +- src/xrpld/app/ledger/LedgerHistory.cpp | 36 ++-- src/xrpld/app/ledger/detail/BuildLedger.cpp | 10 +- src/xrpld/app/ledger/detail/InboundLedger.cpp | 53 +++--- src/xrpld/app/ledger/detail/LedgerCleaner.cpp | 14 +- .../app/ledger/detail/LedgerDeltaAcquire.cpp | 6 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 171 +++++++++--------- .../ledger/detail/LedgerReplayMsgHandler.cpp | 4 +- .../app/ledger/detail/LedgerReplayTask.cpp | 4 +- src/xrpld/app/ledger/detail/LedgerToJson.cpp | 6 +- src/xrpld/app/ledger/detail/LocalTxs.cpp | 2 +- src/xrpld/app/main/Application.cpp | 26 +-- src/xrpld/app/misc/FeeVoteImpl.cpp | 2 +- src/xrpld/app/misc/NegativeUNLVote.cpp | 10 +- src/xrpld/app/misc/NetworkOPs.cpp | 84 +++++---- src/xrpld/app/misc/PermissionedDEXHelpers.cpp | 2 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 2 +- src/xrpld/app/misc/detail/AMMUtils.cpp | 9 +- src/xrpld/app/misc/detail/TxQ.cpp | 11 +- src/xrpld/app/paths/PathRequest.cpp | 2 +- src/xrpld/app/paths/RippleLineCache.cpp | 6 +- src/xrpld/app/rdb/backend/detail/Node.cpp | 39 ++-- src/xrpld/app/tx/detail/AMMBid.cpp | 2 +- src/xrpld/app/tx/detail/Credentials.cpp | 6 +- src/xrpld/app/tx/detail/Escrow.cpp | 6 +- src/xrpld/app/tx/detail/LoanSet.cpp | 2 +- src/xrpld/app/tx/detail/PayChan.cpp | 10 +- src/xrpld/app/tx/detail/SetOracle.cpp | 2 +- src/xrpld/overlay/detail/Handshake.cpp | 4 +- src/xrpld/overlay/detail/PeerImp.cpp | 10 +- src/xrpld/rpc/BookChanges.h | 8 +- src/xrpld/rpc/detail/DeliveredAmount.cpp | 2 +- src/xrpld/rpc/detail/RPCLedgerHelpers.cpp | 10 +- src/xrpld/rpc/handlers/AMMInfo.cpp | 4 +- src/xrpld/rpc/handlers/AccountTx.cpp | 7 +- src/xrpld/rpc/handlers/CanDelete.cpp | 2 +- src/xrpld/rpc/handlers/DepositAuthorized.cpp | 2 +- src/xrpld/rpc/handlers/LedgerClosed.cpp | 4 +- src/xrpld/rpc/handlers/LedgerData.cpp | 4 +- src/xrpld/rpc/handlers/LedgerHandler.cpp | 4 +- src/xrpld/rpc/handlers/LedgerHeader.cpp | 2 +- src/xrpld/rpc/handlers/LedgerRequest.cpp | 2 +- src/xrpld/rpc/handlers/Tx.cpp | 8 +- 90 files changed, 609 insertions(+), 582 deletions(-) diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index ad1125637b..b78c046f58 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -48,9 +48,9 @@ public: } LedgerHeader const& - info() const override + header() const override { - return base_.info(); + return base_.header(); } Fees const& diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index 9027f57b97..2b4bd8a31f 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -82,7 +82,7 @@ private: monotonic_resource_; txs_map txs_; Rules rules_; - LedgerHeader info_; + LedgerHeader header_; ReadView const* base_; detail::RawStateTable items_; std::shared_ptr hold_; @@ -189,7 +189,7 @@ public: // ReadView LedgerHeader const& - info() const override; + header() const override; Fees const& fees() const override; diff --git a/include/xrpl/ledger/ReadView.h b/include/xrpl/ledger/ReadView.h index 4108b19967..70a5fbc006 100644 --- a/include/xrpl/ledger/ReadView.h +++ b/include/xrpl/ledger/ReadView.h @@ -81,7 +81,7 @@ public: /** Returns information about the ledger. */ virtual LedgerHeader const& - info() const = 0; + header() const = 0; /** Returns true if this reflects an open ledger. */ virtual bool @@ -91,14 +91,14 @@ public: NetClock::time_point parentCloseTime() const { - return info().parentCloseTime; + return header().parentCloseTime; } /** Returns the sequence number of the base ledger. */ LedgerIndex seq() const { - return info().seq; + return header().seq; } /** Returns the fees for the base ledger. */ diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index 7bf490cd9c..a75f94ac16 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -28,7 +28,7 @@ public: open() const override; LedgerHeader const& - info() const override; + header() const override; Fees const& fees() const override; diff --git a/src/libxrpl/ledger/ApplyViewBase.cpp b/src/libxrpl/ledger/ApplyViewBase.cpp index f296c3cef2..554822acda 100644 --- a/src/libxrpl/ledger/ApplyViewBase.cpp +++ b/src/libxrpl/ledger/ApplyViewBase.cpp @@ -17,9 +17,9 @@ ApplyViewBase::open() const } LedgerHeader const& -ApplyViewBase::info() const +ApplyViewBase::header() const { - return base_->info(); + return base_->header(); } Fees const& diff --git a/src/libxrpl/ledger/CredentialHelpers.cpp b/src/libxrpl/ledger/CredentialHelpers.cpp index cbca7eb192..aea783b676 100644 --- a/src/libxrpl/ledger/CredentialHelpers.cpp +++ b/src/libxrpl/ledger/CredentialHelpers.cpp @@ -22,7 +22,7 @@ checkExpired( bool removeExpired(ApplyView& view, STVector256 const& arr, beast::Journal const j) { - auto const closeTime = view.info().parentCloseTime; + auto const closeTime = view.header().parentCloseTime; bool foundExpired = false; for (auto const& h : arr) @@ -181,7 +181,7 @@ validDomain(ReadView const& view, uint256 domainID, AccountID const& subject) if (!slePD) return tecOBJECT_NOT_FOUND; - auto const closeTime = view.info().parentCloseTime; + auto const closeTime = view.header().parentCloseTime; bool foundExpired = false; for (auto const& h : slePD->getFieldArray(sfAcceptedCredentials)) { diff --git a/src/libxrpl/ledger/OpenView.cpp b/src/libxrpl/ledger/OpenView.cpp index 25b2ba8a0c..8ddb11abd0 100644 --- a/src/libxrpl/ledger/OpenView.cpp +++ b/src/libxrpl/ledger/OpenView.cpp @@ -61,7 +61,7 @@ OpenView::OpenView(OpenView const& rhs) boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)} , txs_{rhs.txs_, monotonic_resource_.get()} , rules_{rhs.rules_} - , info_{rhs.info_} + , header_{rhs.header_} , base_{rhs.base_} , items_{rhs.items_} , hold_{rhs.hold_} @@ -76,15 +76,15 @@ OpenView::OpenView( boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)} , txs_{monotonic_resource_.get()} , rules_(rules) - , info_(base->info()) + , header_(base->header()) , base_(base) , hold_(std::move(hold)) { - info_.validated = false; - info_.accepted = false; - info_.seq = base_->info().seq + 1; - info_.parentCloseTime = base_->info().closeTime; - info_.parentHash = base_->info().hash; + header_.validated = false; + header_.accepted = false; + header_.seq = base_->header().seq + 1; + header_.parentCloseTime = base_->header().closeTime; + header_.parentHash = base_->header().hash; } OpenView::OpenView(ReadView const* base, std::shared_ptr hold) @@ -92,7 +92,7 @@ OpenView::OpenView(ReadView const* base, std::shared_ptr hold) boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)} , txs_{monotonic_resource_.get()} , rules_(base->rules()) - , info_(base->info()) + , header_(base->header()) , base_(base) , hold_(std::move(hold)) , open_(base->open()) @@ -116,9 +116,9 @@ OpenView::apply(TxsRawView& to) const //--- LedgerHeader const& -OpenView::info() const +OpenView::header() const { - return info_; + return header_; } Fees const& @@ -230,7 +230,7 @@ void OpenView::rawDestroyXRP(XRPAmount const& fee) { items_.destroyXRP(fee); - // VFALCO Deduct from info_.totalDrops ? + // VFALCO Deduct from header_.totalDrops ? // What about child views? } diff --git a/src/libxrpl/ledger/View.cpp b/src/libxrpl/ledger/View.cpp index 33c6cf69ec..d5297479e8 100644 --- a/src/libxrpl/ledger/View.cpp +++ b/src/libxrpl/ledger/View.cpp @@ -907,14 +907,14 @@ areCompatible( { bool ret = true; - if (validLedger.info().seq < testLedger.info().seq) + if (validLedger.header().seq < testLedger.header().seq) { // valid -> ... -> test auto hash = hashOfSeq( testLedger, - validLedger.info().seq, + validLedger.header().seq, beast::Journal{beast::Journal::getNullSink()}); - if (hash && (*hash != validLedger.info().hash)) + if (hash && (*hash != validLedger.header().hash)) { JLOG(s) << reason << " incompatible with valid ledger"; @@ -923,14 +923,14 @@ areCompatible( ret = false; } } - else if (validLedger.info().seq > testLedger.info().seq) + else if (validLedger.header().seq > testLedger.header().seq) { // test -> ... -> valid auto hash = hashOfSeq( validLedger, - testLedger.info().seq, + testLedger.header().seq, beast::Journal{beast::Journal::getNullSink()}); - if (hash && (*hash != testLedger.info().hash)) + if (hash && (*hash != testLedger.header().hash)) { JLOG(s) << reason << " incompatible preceding ledger"; @@ -940,8 +940,8 @@ areCompatible( } } else if ( - (validLedger.info().seq == testLedger.info().seq) && - (validLedger.info().hash != testLedger.info().hash)) + (validLedger.header().seq == testLedger.header().seq) && + (validLedger.header().hash != testLedger.header().hash)) { // Same sequence number, different hash JLOG(s) << reason << " incompatible ledger"; @@ -951,11 +951,11 @@ areCompatible( if (!ret) { - JLOG(s) << "Val: " << validLedger.info().seq << " " - << to_string(validLedger.info().hash); + JLOG(s) << "Val: " << validLedger.header().seq << " " + << to_string(validLedger.header().hash); - JLOG(s) << "New: " << testLedger.info().seq << " " - << to_string(testLedger.info().hash); + JLOG(s) << "New: " << testLedger.header().seq << " " + << to_string(testLedger.header().hash); } return ret; @@ -971,7 +971,7 @@ areCompatible( { bool ret = true; - if (testLedger.info().seq > validIndex) + if (testLedger.header().seq > validIndex) { // Ledger we are testing follows last valid ledger auto hash = hashOfSeq( @@ -987,8 +987,8 @@ areCompatible( } } else if ( - (validIndex == testLedger.info().seq) && - (testLedger.info().hash != validHash)) + (validIndex == testLedger.header().seq) && + (testLedger.header().hash != validHash)) { JLOG(s) << reason << " incompatible ledger"; @@ -999,8 +999,8 @@ areCompatible( { JLOG(s) << "Val: " << validIndex << " " << to_string(validHash); - JLOG(s) << "New: " << testLedger.info().seq << " " - << to_string(testLedger.info().hash); + JLOG(s) << "New: " << testLedger.header().seq << " " + << to_string(testLedger.header().hash); } return ret; @@ -1071,9 +1071,9 @@ hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal) return std::nullopt; } if (seq == ledger.seq()) - return ledger.info().hash; + return ledger.header().hash; if (seq == (ledger.seq() - 1)) - return ledger.info().parentHash; + return ledger.header().parentHash; if (int diff = ledger.seq() - seq; diff <= 256) { @@ -1095,7 +1095,7 @@ hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal) else { JLOG(journal.warn()) - << "Ledger " << ledger.seq() << ":" << ledger.info().hash + << "Ledger " << ledger.seq() << ":" << ledger.header().hash << " missing normal list"; } } @@ -1180,7 +1180,8 @@ pseudoAccountAddress(ReadView const& view, uint256 const& pseudoOwnerKey) for (std::uint16_t i = 0; i < maxAccountAttempts; ++i) { ripesha_hasher rsh; - auto const hash = sha512Half(i, view.info().parentHash, pseudoOwnerKey); + auto const hash = + sha512Half(i, view.header().parentHash, pseudoOwnerKey); rsh(hash.data(), hash.size()); AccountID const ret{static_cast(rsh)}; if (!view.read(keylet::account(ret))) diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index 5a1816ebae..611932e825 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -3646,7 +3646,7 @@ private: auto const pk = carol.pk(); auto const settleDelay = 100s; NetClock::time_point const cancelAfter = - env.current()->info().parentCloseTime + 200s; + env.current()->header().parentCloseTime + 200s; env(paychan::create( carol, ammAlice.ammAccount(), diff --git a/src/test/app/AccountDelete_test.cpp b/src/test/app/AccountDelete_test.cpp index f22f9c4165..91164d3e4e 100644 --- a/src/test/app/AccountDelete_test.cpp +++ b/src/test/app/AccountDelete_test.cpp @@ -922,7 +922,7 @@ public: auto jv = credentials::create(john, carol, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 20; diff --git a/src/test/app/Credentials_test.cpp b/src/test/app/Credentials_test.cpp index fd4a7f41a6..c4a5ee1c7c 100644 --- a/src/test/app/Credentials_test.cpp +++ b/src/test/app/Credentials_test.cpp @@ -336,7 +336,7 @@ struct Credentials_test : public beast::unit_test::suite auto const credKey = credentials::keylet(subject, issuer, credType); auto jv = credentials::create(subject, issuer, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count(); jv[sfExpiration.jsonName] = t + 20; @@ -498,7 +498,7 @@ struct Credentials_test : public beast::unit_test::suite auto jv = credentials::create(subject, issuer, credType); // current time in ripple epoch - 1s uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() - 1; @@ -725,7 +725,7 @@ struct Credentials_test : public beast::unit_test::suite testcase("CredentialsAccept fail, expired credentials."); auto jv = credentials::create(subject, issuer, credType2); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count(); jv[sfExpiration.jsonName] = t; @@ -870,7 +870,7 @@ struct Credentials_test : public beast::unit_test::suite auto jv = credentials::create(subject, issuer, credType); // current time in ripple epoch + 1000s uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 1000; diff --git a/src/test/app/DepositAuth_test.cpp b/src/test/app/DepositAuth_test.cpp index 54d5dd6254..ed727c2fa0 100644 --- a/src/test/app/DepositAuth_test.cpp +++ b/src/test/app/DepositAuth_test.cpp @@ -1107,7 +1107,7 @@ struct DepositPreauth_test : public beast::unit_test::suite // Current time in ripple epoch. // Every time ledger close, unittest timer increase by 10s uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 60; @@ -1122,7 +1122,7 @@ struct DepositPreauth_test : public beast::unit_test::suite // Create credential which not expired jv = credentials::create(alice, issuer, credType2); uint32_t const t2 = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 1000; @@ -1199,7 +1199,7 @@ struct DepositPreauth_test : public beast::unit_test::suite { auto jv = credentials::create(gw, issuer, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 40; @@ -1252,7 +1252,7 @@ struct DepositPreauth_test : public beast::unit_test::suite // Create credentials auto jv = credentials::create(zelda, issuer, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 50; diff --git a/src/test/app/LedgerHistory_test.cpp b/src/test/app/LedgerHistory_test.cpp index e286440679..3223e9e1d8 100644 --- a/src/test/app/LedgerHistory_test.cpp +++ b/src/test/app/LedgerHistory_test.cpp @@ -43,7 +43,7 @@ public: env.app().getNodeFamily()); } auto res = std::make_shared( - *prev, prev->info().closeTime + closeOffset); + *prev, prev->header().closeTime + closeOffset); if (stx) { @@ -62,8 +62,8 @@ public: // Accept ledger res->setAccepted( - res->info().closeTime, - res->info().closeTimeResolution, + res->header().closeTime, + res->header().closeTimeResolution, true /* close time correct*/); lh.insert(res, false); return res; diff --git a/src/test/app/LedgerMaster_test.cpp b/src/test/app/LedgerMaster_test.cpp index 5b815caeda..451e4f9068 100644 --- a/src/test/app/LedgerMaster_test.cpp +++ b/src/test/app/LedgerMaster_test.cpp @@ -37,7 +37,7 @@ class LedgerMaster_test : public beast::unit_test::suite // build ledgers std::vector> txns; std::vector> metas; - auto const startLegSeq = env.current()->info().seq; + auto const startLegSeq = env.current()->header().seq; for (int i = 0; i < 2; ++i) { env(noop(alice)); @@ -48,7 +48,7 @@ class LedgerMaster_test : public beast::unit_test::suite } // add last (empty) ledger env.close(); - auto const endLegSeq = env.closed()->info().seq; + auto const endLegSeq = env.closed()->header().seq; // test invalid range { diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index 9edaaec0a5..a468629de9 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -40,7 +40,7 @@ struct LedgerReplay_test : public beast::unit_test::suite LedgerMaster& ledgerMaster = env.app().getLedgerMaster(); auto const lastClosed = ledgerMaster.getClosedLedger(); auto const lastClosedParent = - ledgerMaster.getLedgerByHash(lastClosed->info().parentHash); + ledgerMaster.getLedgerByHash(lastClosed->header().parentHash); auto const replayed = buildLedger( LedgerReplay(lastClosedParent, lastClosed), @@ -48,7 +48,7 @@ struct LedgerReplay_test : public beast::unit_test::suite env.app(), env.journal); - BEAST_EXPECT(replayed->info().hash == lastClosed->info().hash); + BEAST_EXPECT(replayed->header().hash == lastClosed->header().hash); } }; @@ -610,7 +610,7 @@ public: auto const l = ledgerMaster.getLedgerByHash(hash); if (!l) return false; - hash = l->info().parentHash; + hash = l->header().parentHash; } return true; } @@ -890,7 +890,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite // request, missing key auto request = std::make_shared(); request->set_ledgerhash( - l->info().hash.data(), l->info().hash.size()); + l->header().hash.data(), l->header().hash.size()); request->set_type(protocol::TMLedgerMapType::lmACCOUNT_STATE); auto reply = std::make_shared( server.msgHandler.processProofPathRequest(request)); @@ -914,7 +914,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite // good request auto request = std::make_shared(); request->set_ledgerhash( - l->info().hash.data(), l->info().hash.size()); + l->header().hash.data(), l->header().hash.size()); request->set_type(protocol::TMLedgerMapType::lmACCOUNT_STATE); request->set_key( keylet::skip().key.data(), keylet::skip().key.size()); @@ -970,7 +970,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite // good request auto request = std::make_shared(); request->set_ledgerhash( - l->info().hash.data(), l->info().hash.size()); + l->header().hash.data(), l->header().hash.size()); auto reply = std::make_shared( server.msgHandler.processReplayDeltaRequest(request)); BEAST_EXPECT(!reply->has_error()); @@ -1132,7 +1132,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite NetworkOfTwo net(*this, {totalReplay + 1}, psBhvr, ilBhvr, peerFeature); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; for (int i = 0; i < totalReplay; ++i) { BEAST_EXPECT(l); @@ -1140,7 +1140,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite { net.client.ledgerMaster.storeLedger(l); l = net.server.ledgerMaster.getLedgerByHash( - l->info().parentHash); + l->header().parentHash); } else break; @@ -1175,7 +1175,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite PeerFeature::None); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); @@ -1220,10 +1220,10 @@ struct LedgerReplayer_test : public beast::unit_test::suite // feed client with start ledger since InboundLedgers drops all auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; for (int i = 0; i < totalReplay - 1; ++i) { - l = net.server.ledgerMaster.getLedgerByHash(l->info().parentHash); + l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash); } net.client.ledgerMaster.storeLedger(l); @@ -1258,7 +1258,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); @@ -1288,7 +1288,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); @@ -1333,14 +1333,14 @@ struct LedgerReplayer_test : public beast::unit_test::suite PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.ledgerMaster.storeLedger(l); net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); - auto delta = net.client.findLedgerDeltaAcquire(l->info().parentHash); + auto delta = net.client.findLedgerDeltaAcquire(l->header().parentHash); delta->processData( - l->info(), // wrong ledger info + l->header(), // wrong ledger info std::map>()); BEAST_EXPECT(net.client.taskStatus(delta) == TaskStatus::Failed); BEAST_EXPECT( @@ -1367,7 +1367,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); std::vector deltaStatuses( @@ -1392,9 +1392,9 @@ struct LedgerReplayer_test : public beast::unit_test::suite // no overlap for (int i = 0; i < totalReplay + 2; ++i) { - l = net.server.ledgerMaster.getLedgerByHash(l->info().parentHash); + l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash); } - auto finalHash_early = l->info().hash; + auto finalHash_early = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash_early, totalReplay); BEAST_EXPECT(net.client.waitAndCheckStatus( @@ -1407,8 +1407,8 @@ struct LedgerReplayer_test : public beast::unit_test::suite BEAST_EXPECT(net.client.countsAsExpected(3, 2, 2 * (totalReplay - 1))); // partial overlap - l = net.server.ledgerMaster.getLedgerByHash(l->info().parentHash); - auto finalHash_moreEarly = l->info().parentHash; + l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash); + auto finalHash_moreEarly = l->header().parentHash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash_moreEarly, totalReplay); BEAST_EXPECT(net.client.waitAndCheckStatus( @@ -1479,7 +1479,7 @@ struct LedgerReplayerTimeout_test : public beast::unit_test::suite PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); @@ -1510,7 +1510,7 @@ struct LedgerReplayerTimeout_test : public beast::unit_test::suite PeerFeature::LedgerReplayEnabled); auto l = net.server.ledgerMaster.getClosedLedger(); - uint256 finalHash = l->info().hash; + uint256 finalHash = l->header().hash; net.client.ledgerMaster.storeLedger(l); net.client.replayer.replay( InboundLedger::Reason::GENERIC, finalHash, totalReplay); @@ -1558,11 +1558,11 @@ struct LedgerReplayerLong_test : public beast::unit_test::suite auto l = net.server.ledgerMaster.getClosedLedger(); for (int i = 0; i < rounds; ++i) { - finishHashes.push_back(l->info().hash); + finishHashes.push_back(l->header().hash); for (int j = 0; j < totalReplay; ++j) { l = net.server.ledgerMaster.getLedgerByHash( - l->info().parentHash); + l->header().parentHash); } } BEAST_EXPECT(finishHashes.size() == rounds); diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index b2ad47c2b4..f7672fd380 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -1398,7 +1398,7 @@ protected: env.close(); auto const startDate = - env.current()->info().parentCloseTime.time_since_epoch().count(); + env.current()->header().parentCloseTime.time_since_epoch().count(); if (auto const brokerSle = env.le(keylet::loanbroker(broker.brokerID)); BEAST_EXPECT(brokerSle)) @@ -3761,7 +3761,7 @@ protected: env.close(); - auto const startDate = env.current()->info().parentCloseTime; + auto const startDate = env.current()->header().parentCloseTime; // Loan is successfully created { diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 5f57322be1..5ff0ac17ae 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -57,7 +57,10 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite std::uint32_t lastClose(test::jtx::Env& env) { - return env.current()->info().parentCloseTime.time_since_epoch().count(); + return env.current() + ->header() + .parentCloseTime.time_since_epoch() + .count(); } void diff --git a/src/test/app/NetworkID_test.cpp b/src/test/app/NetworkID_test.cpp index 01db95835e..49ca453ebb 100644 --- a/src/test/app/NetworkID_test.cpp +++ b/src/test/app/NetworkID_test.cpp @@ -112,7 +112,7 @@ public: jvn[jss::TransactionType] = jss::AccountSet; jvn[jss::Fee] = to_string(env.current()->fees().base); jvn[jss::Sequence] = env.seq(alice); - jvn[jss::LastLedgerSequence] = env.current()->info().seq + 2; + jvn[jss::LastLedgerSequence] = env.current()->header().seq + 2; auto jt = env.jtnofill(jvn); Serializer s; jt.stx->add(s); diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 2cbf2598e1..9cf8a7b1f2 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -20,7 +20,10 @@ class OfferBaseUtil_test : public beast::unit_test::suite std::uint32_t lastClose(jtx::Env& env) { - return env.current()->info().parentCloseTime.time_since_epoch().count(); + return env.current() + ->header() + .parentCloseTime.time_since_epoch() + .count(); } static auto diff --git a/src/test/app/Oracle_test.cpp b/src/test/app/Oracle_test.cpp index 42f2455f31..470bcd7950 100644 --- a/src/test/app/Oracle_test.cpp +++ b/src/test/app/Oracle_test.cpp @@ -252,7 +252,9 @@ private: static_cast(env.current()->fees().base.drops()); auto closeTime = [&]() { return duration_cast( - env.current()->info().closeTime.time_since_epoch() - + env.current() + ->header() + .closeTime.time_since_epoch() - 10'000s) .count(); }; @@ -559,7 +561,7 @@ private: BEAST_EXPECT(oracle.exists()); BEAST_EXPECT(oracle1.exists()); auto const index = env.closed()->seq(); - auto const hash = env.closed()->info().hash; + auto const hash = env.closed()->header().hash; for (int i = 0; i < 256; ++i) env.close(); env(acctdelete(owner, alice), fee(acctDelFee)); diff --git a/src/test/app/PayChan_test.cpp b/src/test/app/PayChan_test.cpp index 59c404ae28..3f350626ea 100644 --- a/src/test/app/PayChan_test.cpp +++ b/src/test/app/PayChan_test.cpp @@ -322,7 +322,7 @@ struct PayChan_test : public beast::unit_test::suite auto const pk = alice.pk(); auto const settleDelay = 100s; NetClock::time_point const cancelAfter = - env.current()->info().parentCloseTime + 3600s; + env.current()->header().parentCloseTime + 3600s; auto const channelFunds = XRP(1000); auto const chan = channel(alice, bob, env.seq(alice)); env(create(alice, bob, channelFunds, settleDelay, pk, cancelAfter)); @@ -354,7 +354,7 @@ struct PayChan_test : public beast::unit_test::suite auto const pk = alice.pk(); auto const settleDelay = 100s; NetClock::time_point const cancelAfter = - env.current()->info().parentCloseTime + 3600s; + env.current()->header().parentCloseTime + 3600s; auto const channelFunds = XRP(1000); auto const chan = channel(alice, bob, env.seq(alice)); env(create(alice, bob, channelFunds, settleDelay, pk, cancelAfter)); @@ -385,7 +385,7 @@ struct PayChan_test : public beast::unit_test::suite auto const settleDelay = 100s; auto const channelFunds = XRP(1000); NetClock::time_point const cancelAfter = - env.current()->info().parentCloseTime - 1s; + env.current()->header().parentCloseTime - 1s; auto const txResult = withFixPayChan ? ter(tecEXPIRED) : ter(tesSUCCESS); env(create( @@ -409,7 +409,7 @@ struct PayChan_test : public beast::unit_test::suite auto const settleDelay = 100s; auto const channelFunds = XRP(1000); NetClock::time_point const cancelAfter = - env.current()->info().parentCloseTime; + env.current()->header().parentCloseTime; env(create( alice, bob, channelFunds, settleDelay, pk, cancelAfter), ter(tesSUCCESS)); @@ -430,7 +430,7 @@ struct PayChan_test : public beast::unit_test::suite env.fund(XRP(10000), alice, bob, carol); auto const pk = alice.pk(); auto const settleDelay = 3600s; - auto const closeTime = env.current()->info().parentCloseTime; + auto const closeTime = env.current()->header().parentCloseTime; auto const minExpiration = closeTime + settleDelay; NetClock::time_point const cancelAfter = closeTime + 7200s; auto const channelFunds = XRP(1000); @@ -496,7 +496,7 @@ struct PayChan_test : public beast::unit_test::suite auto const pk = alice.pk(); auto const settleDelay = 3600s; NetClock::time_point const settleTimepoint = - env.current()->info().parentCloseTime + settleDelay; + env.current()->header().parentCloseTime + settleDelay; auto const channelFunds = XRP(1000); auto const chan = channel(alice, bob, env.seq(alice)); env(create(alice, bob, channelFunds, settleDelay, pk)); @@ -861,7 +861,7 @@ struct PayChan_test : public beast::unit_test::suite { // create credentials auto jv = credentials::create(alice, carol, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 100; @@ -1910,7 +1910,7 @@ struct PayChan_test : public beast::unit_test::suite env.close(); // settle delay hasn't elapsed. Channels should exist. BEAST_EXPECT(channelExists(*env.current(), chan)); - auto const closeTime = env.current()->info().parentCloseTime; + auto const closeTime = env.current()->header().parentCloseTime; auto const minExpiration = closeTime + settleDelay; env.close(minExpiration); env(claim(alice, chan), txflags(tfClose)); diff --git a/src/test/app/PermissionedDEX_test.cpp b/src/test/app/PermissionedDEX_test.cpp index 25d94a968b..4b7a1db1be 100644 --- a/src/test/app/PermissionedDEX_test.cpp +++ b/src/test/app/PermissionedDEX_test.cpp @@ -242,7 +242,7 @@ class PermissionedDEX_test : public beast::unit_test::suite auto jv = credentials::create(devin, domainOwner, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count(); jv[sfExpiration.jsonName] = t + 20; @@ -797,7 +797,7 @@ class PermissionedDEX_test : public beast::unit_test::suite auto jv = credentials::create(devin, domainOwner, credType); uint32_t const t = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count(); jv[sfExpiration.jsonName] = t + 20; diff --git a/src/test/app/RCLValidations_test.cpp b/src/test/app/RCLValidations_test.cpp index 2edf61c8c2..2d3c4f2af5 100644 --- a/src/test/app/RCLValidations_test.cpp +++ b/src/test/app/RCLValidations_test.cpp @@ -111,13 +111,13 @@ class RCLValidations_test : public beast::unit_test::suite { std::shared_ptr ledger = history.back(); RCLValidatedLedger a{ledger, env.journal}; - BEAST_EXPECT(a.seq() == ledger->info().seq); + BEAST_EXPECT(a.seq() == ledger->header().seq); BEAST_EXPECT(a.minSeq() == a.seq() - maxAncestors); // Ensure the ancestral 256 ledgers have proper ID for (Seq s = a.seq(); s > 0; s--) { if (s >= a.minSeq()) - BEAST_EXPECT(a[s] == history[s - 1]->info().hash); + BEAST_EXPECT(a[s] == history[s - 1]->header().hash); else BEAST_EXPECT(a[s] == ID{0}); } diff --git a/src/test/app/Regression_test.cpp b/src/test/app/Regression_test.cpp index 81184a595b..be51d9c96e 100644 --- a/src/test/app/Regression_test.cpp +++ b/src/test/app/Regression_test.cpp @@ -50,7 +50,7 @@ struct Regression_test : public beast::unit_test::suite std::vector{}, env.app().getNodeFamily()); auto expectedDrops = INITIAL_XRP; - BEAST_EXPECT(closed->info().drops == expectedDrops); + BEAST_EXPECT(closed->header().drops == expectedDrops); auto const aliceXRP = 400; auto const aliceAmount = XRP(aliceXRP); @@ -70,7 +70,7 @@ struct Regression_test : public beast::unit_test::suite accum.apply(*next); } expectedDrops -= next->fees().base; - BEAST_EXPECT(next->info().drops == expectedDrops); + BEAST_EXPECT(next->header().drops == expectedDrops); { auto const sle = next->read(keylet::account(Account("alice").id())); BEAST_EXPECT(sle); @@ -101,7 +101,7 @@ struct Regression_test : public beast::unit_test::suite BEAST_EXPECT(balance == XRP(0)); } expectedDrops -= aliceXRP * dropsPerXRP; - BEAST_EXPECT(next->info().drops == expectedDrops); + BEAST_EXPECT(next->header().drops == expectedDrops); } void diff --git a/src/test/app/TxQ_test.cpp b/src/test/app/TxQ_test.cpp index e59cf7deff..0af91f25a6 100644 --- a/src/test/app/TxQ_test.cpp +++ b/src/test/app/TxQ_test.cpp @@ -726,7 +726,7 @@ public: env(noop(daria)); checkMetrics(*this, env, 0, std::nullopt, 3, 2); - BEAST_EXPECT(env.current()->info().seq == 6); + BEAST_EXPECT(env.current()->header().seq == 6); // Fail to queue an item with a low LastLedgerSeq env(noop(alice), last_ledger_seq(7), ter(telCAN_NOT_QUEUE)); // Queue an item with a sufficient LastLedgerSeq. @@ -1075,7 +1075,7 @@ public: // Alice - fill up the queue std::int64_t aliceFee = 27; aliceSeq = env.seq(alice); - auto lastLedgerSeq = env.current()->info().seq + 2; + auto lastLedgerSeq = env.current()->header().seq + 2; for (auto i = 0; i < 7; i++) { env(noop(alice), @@ -2683,7 +2683,7 @@ public: checkMetrics(*this, env, 0, std::nullopt, 2, 1); auto const aliceSeq = env.seq(alice); - BEAST_EXPECT(env.current()->info().seq == 3); + BEAST_EXPECT(env.current()->header().seq == 3); env(noop(alice), seq(aliceSeq), last_ledger_seq(5), ter(terQUEUED)); env(noop(alice), seq(aliceSeq + 1), last_ledger_seq(5), ter(terQUEUED)); env(noop(alice), @@ -2779,7 +2779,7 @@ public: checkMetrics(*this, env, 0, std::nullopt, 2, 1); auto const aliceSeq = env.seq(alice); - BEAST_EXPECT(env.current()->info().seq == 3); + BEAST_EXPECT(env.current()->header().seq == 3); // Start by procuring tickets for alice to use to keep her queue full // without affecting the sequence gap that will appear later. @@ -2932,7 +2932,7 @@ public: // Queue up several transactions for alice sign-and-submit auto const aliceSeq = env.seq(alice); - auto const lastLedgerSeq = env.current()->info().seq + 2; + auto const lastLedgerSeq = env.current()->header().seq + 2; auto submitParams = Json::Value(Json::objectValue); for (int i = 0; i < 5; ++i) @@ -3073,7 +3073,7 @@ public: prevLedgerWithQueue[jss::account] = alice.human(); prevLedgerWithQueue[jss::queue] = true; prevLedgerWithQueue[jss::ledger_index] = 3; - BEAST_EXPECT(env.current()->info().seq > 3); + BEAST_EXPECT(env.current()->header().seq > 3); { // account_info without the "queue" argument. diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index ce76e06912..a07045743e 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -3520,7 +3520,7 @@ class Vault_test : public beast::unit_test::suite { testcase("private vault expired authorization"); uint32_t const closeTime = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count(); { diff --git a/src/test/consensus/NegativeUNL_test.cpp b/src/test/consensus/NegativeUNL_test.cpp index 5b7eebed2f..a1000c0d49 100644 --- a/src/test/consensus/NegativeUNL_test.cpp +++ b/src/test/consensus/NegativeUNL_test.cpp @@ -621,7 +621,7 @@ struct NetworkHistory keyPair.second, v, [&](STValidation& v) { - v.setFieldH256(sfLedgerHash, ledger->info().hash); + v.setFieldH256(sfLedgerHash, ledger->header().hash); v.setFieldU32(sfLedgerSequence, ledger->seq()); v.setFlag(vfFullValidation); }); @@ -1773,7 +1773,7 @@ class NegativeUNLVoteFilterValidations_test : public beast::unit_test::suite keys.second, calcNodeID(keys.first), [&](STValidation& v) { - v.setFieldH256(sfLedgerHash, l->info().hash); + v.setFieldH256(sfLedgerHash, l->header().hash); v.setFieldU32(sfLedgerSequence, l->seq()); v.setFlag(vfFullValidation); }); diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index 9ce76d01c9..311a5dde3a 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -67,7 +67,8 @@ Env::AppBundle::AppBundle( app->logs().threshold(thresh); if (!app->setup({})) Throw("Env::AppBundle: setup failed"); - timeKeeper->set(app->getLedgerMaster().getClosedLedger()->info().closeTime); + timeKeeper->set( + app->getLedgerMaster().getClosedLedger()->header().closeTime); app->start(false /*don't start timers*/); thread = std::thread([&]() { app->run(); }); @@ -107,7 +108,7 @@ Env::close( // Round up to next distinguishable value using namespace std::chrono_literals; bool res = true; - closeTime += closed()->info().closeTimeResolution - 1s; + closeTime += closed()->header().closeTimeResolution - 1s; timeKeeper().set(closeTime); // Go through the rpc interface unless we need to simulate // a specific consensus delay. @@ -130,7 +131,7 @@ Env::close( res = false; } } - timeKeeper().set(closed()->info().closeTime); + timeKeeper().set(closed()->header().closeTime); return res; } diff --git a/src/test/jtx/impl/Oracle.cpp b/src/test/jtx/impl/Oracle.cpp index 4c5fab3b61..e3396f3ebc 100644 --- a/src/test/jtx/impl/Oracle.cpp +++ b/src/test/jtx/impl/Oracle.cpp @@ -216,7 +216,7 @@ Oracle::set(UpdateArg const& arg) else jv[jss::LastUpdateTime] = to_string( duration_cast( - env_.current()->info().closeTime.time_since_epoch()) + env_.current()->header().closeTime.time_since_epoch()) .count() + epoch_offset.count()); Json::Value dataSeries(Json::arrayValue); diff --git a/src/test/ledger/Directory_test.cpp b/src/test/ledger/Directory_test.cpp index b927103f8f..68c3286660 100644 --- a/src/test/ledger/Directory_test.cpp +++ b/src/test/ledger/Directory_test.cpp @@ -436,7 +436,7 @@ struct Directory_test : public beast::unit_test::suite // exist env(offer(alice, XRP(1), USD(1))); auto const txID = to_string(env.tx()->getTransactionID()); - auto const ledgerSeq = env.current()->info().seq; + auto const ledgerSeq = env.current()->header().seq; env.close(); // Make sure the fields only exist if the object is touched env(noop(gw)); diff --git a/src/test/ledger/SkipList_test.cpp b/src/test/ledger/SkipList_test.cpp index b84f002503..4869036014 100644 --- a/src/test/ledger/SkipList_test.cpp +++ b/src/test/ledger/SkipList_test.cpp @@ -35,32 +35,35 @@ class SkipList_test : public beast::unit_test::suite { auto l = *(std::next(std::begin(history))); - BEAST_EXPECT((*std::begin(history))->info().seq < l->info().seq); BEAST_EXPECT( - !hashOfSeq(*l, l->info().seq + 1, env.journal).has_value()); + (*std::begin(history))->header().seq < l->header().seq); BEAST_EXPECT( - hashOfSeq(*l, l->info().seq, env.journal) == l->info().hash); + !hashOfSeq(*l, l->header().seq + 1, env.journal).has_value()); BEAST_EXPECT( - hashOfSeq(*l, l->info().seq - 1, env.journal) == - l->info().parentHash); - BEAST_EXPECT(!hashOfSeq(*history.back(), l->info().seq, env.journal) - .has_value()); + hashOfSeq(*l, l->header().seq, env.journal) == + l->header().hash); + BEAST_EXPECT( + hashOfSeq(*l, l->header().seq - 1, env.journal) == + l->header().parentHash); + BEAST_EXPECT( + !hashOfSeq(*history.back(), l->header().seq, env.journal) + .has_value()); } // ledger skip lists store up to the previous 256 hashes for (auto i = history.crbegin(); i != history.crend(); i += 256) { for (auto n = i; - n != std::next(i, (*i)->info().seq - 256 > 1 ? 257 : 256); + n != std::next(i, (*i)->header().seq - 256 > 1 ? 257 : 256); ++n) { BEAST_EXPECT( - hashOfSeq(**i, (*n)->info().seq, env.journal) == - (*n)->info().hash); + hashOfSeq(**i, (*n)->header().seq, env.journal) == + (*n)->header().hash); } // edge case accessing beyond 256 - BEAST_EXPECT(!hashOfSeq(**i, (*i)->info().seq - 258, env.journal) + BEAST_EXPECT(!hashOfSeq(**i, (*i)->header().seq - 258, env.journal) .has_value()); } @@ -71,8 +74,8 @@ class SkipList_test : public beast::unit_test::suite for (auto n = std::next(i, 512); n != history.crend(); n += 256) { BEAST_EXPECT( - hashOfSeq(**i, (*n)->info().seq, env.journal) == - (*n)->info().hash); + hashOfSeq(**i, (*n)->header().seq, env.journal) == + (*n)->header().hash); } } } diff --git a/src/test/ledger/View_test.cpp b/src/test/ledger/View_test.cpp index 9c7a5a286e..a8f3f7fc3b 100644 --- a/src/test/ledger/View_test.cpp +++ b/src/test/ledger/View_test.cpp @@ -1019,8 +1019,8 @@ class View_test : public beast::unit_test::suite // Try the other interface. // Note that the different interface has different outcomes. - auto const& iA3 = rdViewA3->info(); - auto const& iA4 = rdViewA4->info(); + auto const& iA3 = rdViewA3->header(); + auto const& iA4 = rdViewA4->header(); BEAST_EXPECT(areCompatible(iA3.hash, iA3.seq, *rdViewA4, jStream, "")); BEAST_EXPECT(areCompatible(iA4.hash, iA4.seq, *rdViewA3, jStream, "")); diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index 2bc6c38779..200331b9be 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -68,7 +68,7 @@ public: } env.fund(XRP(10000), alice); env.close(); - LedgerHeader const ledger3Info = env.closed()->info(); + LedgerHeader const ledger3Info = env.closed()->header(); BEAST_EXPECT(ledger3Info.seq == 3); { @@ -118,7 +118,7 @@ public: env(pay(gw1, alice, gw1Currency(50 + c))); } env.close(); - LedgerHeader const ledger4Info = env.closed()->info(); + LedgerHeader const ledger4Info = env.closed()->header(); BEAST_EXPECT(ledger4Info.seq == 4); // Add another set of trust lines in another ledger so we can see @@ -153,7 +153,7 @@ public: tfSetNoRipple | tfSetFreeze | tfSetDeepFreeze)); } env.close(); - LedgerHeader const ledger58Info = env.closed()->info(); + LedgerHeader const ledger58Info = env.closed()->header(); BEAST_EXPECT(ledger58Info.seq == 58); // A re-usable test for historic ledgers. @@ -817,7 +817,7 @@ public: } env.fund(XRP(10000), alice); env.close(); - LedgerHeader const ledger3Info = env.closed()->info(); + LedgerHeader const ledger3Info = env.closed()->header(); BEAST_EXPECT(ledger3Info.seq == 3); { @@ -899,7 +899,7 @@ public: env(pay(gw1, alice, gw1Currency(50 + c))); } env.close(); - LedgerHeader const ledger4Info = env.closed()->info(); + LedgerHeader const ledger4Info = env.closed()->header(); BEAST_EXPECT(ledger4Info.seq == 4); // Add another set of trust lines in another ledger so we can see @@ -934,7 +934,7 @@ public: tfSetNoRipple | tfSetFreeze | tfSetDeepFreeze)); } env.close(); - LedgerHeader const ledger58Info = env.closed()->info(); + LedgerHeader const ledger58Info = env.closed()->header(); BEAST_EXPECT(ledger58Info.seq == 58); // A re-usable test for historic ledgers. diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index f55d053c9e..f9f21c5e87 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -242,7 +242,7 @@ class AccountTx_test : public beast::unit_test::suite env.rpc("json", "account_tx", to_string(p)), rpcLGR_IDX_MALFORMED)); - p[jss::ledger_index_min] = env.current()->info().seq; + p[jss::ledger_index_min] = env.current()->header().seq; BEAST_EXPECT(isErr( env.rpc("json", "account_tx", to_string(p)), (apiVersion == 1 ? rpcLGR_IDXS_INVALID @@ -256,7 +256,7 @@ class AccountTx_test : public beast::unit_test::suite BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); - p[jss::ledger_index_max] = env.current()->info().seq; + p[jss::ledger_index_max] = env.current()->header().seq; if (apiVersion < 2u) BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); @@ -269,11 +269,11 @@ class AccountTx_test : public beast::unit_test::suite BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); - p[jss::ledger_index_max] = env.closed()->info().seq; + p[jss::ledger_index_max] = env.closed()->header().seq; BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); - p[jss::ledger_index_max] = env.closed()->info().seq - 1; + p[jss::ledger_index_max] = env.closed()->header().seq - 1; BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p)))); } @@ -281,19 +281,19 @@ class AccountTx_test : public beast::unit_test::suite { Json::Value p{jParams}; - p[jss::ledger_index] = env.closed()->info().seq; + p[jss::ledger_index] = env.closed()->header().seq; BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); - p[jss::ledger_index] = env.closed()->info().seq - 1; + p[jss::ledger_index] = env.closed()->header().seq - 1; BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p)))); - p[jss::ledger_index] = env.current()->info().seq; + p[jss::ledger_index] = env.current()->header().seq; BEAST_EXPECT(isErr( env.rpc("json", "account_tx", to_string(p)), rpcLGR_NOT_VALIDATED)); - p[jss::ledger_index] = env.current()->info().seq + 1; + p[jss::ledger_index] = env.current()->header().seq + 1; BEAST_EXPECT(isErr( env.rpc("json", "account_tx", to_string(p)), rpcLGR_NOT_FOUND)); } @@ -302,11 +302,11 @@ class AccountTx_test : public beast::unit_test::suite { Json::Value p{jParams}; - p[jss::ledger_hash] = to_string(env.closed()->info().hash); + p[jss::ledger_hash] = to_string(env.closed()->header().hash); BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); - p[jss::ledger_hash] = to_string(env.closed()->info().parentHash); + p[jss::ledger_hash] = to_string(env.closed()->header().parentHash); BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p)))); } @@ -333,7 +333,7 @@ class AccountTx_test : public beast::unit_test::suite // Ledger index max only { Json::Value p{jParams}; - p[jss::ledger_index_max] = env.current()->info().seq; + p[jss::ledger_index_max] = env.current()->header().seq; if (apiVersion < 2u) BEAST_EXPECT(hasTxs( env.rpc(apiVersion, "json", "account_tx", to_string(p)))); @@ -903,7 +903,7 @@ class AccountTx_test : public beast::unit_test::suite // // ledger hash should be fixed regardless any change to account history // BEAST_EXPECT( - // to_string(env.closed()->info().hash) == + // to_string(env.closed()->header().hash) == // "0BD507BB87D3C0E73B462485E6E381798A8C82FC49BF17FE39C60E08A1AF035D"); // alice authorizes bob diff --git a/src/test/rpc/DepositAuthorized_test.cpp b/src/test/rpc/DepositAuthorized_test.cpp index 8ed52542d6..6e46b077b8 100644 --- a/src/test/rpc/DepositAuthorized_test.cpp +++ b/src/test/rpc/DepositAuthorized_test.cpp @@ -557,7 +557,7 @@ public: // check expired credentials char const credType2[] = "fghijk"; std::uint32_t const x = env.current() - ->info() + ->header() .parentCloseTime.time_since_epoch() .count() + 40; diff --git a/src/test/rpc/LedgerData_test.cpp b/src/test/rpc/LedgerData_test.cpp index 3705133432..9ac61c277a 100644 --- a/src/test/rpc/LedgerData_test.cpp +++ b/src/test/rpc/LedgerData_test.cpp @@ -217,7 +217,7 @@ public: if (BEAST_EXPECT(jrr.isMember(jss::ledger))) BEAST_EXPECT( jrr[jss::ledger][jss::ledger_hash] == - to_string(env.closed()->info().hash)); + to_string(env.closed()->header().hash)); } { // Closed ledger with binary form diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index 372f5676b0..8e9be02dda 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -539,7 +539,7 @@ class LedgerEntry_test : public beast::unit_test::suite env.fund(XRP(10000), alice); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; { // Exercise ledger_closed along the way. Json::Value const jrr = env.rpc("ledger_closed")[jss::result]; @@ -646,7 +646,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(check::create(env.master, alice, XRP(100))); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; { // Request a check. Json::Value jvParams; @@ -765,7 +765,7 @@ class LedgerEntry_test : public beast::unit_test::suite env.close(); env(delegate::set(alice, bob, {"Payment", "CheckCreate"})); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; std::string delegateIndex; { // Request by account and authorize @@ -823,7 +823,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(deposit::auth(alice, becky)); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; std::string depositPreauthIndex; { // Request a depositPreauth by owner and authorized. @@ -1171,7 +1171,7 @@ class LedgerEntry_test : public beast::unit_test::suite } env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; { // Exercise ledger_closed along the way. Json::Value const jrr = env.rpc("ledger_closed")[jss::result]; @@ -1331,7 +1331,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(escrowCreate(alice, alice, XRP(333), env.now() + 2s)); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; std::string escrowIndex; { // Request the escrow using owner and sequence. @@ -1379,7 +1379,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(offer(alice, USD(321), XRP(322))); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; std::string offerIndex; { // Request the offer using owner and sequence. @@ -1443,7 +1443,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(payChanCreate(alice, env.master, XRP(57), 18s, alice.pk())); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; uint256 const payChanIndex{ keylet::payChan(alice, env.master, env.seq(alice) - 1).key}; @@ -1495,7 +1495,8 @@ class LedgerEntry_test : public beast::unit_test::suite // check both aliases for (auto const& fieldName : {jss::ripple_state, jss::state}) { - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{ + to_string(env.closed()->header().hash)}; { // Request the trust line using the accounts and currency. Json::Value jvParams; @@ -1637,7 +1638,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(ticket::create(env.master, 2)); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; // Request four tickets: one before the first one we created, the // two created tickets, and the ticket that would come after the // last created ticket. @@ -1734,7 +1735,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(didCreate(alice)); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; { // Request the DID using its index. @@ -1865,7 +1866,7 @@ class LedgerEntry_test : public beast::unit_test::suite tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback}); mptAlice.authorize({.account = bob, .holderCount = 1}); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; std::string const badMptID = "00000193B9DDCAF401B5B3B26875986043F82CD0D13B4315"; @@ -2024,7 +2025,7 @@ class LedgerEntry_test : public beast::unit_test::suite env(check::create(env.master, alice, XRP(100))); env.close(); - std::string const ledgerHash{to_string(env.closed()->info().hash)}; + std::string const ledgerHash{to_string(env.closed()->header().hash)}; { // Request a check. Json::Value const jrr = @@ -2095,7 +2096,7 @@ class LedgerEntry_XChain_test : public beast::unit_test::suite, createBridgeObjects(mcEnv, scEnv); - std::string const ledgerHash{to_string(mcEnv.closed()->info().hash)}; + std::string const ledgerHash{to_string(mcEnv.closed()->header().hash)}; std::string bridge_index; Json::Value mcBridge; { diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 4a90793fa2..7728973045 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -60,7 +60,7 @@ class LedgerRPC_test : public beast::unit_test::suite Env env{*this}; env.close(); - BEAST_EXPECT(env.current()->info().seq == 4); + BEAST_EXPECT(env.current()->header().seq == 4); { Json::Value jvParams; @@ -87,9 +87,9 @@ class LedgerRPC_test : public beast::unit_test::suite BEAST_EXPECT(jrr[jss::ledger][jss::closed] == false); BEAST_EXPECT( jrr[jss::ledger][jss::ledger_index] == - std::to_string(env.current()->info().seq)); + std::to_string(env.current()->header().seq)); BEAST_EXPECT( - jrr[jss::ledger_current_index] == env.current()->info().seq); + jrr[jss::ledger_current_index] == env.current()->header().seq); } } @@ -182,12 +182,12 @@ class LedgerRPC_test : public beast::unit_test::suite Env env{*this}; env.close(); - BEAST_EXPECT(env.current()->info().seq == 4); + BEAST_EXPECT(env.current()->header().seq == 4); { auto const jrr = env.rpc("ledger_current")[jss::result]; BEAST_EXPECT( - jrr[jss::ledger_current_index] == env.current()->info().seq); + jrr[jss::ledger_current_index] == env.current()->header().seq); } } @@ -475,7 +475,7 @@ class LedgerRPC_test : public beast::unit_test::suite env(noop(alice)); } - BEAST_EXPECT(env.current()->info().seq == 5); + BEAST_EXPECT(env.current()->header().seq == 5); // Put some txs in the queue // Alice auto aliceSeq = env.seq(alice); @@ -508,7 +508,7 @@ class LedgerRPC_test : public beast::unit_test::suite env.close(); env.close(); env.close(); - BEAST_EXPECT(env.current()->info().seq == 8); + BEAST_EXPECT(env.current()->header().seq == 8); jrr = env.rpc("json", "ledger", to_string(jv))[jss::result]; BEAST_EXPECT(jrr[jss::queue_data].size() == 11); @@ -517,7 +517,7 @@ class LedgerRPC_test : public beast::unit_test::suite jrr = env.rpc("json", "ledger", to_string(jv))[jss::result]; std::string const txid0 = [&]() { - auto const& parentHash = env.current()->info().parentHash; + auto const& parentHash = env.current()->header().parentHash; if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2)) { std::string const txid1 = [&]() { @@ -559,7 +559,7 @@ class LedgerRPC_test : public beast::unit_test::suite jrr = env.rpc("json", "ledger", to_string(jv))[jss::result]; if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2)) { - auto const& parentHash = env.current()->info().parentHash; + auto const& parentHash = env.current()->header().parentHash; auto const txid1 = [&]() { auto const& txj = jrr[jss::queue_data][1u]; BEAST_EXPECT(txj[jss::account] == alice.human()); diff --git a/src/test/rpc/LedgerRequest_test.cpp b/src/test/rpc/LedgerRequest_test.cpp index 68d29d1901..013d4cbe0f 100644 --- a/src/test/rpc/LedgerRequest_test.cpp +++ b/src/test/rpc/LedgerRequest_test.cpp @@ -32,7 +32,7 @@ public: env.close(); env.close(); - BEAST_EXPECT(env.current()->info().seq == 5); + BEAST_EXPECT(env.current()->header().seq == 5); { // arbitrary text is converted to 0. diff --git a/src/test/rpc/Simulate_test.cpp b/src/test/rpc/Simulate_test.cpp index d7018fdbbc..61d3f1ce6e 100644 --- a/src/test/rpc/Simulate_test.cpp +++ b/src/test/rpc/Simulate_test.cpp @@ -1027,7 +1027,7 @@ class Simulate_test : public beast::unit_test::suite auto jv = credentials::create(subject, issuer, credType); uint32_t const t = - env.current()->info().parentCloseTime.time_since_epoch().count(); + env.current()->header().parentCloseTime.time_since_epoch().count(); jv[sfExpiration.jsonName] = t; env(jv); env.close(); diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index 98e86484f5..a4eea3f12c 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -469,11 +469,11 @@ public: return false; if (jv[jss::ledger_hash] != - to_string(env.closed()->info().hash)) + to_string(env.closed()->header().hash)) return false; if (jv[jss::ledger_index] != - std::to_string(env.closed()->info().seq)) + std::to_string(env.closed()->header().seq)) return false; if (jv[jss::flags] != (vfFullyCanonicalSig | vfFullValidation)) @@ -504,7 +504,7 @@ public: // Certain fields are only added on a flag ledger. bool const isFlagLedger = - (env.closed()->info().seq + 1) % 256 == 0; + (env.closed()->header().seq + 1) % 256 == 0; if (jv.isMember(jss::server_version) != isFlagLedger) return false; @@ -520,7 +520,7 @@ public: // Check stream update. Look at enough stream entries so we see // at least one flag ledger. - while (env.closed()->info().seq < 300) + while (env.closed()->header().seq < 300) { env.close(); using namespace std::chrono_literals; diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index f8ce2bc830..b1bea237f5 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -50,7 +50,7 @@ class Transaction_test : public beast::unit_test::suite std::vector> txns; std::vector> metas; - auto const startLegSeq = env.current()->info().seq; + auto const startLegSeq = env.current()->header().seq; for (int i = 0; i < 750; ++i) { env(noop(alice)); @@ -59,7 +59,7 @@ class Transaction_test : public beast::unit_test::suite metas.emplace_back( env.closed()->txRead(env.tx()->getTransactionID()).second); } - auto const endLegSeq = env.closed()->info().seq; + auto const endLegSeq = env.closed()->header().seq; // Find the existing transactions for (size_t i = 0; i < txns.size(); ++i) @@ -302,7 +302,7 @@ class Transaction_test : public beast::unit_test::suite std::vector> txns; std::vector> metas; - auto const startLegSeq = env.current()->info().seq; + auto const startLegSeq = env.current()->header().seq; for (int i = 0; i < 750; ++i) { env(noop(alice)); @@ -311,7 +311,7 @@ class Transaction_test : public beast::unit_test::suite metas.emplace_back( env.closed()->txRead(env.tx()->getTransactionID()).second); } - auto const endLegSeq = env.closed()->info().seq; + auto const endLegSeq = env.closed()->header().seq; // Find the existing transactions for (size_t i = 0; i < txns.size(); ++i) @@ -630,7 +630,7 @@ class Transaction_test : public beast::unit_test::suite auto const alice = Account("alice"); auto const bob = Account("bob"); - auto const startLegSeq = env.current()->info().seq; + auto const startLegSeq = env.current()->header().seq; env.fund(XRP(10000), alice, bob); env(pay(alice, bob, XRP(10))); env.close(); @@ -661,7 +661,7 @@ class Transaction_test : public beast::unit_test::suite Account const alice = Account("alice"); Account const bob = Account("bob"); - std::uint32_t const startLegSeq = env.current()->info().seq; + std::uint32_t const startLegSeq = env.current()->header().seq; env.fund(XRP(10000), alice, bob); env(pay(alice, bob, XRP(10))); env.close(); @@ -709,7 +709,7 @@ class Transaction_test : public beast::unit_test::suite env(pay(alice, bob, XRP(10))); env.close(); - auto const ledgerSeq = env.current()->info().seq; + auto const ledgerSeq = env.current()->header().seq; env(noop(alice), ter(tesSUCCESS)); env.close(); @@ -738,7 +738,7 @@ class Transaction_test : public beast::unit_test::suite auto const alice = Account("alice"); auto const bob = Account("bob"); - auto const startLegSeq = env.current()->info().seq; + auto const startLegSeq = env.current()->header().seq; env.fund(XRP(10000), alice, bob); env(pay(alice, bob, XRP(10))); env.close(); diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index 0a82c3b7e1..b93c3a30e7 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -842,7 +842,7 @@ class ServerStatus_test : public beast::unit_test::suite, // mark the Network as having an Amendment Warning, but won't fail env.app().getOPs().setAmendmentWarned(); - env.app().getOPs().beginConsensus(env.closed()->info().hash, {}); + env.app().getOPs().beginConsensus(env.closed()->header().hash, {}); // consensus doesn't change BEAST_EXPECT( @@ -973,7 +973,7 @@ class ServerStatus_test : public beast::unit_test::suite, // mark the Network as Amendment Blocked, but still won't fail until // ELB is enabled (next step) env.app().getOPs().setAmendmentBlocked(); - env.app().getOPs().beginConsensus(env.closed()->info().hash, {}); + env.app().getOPs().beginConsensus(env.closed()->header().hash, {}); // consensus now sees validation disabled BEAST_EXPECT( diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 09584f2e77..4c2ecbac10 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -135,11 +135,11 @@ RCLConsensus::Adaptor::acquireLedger(LedgerHash const& hash) !built->open() && built->isImmutable(), "ripple::RCLConsensus::Adaptor::acquireLedger : valid ledger state"); XRPL_ASSERT( - built->info().hash == hash, + built->header().hash == hash, "ripple::RCLConsensus::Adaptor::acquireLedger : ledger hash match"); // Notify inbound transactions of the new ledger sequence number - inboundTransactions_.newRound(built->info().seq); + inboundTransactions_.newRound(built->header().seq); return RCLCxLedger(built); } @@ -309,7 +309,7 @@ RCLConsensus::Adaptor::onClose( ledgerMaster_.applyHeldTransactions(); // Tell the ledger master not to acquire the ledger we're probably building - ledgerMaster_.setBuildingLedger(prevLedger->info().seq + 1); + ledgerMaster_.setBuildingLedger(prevLedger->header().seq + 1); auto initialLedger = app_.openLedger().current(); @@ -338,7 +338,7 @@ RCLConsensus::Adaptor::onClose( // pseudo-transactions auto validations = app_.validators().negativeUNLFilter( app_.getValidations().getTrustedForLedger( - prevLedger->info().parentHash, prevLedger->seq() - 1)); + prevLedger->header().parentHash, prevLedger->seq() - 1)); if (validations.size() >= app_.validators().quorum()) { feeVote_->doVoting(prevLedger, validations, initialSet); @@ -364,7 +364,7 @@ RCLConsensus::Adaptor::onClose( if (!wrongLCL) { - LedgerIndex const seq = prevLedger->info().seq + 1; + LedgerIndex const seq = prevLedger->header().seq + 1; RCLCensorshipDetector::TxIDSeqVec proposed; initialSet->visitLeaves( @@ -382,7 +382,7 @@ RCLConsensus::Adaptor::onClose( return Result{ std::move(initialSet), RCLCxPeerPos::Proposal{ - initialLedger->info().parentHash, + initialLedger->header().parentHash, RCLCxPeerPos::Proposal::seqJoin, setHash, closeTime, @@ -663,10 +663,10 @@ RCLConsensus::Adaptor::doAccept( // Do these need to exist? XRPL_ASSERT( - ledgerMaster_.getClosedLedger()->info().hash == built.id(), + ledgerMaster_.getClosedLedger()->header().hash == built.id(), "ripple::RCLConsensus::Adaptor::doAccept : ledger hash match"); XRPL_ASSERT( - app_.openLedger().current()->info().parentHash == built.id(), + app_.openLedger().current()->header().parentHash == built.id(), "ripple::RCLConsensus::Adaptor::doAccept : parent hash match"); } @@ -764,7 +764,7 @@ RCLConsensus::Adaptor::buildLCL( if (auto const replayData = ledgerMaster_.releaseReplay()) { XRPL_ASSERT( - replayData->parent()->info().hash == previousLedger.id(), + replayData->parent()->header().hash == previousLedger.id(), "ripple::RCLConsensus::Adaptor::buildLCL : parent hash match"); return buildLedger(*replayData, tapNONE, app_, j_); } @@ -786,7 +786,7 @@ RCLConsensus::Adaptor::buildLCL( // And stash the ledger in the ledger master if (ledgerMaster_.storeLedger(built)) JLOG(j_.debug()) << "Consensus built ledger we already had"; - else if (app_.getInboundLedgers().find(built->info().hash)) + else if (app_.getInboundLedgers().find(built->header().hash)) JLOG(j_.debug()) << "Consensus built ledger we were acquiring"; else JLOG(j_.debug()) << "Consensus built new ledger"; @@ -833,7 +833,7 @@ RCLConsensus::Adaptor::validate( // validated ledger. This may be the hash of the ledger we are // validating here, and that's fine. if (auto const vl = ledgerMaster_.getValidatedLedger()) - v.setFieldH256(sfValidatedHash, vl->info().hash); + v.setFieldH256(sfValidatedHash, vl->header().hash); v.setFieldU64(sfCookie, valCookie_); diff --git a/src/xrpld/app/consensus/RCLCxLedger.h b/src/xrpld/app/consensus/RCLCxLedger.h index 93b55d76d3..5671fa988d 100644 --- a/src/xrpld/app/consensus/RCLCxLedger.h +++ b/src/xrpld/app/consensus/RCLCxLedger.h @@ -41,49 +41,49 @@ public: Seq const& seq() const { - return ledger_->info().seq; + return ledger_->header().seq; } //! Unique identifier (hash) of this ledger. ID const& id() const { - return ledger_->info().hash; + return ledger_->header().hash; } //! Unique identifier (hash) of this ledger's parent. ID const& parentID() const { - return ledger_->info().parentHash; + return ledger_->header().parentHash; } //! Resolution used when calculating this ledger's close time. NetClock::duration closeTimeResolution() const { - return ledger_->info().closeTimeResolution; + return ledger_->header().closeTimeResolution; } //! Whether consensus process agreed on close time of the ledger. bool closeAgree() const { - return ripple::getCloseAgree(ledger_->info()); + return ripple::getCloseAgree(ledger_->header()); } //! The close time of this ledger NetClock::time_point closeTime() const { - return ledger_->info().closeTime; + return ledger_->header().closeTime; } //! The close time of this ledger's parent. NetClock::time_point parentCloseTime() const { - return ledger_->info().parentCloseTime; + return ledger_->header().parentCloseTime; } //! JSON representation of this ledger. diff --git a/src/xrpld/app/consensus/RCLValidations.cpp b/src/xrpld/app/consensus/RCLValidations.cpp index d6a8747c20..d24f24a5f1 100644 --- a/src/xrpld/app/consensus/RCLValidations.cpp +++ b/src/xrpld/app/consensus/RCLValidations.cpp @@ -23,7 +23,7 @@ RCLValidatedLedger::RCLValidatedLedger(MakeGenesis) RCLValidatedLedger::RCLValidatedLedger( std::shared_ptr const& ledger, beast::Journal j) - : ledgerID_{ledger->info().hash}, ledgerSeq_{ledger->seq()}, j_{j} + : ledgerID_{ledger->header().hash}, ledgerSeq_{ledger->seq()}, j_{j} { auto const hashIndex = ledger->read(keylet::skip()); if (hashIndex) @@ -136,7 +136,7 @@ RCLValidationsAdaptor::acquire(LedgerHash const& hash) !ledger->open() && ledger->isImmutable(), "ripple::RCLValidationsAdaptor::acquire : valid ledger state"); XRPL_ASSERT( - ledger->info().hash == hash, + ledger->header().hash == hash, "ripple::RCLValidationsAdaptor::acquire : ledger hash match"); return RCLValidatedLedger(std::move(ledger), j_); diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index aaf71b2dc3..055d9ddc9d 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -157,9 +157,9 @@ Ledger::Ledger( , rules_{config.features} , j_(beast::Journal(beast::Journal::getNullSink())) { - info_.seq = 1; - info_.drops = INITIAL_XRP; - info_.closeTimeResolution = ledgerGenesisTimeResolution; + header_.seq = 1; + header_.drops = INITIAL_XRP; + header_.closeTimeResolution = ledgerGenesisTimeResolution; static auto const id = calcAccountID( generateKeyPair(KeyType::secp256k1, generateSeed("masterpassphrase")) @@ -168,7 +168,7 @@ Ledger::Ledger( auto const sle = std::make_shared(keylet::account(id)); sle->setFieldU32(sfSequence, 1); sle->setAccountID(sfAccount, id); - sle->setFieldAmount(sfBalance, info_.drops); + sle->setFieldAmount(sfBalance, header_.drops); rawInsert(sle); } @@ -220,23 +220,25 @@ Ledger::Ledger( , txMap_(SHAMapType::TRANSACTION, info.txHash, family) , stateMap_(SHAMapType::STATE, info.accountHash, family) , rules_(config.features) - , info_(info) + , header_(info) , j_(j) { loaded = true; - if (info_.txHash.isNonZero() && - !txMap_.fetchRoot(SHAMapHash{info_.txHash}, nullptr)) + if (header_.txHash.isNonZero() && + !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr)) { loaded = false; - JLOG(j.warn()) << "Don't have transaction root for ledger" << info_.seq; + JLOG(j.warn()) << "Don't have transaction root for ledger" + << header_.seq; } - if (info_.accountHash.isNonZero() && - !stateMap_.fetchRoot(SHAMapHash{info_.accountHash}, nullptr)) + if (header_.accountHash.isNonZero() && + !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr)) { loaded = false; - JLOG(j.warn()) << "Don't have state data root for ledger" << info_.seq; + JLOG(j.warn()) << "Don't have state data root for ledger" + << header_.seq; } txMap_.setImmutable(); @@ -248,9 +250,9 @@ Ledger::Ledger( if (!loaded) { - info_.hash = calculateLedgerHash(info_); + header_.hash = calculateLedgerHash(header_); if (acquire) - family.missingNodeAcquireByHash(info_.hash, info_.seq); + family.missingNodeAcquireByHash(header_.hash, header_.seq); } } @@ -263,25 +265,26 @@ Ledger::Ledger(Ledger const& prevLedger, NetClock::time_point closeTime) , rules_(prevLedger.rules_) , j_(beast::Journal(beast::Journal::getNullSink())) { - info_.seq = prevLedger.info_.seq + 1; - info_.parentCloseTime = prevLedger.info_.closeTime; - info_.hash = prevLedger.info().hash + uint256(1); - info_.drops = prevLedger.info().drops; - info_.closeTimeResolution = prevLedger.info_.closeTimeResolution; - info_.parentHash = prevLedger.info().hash; - info_.closeTimeResolution = getNextLedgerTimeResolution( - prevLedger.info_.closeTimeResolution, - getCloseAgree(prevLedger.info()), - info_.seq); + header_.seq = prevLedger.header_.seq + 1; + header_.parentCloseTime = prevLedger.header_.closeTime; + header_.hash = prevLedger.header().hash + uint256(1); + header_.drops = prevLedger.header().drops; + header_.closeTimeResolution = prevLedger.header_.closeTimeResolution; + header_.parentHash = prevLedger.header().hash; + header_.closeTimeResolution = getNextLedgerTimeResolution( + prevLedger.header_.closeTimeResolution, + getCloseAgree(prevLedger.header()), + header_.seq); - if (prevLedger.info_.closeTime == NetClock::time_point{}) + if (prevLedger.header_.closeTime == NetClock::time_point{}) { - info_.closeTime = roundCloseTime(closeTime, info_.closeTimeResolution); + header_.closeTime = + roundCloseTime(closeTime, header_.closeTimeResolution); } else { - info_.closeTime = - prevLedger.info_.closeTime + info_.closeTimeResolution; + header_.closeTime = + prevLedger.header_.closeTime + header_.closeTimeResolution; } } @@ -290,10 +293,10 @@ Ledger::Ledger(LedgerHeader const& info, Config const& config, Family& family) , txMap_(SHAMapType::TRANSACTION, info.txHash, family) , stateMap_(SHAMapType::STATE, info.accountHash, family) , rules_{config.features} - , info_(info) + , header_(info) , j_(beast::Journal(beast::Journal::getNullSink())) { - info_.hash = calculateLedgerHash(info_); + header_.hash = calculateLedgerHash(header_); } Ledger::Ledger( @@ -307,9 +310,9 @@ Ledger::Ledger( , rules_{config.features} , j_(beast::Journal(beast::Journal::getNullSink())) { - info_.seq = ledgerSeq; - info_.closeTime = closeTime; - info_.closeTimeResolution = ledgerDefaultTimeResolution; + header_.seq = ledgerSeq; + header_.closeTime = closeTime; + header_.closeTimeResolution = ledgerDefaultTimeResolution; defaultFees(config); setup(); } @@ -321,12 +324,12 @@ Ledger::setImmutable(bool rehash) // place the hash transitions to valid if (!mImmutable && rehash) { - info_.txHash = txMap_.getHash().as_uint256(); - info_.accountHash = stateMap_.getHash().as_uint256(); + header_.txHash = txMap_.getHash().as_uint256(); + header_.accountHash = stateMap_.getHash().as_uint256(); } if (rehash) - info_.hash = calculateLedgerHash(info_); + header_.hash = calculateLedgerHash(header_); mImmutable = true; txMap_.setImmutable(); @@ -343,9 +346,9 @@ Ledger::setAccepted( // Used when we witnessed the consensus. XRPL_ASSERT(!open(), "ripple::Ledger::setAccepted : valid ledger state"); - info_.closeTime = closeTime; - info_.closeTimeResolution = closeResolution; - info_.closeFlags = correctCloseTime ? 0 : sLCF_NoConsensusTime; + header_.closeTime = closeTime; + header_.closeTimeResolution = closeResolution; + header_.closeFlags = correctCloseTime ? 0 : sLCF_NoConsensusTime; setImmutable(); } @@ -788,11 +791,11 @@ Ledger::walkLedger(beast::Journal j, bool parallel) const std::vector missingNodes1; std::vector missingNodes2; - if (stateMap_.getHash().isZero() && !info_.accountHash.isZero() && - !stateMap_.fetchRoot(SHAMapHash{info_.accountHash}, nullptr)) + if (stateMap_.getHash().isZero() && !header_.accountHash.isZero() && + !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr)) { missingNodes1.emplace_back( - SHAMapType::STATE, SHAMapHash{info_.accountHash}); + SHAMapType::STATE, SHAMapHash{header_.accountHash}); } else { @@ -811,11 +814,11 @@ Ledger::walkLedger(beast::Journal j, bool parallel) const } } - if (txMap_.getHash().isZero() && info_.txHash.isNonZero() && - !txMap_.fetchRoot(SHAMapHash{info_.txHash}, nullptr)) + if (txMap_.getHash().isZero() && header_.txHash.isNonZero() && + !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr)) { missingNodes2.emplace_back( - SHAMapType::TRANSACTION, SHAMapHash{info_.txHash}); + SHAMapType::TRANSACTION, SHAMapHash{header_.txHash}); } else { @@ -836,9 +839,9 @@ Ledger::walkLedger(beast::Journal j, bool parallel) const bool Ledger::assertSensible(beast::Journal ledgerJ) const { - if (info_.hash.isNonZero() && info_.accountHash.isNonZero() && - (info_.accountHash == stateMap_.getHash().as_uint256()) && - (info_.txHash == txMap_.getHash().as_uint256())) + if (header_.hash.isNonZero() && header_.accountHash.isNonZero() && + (header_.accountHash == stateMap_.getHash().as_uint256()) && + (header_.txHash == txMap_.getHash().as_uint256())) { return true; } @@ -846,8 +849,8 @@ Ledger::assertSensible(beast::Journal ledgerJ) const // LCOV_EXCL_START Json::Value j = getJson({*this, {}}); - j[jss::accountTreeHash] = to_string(info_.accountHash); - j[jss::transTreeHash] = to_string(info_.txHash); + j[jss::accountTreeHash] = to_string(header_.accountHash); + j[jss::transTreeHash] = to_string(header_.txHash); JLOG(ledgerJ.fatal()) << "ledger is not sensible" << j; @@ -862,10 +865,10 @@ Ledger::assertSensible(beast::Journal ledgerJ) const void Ledger::updateSkipList() { - if (info_.seq == 0) // genesis ledger has no previous ledger + if (header_.seq == 0) // genesis ledger has no previous ledger return; - std::uint32_t prevIndex = info_.seq - 1; + std::uint32_t prevIndex = header_.seq - 1; // update record of every 256th ledger if ((prevIndex & 0xff) == 0) @@ -889,7 +892,7 @@ Ledger::updateSkipList() XRPL_ASSERT( hashes.size() <= 256, "ripple::Ledger::updateSkipList : first maximum hashes size"); - hashes.push_back(info_.parentHash); + hashes.push_back(header_.parentHash); sle->setFieldV256(sfHashes, STVector256(hashes)); sle->setFieldU32(sfLastLedgerSequence, prevIndex); if (created) @@ -918,7 +921,7 @@ Ledger::updateSkipList() "ripple::Ledger::updateSkipList : second maximum hashes size"); if (hashes.size() == 256) hashes.erase(hashes.begin()); - hashes.push_back(info_.parentHash); + hashes.push_back(header_.parentHash); sle->setFieldV256(sfHashes, STVector256(hashes)); sle->setFieldU32(sfLastLedgerSequence, prevIndex); if (created) @@ -930,12 +933,12 @@ Ledger::updateSkipList() bool Ledger::isFlagLedger() const { - return info_.seq % FLAG_LEDGER_INTERVAL == 0; + return header_.seq % FLAG_LEDGER_INTERVAL == 0; } bool Ledger::isVotingLedger() const { - return (info_.seq + 1) % FLAG_LEDGER_INTERVAL == 0; + return (header_.seq + 1) % FLAG_LEDGER_INTERVAL == 0; } bool @@ -951,7 +954,7 @@ saveValidatedLedger( bool current) { auto j = app.journal("Ledger"); - auto seq = ledger->info().seq; + auto seq = ledger->header().seq; if (!app.pendingSaves().startWork(seq)) { // The save was completed synchronously @@ -982,13 +985,13 @@ pendSaveValidated( bool isCurrent) { if (!app.getHashRouter().setFlags( - ledger->info().hash, HashRouterFlags::SAVED)) + ledger->header().hash, HashRouterFlags::SAVED)) { // We have tried to save this ledger recently auto stream = app.journal("Ledger").debug(); - JLOG(stream) << "Double pend save for " << ledger->info().seq; + JLOG(stream) << "Double pend save for " << ledger->header().seq; - if (!isSynchronous || !app.pendingSaves().pending(ledger->info().seq)) + if (!isSynchronous || !app.pendingSaves().pending(ledger->header().seq)) { // Either we don't need it to be finished // or it is finished @@ -999,11 +1002,11 @@ pendSaveValidated( XRPL_ASSERT( ledger->isImmutable(), "ripple::pendSaveValidated : immutable ledger"); - if (!app.pendingSaves().shouldWork(ledger->info().seq, isSynchronous)) + if (!app.pendingSaves().shouldWork(ledger->header().seq, isSynchronous)) { auto stream = app.journal("Ledger").debug(); JLOG(stream) << "Pend save with seq in pending saves " - << ledger->info().seq; + << ledger->header().seq; return true; } @@ -1075,12 +1078,12 @@ finishLoadByIndexOrHash( return; XRPL_ASSERT( - ledger->info().seq < XRP_LEDGER_EARLIEST_FEES || + ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()), "ripple::finishLoadByIndexOrHash : valid ledger fees"); ledger->setImmutable(); - JLOG(j.trace()) << "Loaded ledger: " << to_string(ledger->info().hash); + JLOG(j.trace()) << "Loaded ledger: " << to_string(ledger->header().hash); ledger->setFull(); } @@ -1117,7 +1120,7 @@ loadByHash(uint256 const& ledgerHash, Application& app, bool acquire) std::shared_ptr ledger = loadLedgerHelper(*info, app, acquire); finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger")); XRPL_ASSERT( - !ledger || ledger->info().hash == ledgerHash, + !ledger || ledger->header().hash == ledgerHash, "ripple::loadByHash : ledger hash match if loaded"); return ledger; } diff --git a/src/xrpld/app/ledger/Ledger.h b/src/xrpld/app/ledger/Ledger.h index cc3bc43c50..0e849389fd 100644 --- a/src/xrpld/app/ledger/Ledger.h +++ b/src/xrpld/app/ledger/Ledger.h @@ -130,15 +130,15 @@ public: } LedgerHeader const& - info() const override + header() const override { - return info_; + return header_; } void setLedgerInfo(LedgerHeader const& info) { - info_ = info; + header_ = info; } Fees const& @@ -213,7 +213,7 @@ public: void rawDestroyXRP(XRPAmount const& fee) override { - info_.drops -= fee; + header_.drops -= fee; } // @@ -244,7 +244,7 @@ public: void setValidated() const { - info_.validated = true; + header_.validated = true; } void @@ -276,15 +276,15 @@ public: setFull() const { txMap_.setFull(); - txMap_.setLedgerSeq(info_.seq); + txMap_.setLedgerSeq(header_.seq); stateMap_.setFull(); - stateMap_.setLedgerSeq(info_.seq); + stateMap_.setLedgerSeq(header_.seq); } void setTotalDrops(std::uint64_t totDrops) { - info_.drops = totDrops; + header_.drops = totDrops; } SHAMap const& @@ -397,7 +397,7 @@ private: Fees fees_; Rules rules_; - LedgerHeader info_; + LedgerHeader header_; beast::Journal j_; }; diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index 4f2660c70a..c084297641 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -47,9 +47,9 @@ LedgerHistory::insert( std::unique_lock sl(m_ledgers_by_hash.peekMutex()); bool const alreadyHad = m_ledgers_by_hash.canonicalize_replace_cache( - ledger->info().hash, ledger); + ledger->header().hash, ledger); if (validated) - mLedgersByIndex[ledger->info().seq] = ledger->info().hash; + mLedgersByIndex[ledger->header().seq] = ledger->header().hash; return alreadyHad; } @@ -84,7 +84,7 @@ LedgerHistory::getLedgerBySeq(LedgerIndex index) return ret; XRPL_ASSERT( - ret->info().seq == index, + ret->header().seq == index, "ripple::LedgerHistory::getLedgerBySeq : result sequence match"); { @@ -94,9 +94,9 @@ LedgerHistory::getLedgerBySeq(LedgerIndex index) XRPL_ASSERT( ret->isImmutable(), "ripple::LedgerHistory::getLedgerBySeq : immutable result ledger"); - m_ledgers_by_hash.canonicalize_replace_client(ret->info().hash, ret); - mLedgersByIndex[ret->info().seq] = ret->info().hash; - return (ret->info().seq == index) ? ret : nullptr; + m_ledgers_by_hash.canonicalize_replace_client(ret->header().hash, ret); + mLedgersByIndex[ret->header().seq] = ret->header().hash; + return (ret->header().seq == index) ? ret : nullptr; } } @@ -112,7 +112,7 @@ LedgerHistory::getLedgerByHash(LedgerHash const& hash) "ripple::LedgerHistory::getLedgerByHash : immutable fetched " "ledger"); XRPL_ASSERT( - ret->info().hash == hash, + ret->header().hash == hash, "ripple::LedgerHistory::getLedgerByHash : fetched ledger hash " "match"); return ret; @@ -127,11 +127,11 @@ LedgerHistory::getLedgerByHash(LedgerHash const& hash) ret->isImmutable(), "ripple::LedgerHistory::getLedgerByHash : immutable loaded ledger"); XRPL_ASSERT( - ret->info().hash == hash, + ret->header().hash == hash, "ripple::LedgerHistory::getLedgerByHash : loaded ledger hash match"); - m_ledgers_by_hash.canonicalize_replace_client(ret->info().hash, ret); + m_ledgers_by_hash.canonicalize_replace_client(ret->header().hash, ret); XRPL_ASSERT( - ret->info().hash == hash, + ret->header().hash == hash, "ripple::LedgerHistory::getLedgerByHash : result hash match"); return ret; @@ -342,7 +342,7 @@ LedgerHistory::handleMismatch( } XRPL_ASSERT( - builtLedger->info().seq == validLedger->info().seq, + builtLedger->header().seq == validLedger->header().seq, "ripple::LedgerHistory::handleMismatch : sequence match"); if (auto stream = j_.debug()) @@ -356,14 +356,14 @@ LedgerHistory::handleMismatch( // failure from transaction processing difference // Disagreement over prior ledger indicates sync issue - if (builtLedger->info().parentHash != validLedger->info().parentHash) + if (builtLedger->header().parentHash != validLedger->header().parentHash) { JLOG(j_.error()) << "MISMATCH on prior ledger"; return; } // Disagreement over close time indicates Byzantine failure - if (builtLedger->info().closeTime != validLedger->info().closeTime) + if (builtLedger->header().closeTime != validLedger->header().closeTime) { JLOG(j_.error()) << "MISMATCH on close time"; return; @@ -434,8 +434,8 @@ LedgerHistory::builtLedger( uint256 const& consensusHash, Json::Value consensus) { - LedgerIndex index = ledger->info().seq; - LedgerHash hash = ledger->info().hash; + LedgerIndex index = ledger->header().seq; + LedgerHash hash = ledger->header().hash; XRPL_ASSERT( !hash.isZero(), "ripple::LedgerHistory::builtLedger : nonzero hash"); @@ -475,8 +475,8 @@ LedgerHistory::validatedLedger( std::shared_ptr const& ledger, std::optional const& consensusHash) { - LedgerIndex index = ledger->info().seq; - LedgerHash hash = ledger->info().hash; + LedgerIndex index = ledger->header().seq; + LedgerHash hash = ledger->header().hash; XRPL_ASSERT( !hash.isZero(), "ripple::LedgerHistory::validatedLedger : nonzero hash"); @@ -533,7 +533,7 @@ LedgerHistory::clearLedgerCachePrior(LedgerIndex seq) for (LedgerHash it : m_ledgers_by_hash.getKeys()) { auto const ledger = getLedgerByHash(it); - if (!ledger || ledger->info().seq < seq) + if (!ledger || ledger->header().seq < seq) m_ledgers_by_hash.del(it, false); } } diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index dd3593e1cf..d7153c0fe9 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -58,7 +58,7 @@ buildLedgerImpl( // Accept ledger XRPL_ASSERT( - built->info().seq < XRP_LEDGER_EARLIEST_FEES || + built->header().seq < XRP_LEDGER_EARLIEST_FEES || built->read(keylet::fees()), "ripple::buildLedgerImpl : valid ledger fees"); built->setAccepted(closeTime, closeResolution, closeTimeCorrect); @@ -213,13 +213,13 @@ buildLedger( { auto const& replayLedger = replayData.replay(); - JLOG(j.debug()) << "Report: Replay Ledger " << replayLedger->info().hash; + JLOG(j.debug()) << "Report: Replay Ledger " << replayLedger->header().hash; return buildLedgerImpl( replayData.parent(), - replayLedger->info().closeTime, - ((replayLedger->info().closeFlags & sLCF_NoConsensusTime) == 0), - replayLedger->info().closeTimeResolution, + replayLedger->header().closeTime, + ((replayLedger->header().closeFlags & sLCF_NoConsensusTime) == 0), + replayLedger->header().closeTimeResolution, app, j, [&](OpenView& accum, std::shared_ptr const& built) { diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index 5bfa9144d3..24de3cce14 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -102,7 +102,7 @@ InboundLedger::init(ScopedLockType& collectionLock) JLOG(journal_.debug()) << "Acquiring ledger we already have in " << " local store. " << hash_; XRPL_ASSERT( - mLedger->info().seq < XRP_LEDGER_EARLIEST_FEES || + mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), "ripple::InboundLedger::init : valid ledger fees"); mLedger->setImmutable(); @@ -206,14 +206,15 @@ neededHashes( std::vector InboundLedger::neededTxHashes(int max, SHAMapSyncFilter* filter) const { - return neededHashes(mLedger->info().txHash, mLedger->txMap(), max, filter); + return neededHashes( + mLedger->header().txHash, mLedger->txMap(), max, filter); } std::vector InboundLedger::neededStateHashes(int max, SHAMapSyncFilter* filter) const { return neededHashes( - mLedger->info().accountHash, mLedger->stateMap(), max, filter); + mLedger->header().accountHash, mLedger->stateMap(), max, filter); } // See how much of the ledger data is stored locally @@ -229,8 +230,8 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) deserializePrefixedHeader(makeSlice(data)), app_.config(), app_.getNodeFamily()); - if (mLedger->info().hash != hash_ || - (mSeq != 0 && mSeq != mLedger->info().seq)) + if (mLedger->header().hash != hash_ || + (mSeq != 0 && mSeq != mLedger->header().seq)) { // We know for a fact the ledger can never be acquired JLOG(journal_.warn()) @@ -256,7 +257,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) { Blob blob{nodeObject->getData()}; dstDB.store( - hotLEDGER, std::move(blob), hash_, mLedger->info().seq); + hotLEDGER, std::move(blob), hash_, mLedger->header().seq); } } else @@ -274,11 +275,11 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) // Store the ledger header in the ledger's database mLedger->stateMap().family().db().store( - hotLEDGER, std::move(*data), hash_, mLedger->info().seq); + hotLEDGER, std::move(*data), hash_, mLedger->header().seq); } if (mSeq == 0) - mSeq = mLedger->info().seq; + mSeq = mLedger->header().seq; mLedger->stateMap().setLedgerSeq(mSeq); mLedger->txMap().setLedgerSeq(mSeq); mHaveHeader = true; @@ -286,7 +287,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) if (!mHaveTransactions) { - if (mLedger->info().txHash.isZero()) + if (mLedger->header().txHash.isZero()) { JLOG(journal_.trace()) << "No TXNs to fetch"; mHaveTransactions = true; @@ -296,7 +297,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) TransactionStateSF filter( mLedger->txMap().family().db(), app_.getLedgerMaster()); if (mLedger->txMap().fetchRoot( - SHAMapHash{mLedger->info().txHash}, &filter)) + SHAMapHash{mLedger->header().txHash}, &filter)) { if (neededTxHashes(1, &filter).empty()) { @@ -309,7 +310,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) if (!mHaveState) { - if (mLedger->info().accountHash.isZero()) + if (mLedger->header().accountHash.isZero()) { JLOG(journal_.fatal()) << "We are acquiring a ledger with a zero account hash"; @@ -319,7 +320,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) AccountStateSF filter( mLedger->stateMap().family().db(), app_.getLedgerMaster()); if (mLedger->stateMap().fetchRoot( - SHAMapHash{mLedger->info().accountHash}, &filter)) + SHAMapHash{mLedger->header().accountHash}, &filter)) { if (neededStateHashes(1, &filter).empty()) { @@ -334,7 +335,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) JLOG(journal_.debug()) << "Had everything locally"; complete_ = true; XRPL_ASSERT( - mLedger->info().seq < XRP_LEDGER_EARLIEST_FEES || + mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), "ripple::InboundLedger::tryDB : valid ledger fees"); mLedger->setImmutable(); @@ -437,7 +438,7 @@ InboundLedger::done() if (complete_ && !failed_ && mLedger) { XRPL_ASSERT( - mLedger->info().seq < XRP_LEDGER_EARLIEST_FEES || + mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), "ripple::InboundLedger::done : valid ledger fees"); mLedger->setImmutable(); @@ -582,7 +583,7 @@ InboundLedger::trigger(std::shared_ptr const& peer, TriggerReason reason) } if (mLedger) - tmGL.set_ledgerseq(mLedger->info().seq); + tmGL.set_ledgerseq(mLedger->header().seq); if (reason != TriggerReason::reply) { @@ -744,7 +745,7 @@ InboundLedger::trigger(std::shared_ptr const& peer, TriggerReason reason) { JLOG(journal_.debug()) << "Done:" << (complete_ ? " complete" : "") - << (failed_ ? " failed " : " ") << mLedger->info().seq; + << (failed_ ? " failed " : " ") << mLedger->header().seq; sl.unlock(); done(); } @@ -808,17 +809,17 @@ InboundLedger::takeHeader(std::string const& data) auto* f = &app_.getNodeFamily(); mLedger = std::make_shared( deserializeHeader(makeSlice(data)), app_.config(), *f); - if (mLedger->info().hash != hash_ || - (mSeq != 0 && mSeq != mLedger->info().seq)) + if (mLedger->header().hash != hash_ || + (mSeq != 0 && mSeq != mLedger->header().seq)) { JLOG(journal_.warn()) - << "Acquire hash mismatch: " << mLedger->info().hash + << "Acquire hash mismatch: " << mLedger->header().hash << "!=" << hash_; mLedger.reset(); return false; } if (mSeq == 0) - mSeq = mLedger->info().seq; + mSeq = mLedger->header().seq; mLedger->stateMap().setLedgerSeq(mSeq); mLedger->txMap().setLedgerSeq(mSeq); mHaveHeader = true; @@ -828,10 +829,10 @@ InboundLedger::takeHeader(std::string const& data) s.addRaw(data.data(), data.size()); f->db().store(hotLEDGER, std::move(s.modData()), hash_, mSeq); - if (mLedger->info().txHash.isZero()) + if (mLedger->header().txHash.isZero()) mHaveTransactions = true; - if (mLedger->info().accountHash.isZero()) + if (mLedger->header().accountHash.isZero()) mHaveState = true; mLedger->txMap().setSynching(); @@ -871,12 +872,12 @@ InboundLedger::receiveNode(protocol::TMLedgerData& packet, SHAMapAddNode& san) if (packet.type() == protocol::liTX_NODE) return { mLedger->txMap(), - SHAMapHash{mLedger->info().txHash}, + SHAMapHash{mLedger->header().txHash}, std::make_unique( mLedger->txMap().family().db(), app_.getLedgerMaster())}; return { mLedger->stateMap(), - SHAMapHash{mLedger->info().accountHash}, + SHAMapHash{mLedger->header().accountHash}, std::make_unique( mLedger->stateMap().family().db(), app_.getLedgerMaster())}; }(); @@ -953,7 +954,7 @@ InboundLedger::takeAsRootNode(Slice const& data, SHAMapAddNode& san) AccountStateSF filter( mLedger->stateMap().family().db(), app_.getLedgerMaster()); san += mLedger->stateMap().addRootNode( - SHAMapHash{mLedger->info().accountHash}, data, &filter); + SHAMapHash{mLedger->header().accountHash}, data, &filter); return san.isGood(); } @@ -980,7 +981,7 @@ InboundLedger::takeTxRootNode(Slice const& data, SHAMapAddNode& san) TransactionStateSF filter( mLedger->txMap().family().db(), app_.getLedgerMaster()); san += mLedger->txMap().addRootNode( - SHAMapHash{mLedger->info().txHash}, data, &filter); + SHAMapHash{mLedger->header().txHash}, data, &filter); return san.isGood(); } diff --git a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp index 5de811fc39..639d8250ac 100644 --- a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp +++ b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp @@ -233,10 +233,10 @@ private: catch (SHAMapMissingNode const& mn) { JLOG(j_.warn()) - << "Ledger #" << ledger->info().seq << ": " << mn.what(); + << "Ledger #" << ledger->header().seq << ": " << mn.what(); app_.getInboundLedgers().acquire( - ledger->info().hash, - ledger->info().seq, + ledger->header().hash, + ledger->header().seq, InboundLedger::Reason::GENERIC); } return hash ? *hash : beast::zero; // kludge @@ -268,8 +268,8 @@ private: } auto dbLedger = loadByIndex(ledgerIndex, app_); - if (!dbLedger || (dbLedger->info().hash != ledgerHash) || - (dbLedger->info().parentHash != nodeLedger->info().parentHash)) + if (!dbLedger || (dbLedger->header().hash != ledgerHash) || + (dbLedger->header().parentHash != nodeLedger->header().parentHash)) { // Ideally we'd also check for more than one ledger with that index JLOG(j_.debug()) @@ -314,7 +314,7 @@ private: { LedgerHash ledgerHash; - if (!referenceLedger || (referenceLedger->info().seq < ledgerIndex)) + if (!referenceLedger || (referenceLedger->header().seq < ledgerIndex)) { referenceLedger = app_.getLedgerMaster().getValidatedLedger(); if (!referenceLedger) @@ -324,7 +324,7 @@ private: } } - if (referenceLedger->info().seq >= ledgerIndex) + if (referenceLedger->header().seq >= ledgerIndex) { // See if the hash for the ledger we need is in the reference ledger ledgerHash = getLedgerHash(referenceLedger, ledgerIndex); diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index 91b1dca5e2..c803c0bdd4 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -184,12 +184,12 @@ LedgerDeltaAcquire::tryBuild(std::shared_ptr const& parent) parent->seq() + 1 == replayTemp_->seq(), "ripple::LedgerDeltaAcquire::tryBuild : parent sequence match"); XRPL_ASSERT( - parent->info().hash == replayTemp_->info().parentHash, + parent->header().hash == replayTemp_->header().parentHash, "ripple::LedgerDeltaAcquire::tryBuild : parent hash match"); // build ledger LedgerReplay replayData(parent, replayTemp_, std::move(orderedTxns_)); fullLedger_ = buildLedger(replayData, tapNONE, app_, journal_); - if (fullLedger_ && fullLedger_->info().hash == hash_) + if (fullLedger_ && fullLedger_->header().hash == hash_) { JLOG(journal_.info()) << "Built " << hash_; onLedgerBuilt(sl); @@ -200,7 +200,7 @@ LedgerDeltaAcquire::tryBuild(std::shared_ptr const& parent) failed_ = true; complete_ = false; JLOG(journal_.error()) << "tryBuild failed " << hash_ << " with parent " - << parent->info().hash; + << parent->header().hash; Throw("Cannot replay ledger"); } } diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 0c3b3266d9..3e75a28abd 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -103,7 +103,7 @@ LedgerMaster::LedgerMaster( LedgerIndex LedgerMaster::getCurrentLedgerIndex() { - return app_.openLedger().current()->info().seq; + return app_.openLedger().current()->header().seq; } LedgerIndex @@ -227,7 +227,7 @@ LedgerMaster::setValidLedger(std::shared_ptr const& l) { auto validations = app_.validators().negativeUNLFilter( app_.getValidations().getTrustedForLedger( - l->info().hash, l->info().seq)); + l->header().hash, l->header().seq)); times.reserve(validations.size()); for (auto const& val : validations) times.push_back(val->getSignTime()); @@ -248,18 +248,18 @@ LedgerMaster::setValidLedger(std::shared_ptr const& l) } else { - signTime = l->info().closeTime; + signTime = l->header().closeTime; } mValidLedger.set(l); mValidLedgerSign = signTime.time_since_epoch().count(); XRPL_ASSERT( mValidLedgerSeq || !app_.getMaxDisallowedLedger() || - l->info().seq + max_ledger_difference_ > + l->header().seq + max_ledger_difference_ > app_.getMaxDisallowedLedger(), "ripple::LedgerMaster::setValidLedger : valid ledger sequence"); (void)max_ledger_difference_; - mValidLedgerSeq = l->info().seq; + mValidLedgerSeq = l->header().seq; app_.getOPs().updateLocalTx(*l); app_.getSHAMapStore().onLedgerClosed(getValidatedLedger()); @@ -304,8 +304,8 @@ void LedgerMaster::setPubLedger(std::shared_ptr const& l) { mPubLedger = l; - mPubLedgerClose = l->info().closeTime.time_since_epoch().count(); - mPubLedgerSeq = l->info().seq; + mPubLedgerClose = l->header().closeTime.time_since_epoch().count(); + mPubLedgerSeq = l->header().seq; } void @@ -328,11 +328,11 @@ LedgerMaster::canBeCurrent(std::shared_ptr const& ledger) // last validated ledger auto validLedger = getValidatedLedger(); - if (validLedger && (ledger->info().seq < validLedger->info().seq)) + if (validLedger && (ledger->header().seq < validLedger->header().seq)) { JLOG(m_journal.trace()) - << "Candidate for current ledger has low seq " << ledger->info().seq - << " < " << validLedger->info().seq; + << "Candidate for current ledger has low seq " + << ledger->header().seq << " < " << validLedger->header().seq; return false; } @@ -342,17 +342,17 @@ LedgerMaster::canBeCurrent(std::shared_ptr const& ledger) // few ledgers as our clock can be off when we first start up auto closeTime = app_.timeKeeper().closeTime(); - auto ledgerClose = ledger->info().parentCloseTime; + auto ledgerClose = ledger->header().parentCloseTime; using namespace std::chrono_literals; - if ((validLedger || (ledger->info().seq > 10)) && + if ((validLedger || (ledger->header().seq > 10)) && ((std::max(closeTime, ledgerClose) - std::min(closeTime, ledgerClose)) > 5min)) { JLOG(m_journal.warn()) << "Candidate for current ledger has close time " << to_string(ledgerClose) << " at network time " - << to_string(closeTime) << " seq " << ledger->info().seq; + << to_string(closeTime) << " seq " << ledger->header().seq; return false; } @@ -363,25 +363,25 @@ LedgerMaster::canBeCurrent(std::shared_ptr const& ledger) // every two seconds. The goal is to prevent a malicious ledger // from increasing our sequence unreasonably high - LedgerIndex maxSeq = validLedger->info().seq + 10; + LedgerIndex maxSeq = validLedger->header().seq + 10; - if (closeTime > validLedger->info().parentCloseTime) + if (closeTime > validLedger->header().parentCloseTime) maxSeq += std::chrono::duration_cast( - closeTime - validLedger->info().parentCloseTime) + closeTime - validLedger->header().parentCloseTime) .count() / 2; - if (ledger->info().seq > maxSeq) + if (ledger->header().seq > maxSeq) { JLOG(m_journal.warn()) << "Candidate for current ledger has high seq " - << ledger->info().seq << " > " << maxSeq; + << ledger->header().seq << " > " << maxSeq; return false; } JLOG(m_journal.trace()) - << "Acceptable seq range: " << validLedger->info().seq - << " <= " << ledger->info().seq << " <= " << maxSeq; + << "Acceptable seq range: " << validLedger->header().seq + << " <= " << ledger->header().seq << " <= " << maxSeq; } return true; @@ -422,7 +422,7 @@ LedgerMaster::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) bool LedgerMaster::storeLedger(std::shared_ptr ledger) { - bool validated = ledger->info().validated; + bool validated = ledger->header().validated; // Returns true if we already had the ledger return mLedgerHistory.insert(std::move(ledger), validated); } @@ -439,7 +439,7 @@ LedgerMaster::applyHeldTransactions() std::lock_guard sl(m_mutex); // VFALCO NOTE The hash for an open ledger is undefined so we use // something that is a reasonable substitute. - CanonicalTXSet set(app_.openLedger().current()->info().parentHash); + CanonicalTXSet set(app_.openLedger().current()->header().parentHash); std::swap(mHeldTransactions, set); return set; }(); @@ -482,10 +482,10 @@ LedgerMaster::isValidated(ReadView const& ledger) if (ledger.open()) return false; - if (ledger.info().validated) + if (ledger.header().validated) return true; - auto const seq = ledger.info().seq; + auto const seq = ledger.header().seq; try { // Use the skip list in the last validated ledger to see if ledger @@ -493,7 +493,7 @@ LedgerMaster::isValidated(ReadView const& ledger) // validated). auto const hash = walkHashBySeq(seq, InboundLedger::Reason::GENERIC); - if (!hash || ledger.info().hash != *hash) + if (!hash || ledger.header().hash != *hash) { // This ledger's hash is not the hash of the validated ledger if (hash) @@ -503,7 +503,7 @@ LedgerMaster::isValidated(ReadView const& ledger) "ripple::LedgerMaster::isValidated : nonzero hash"); uint256 valHash = app_.getRelationalDatabase().getHashByIndex(seq); - if (valHash == ledger.info().hash) + if (valHash == ledger.header().hash) { // SQL database doesn't match ledger chain clearLedger(seq); @@ -519,7 +519,7 @@ LedgerMaster::isValidated(ReadView const& ledger) } // Mark ledger as validated to save time if we see it again. - ledger.info().validated = true; + ledger.header().validated = true; return true; } @@ -597,7 +597,7 @@ LedgerMaster::getEarliestFetch() { // The earliest ledger we will let people fetch is ledger zero, // unless that creates a larger range than allowed - std::uint32_t e = getClosedLedger()->info().seq; + std::uint32_t e = getClosedLedger()->header().seq; if (e > fetch_depth_) e -= fetch_depth_; @@ -609,8 +609,8 @@ LedgerMaster::getEarliestFetch() void LedgerMaster::tryFill(std::shared_ptr ledger) { - std::uint32_t seq = ledger->info().seq; - uint256 prevHash = ledger->info().parentHash; + std::uint32_t seq = ledger->header().seq; + uint256 prevHash = ledger->header().parentHash; std::map ledgerHashes; @@ -732,7 +732,7 @@ LedgerMaster::fixMismatch(ReadView const& ledger) int invalidate = 0; std::optional hash; - for (std::uint32_t lSeq = ledger.info().seq - 1; lSeq > 0; --lSeq) + for (std::uint32_t lSeq = ledger.header().seq - 1; lSeq > 0; --lSeq) { if (haveLedger(lSeq)) { @@ -754,7 +754,7 @@ LedgerMaster::fixMismatch(ReadView const& ledger) // try to close the seam auto otherLedger = getLedgerBySeq(lSeq); - if (otherLedger && (otherLedger->info().hash == *hash)) + if (otherLedger && (otherLedger->header().hash == *hash)) { // we closed the seam if (invalidate != 0) @@ -788,8 +788,8 @@ LedgerMaster::setFullLedger( bool isCurrent) { // A new ledger has been accepted as part of the trusted chain - JLOG(m_journal.debug()) << "Ledger " << ledger->info().seq - << " accepted :" << ledger->info().hash; + JLOG(m_journal.debug()) << "Ledger " << ledger->header().seq + << " accepted :" << ledger->header().hash; XRPL_ASSERT( ledger->stateMap().getHash().isNonZero(), "ripple::LedgerMaster::setFullLedger : nonzero ledger state hash"); @@ -803,23 +803,23 @@ LedgerMaster::setFullLedger( { // Check the SQL database's entry for the sequence before this // ledger, if it's not this ledger's parent, invalidate it - uint256 prevHash = - app_.getRelationalDatabase().getHashByIndex(ledger->info().seq - 1); - if (prevHash.isNonZero() && prevHash != ledger->info().parentHash) - clearLedger(ledger->info().seq - 1); + uint256 prevHash = app_.getRelationalDatabase().getHashByIndex( + ledger->header().seq - 1); + if (prevHash.isNonZero() && prevHash != ledger->header().parentHash) + clearLedger(ledger->header().seq - 1); } pendSaveValidated(app_, ledger, isSynchronous, isCurrent); { std::lock_guard ml(mCompleteLock); - mCompleteLedgers.insert(ledger->info().seq); + mCompleteLedgers.insert(ledger->header().seq); } { std::lock_guard ml(m_mutex); - if (ledger->info().seq > mValidLedgerSeq) + if (ledger->header().seq > mValidLedgerSeq) setValidLedger(ledger); if (!mPubLedger) { @@ -827,13 +827,13 @@ LedgerMaster::setFullLedger( app_.getOrderBookDB().setup(ledger); } - if (ledger->info().seq != 0 && haveLedger(ledger->info().seq - 1)) + if (ledger->header().seq != 0 && haveLedger(ledger->header().seq - 1)) { // we think we have the previous ledger, double check - auto prevLedger = getLedgerBySeq(ledger->info().seq - 1); + auto prevLedger = getLedgerBySeq(ledger->header().seq - 1); if (!prevLedger || - (prevLedger->info().hash != ledger->info().parentHash)) + (prevLedger->header().hash != ledger->header().parentHash)) { JLOG(m_journal.warn()) << "Acquired ledger invalidates previous ledger: " @@ -926,23 +926,23 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) // publish? std::lock_guard ml(m_mutex); - if (ledger->info().seq <= mValidLedgerSeq) + if (ledger->header().seq <= mValidLedgerSeq) return; auto const minVal = getNeededValidations(); auto validations = app_.validators().negativeUNLFilter( app_.getValidations().getTrustedForLedger( - ledger->info().hash, ledger->info().seq)); + ledger->header().hash, ledger->header().seq)); auto const tvc = validations.size(); if (tvc < minVal) // nothing we can do { JLOG(m_journal.trace()) - << "Only " << tvc << " validations for " << ledger->info().hash; + << "Only " << tvc << " validations for " << ledger->header().hash; return; } JLOG(m_journal.info()) << "Advancing accepted ledger to " - << ledger->info().seq << " with >= " << minVal + << ledger->header().seq << " with >= " << minVal << " validations"; ledger->setValidated(); @@ -956,10 +956,10 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) } std::uint32_t const base = app_.getFeeTrack().getLoadBase(); - auto fees = app_.getValidations().fees(ledger->info().hash, base); + auto fees = app_.getValidations().fees(ledger->header().hash, base); { auto fees2 = - app_.getValidations().fees(ledger->info().parentHash, base); + app_.getValidations().fees(ledger->header().parentHash, base); fees.reserve(fees.size() + fees2.size()); std::copy(fees2.begin(), fees2.end(), std::back_inserter(fees)); } @@ -1007,7 +1007,7 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) { // Have not printed the warning before, check if need to print. auto const vals = app_.getValidations().getTrustedForLedger( - ledger->info().parentHash, ledger->info().seq - 1); + ledger->header().parentHash, ledger->header().seq - 1); std::size_t higherVersionCount = 0; std::size_t rippledCount = 0; for (auto const& v : vals) @@ -1077,10 +1077,10 @@ LedgerMaster::consensusBuilt( mLedgerHistory.builtLedger(ledger, consensusHash, std::move(consensus)); - if (ledger->info().seq <= mValidLedgerSeq) + if (ledger->header().seq <= mValidLedgerSeq) { auto stream = app_.journal("LedgerConsensus").info(); - JLOG(stream) << "Consensus built old ledger: " << ledger->info().seq + JLOG(stream) << "Consensus built old ledger: " << ledger->header().seq << " <= " << mValidLedgerSeq; return; } @@ -1088,7 +1088,7 @@ LedgerMaster::consensusBuilt( // See if this ledger can be the new fully-validated ledger checkAccept(ledger); - if (ledger->info().seq <= mValidLedgerSeq) + if (ledger->header().seq <= mValidLedgerSeq) { auto stream = app_.journal("LedgerConsensus").debug(); JLOG(stream) << "Consensus ledger fully validated"; @@ -1134,7 +1134,7 @@ LedgerMaster::consensusBuilt( auto const neededValidations = getNeededValidations(); auto maxSeq = mValidLedgerSeq.load(); - auto maxLedger = ledger->info().hash; + auto maxLedger = ledger->header().hash; // Of the ledgers with sufficient validations, // find the one with the highest sequence @@ -1145,7 +1145,7 @@ LedgerMaster::consensusBuilt( if (v.second.ledgerSeq_ == 0) { if (auto l = getLedgerByHash(v.first)) - v.second.ledgerSeq_ = l->info().seq; + v.second.ledgerSeq_ = l->header().seq; } if (v.second.ledgerSeq_ > maxSeq) @@ -1172,7 +1172,7 @@ LedgerMaster::getLedgerHashForHistory( std::optional ret; auto const& l{mHistLedger}; - if (l && l->info().seq >= index) + if (l && l->header().seq >= index) { ret = hashOfSeq(*l, index, m_journal); if (!ret) @@ -1230,7 +1230,7 @@ LedgerMaster::findNewLedgersToPublish( auto pubSeq = mPubLedgerSeq + 1; // Next sequence to publish auto valLedger = mValidLedger.get(); - std::uint32_t valSeq = valLedger->info().seq; + std::uint32_t valSeq = valLedger->header().seq; scope_unlock sul{sl}; try @@ -1276,7 +1276,7 @@ LedgerMaster::findNewLedgersToPublish( } // Did we acquire the next ledger we need to publish? - if (ledger && (ledger->info().seq == pubSeq)) + if (ledger && (ledger->header().seq == pubSeq)) { ledger->setValidated(); ret.push_back(ledger); @@ -1307,7 +1307,7 @@ LedgerMaster::findNewLedgersToPublish( while (startLedger->seq() + 1 < finishLedger->seq()) { if (auto const parent = mLedgerHistory.getLedgerByHash( - finishLedger->info().parentHash); + finishLedger->header().parentHash); parent) { finishLedger = parent; @@ -1318,13 +1318,13 @@ LedgerMaster::findNewLedgersToPublish( finishLedger->seq() - startLedger->seq() + 1; JLOG(m_journal.debug()) << "Publish LedgerReplays " << numberLedgers - << " ledgers, from seq=" << startLedger->info().seq << ", " - << startLedger->info().hash - << " to seq=" << finishLedger->info().seq << ", " - << finishLedger->info().hash; + << " ledgers, from seq=" << startLedger->header().seq + << ", " << startLedger->header().hash + << " to seq=" << finishLedger->header().seq << ", " + << finishLedger->header().hash; app_.getLedgerReplayer().replay( InboundLedger::Reason::GENERIC, - finishLedger->info().hash, + finishLedger->header().hash, numberLedgers); break; } @@ -1390,7 +1390,8 @@ LedgerMaster::updatePaths() std::lock_guard ml(m_mutex); if (!mValidLedger.empty() && - (!mPathLedger || (mPathLedger->info().seq != mValidLedgerSeq))) + (!mPathLedger || + (mPathLedger->header().seq != mValidLedgerSeq))) { // We have a new valid ledger since the last full pathfinding mPathLedger = mValidLedger.get(); lastLedger = mPathLedger; @@ -1412,7 +1413,7 @@ LedgerMaster::updatePaths() { // don't pathfind with a ledger that's more than 60 seconds old using namespace std::chrono; auto age = time_point_cast(app_.timeKeeper().closeTime()) - - lastLedger->info().closeTime; + lastLedger->header().closeTime; if (age > 1min) { JLOG(m_journal.debug()) @@ -1461,16 +1462,16 @@ LedgerMaster::updatePaths() { // our parent is the problem app_.getInboundLedgers().acquire( - lastLedger->info().parentHash, - lastLedger->info().seq - 1, + lastLedger->header().parentHash, + lastLedger->header().seq - 1, InboundLedger::Reason::GENERIC); } else { // this ledger is the problem app_.getInboundLedgers().acquire( - lastLedger->info().hash, - lastLedger->info().seq, + lastLedger->header().hash, + lastLedger->header().seq, InboundLedger::Reason::GENERIC); } } @@ -1635,7 +1636,7 @@ LedgerMaster::walkHashBySeq( std::shared_ptr const& referenceLedger, InboundLedger::Reason reason) { - if (!referenceLedger || (referenceLedger->info().seq < index)) + if (!referenceLedger || (referenceLedger->header().seq < index)) { // Nothing we can do. No validated ledger. return std::nullopt; @@ -1693,7 +1694,7 @@ LedgerMaster::getLedgerBySeq(std::uint32_t index) // Always prefer a validated ledger if (auto valid = mValidLedger.get()) { - if (valid->info().seq == index) + if (valid->header().seq == index) return valid; try @@ -1714,7 +1715,7 @@ LedgerMaster::getLedgerBySeq(std::uint32_t index) return ret; auto ret = mClosedLedger.get(); - if (ret && (ret->info().seq == index)) + if (ret && (ret->header().seq == index)) return ret; clearLedger(index); @@ -1728,7 +1729,7 @@ LedgerMaster::getLedgerByHash(uint256 const& hash) return ret; auto ret = mClosedLedger.get(); - if (ret && (ret->info().hash == hash)) + if (ret && (ret->header().hash == hash)) return ret; return {}; @@ -1818,7 +1819,7 @@ LedgerMaster::fetchForHistory( } if (ledger) { - auto seq = ledger->info().seq; + auto seq = ledger->header().seq; XRPL_ASSERT( seq == missing, "ripple::LedgerMaster::fetchForHistory : sequence match"); @@ -1832,7 +1833,7 @@ LedgerMaster::fetchForHistory( } if (fillInProgress == 0 && app_.getRelationalDatabase().getHashByIndex(seq - 1) == - ledger->info().parentHash) + ledger->header().parentHash) { { // Previous ledger is in DB @@ -1919,7 +1920,7 @@ LedgerMaster::doAdvance(std::unique_lock& sl) std::lock_guard sll(mCompleteLock); missing = prevMissing( mCompleteLedgers, - mPubLedger->info().seq, + mPubLedger->header().seq, app_.getNodeStore().earliestLedgerSeq()); } if (missing) @@ -1966,7 +1967,7 @@ LedgerMaster::doAdvance(std::unique_lock& sl) { scope_unlock sul{sl}; JLOG(m_journal.debug()) - << "tryAdvance publishing seq " << ledger->info().seq; + << "tryAdvance publishing seq " << ledger->header().seq; setFullLedger(ledger, true, true); } @@ -2118,14 +2119,14 @@ LedgerMaster::makeFetchPack( return; } - if (have->info().seq < getEarliestFetch()) + if (have->header().seq < getEarliestFetch()) { JLOG(m_journal.debug()) << "Peer requests fetch pack that is too early"; peer->charge(Resource::feeMalformedRequest, "get_object ledger early"); return; } - auto want = getLedgerByHash(have->info().parentHash); + auto want = getLedgerByHash(have->header().parentHash); if (!want) { @@ -2160,19 +2161,19 @@ LedgerMaster::makeFetchPack( // the same process adding the previous ledger to the FetchPack. do { - std::uint32_t lSeq = want->info().seq; + std::uint32_t lSeq = want->header().seq; { // Serialize the ledger header: hdr.erase(); hdr.add32(HashPrefix::ledgerMaster); - addRaw(want->info(), hdr); + addRaw(want->header(), hdr); // Add the data protocol::TMIndexedObject* obj = reply.add_objects(); obj->set_hash( - want->info().hash.data(), want->info().hash.size()); + want->header().hash.data(), want->header().hash.size()); obj->set_data(hdr.getDataPtr(), hdr.getLength()); obj->set_ledgerseq(lSeq); } @@ -2182,14 +2183,14 @@ LedgerMaster::makeFetchPack( // We use nullptr here because transaction maps are per ledger // and so the requestor is unlikely to already have it. - if (want->info().txHash.isNonZero()) + if (want->header().txHash.isNonZero()) populateFetchPack(want->txMap(), nullptr, 512, &reply, lSeq); if (reply.objects().size() >= 512) break; have = std::move(want); - want = getLedgerByHash(have->info().parentHash); + want = getLedgerByHash(have->header().parentHash); } while (want && UptimeClock::now() <= uptime + 1s); auto msg = std::make_shared(reply, protocol::mtGET_OBJECTS); diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp index da7f7db23d..0a070fdeb0 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp @@ -72,7 +72,7 @@ LedgerReplayMsgHandler::processProofPathRequest( // pack header Serializer nData(128); - addRaw(ledger->info(), nData); + addRaw(ledger->header(), nData); reply.set_ledgerheader(nData.getDataPtr(), nData.getLength()); // pack path for (auto const& b : *path) @@ -185,7 +185,7 @@ LedgerReplayMsgHandler::processReplayDeltaRequest( // pack header Serializer nData(128); - addRaw(ledger->info(), nData); + addRaw(ledger->header(), nData); reply.set_ledgerheader(nData.getDataPtr(), nData.getLength()); // pack transactions auto const& txMap = ledger->txMap(); diff --git a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp index 4b068882c9..4e73b54d53 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp @@ -173,7 +173,7 @@ LedgerReplayTask::tryAdvance(ScopedLockType& sl) : ", waiting to fill parameter") << ", deltaIndex=" << deltaToBuild_ << ", totalDeltas=" << deltas_.size() << ", parent " - << (parent_ ? parent_->info().hash : uint256()); + << (parent_ ? parent_->header().hash : uint256()); bool shouldTry = parent_ && parameter_.full_ && parameter_.totalLedgers_ - 1 == deltas_.size(); @@ -191,7 +191,7 @@ LedgerReplayTask::tryAdvance(ScopedLockType& sl) if (auto l = delta->tryBuild(parent_); l) { JLOG(journal_.debug()) - << "Task " << hash_ << " got ledger " << l->info().hash + << "Task " << hash_ << " got ledger " << l->header().hash << " deltaIndex=" << deltaToBuild_ << " totalDeltas=" << deltas_.size(); parent_ = l; diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index 7e8ff9e541..f571669e5c 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -147,7 +147,7 @@ fillJsonTx( } if (!fill.ledger.open()) - txJson[jss::ledger_hash] = to_string(fill.ledger.info().hash); + txJson[jss::ledger_hash] = to_string(fill.ledger.header().hash); bool const validated = fill.context->ledgerMaster.isValidated(fill.ledger); @@ -305,12 +305,12 @@ fillJson(Object& json, LedgerFill const& fill) // Is there a way to report this back? auto bFull = isFull(fill); if (isBinary(fill)) - fillJsonBinary(json, !fill.ledger.open(), fill.ledger.info()); + fillJsonBinary(json, !fill.ledger.open(), fill.ledger.header()); else fillJson( json, !fill.ledger.open(), - fill.ledger.info(), + fill.ledger.header(), bFull, (fill.context ? fill.context->apiVersion : RPC::apiMaximumSupportedVersion)); diff --git a/src/xrpld/app/ledger/detail/LocalTxs.cpp b/src/xrpld/app/ledger/detail/LocalTxs.cpp index 557fde80ce..4d26b60a6f 100644 --- a/src/xrpld/app/ledger/detail/LocalTxs.cpp +++ b/src/xrpld/app/ledger/detail/LocalTxs.cpp @@ -126,7 +126,7 @@ public: std::lock_guard lock(m_lock); m_txns.remove_if([&view](auto const& txn) { - if (txn.isExpired(view.info().seq)) + if (txn.isExpired(view.header().seq)) return true; if (view.txExists(txn.getID())) return true; diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 2ba6630945..79b48e42b1 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -1384,7 +1384,7 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) // start first consensus round if (!m_networkOPs->beginConsensus( - m_ledgerMaster->getClosedLedger()->info().hash, {})) + m_ledgerMaster->getClosedLedger()->header().hash, {})) { JLOG(m_journal.fatal()) << "Unable to start consensus"; return false; @@ -1699,7 +1699,7 @@ ApplicationImp::startGenesisLedger() std::make_shared(*genesis, timeKeeper().closeTime()); next->updateSkipList(); XRPL_ASSERT( - next->info().seq < XRP_LEDGER_EARLIEST_FEES || + next->header().seq < XRP_LEDGER_EARLIEST_FEES || next->read(keylet::fees()), "ripple::ApplicationImp::startGenesisLedger : valid ledger fees"); next->setImmutable(); @@ -1721,7 +1721,7 @@ ApplicationImp::getLastFullLedger() return ledger; XRPL_ASSERT( - ledger->info().seq < XRP_LEDGER_EARLIEST_FEES || + ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()), "ripple::ApplicationImp::getLastFullLedger : valid ledger fees"); ledger->setImmutable(); @@ -1729,7 +1729,7 @@ ApplicationImp::getLastFullLedger() if (getLedgerMaster().haveLedger(seq)) ledger->setValidated(); - if (ledger->info().hash == hash) + if (ledger->header().hash == hash) { JLOG(j.trace()) << "Loaded ledger: " << hash; return ledger; @@ -1876,7 +1876,7 @@ ApplicationImp::loadLedgerFromFile(std::string const& name) loadLedger->stateMap().flushDirty(hotACCOUNT_NODE); XRPL_ASSERT( - loadLedger->info().seq < XRP_LEDGER_EARLIEST_FEES || + loadLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || loadLedger->read(keylet::fees()), "ripple::ApplicationImp::loadLedgerFromFile : valid ledger fees"); loadLedger->setAccepted( @@ -1955,7 +1955,7 @@ ApplicationImp::loadOldLedger( JLOG(m_journal.info()) << "Loading parent ledger"; - loadLedger = loadByHash(replayLedger->info().parentHash, *this); + loadLedger = loadByHash(replayLedger->header().parentHash, *this); if (!loadLedger) { JLOG(m_journal.info()) @@ -1964,7 +1964,7 @@ ApplicationImp::loadOldLedger( // Try to build the ledger from the back end auto il = std::make_shared( *this, - replayLedger->info().parentHash, + replayLedger->header().parentHash, 0, InboundLedger::Reason::GENERIC, stopwatch(), @@ -1989,7 +1989,7 @@ ApplicationImp::loadOldLedger( using namespace date; static constexpr NetClock::time_point ledgerWarnTimePoint{ sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}}; - if (loadLedger->info().closeTime < ledgerWarnTimePoint) + if (loadLedger->header().closeTime < ledgerWarnTimePoint) { JLOG(m_journal.fatal()) << "\n\n*** WARNING ***\n" @@ -2003,10 +2003,10 @@ ApplicationImp::loadOldLedger( "get the older rules.\n*** CONTINUING ***\n"; } - JLOG(m_journal.info()) << "Loading ledger " << loadLedger->info().hash - << " seq:" << loadLedger->info().seq; + JLOG(m_journal.info()) << "Loading ledger " << loadLedger->header().hash + << " seq:" << loadLedger->header().seq; - if (loadLedger->info().accountHash.isZero()) + if (loadLedger->header().accountHash.isZero()) { // LCOV_EXCL_START JLOG(m_journal.fatal()) << "Ledger is empty."; @@ -2039,7 +2039,7 @@ ApplicationImp::loadOldLedger( } m_ledgerMaster->setLedgerRangePresent( - loadLedger->info().seq, loadLedger->info().seq); + loadLedger->header().seq, loadLedger->header().seq); m_ledgerMaster->switchLCL(loadLedger); loadLedger->setValidated(); @@ -2081,7 +2081,7 @@ ApplicationImp::loadOldLedger( if (trapTxID && !trapTxID_) { JLOG(m_journal.fatal()) - << "Ledger " << replayLedger->info().seq + << "Ledger " << replayLedger->header().seq << " does not contain the transaction hash " << *trapTxID; return false; } diff --git a/src/xrpld/app/misc/FeeVoteImpl.cpp b/src/xrpld/app/misc/FeeVoteImpl.cpp index f116150681..88c33bd66b 100644 --- a/src/xrpld/app/misc/FeeVoteImpl.cpp +++ b/src/xrpld/app/misc/FeeVoteImpl.cpp @@ -266,7 +266,7 @@ FeeVoteImpl::doVoting( auto const baseReserve = baseReserveVote.getVotes(); auto const incReserve = incReserveVote.getVotes(); - auto const seq = lastClosedLedger->info().seq + 1; + auto const seq = lastClosedLedger->header().seq + 1; // add transactions to our position if (baseFee.second || baseReserve.second || incReserve.second) diff --git a/src/xrpld/app/misc/NegativeUNLVote.cpp b/src/xrpld/app/misc/NegativeUNLVote.cpp index e325403336..23d3248ba6 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.cpp +++ b/src/xrpld/app/misc/NegativeUNLVote.cpp @@ -59,7 +59,7 @@ NegativeUNLVote::doVoting( } } - auto const seq = prevLedger->info().seq + 1; + auto const seq = prevLedger->header().seq + 1; purgeNewValidators(seq); // Process the table and find all candidates to disable or to re-enable @@ -69,8 +69,8 @@ NegativeUNLVote::doVoting( // Pick one to disable and one to re-enable if any, add ttUNL_MODIFY Tx if (!candidates.toDisableCandidates.empty()) { - auto n = - choose(prevLedger->info().hash, candidates.toDisableCandidates); + auto n = choose( + prevLedger->header().hash, candidates.toDisableCandidates); XRPL_ASSERT( nidToKeyMap.contains(n), "ripple::NegativeUNLVote::doVoting : found node to disable"); @@ -80,7 +80,7 @@ NegativeUNLVote::doVoting( if (!candidates.toReEnableCandidates.empty()) { auto n = choose( - prevLedger->info().hash, candidates.toReEnableCandidates); + prevLedger->header().hash, candidates.toReEnableCandidates); XRPL_ASSERT( nidToKeyMap.contains(n), "ripple::NegativeUNLVote::doVoting : found node to enable"); @@ -154,7 +154,7 @@ NegativeUNLVote::buildScoreTable( // Ask the validation container to keep enough validation message history // for next time. - auto const seq = prevLedger->info().seq + 1; + auto const seq = prevLedger->header().seq + 1; validations.setSeqToKeep(seq - 1, seq + FLAG_LEDGER_INTERVAL); // Find FLAG_LEDGER_INTERVAL (i.e. 256) previous ledger hashes diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 157de028e5..1b0b4e5143 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1514,7 +1514,7 @@ NetworkOPsImp::apply(std::unique_lock& batchLock) std::optional validatedLedgerIndex; if (auto const l = m_ledgerMaster.getValidatedLedger()) - validatedLedgerIndex = l->info().seq; + validatedLedgerIndex = l->header().seq; auto newOL = app_.openLedger().current(); for (TransactionStatus& e : transactions) @@ -1882,8 +1882,8 @@ NetworkOPsImp::checkLastClosedLedger( if (!ourClosed) return false; - uint256 closedLedger = ourClosed->info().hash; - uint256 prevClosedLedger = ourClosed->info().parentHash; + uint256 closedLedger = ourClosed->header().hash; + uint256 prevClosedLedger = ourClosed->header().parentHash; JLOG(m_journal.trace()) << "OurClosed: " << closedLedger; JLOG(m_journal.trace()) << "PrevClosed: " << prevClosedLedger; @@ -1924,7 +1924,7 @@ NetworkOPsImp::checkLastClosedLedger( { // don't switch to our own previous ledger JLOG(m_journal.info()) << "We won't switch to our own previous ledger"; - networkClosed = ourClosed->info().hash; + networkClosed = ourClosed->header().hash; switchLedgers = false; } else @@ -1946,12 +1946,12 @@ NetworkOPsImp::checkLastClosedLedger( { // Don't switch to a ledger not on the validated chain // or with an invalid close time or sequence - networkClosed = ourClosed->info().hash; + networkClosed = ourClosed->header().hash; return false; } JLOG(m_journal.warn()) << "We are not running on the consensus ledger"; - JLOG(m_journal.info()) << "Our LCL: " << ourClosed->info().hash + JLOG(m_journal.info()) << "Our LCL: " << ourClosed->header().hash << getJson({*ourClosed, {}}); JLOG(m_journal.info()) << "Net LCL " << closedLedger; @@ -1977,7 +1977,7 @@ NetworkOPsImp::switchLastClosedLedger( { // set the newLCL as our last closed ledger -- this is abnormal code JLOG(m_journal.error()) - << "JUMP last closed ledger to " << newLCL->info().hash; + << "JUMP last closed ledger to " << newLCL->header().hash; clearNeedNetworkLedger(); @@ -2015,11 +2015,13 @@ NetworkOPsImp::switchLastClosedLedger( protocol::TMStatusChange s; s.set_newevent(protocol::neSWITCHED_LEDGER); - s.set_ledgerseq(newLCL->info().seq); + s.set_ledgerseq(newLCL->header().seq); s.set_networktime(app_.timeKeeper().now().time_since_epoch().count()); s.set_ledgerhashprevious( - newLCL->info().parentHash.begin(), newLCL->info().parentHash.size()); - s.set_ledgerhash(newLCL->info().hash.begin(), newLCL->info().hash.size()); + newLCL->header().parentHash.begin(), + newLCL->header().parentHash.size()); + s.set_ledgerhash( + newLCL->header().hash.begin(), newLCL->header().hash.size()); app_.overlay().foreach( send_always(std::make_shared(s, protocol::mtSTATUS_CHANGE))); @@ -2034,7 +2036,7 @@ NetworkOPsImp::beginConsensus( networkClosed.isNonZero(), "ripple::NetworkOPsImp::beginConsensus : nonzero input"); - auto closingInfo = m_ledgerMaster.getCurrentLedger()->info(); + auto closingInfo = m_ledgerMaster.getCurrentLedger()->header(); JLOG(m_journal.info()) << "Consensus time for #" << closingInfo.seq << " with LCL " << closingInfo.parentHash; @@ -2056,11 +2058,12 @@ NetworkOPsImp::beginConsensus( } XRPL_ASSERT( - prevLedger->info().hash == closingInfo.parentHash, + prevLedger->header().hash == closingInfo.parentHash, "ripple::NetworkOPsImp::beginConsensus : prevLedger hash matches " "parent"); XRPL_ASSERT( - closingInfo.parentHash == m_ledgerMaster.getClosedLedger()->info().hash, + closingInfo.parentHash == + m_ledgerMaster.getClosedLedger()->header().hash, "ripple::NetworkOPsImp::beginConsensus : closedLedger parent matches " "hash"); @@ -2147,7 +2150,7 @@ NetworkOPsImp::mapComplete(std::shared_ptr const& map, bool fromAcquire) void NetworkOPsImp::endConsensus(std::unique_ptr const& clog) { - uint256 deadLedger = m_ledgerMaster.getClosedLedger()->info().parentHash; + uint256 deadLedger = m_ledgerMaster.getClosedLedger()->header().parentHash; for (auto const& it : app_.overlay().getActivePeers()) { @@ -2193,8 +2196,9 @@ NetworkOPsImp::endConsensus(std::unique_ptr const& clog) // Note: Do not go to FULL if we don't have the previous ledger // check if the ledger is bad enough to go to CONNECTE D -- TODO auto current = m_ledgerMaster.getCurrentLedger(); - if (app_.timeKeeper().now() < (current->info().parentCloseTime + - 2 * current->info().closeTimeResolution)) + if (app_.timeKeeper().now() < + (current->header().parentCloseTime + + 2 * current->header().closeTimeResolution)) { setMode(OperatingMode::FULL); } @@ -2911,8 +2915,8 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) { XRPAmount const baseFee = lpClosed->fees().base; Json::Value l(Json::objectValue); - l[jss::seq] = Json::UInt(lpClosed->info().seq); - l[jss::hash] = to_string(lpClosed->info().hash); + l[jss::seq] = Json::UInt(lpClosed->header().seq); + l[jss::hash] = to_string(lpClosed->header().hash); if (!human) { @@ -2920,7 +2924,7 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) l[jss::reserve_base] = lpClosed->fees().reserve.jsonClipped(); l[jss::reserve_inc] = lpClosed->fees().increment.jsonClipped(); l[jss::close_time] = Json::Value::UInt( - lpClosed->info().closeTime.time_since_epoch().count()); + lpClosed->header().closeTime.time_since_epoch().count()); } else { @@ -2942,7 +2946,7 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) } else { - auto lCloseTime = lpClosed->info().closeTime; + auto lCloseTime = lpClosed->header().closeTime; auto closeTime = app_.timeKeeper().closeTime(); if (lCloseTime <= closeTime) { @@ -2962,8 +2966,8 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) auto lpPublished = m_ledgerMaster.getPublishedLedger(); if (!lpPublished) info[jss::published_ledger] = "none"; - else if (lpPublished->info().seq != lpClosed->info().seq) - info[jss::published_ledger] = lpPublished->info().seq; + else if (lpPublished->header().seq != lpClosed->header().seq) + info[jss::published_ledger] = lpPublished->header().seq; } accounting_.json(info); @@ -3083,12 +3087,12 @@ NetworkOPsImp::pubLedger(std::shared_ptr const& lpAccepted) // Holes are filled across connection loss or other catastrophe std::shared_ptr alpAccepted = - app_.getAcceptedLedgerCache().fetch(lpAccepted->info().hash); + app_.getAcceptedLedgerCache().fetch(lpAccepted->header().hash); if (!alpAccepted) { alpAccepted = std::make_shared(lpAccepted, app_); app_.getAcceptedLedgerCache().canonicalize_replace_client( - lpAccepted->info().hash, alpAccepted); + lpAccepted->header().hash, alpAccepted); } XRPL_ASSERT( @@ -3097,8 +3101,8 @@ NetworkOPsImp::pubLedger(std::shared_ptr const& lpAccepted) { JLOG(m_journal.debug()) - << "Publishing ledger " << lpAccepted->info().seq << " " - << lpAccepted->info().hash; + << "Publishing ledger " << lpAccepted->header().seq << " " + << lpAccepted->header().hash; std::lock_guard sl(mSubLock); @@ -3107,10 +3111,10 @@ NetworkOPsImp::pubLedger(std::shared_ptr const& lpAccepted) Json::Value jvObj(Json::objectValue); jvObj[jss::type] = "ledgerClosed"; - jvObj[jss::ledger_index] = lpAccepted->info().seq; - jvObj[jss::ledger_hash] = to_string(lpAccepted->info().hash); + jvObj[jss::ledger_index] = lpAccepted->header().seq; + jvObj[jss::ledger_hash] = to_string(lpAccepted->header().hash); jvObj[jss::ledger_time] = Json::Value::UInt( - lpAccepted->info().closeTime.time_since_epoch().count()); + lpAccepted->header().closeTime.time_since_epoch().count()); jvObj[jss::network_id] = app_.config().NETWORK_ID; @@ -3273,27 +3277,27 @@ NetworkOPsImp::transJson( netID = transaction->getFieldU32(sfNetworkID); if (std::optional ctid = - RPC::encodeCTID(ledger->info().seq, txnSeq, netID); + RPC::encodeCTID(ledger->header().seq, txnSeq, netID); ctid) jvObj[jss::ctid] = *ctid; } if (!ledger->open()) - jvObj[jss::ledger_hash] = to_string(ledger->info().hash); + jvObj[jss::ledger_hash] = to_string(ledger->header().hash); if (validated) { - jvObj[jss::ledger_index] = ledger->info().seq; + jvObj[jss::ledger_index] = ledger->header().seq; jvObj[jss::transaction][jss::date] = - ledger->info().closeTime.time_since_epoch().count(); + ledger->header().closeTime.time_since_epoch().count(); jvObj[jss::validated] = true; - jvObj[jss::close_time_iso] = to_string_iso(ledger->info().closeTime); + jvObj[jss::close_time_iso] = to_string_iso(ledger->header().closeTime); // WRITEME: Put the account next seq here } else { jvObj[jss::validated] = false; - jvObj[jss::ledger_current_index] = ledger->info().seq; + jvObj[jss::ledger_current_index] = ledger->header().seq; } jvObj[jss::status] = validated ? "closed" : "proposed"; @@ -4177,9 +4181,9 @@ NetworkOPsImp::acceptLedger( // FIXME Could we improve on this and remove the need for a specialized // API in Consensus? - beginConsensus(m_ledgerMaster.getClosedLedger()->info().hash, {}); + beginConsensus(m_ledgerMaster.getClosedLedger()->header().hash, {}); mConsensus.simulate(app_.timeKeeper().closeTime(), consensusDelay); - return m_ledgerMaster.getCurrentLedger()->info().seq; + return m_ledgerMaster.getCurrentLedger()->header().seq; } // <-- bool: true=added, false=already there @@ -4188,10 +4192,10 @@ NetworkOPsImp::subLedger(InfoSub::ref isrListener, Json::Value& jvResult) { if (auto lpClosed = m_ledgerMaster.getValidatedLedger()) { - jvResult[jss::ledger_index] = lpClosed->info().seq; - jvResult[jss::ledger_hash] = to_string(lpClosed->info().hash); + jvResult[jss::ledger_index] = lpClosed->header().seq; + jvResult[jss::ledger_hash] = to_string(lpClosed->header().hash); jvResult[jss::ledger_time] = Json::Value::UInt( - lpClosed->info().closeTime.time_since_epoch().count()); + lpClosed->header().closeTime.time_since_epoch().count()); if (!lpClosed->rules().enabled(featureXRPFees)) jvResult[jss::fee_ref] = Config::FEE_UNITS_DEPRECATED; jvResult[jss::fee_base] = lpClosed->fees().base.jsonClipped(); diff --git a/src/xrpld/app/misc/PermissionedDEXHelpers.cpp b/src/xrpld/app/misc/PermissionedDEXHelpers.cpp index d02ae8e180..bc90848428 100644 --- a/src/xrpld/app/misc/PermissionedDEXHelpers.cpp +++ b/src/xrpld/app/misc/PermissionedDEXHelpers.cpp @@ -29,7 +29,7 @@ accountInDomain( return false; return !credentials::checkExpired( - sleCred, view.info().parentCloseTime); + sleCred, view.header().parentCloseTime); }); return inDomain; diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index d771145540..79c75ca0cf 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -278,7 +278,7 @@ SHAMapStoreImp::run() continue; } - LedgerIndex const validatedSeq = validatedLedger->info().seq; + LedgerIndex const validatedSeq = validatedLedger->header().seq; if (!lastRotated) { lastRotated = validatedSeq; diff --git a/src/xrpld/app/misc/detail/AMMUtils.cpp b/src/xrpld/app/misc/detail/AMMUtils.cpp index 84236b0b6e..ab0aec41b1 100644 --- a/src/xrpld/app/misc/detail/AMMUtils.cpp +++ b/src/xrpld/app/misc/detail/AMMUtils.cpp @@ -171,7 +171,7 @@ getTradingFee(ReadView const& view, SLE const& ammSle, AccountID const& account) // Not expired if (auto const expiration = auctionSlot[~sfExpiration]; duration_cast( - view.info().parentCloseTime.time_since_epoch()) + view.header().parentCloseTime.time_since_epoch()) .count() < expiration) { if (auctionSlot[~sfAccount] == account) @@ -347,9 +347,10 @@ initializeFeeAuctionVote( STObject& auctionSlot = ammSle->peekFieldObject(sfAuctionSlot); auctionSlot.setAccountID(sfAccount, account); // current + sec in 24h - auto const expiration = std::chrono::duration_cast( - view.info().parentCloseTime.time_since_epoch()) - .count() + + auto const expiration = + std::chrono::duration_cast( + view.header().parentCloseTime.time_since_epoch()) + .count() + TOTAL_TIME_SLOT_SECS; auctionSlot.setFieldU32(sfExpiration, expiration); auctionSlot.setFieldAmount(sfPrice, STAmount{lptIssue, 0}); diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index fd975f9178..35ae25c82f 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -82,7 +82,8 @@ TxQ::FeeMetrics::update( "ripple::TxQ::FeeMetrics::update : fee levels size"); JLOG((timeLeap ? j_.warn() : j_.debug())) - << "Ledger " << view.info().seq << " has " << size << " transactions. " + << "Ledger " << view.header().seq << " has " << size + << " transactions. " << "Ledgers are processing " << (timeLeap ? "slowly" : "as expected") << ". Expected transactions is currently " << txnsExpected_ << " and multiplier is " << escalationMultiplier_; @@ -384,7 +385,7 @@ TxQ::canBeHeld( // a realistic chance of getting into a ledger. auto const lastValid = getLastLedgerSequence(tx); if (lastValid && - *lastValid < view.info().seq + setup_.minimumLastLedgerBuffer) + *lastValid < view.header().seq + setup_.minimumLastLedgerBuffer) return telCAN_NOT_QUEUE; } @@ -1349,7 +1350,7 @@ TxQ::processClosedLedger(Application& app, ReadView const& view, bool timeLeap) feeMetrics_.update(app, view, timeLeap, setup_); auto const& snapshot = feeMetrics_.getSnapshot(); - auto ledgerSeq = view.info().seq; + auto ledgerSeq = view.header().seq; if (!timeLeap) maxSize_ = std::max( @@ -1548,7 +1549,7 @@ TxQ::accept(Application& app, OpenView& view) // ledger have been. Rebuild the queue using the open ledger's // parent hash, so that transactions paying the same fee are // reordered. - LedgerHash const& parentHash = view.info().parentHash; + LedgerHash const& parentHash = view.header().parentHash; if (parentHash == parentHash_) JLOG(j_.warn()) << "Parent ledger hash unchanged from " << parentHash; else @@ -1851,7 +1852,7 @@ TxQ::doRPC(Application& app) const auto& levels = ret[jss::levels] = Json::objectValue; - ret[jss::ledger_current_index] = view->info().seq; + ret[jss::ledger_current_index] = view->header().seq; ret[jss::expected_ledger_size] = std::to_string(metrics.txPerLedger); ret[jss::current_ledger_size] = std::to_string(metrics.txInLedger); ret[jss::current_queue_size] = std::to_string(metrics.txCount); diff --git a/src/xrpld/app/paths/PathRequest.cpp b/src/xrpld/app/paths/PathRequest.cpp index 5ab7766e30..6b7b35e366 100644 --- a/src/xrpld/app/paths/PathRequest.cpp +++ b/src/xrpld/app/paths/PathRequest.cpp @@ -207,7 +207,7 @@ PathRequest::isValid(std::shared_ptr const& crCache) (sleDest->getFlags() & lsfRequireDestTag); } - jvStatus[jss::ledger_hash] = to_string(lrLedger->info().hash); + jvStatus[jss::ledger_hash] = to_string(lrLedger->header().hash); jvStatus[jss::ledger_index] = lrLedger->seq(); return true; } diff --git a/src/xrpld/app/paths/RippleLineCache.cpp b/src/xrpld/app/paths/RippleLineCache.cpp index 8e35b771fd..498b060cb3 100644 --- a/src/xrpld/app/paths/RippleLineCache.cpp +++ b/src/xrpld/app/paths/RippleLineCache.cpp @@ -8,12 +8,12 @@ RippleLineCache::RippleLineCache( beast::Journal j) : ledger_(ledger), journal_(j) { - JLOG(journal_.debug()) << "created for ledger " << ledger_->info().seq; + JLOG(journal_.debug()) << "created for ledger " << ledger_->header().seq; } RippleLineCache::~RippleLineCache() { - JLOG(journal_.debug()) << "destroyed for ledger " << ledger_->info().seq + JLOG(journal_.debug()) << "destroyed for ledger " << ledger_->header().seq << " with " << lines_.size() << " accounts and " << totalLineCount_ << " distinct trust lines."; } @@ -99,7 +99,7 @@ RippleLineCache::getRippleLines( "ripple::RippleLineCache::getRippleLines : null or nonempty lines"); auto const size = it->second ? it->second->size() : 0; JLOG(journal_.trace()) << "getRippleLines for ledger " - << ledger_->info().seq << " found " << size + << ledger_->header().seq << " found " << size << (key.direction_ == LineDirection::outgoing ? " outgoing" : " incoming") diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index a7b35a5305..c8458d15db 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -177,13 +177,13 @@ saveValidatedLedger( bool current) { auto j = app.journal("Ledger"); - auto seq = ledger->info().seq; + auto seq = ledger->header().seq; // TODO(tom): Fix this hard-coded SQL! JLOG(j.trace()) << "saveValidatedLedger " << (current ? "" : "fromAcquire ") << seq; - if (!ledger->info().accountHash.isNonZero()) + if (!ledger->header().accountHash.isNonZero()) { // LCOV_EXCL_START JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}}); @@ -191,10 +191,11 @@ saveValidatedLedger( // LCOV_EXCL_STOP } - if (ledger->info().accountHash != ledger->stateMap().getHash().as_uint256()) + if (ledger->header().accountHash != + ledger->stateMap().getHash().as_uint256()) { // LCOV_EXCL_START - JLOG(j.fatal()) << "sAL: " << ledger->info().accountHash + JLOG(j.fatal()) << "sAL: " << ledger->header().accountHash << " != " << ledger->stateMap().getHash(); JLOG(j.fatal()) << "saveAcceptedLedger: seq=" << seq << ", current=" << current; @@ -204,33 +205,33 @@ saveValidatedLedger( } XRPL_ASSERT( - ledger->info().txHash == ledger->txMap().getHash().as_uint256(), + ledger->header().txHash == ledger->txMap().getHash().as_uint256(), "ripple::detail::saveValidatedLedger : transaction hash match"); // Save the ledger header in the hashed object store { Serializer s(128); s.add32(HashPrefix::ledgerMaster); - addRaw(ledger->info(), s); + addRaw(ledger->header(), s); app.getNodeStore().store( - hotLEDGER, std::move(s.modData()), ledger->info().hash, seq); + hotLEDGER, std::move(s.modData()), ledger->header().hash, seq); } std::shared_ptr aLedger; try { - aLedger = app.getAcceptedLedgerCache().fetch(ledger->info().hash); + aLedger = app.getAcceptedLedgerCache().fetch(ledger->header().hash); if (!aLedger) { aLedger = std::make_shared(ledger, app); app.getAcceptedLedgerCache().canonicalize_replace_client( - ledger->info().hash, aLedger); + ledger->header().hash, aLedger); } } catch (std::exception const&) { JLOG(j.warn()) << "An accepted ledger was missing nodes"; - app.getLedgerMaster().failedSave(seq, ledger->info().hash); + app.getLedgerMaster().failedSave(seq, ledger->header().hash); // Clients can now trust the database for information about this // ledger sequence. app.pendingSaves().finishWork(seq); @@ -357,18 +358,18 @@ saveValidatedLedger( soci::transaction tr(*db); - auto const hash = to_string(ledger->info().hash); - auto const parentHash = to_string(ledger->info().parentHash); - auto const drops = to_string(ledger->info().drops); + auto const hash = to_string(ledger->header().hash); + auto const parentHash = to_string(ledger->header().parentHash); + auto const drops = to_string(ledger->header().drops); auto const closeTime = - ledger->info().closeTime.time_since_epoch().count(); + ledger->header().closeTime.time_since_epoch().count(); auto const parentCloseTime = - ledger->info().parentCloseTime.time_since_epoch().count(); + ledger->header().parentCloseTime.time_since_epoch().count(); auto const closeTimeResolution = - ledger->info().closeTimeResolution.count(); - auto const closeFlags = ledger->info().closeFlags; - auto const accountHash = to_string(ledger->info().accountHash); - auto const txHash = to_string(ledger->info().txHash); + ledger->header().closeTimeResolution.count(); + auto const closeFlags = ledger->header().closeFlags; + auto const accountHash = to_string(ledger->header().accountHash); + auto const txHash = to_string(ledger->header().txHash); *db << addLedger, soci::use(hash), soci::use(seq), soci::use(parentHash), soci::use(drops), soci::use(closeTime), diff --git a/src/xrpld/app/tx/detail/AMMBid.cpp b/src/xrpld/app/tx/detail/AMMBid.cpp index 158f60e0e4..47b89417a3 100644 --- a/src/xrpld/app/tx/detail/AMMBid.cpp +++ b/src/xrpld/app/tx/detail/AMMBid.cpp @@ -180,7 +180,7 @@ applyBid( auto& auctionSlot = ammSle->peekFieldObject(sfAuctionSlot); auto const current = duration_cast( - ctx_.view().info().parentCloseTime.time_since_epoch()) + ctx_.view().header().parentCloseTime.time_since_epoch()) .count(); // Auction slot discounted fee auto const discountedFee = diff --git a/src/xrpld/app/tx/detail/Credentials.cpp b/src/xrpld/app/tx/detail/Credentials.cpp index e16a432656..274a25e0c6 100644 --- a/src/xrpld/app/tx/detail/Credentials.cpp +++ b/src/xrpld/app/tx/detail/Credentials.cpp @@ -104,7 +104,7 @@ CredentialCreate::doApply() if (optExp) { std::uint32_t const closeTime = - ctx_.view().info().parentCloseTime.time_since_epoch().count(); + ctx_.view().header().parentCloseTime.time_since_epoch().count(); if (closeTime > *optExp) { @@ -242,7 +242,7 @@ CredentialDelete::doApply() return tefINTERNAL; // LCOV_EXCL_LINE if ((subject != account_) && (issuer != account_) && - !checkExpired(sleCred, ctx_.view().info().parentCloseTime)) + !checkExpired(sleCred, ctx_.view().header().parentCloseTime)) { JLOG(j_.trace()) << "Can't delete non-expired credential."; return tecNO_PERMISSION; @@ -336,7 +336,7 @@ CredentialAccept::doApply() Keylet const credentialKey = keylet::credential(account_, issuer, credType); auto const sleCred = view().peek(credentialKey); // Checked in preclaim() - if (checkExpired(sleCred, view().info().parentCloseTime)) + if (checkExpired(sleCred, view().header().parentCloseTime)) { JLOG(j_.trace()) << "Credential is expired: " << sleCred->getText(); // delete expired credentials even if the transaction failed diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index c22b8145c6..e9aad6ad37 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -416,7 +416,7 @@ escrowLockApplyHelper( TER EscrowCreate::doApply() { - auto const closeTime = ctx_.view().info().parentCloseTime; + auto const closeTime = ctx_.view().header().parentCloseTime; if (ctx_.tx[~sfCancelAfter] && after(closeTime, ctx_.tx[sfCancelAfter])) return tecNO_PERMISSION; @@ -964,7 +964,7 @@ EscrowFinish::doApply() // If a cancel time is present, a finish operation should only succeed prior // to that time. - auto const now = ctx_.view().info().parentCloseTime; + auto const now = ctx_.view().header().parentCloseTime; // Too soon: can't execute before the finish time if ((*slep)[~sfFinishAfter] && !after(now, (*slep)[sfFinishAfter])) @@ -1226,7 +1226,7 @@ EscrowCancel::doApply() return tecNO_TARGET; } - auto const now = ctx_.view().info().parentCloseTime; + auto const now = ctx_.view().header().parentCloseTime; // No cancel time specified: can't execute at all. if (!(*slep)[~sfCancelAfter]) diff --git a/src/xrpld/app/tx/detail/LoanSet.cpp b/src/xrpld/app/tx/detail/LoanSet.cpp index 838e774cae..756ea53fc1 100644 --- a/src/xrpld/app/tx/detail/LoanSet.cpp +++ b/src/xrpld/app/tx/detail/LoanSet.cpp @@ -188,7 +188,7 @@ LoanSet::getValueFields() static std::uint32_t getStartDate(ReadView const& view) { - return view.info().closeTime.time_since_epoch().count(); + return view.header().closeTime.time_since_epoch().count(); } TER diff --git a/src/xrpld/app/tx/detail/PayChan.cpp b/src/xrpld/app/tx/detail/PayChan.cpp index ae47036ab6..40e760e5f5 100644 --- a/src/xrpld/app/tx/detail/PayChan.cpp +++ b/src/xrpld/app/tx/detail/PayChan.cpp @@ -231,7 +231,7 @@ PayChanCreate::doApply() if (ctx_.view().rules().enabled(fixPayChanCancelAfter)) { - auto const closeTime = ctx_.view().info().parentCloseTime; + auto const closeTime = ctx_.view().header().parentCloseTime; if (ctx_.tx[~sfCancelAfter] && after(closeTime, ctx_.tx[sfCancelAfter])) return tecEXPIRED; } @@ -324,7 +324,7 @@ PayChanFund::doApply() { auto const cancelAfter = (*slep)[~sfCancelAfter]; auto const closeTime = - ctx_.view().info().parentCloseTime.time_since_epoch().count(); + ctx_.view().header().parentCloseTime.time_since_epoch().count(); if ((cancelAfter && closeTime >= *cancelAfter) || (expiration && closeTime >= *expiration)) return closeChannel( @@ -338,7 +338,7 @@ PayChanFund::doApply() if (auto extend = ctx_.tx[~sfExpiration]) { auto minExpiration = - ctx_.view().info().parentCloseTime.time_since_epoch().count() + + ctx_.view().header().parentCloseTime.time_since_epoch().count() + (*slep)[sfSettleDelay]; if (expiration && *expiration < minExpiration) minExpiration = *expiration; @@ -481,7 +481,7 @@ PayChanClaim::doApply() { auto const cancelAfter = (*slep)[~sfCancelAfter]; auto const closeTime = - ctx_.view().info().parentCloseTime.time_since_epoch().count(); + ctx_.view().header().parentCloseTime.time_since_epoch().count(); if ((cancelAfter && closeTime >= *cancelAfter) || (curExpiration && closeTime >= *curExpiration)) return closeChannel( @@ -549,7 +549,7 @@ PayChanClaim::doApply() slep, ctx_.view(), k.key, ctx_.app.journal("View")); auto const settleExpiration = - ctx_.view().info().parentCloseTime.time_since_epoch().count() + + ctx_.view().header().parentCloseTime.time_since_epoch().count() + (*slep)[sfSettleDelay]; if (!curExpiration || *curExpiration > settleExpiration) diff --git a/src/xrpld/app/tx/detail/SetOracle.cpp b/src/xrpld/app/tx/detail/SetOracle.cpp index cecb623d82..453d799b0d 100644 --- a/src/xrpld/app/tx/detail/SetOracle.cpp +++ b/src/xrpld/app/tx/detail/SetOracle.cpp @@ -51,7 +51,7 @@ SetOracle::preclaim(PreclaimContext const& ctx) // of the last closed ledger using namespace std::chrono; std::size_t const closeTime = - duration_cast(ctx.view.info().closeTime.time_since_epoch()) + duration_cast(ctx.view.header().closeTime.time_since_epoch()) .count(); std::size_t const lastUpdateTime = ctx.tx[sfLastUpdateTime]; if (lastUpdateTime < epoch_offset.count()) diff --git a/src/xrpld/overlay/detail/Handshake.cpp b/src/xrpld/overlay/detail/Handshake.cpp index 469dab6d9a..45dc37f52c 100644 --- a/src/xrpld/overlay/detail/Handshake.cpp +++ b/src/xrpld/overlay/detail/Handshake.cpp @@ -199,8 +199,8 @@ buildHandshake( if (auto const cl = app.getLedgerMaster().getClosedLedger()) { - h.insert("Closed-Ledger", strHex(cl->info().hash)); - h.insert("Previous-Ledger", strHex(cl->info().parentHash)); + h.insert("Closed-Ledger", strHex(cl->header().hash)); + h.insert("Previous-Ledger", strHex(cl->header().parentHash)); } } diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 1a0995442b..097eaae4d9 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -3228,7 +3228,7 @@ PeerImp::sendLedgerBase( JLOG(p_journal_.trace()) << "sendLedgerBase: Base data"; Serializer s(sizeof(LedgerHeader)); - addRaw(ledger->info(), s); + addRaw(ledger->header(), s); ledgerData.add_nodes()->set_nodedata(s.getDataPtr(), s.getLength()); auto const& stateMap{ledger->stateMap()}; @@ -3241,7 +3241,7 @@ PeerImp::sendLedgerBase( ledgerData.add_nodes()->set_nodedata( root.getDataPtr(), root.getLength()); - if (ledger->info().txHash != beast::zero) + if (ledger->header().txHash != beast::zero) { auto const& txMap{ledger->txMap()}; if (txMap.getHash() != beast::zero) @@ -3326,7 +3326,7 @@ PeerImp::getLedger(std::shared_ptr const& m) if (ledger) { // Validate retrieved ledger sequence - auto const ledgerSeq{ledger->info().seq}; + auto const ledgerSeq{ledger->header().seq}; if (m->has_ledgerseq()) { if (ledgerSeq != m->ledgerseq()) @@ -3440,9 +3440,9 @@ PeerImp::processLedgerRequest(std::shared_ptr const& m) return; // Fill out the reply - auto const ledgerHash{ledger->info().hash}; + auto const ledgerHash{ledger->header().hash}; ledgerData.set_ledgerhash(ledgerHash.begin(), ledgerHash.size()); - ledgerData.set_ledgerseq(ledger->info().seq); + ledgerData.set_ledgerseq(ledger->header().seq); ledgerData.set_type(itype); if (m->has_requestcookie()) ledgerData.set_requestcookie(m->requestcookie()); diff --git a/src/xrpld/rpc/BookChanges.h b/src/xrpld/rpc/BookChanges.h index 58e8c25dc1..c30dadb9fe 100644 --- a/src/xrpld/rpc/BookChanges.h +++ b/src/xrpld/rpc/BookChanges.h @@ -166,11 +166,11 @@ computeBookChanges(std::shared_ptr const& lpAccepted) jvObj[jss::type] = "bookChanges"; // retrieve validated information from LedgerHeader class - jvObj[jss::validated] = lpAccepted->info().validated; - jvObj[jss::ledger_index] = lpAccepted->info().seq; - jvObj[jss::ledger_hash] = to_string(lpAccepted->info().hash); + jvObj[jss::validated] = lpAccepted->header().validated; + jvObj[jss::ledger_index] = lpAccepted->header().seq; + jvObj[jss::ledger_hash] = to_string(lpAccepted->header().hash); jvObj[jss::ledger_time] = Json::Value::UInt( - lpAccepted->info().closeTime.time_since_epoch().count()); + lpAccepted->header().closeTime.time_since_epoch().count()); jvObj[jss::changes] = Json::arrayValue; diff --git a/src/xrpld/rpc/detail/DeliveredAmount.cpp b/src/xrpld/rpc/detail/DeliveredAmount.cpp index 2191d2b338..bcc7c4389d 100644 --- a/src/xrpld/rpc/detail/DeliveredAmount.cpp +++ b/src/xrpld/rpc/detail/DeliveredAmount.cpp @@ -88,7 +88,7 @@ insertDeliveredAmount( std::shared_ptr const& serializedTx, TxMeta const& transactionMeta) { - auto const info = ledger.info(); + auto const info = ledger.header(); if (canHaveDeliveredAmount(serializedTx, transactionMeta)) { diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp index 144378a1ec..d2bf7d5349 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp @@ -234,7 +234,7 @@ getLedger(T& ledger, uint32_t ledgerIndex, Context const& context) if (ledger == nullptr) { auto cur = context.ledgerMaster.getCurrentLedger(); - if (cur->info().seq == ledgerIndex) + if (cur->header().seq == ledgerIndex) { ledger = cur; } @@ -243,7 +243,7 @@ getLedger(T& ledger, uint32_t ledgerIndex, Context const& context) if (ledger == nullptr) return {rpcLGR_NOT_FOUND, "ledgerNotFound"}; - if (ledger->info().seq > context.ledgerMaster.getValidLedgerIndex() && + if (ledger->header().seq > context.ledgerMaster.getValidLedgerIndex() && isValidatedOld(context.ledgerMaster, context.app.config().standalone())) { ledger.reset(); @@ -307,7 +307,7 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context const& context) static auto const minSequenceGap = 10; - if (ledger->info().seq + minSequenceGap < + if (ledger->header().seq + minSequenceGap < context.ledgerMaster.getValidLedgerIndex()) { ledger.reset(); @@ -360,7 +360,7 @@ lookupLedger( if (auto status = ledgerFromRequest(ledger, context)) return status; - auto& info = ledger->info(); + auto& info = ledger->header(); if (!ledger->open()) { @@ -433,7 +433,7 @@ getOrAcquireLedger(RPC::JsonContext const& context) ledgerIndex = jsonIndex.asInt(); auto ledger = ledgerMaster.getValidatedLedger(); - if (ledgerIndex >= ledger->info().seq) + if (ledgerIndex >= ledger->header().seq) return Unexpected(RPC::make_param_error("Ledger index too large")); if (ledgerIndex <= 0) return Unexpected(RPC::make_param_error("Ledger index too small")); diff --git a/src/xrpld/rpc/handlers/AMMInfo.cpp b/src/xrpld/rpc/handlers/AMMInfo.cpp index 0504adca02..5ea826fce5 100644 --- a/src/xrpld/rpc/handlers/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/AMMInfo.cpp @@ -194,7 +194,7 @@ doAMMInfo(RPC::JsonContext& context) { Json::Value auction; auto const timeSlot = ammAuctionTimeSlot( - ledger->info().parentCloseTime.time_since_epoch().count(), + ledger->header().parentCloseTime.time_since_epoch().count(), auctionSlot); auction[jss::time_interval] = timeSlot ? *timeSlot : AUCTION_SLOT_TIME_INTERVALS; @@ -230,7 +230,7 @@ doAMMInfo(RPC::JsonContext& context) result[jss::amm] = std::move(ammResult); if (!result.isMember(jss::ledger_index) && !result.isMember(jss::ledger_hash)) - result[jss::ledger_current_index] = ledger->info().seq; + result[jss::ledger_current_index] = ledger->header().seq; result[jss::validated] = context.ledgerMaster.isValidated(*ledger); return result; diff --git a/src/xrpld/rpc/handlers/AccountTx.cpp b/src/xrpld/rpc/handlers/AccountTx.cpp index e248764194..efb246b4d5 100644 --- a/src/xrpld/rpc/handlers/AccountTx.cpp +++ b/src/xrpld/rpc/handlers/AccountTx.cpp @@ -176,12 +176,13 @@ getLedgerRange( bool validated = context.ledgerMaster.isValidated(*ledgerView); - if (!validated || ledgerView->info().seq > uValidatedMax || - ledgerView->info().seq < uValidatedMin) + if (!validated || + ledgerView->header().seq > uValidatedMax || + ledgerView->header().seq < uValidatedMin) { return rpcLGR_NOT_VALIDATED; } - uLedgerMin = uLedgerMax = ledgerView->info().seq; + uLedgerMin = uLedgerMax = ledgerView->header().seq; } return RPC::Status::OK; }, diff --git a/src/xrpld/rpc/handlers/CanDelete.cpp b/src/xrpld/rpc/handlers/CanDelete.cpp index c950b7a23d..d07d344242 100644 --- a/src/xrpld/rpc/handlers/CanDelete.cpp +++ b/src/xrpld/rpc/handlers/CanDelete.cpp @@ -60,7 +60,7 @@ doCanDelete(RPC::JsonContext& context) if (!ledger) return RPC::make_error(rpcLGR_NOT_FOUND, "ledgerNotFound"); - canDeleteSeq = ledger->info().seq; + canDeleteSeq = ledger->header().seq; } else { diff --git a/src/xrpld/rpc/handlers/DepositAuthorized.cpp b/src/xrpld/rpc/handlers/DepositAuthorized.cpp index 707db63e36..7beaffaf99 100644 --- a/src/xrpld/rpc/handlers/DepositAuthorized.cpp +++ b/src/xrpld/rpc/handlers/DepositAuthorized.cpp @@ -135,7 +135,7 @@ doDepositAuthorized(RPC::JsonContext& context) } if (credentials::checkExpired( - sleCred, ledger->info().parentCloseTime)) + sleCred, ledger->header().parentCloseTime)) { RPC::inject_error( rpcBAD_CREDENTIALS, "credentials are expired", result); diff --git a/src/xrpld/rpc/handlers/LedgerClosed.cpp b/src/xrpld/rpc/handlers/LedgerClosed.cpp index d7911f6b5b..3628c0f8d6 100644 --- a/src/xrpld/rpc/handlers/LedgerClosed.cpp +++ b/src/xrpld/rpc/handlers/LedgerClosed.cpp @@ -14,8 +14,8 @@ doLedgerClosed(RPC::JsonContext& context) XRPL_ASSERT(ledger, "ripple::doLedgerClosed : non-null closed ledger"); Json::Value jvResult; - jvResult[jss::ledger_index] = ledger->info().seq; - jvResult[jss::ledger_hash] = to_string(ledger->info().hash); + jvResult[jss::ledger_index] = ledger->header().seq; + jvResult[jss::ledger_hash] = to_string(ledger->header().hash); return jvResult; } diff --git a/src/xrpld/rpc/handlers/LedgerData.cpp b/src/xrpld/rpc/handlers/LedgerData.cpp index c5e39f69b4..35e5055242 100644 --- a/src/xrpld/rpc/handlers/LedgerData.cpp +++ b/src/xrpld/rpc/handlers/LedgerData.cpp @@ -59,8 +59,8 @@ doLedgerData(RPC::JsonContext& context) if ((limit < 0) || ((limit > maxLimit) && (!isUnlimited(context.role)))) limit = maxLimit; - jvResult[jss::ledger_hash] = to_string(lpLedger->info().hash); - jvResult[jss::ledger_index] = lpLedger->info().seq; + jvResult[jss::ledger_hash] = to_string(lpLedger->header().hash); + jvResult[jss::ledger_index] = lpLedger->header().seq; if (!isMarker) { diff --git a/src/xrpld/rpc/handlers/LedgerHandler.cpp b/src/xrpld/rpc/handlers/LedgerHandler.cpp index 4483838fa0..14c6fc67d9 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.cpp +++ b/src/xrpld/rpc/handlers/LedgerHandler.cpp @@ -103,7 +103,7 @@ doLedgerGrpc(RPC::GRPCContext& context) } Serializer s; - addRaw(ledger->info(), s, true); + addRaw(ledger->header(), s, true); response.set_ledger_header(s.peekData().data(), s.getLength()); @@ -139,7 +139,7 @@ doLedgerGrpc(RPC::GRPCContext& context) { JLOG(context.j.error()) << __func__ << " - Error deserializing transaction in ledger " - << ledger->info().seq + << ledger->header().seq << " . skipping transaction and following transactions. You " "should look into this further"; } diff --git a/src/xrpld/rpc/handlers/LedgerHeader.cpp b/src/xrpld/rpc/handlers/LedgerHeader.cpp index ebbd6beb01..8c34b8a7cc 100644 --- a/src/xrpld/rpc/handlers/LedgerHeader.cpp +++ b/src/xrpld/rpc/handlers/LedgerHeader.cpp @@ -21,7 +21,7 @@ doLedgerHeader(RPC::JsonContext& context) return jvResult; Serializer s; - addRaw(lpLedger->info(), s); + addRaw(lpLedger->header(), s); jvResult[jss::ledger_data] = strHex(s.peekData()); // This information isn't verified: they should only use it if they trust diff --git a/src/xrpld/rpc/handlers/LedgerRequest.cpp b/src/xrpld/rpc/handlers/LedgerRequest.cpp index 2846bb9f08..8ae0e543f2 100644 --- a/src/xrpld/rpc/handlers/LedgerRequest.cpp +++ b/src/xrpld/rpc/handlers/LedgerRequest.cpp @@ -24,7 +24,7 @@ doLedgerRequest(RPC::JsonContext& context) auto const& ledger = res.value(); Json::Value jvResult; - jvResult[jss::ledger_index] = ledger->info().seq; + jvResult[jss::ledger_index] = ledger->header().seq; addJson(jvResult, {*ledger, &context, 0}); return jvResult; } diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index 7aba4d5f84..e7e812563d 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -26,7 +26,7 @@ isValidated(LedgerMaster& ledgerMaster, std::uint32_t seq, uint256 const& hash) if (!ledgerMaster.haveLedger(seq)) return false; - if (seq > ledgerMaster.getValidatedLedger()->info().seq) + if (seq > ledgerMaster.getValidatedLedger()->header().seq) return false; return ledgerMaster.getHashBySeq(seq) == hash; @@ -130,7 +130,7 @@ doTxHelp(RPC::Context& context, TxArgs args) context.ledgerMaster.getLedgerBySeq(txn->getLedger()); if (ledger && !ledger->open()) - result.ledgerHash = ledger->info().hash; + result.ledgerHash = ledger->header().hash; if (ledger && meta) { @@ -143,7 +143,7 @@ doTxHelp(RPC::Context& context, TxArgs args) result.meta = meta; } result.validated = isValidated( - context.ledgerMaster, ledger->info().seq, ledger->info().hash); + context.ledgerMaster, ledger->header().seq, ledger->header().hash); if (result.validated) result.closeTime = context.ledgerMaster.getCloseTimeBySeq(txn->getLedger()); @@ -151,7 +151,7 @@ doTxHelp(RPC::Context& context, TxArgs args) // compute outgoing CTID if (meta->getAsObject().isFieldPresent(sfTransactionIndex)) { - uint32_t lgrSeq = ledger->info().seq; + uint32_t lgrSeq = ledger->header().seq; uint32_t txnIdx = meta->getAsObject().getFieldU32(sfTransactionIndex); uint32_t netID = context.app.config().NETWORK_ID; From 9eb84a561ef8bb066d89f098bd9b4ac71baed67c Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 11 Dec 2025 08:54:23 -0500 Subject: [PATCH 04/20] refactor: Rename `rippled` binary to `xrpld` (#5983) Per [XLS-0095](https://xls.xrpl.org/xls/XLS-0095-rename-rippled-to-xrpld.html), we are taking steps to rename ripple(d) to xrpl(d). This change modifies the binary name from `rippled` to `xrpld`, and creates a symlink named `rippled` that points to the `xrpld` binary. Note that https://github.com/XRPLF/rippled/pull/5975 renamed any references to `rippled` in the CMake files and their contents, but explicitly maintained the `rippled` binary name by adding an exception. This change now undoes this exception and adds an explicit symlink instead. --- .github/ISSUE_TEMPLATE/bug_report.md | 6 +- .github/scripts/rename/README.md | 4 ++ .github/scripts/rename/binary.sh | 54 ++++++++++++++++++ .../workflows/reusable-build-test-config.yml | 14 ++--- .../workflows/reusable-check-levelization.yml | 2 +- .github/workflows/reusable-check-rename.yml | 2 + BUILD.md | 56 +++++++++---------- CONTRIBUTING.md | 14 ++--- cmake/XrplCore.cmake | 2 - cmake/XrplInstall.cmake | 4 +- 10 files changed, 108 insertions(+), 50 deletions(-) create mode 100755 .github/scripts/rename/binary.sh diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cc921f5a55..9d1f1f4e6b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug Report -about: Create a report to help us improve rippled -title: "[Title with short description] (Version: [rippled version])" +about: Create a report to help us improve xrpld +title: "[Title with short description] (Version: [xrpld version])" labels: "" assignees: "" --- @@ -27,7 +27,7 @@ assignees: "" ## Environment - + ## Supporting Files diff --git a/.github/scripts/rename/README.md b/.github/scripts/rename/README.md index 7df661609b..836f3606ba 100644 --- a/.github/scripts/rename/README.md +++ b/.github/scripts/rename/README.md @@ -26,6 +26,9 @@ run from the repository root. references to `ripple` and `rippled` (with or without capital letters) to `xrpl` and `xrpld`, respectively. The name of the binary will remain as-is, and will only be renamed to `xrpld` by a later script. +4. `.github/scripts/rename/binary.sh`: This script will rename the binary from + `rippled` to `xrpld`, and reverses the symlink so that `rippled` points to + the `xrpld` binary. You can run all these scripts from the repository root as follows: @@ -33,4 +36,5 @@ You can run all these scripts from the repository root as follows: ./.github/scripts/rename/definitions.sh . ./.github/scripts/rename/copyright.sh . ./.github/scripts/rename/cmake.sh . +./.github/scripts/rename/binary.sh . ``` diff --git a/.github/scripts/rename/binary.sh b/.github/scripts/rename/binary.sh new file mode 100755 index 0000000000..deb4dd5fb4 --- /dev/null +++ b/.github/scripts/rename/binary.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Exit the script as soon as an error occurs. +set -e + +# On MacOS, ensure that GNU sed is installed and available as `gsed`. +SED_COMMAND=sed +if [[ "${OSTYPE}" == 'darwin'* ]]; then + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed +fi + +# This script changes the binary name from `rippled` to `xrpld`, and reverses +# the symlink that currently points from `xrpld` to `rippled` so that it points +# from `rippled` to `xrpld` instead. +# Usage: .github/scripts/rename/binary.sh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +DIRECTORY=$1 +echo "Processing directory: ${DIRECTORY}" +if [ ! -d "${DIRECTORY}" ]; then + echo "Error: Directory '${DIRECTORY}' does not exist." + exit 1 +fi +pushd ${DIRECTORY} + +# Remove the binary name override added by the cmake.sh script. +${SED_COMMAND} -z -i -E 's@\s+# For the time being.+"rippled"\)@@' cmake/XrplCore.cmake + +# Reverse the symlink. +${SED_COMMAND} -i -E 's@create_symbolic_link\(rippled@create_symbolic_link(xrpld@' cmake/XrplInstall.cmake +${SED_COMMAND} -i -E 's@/xrpld\$\{suffix\}@/rippled${suffix}@' cmake/XrplInstall.cmake + +# Rename references to the binary. +${SED_COMMAND} -i -E 's@rippled@xrpld@g' BUILD.md +${SED_COMMAND} -i -E 's@rippled@xrpld@g' CONTRIBUTING.md +${SED_COMMAND} -i -E 's@rippled@xrpld@g' .github/ISSUE_TEMPLATE/bug_report.md + +# Restore and/or fix certain renames. The pre-commit hook will update the +# formatting upon saving/committing. +${SED_COMMAND} -i -E 's@ripple/xrpld@XRPLF/rippled@g' BUILD.md +${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' BUILD.md +${SED_COMMAND} -i -E 's@xrpld \(`xrpld`\)@xrpld@g' BUILD.md +${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' CONTRIBUTING.md + +popd +echo "Processing complete." diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index 8ce810aa2e..70d4f93e16 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -129,14 +129,14 @@ jobs: --parallel "${BUILD_NPROC}" \ --target "${CMAKE_TARGET}" - - name: Upload rippled artifact (Linux) + - name: Upload the binary (Linux) if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 env: BUILD_DIR: ${{ inputs.build_dir }} with: - name: rippled-${{ inputs.config_name }} - path: ${{ env.BUILD_DIR }}/rippled + name: xrpld-${{ inputs.config_name }} + path: ${{ env.BUILD_DIR }}/xrpld retention-days: 3 if-no-files-found: error @@ -144,8 +144,8 @@ jobs: if: ${{ runner.os == 'Linux' }} working-directory: ${{ inputs.build_dir }} run: | - ldd ./rippled - if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then + ldd ./xrpld + if [ "$(ldd ./xrpld | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then echo 'The binary is statically linked.' else echo 'The binary is dynamically linked.' @@ -156,7 +156,7 @@ jobs: if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }} working-directory: ${{ inputs.build_dir }} run: | - ./rippled --version | grep libvoidstar + ./xrpld --version | grep libvoidstar - name: Run the separate tests if: ${{ !inputs.build_only }} @@ -177,7 +177,7 @@ jobs: env: BUILD_NPROC: ${{ steps.nproc.outputs.nproc }} run: | - ./rippled --unittest --unittest-jobs "${BUILD_NPROC}" + ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" - name: Debug failure (Linux) if: ${{ failure() && runner.os == 'Linux' && !inputs.build_only }} diff --git a/.github/workflows/reusable-check-levelization.yml b/.github/workflows/reusable-check-levelization.yml index 3430ca28a2..29a1dc1480 100644 --- a/.github/workflows/reusable-check-levelization.yml +++ b/.github/workflows/reusable-check-levelization.yml @@ -25,7 +25,7 @@ jobs: env: MESSAGE: | - The dependency relationships between the modules in rippled have + The dependency relationships between the modules in xrpld have changed, which may be an improvement or a regression. A rule of thumb is that if your changes caused something to be diff --git a/.github/workflows/reusable-check-rename.yml b/.github/workflows/reusable-check-rename.yml index 0e42dc55ab..00ef7c6f14 100644 --- a/.github/workflows/reusable-check-rename.yml +++ b/.github/workflows/reusable-check-rename.yml @@ -25,6 +25,8 @@ jobs: run: .github/scripts/rename/copyright.sh . - name: Check CMake configs run: .github/scripts/rename/cmake.sh . + - name: Check binary name + run: .github/scripts/rename/binary.sh . - name: Check for differences env: MESSAGE: | diff --git a/BUILD.md b/BUILD.md index 54e02c6ae9..85b3e3ea74 100644 --- a/BUILD.md +++ b/BUILD.md @@ -10,7 +10,7 @@ ## Branches For a stable release, choose the `master` branch or one of the [tagged -releases](https://github.com/ripple/rippled/releases). +releases](https://github.com/XRPLF/rippled/releases). ```bash git checkout master @@ -33,7 +33,7 @@ git checkout develop See [System Requirements](https://xrpl.org/system-requirements.html). -Building rippled generally requires git, Python, Conan, CMake, and a C++ +Building xrpld generally requires git, Python, Conan, CMake, and a C++ compiler. Some guidance on setting up such a [C++ development environment can be found here](./docs/build/environment.md). @@ -45,7 +45,7 @@ found here](./docs/build/environment.md). It is possible to build with Conan 1.60+, but the instructions are significantly different, which is why we are not recommending it. -`rippled` is written in the C++20 dialect and includes the `` header. +`xrpld` is written in the C++20 dialect and includes the `` header. The [minimum compiler versions][2] required are: | Compiler | Version | @@ -66,7 +66,7 @@ Linux](./docs/build/environment.md#linux). ### Mac -Many rippled engineers use macOS for development. +Many xrpld engineers use macOS for development. Here are [sample instructions for setting up a C++ development environment on macOS](./docs/build/environment.md#macos). @@ -126,7 +126,7 @@ default profile. ### Patched recipes The recipes in Conan Center occasionally need to be patched for compatibility -with the latest version of `rippled`. We maintain a fork of the Conan Center +with the latest version of `xrpld`. We maintain a fork of the Conan Center [here](https://github.com/XRPLF/conan-center-index/) containing the patches. To ensure our patched recipes are used, you must add our Conan remote at a @@ -292,7 +292,7 @@ sed -i.bak -e 's|^compiler\.libcxx=.*$|compiler.libcxx=libstdc++11|' $(conan con to do that is to run the shortcut "x64 Native Tools Command Prompt" for the version of Visual Studio that you have installed. -Windows developers must also build `rippled` and its dependencies for the x64 +Windows developers must also build `xrpld` and its dependencies for the x64 architecture: ```bash @@ -422,9 +422,9 @@ tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS'] cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -Dxrpld=ON -Dtests=ON .. ``` - **Note:** You can pass build options for `rippled` in this step. + **Note:** You can pass build options for `xrpld` in this step. -4. Build `rippled`. +4. Build `xrpld`. For a single-configuration generator, it will build whatever configuration you passed for `CMAKE_BUILD_TYPE`. For a multi-configuration generator, you @@ -443,26 +443,26 @@ tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS'] cmake --build . --config Debug ``` -5. Test rippled. +5. Test xrpld. Single-config generators: ``` - ./rippled --unittest --unittest-jobs N + ./xrpld --unittest --unittest-jobs N ``` Multi-config generators: ``` - ./Release/rippled --unittest --unittest-jobs N - ./Debug/rippled --unittest --unittest-jobs N + ./Release/xrpld --unittest --unittest-jobs N + ./Debug/xrpld --unittest --unittest-jobs N ``` Replace the `--unittest-jobs` parameter N with the desired unit tests concurrency. Recommended setting is half of the number of available CPU cores. - The location of `rippled` binary in your build directory depends on your + The location of `xrpld` binary in your build directory depends on your CMake generator. Pass `--help` to see the rest of the command line options. ## Coverage report @@ -481,18 +481,18 @@ Prerequisites for the coverage report: A coverage report is created when the following steps are completed, in order: -1. `rippled` binary built with instrumentation data, enabled by the `coverage` +1. `xrpld` binary built with instrumentation data, enabled by the `coverage` option mentioned above 2. completed one or more run of the unit tests, which populates coverage capture data 3. completed run of the `gcovr` tool (which internally invokes either `gcov` or `llvm-cov`) to assemble both instrumentation data and the coverage capture data into a coverage report The last step of the above is automated into a single target `coverage`. The instrumented -`rippled` binary can also be used for regular development or testing work, at +`xrpld` binary can also be used for regular development or testing work, at the cost of extra disk space utilization and a small performance hit -(to store coverage capture data). Since `rippled` binary is simply a dependency of the +(to store coverage capture data). Since `xrpld` binary is simply a dependency of the coverage report target, it is possible to re-run the `coverage` target without -rebuilding the `rippled` binary. Note, running of the unit tests before the `coverage` +rebuilding the `xrpld` binary. Note, running of the unit tests before the `coverage` target is left to the developer. Each such run will append to the coverage data collected in the build directory. @@ -520,16 +520,16 @@ stored inside the build directory, as either of: ## Options -| Option | Default Value | Description | -| ---------- | ------------- | -------------------------------------------------------------------------- | -| `assert` | OFF | Enable assertions. | -| `coverage` | OFF | Prepare the coverage report. | -| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. | -| `tests` | OFF | Build tests. | -| `unity` | OFF | Configure a unity build. | -| `xrpld` | OFF | Build the xrpld (`rippled`) application, and not just the libxrpl library. | -| `werr` | OFF | Treat compilation warnings as errors | -| `wextra` | OFF | Enable additional compilation warnings | +| Option | Default Value | Description | +| ---------- | ------------- | ------------------------------------------------------------------ | +| `assert` | OFF | Enable assertions. | +| `coverage` | OFF | Prepare the coverage report. | +| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. | +| `tests` | OFF | Build tests. | +| `unity` | OFF | Configure a unity build. | +| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. | +| `werr` | OFF | Treat compilation warnings as errors | +| `wextra` | OFF | Enable additional compilation warnings | [Unity builds][5] may be faster for the first build (at the cost of much more memory) since they concatenate sources into fewer @@ -573,7 +573,7 @@ you might have generated CMake files for a different `build_type` than the `CMAKE_BUILD_TYPE` you passed to Conan. ``` -/rippled/.build/pb-xrpl.libpb/xrpl/proto/xrpl.pb.h:10:10: fatal error: 'google/protobuf/port_def.inc' file not found +/xrpld/.build/pb-xrpl.libpb/xrpl/proto/xrpl.pb.h:10:10: fatal error: 'google/protobuf/port_def.inc' file not found 10 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 760e11bea6..86cfa9dc6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ your verifying key. Please set up [signature verification][signing]. In general, external contributions should be developed in your personal [fork][forking]. Contributions from developers with write permissions -should be done in [the main repository][rippled] in a branch with +should be done in [the main repository][xrpld] in a branch with a permitted prefix. Permitted prefixes are: - XLS-[a-zA-Z0-9]+/.+ @@ -73,7 +73,7 @@ Ensure that your code compiles according to the build instructions in Please write tests for your code. If your test can be run offline, in under 60 seconds, then it can be an -automatic test run by `rippled --unittest`. +automatic test run by `xrpld --unittest`. Otherwise, it must be a manual test. If you create new source files, they must be organized as follows: @@ -256,13 +256,13 @@ pre-commit install We are using [Antithesis](https://antithesis.com/) for continuous fuzzing, and keep a copy of [Antithesis C++ SDK](https://github.com/antithesishq/antithesis-sdk-cpp/) in `external/antithesis-sdk`. One of the aims of fuzzing is to identify bugs -by finding external conditions which cause contracts violations inside `rippled`. +by finding external conditions which cause contracts violations inside `xrpld`. The contracts are expressed as `XRPL_ASSERT` or `UNREACHABLE` (defined in `include/xrpl/beast/utility/instrumentation.h`), which are effectively (outside of Antithesis) wrappers for `assert(...)` with added name. The purpose of name is to provide contracts with stable identity which does not rely on line numbers. -When `rippled` is built with the Antithesis instrumentation enabled +When `xrpld` is built with the Antithesis instrumentation enabled (using `voidstar` CMake option) and ran on the Antithesis platform, the contracts become [test properties](https://antithesis.com/docs/using_antithesis/properties.html); @@ -318,7 +318,7 @@ For this reason: To execute all unit tests: -`rippled --unittest --unittest-jobs=` +`xrpld --unittest --unittest-jobs=` (Note: Using multiple cores on a Mac M1 can cause spurious test failures. The cause is still under investigation. If you observe this problem, try specifying fewer jobs.) @@ -326,7 +326,7 @@ cause is still under investigation. If you observe this problem, try specifying To run a specific set of test suites: ``` -rippled --unittest TestSuiteName +xrpld --unittest TestSuiteName ``` Note: In this example, all tests with prefix `TestSuiteName` will be run, so if @@ -1075,7 +1075,7 @@ git fetch upstreams [contrib]: https://docs.github.com/en/get-started/quickstart/contributing-to-projects [squash]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits [forking]: https://github.com/XRPLF/rippled/fork -[rippled]: https://github.com/XRPLF/rippled +[xrpld]: https://github.com/XRPLF/rippled [signing]: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification [setup-upstreams]: ./bin/git/setup-upstreams.sh [squash-branches]: ./bin/git/squash-branches.sh diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 40b5535fc7..e4f97c46c3 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -223,6 +223,4 @@ if(xrpld) src/test/ledger/Invariants_test.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) endif() - # For the time being, we will keep the name of the binary as it was. - set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled") endif() diff --git a/cmake/XrplInstall.cmake b/cmake/XrplInstall.cmake index 05ace6eeea..ca3ad11d74 100644 --- a/cmake/XrplInstall.cmake +++ b/cmake/XrplInstall.cmake @@ -67,8 +67,8 @@ if (is_root_project AND TARGET xrpld) install(CODE " set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\") include(create_symbolic_link) - create_symbolic_link(rippled${suffix} \ - \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix}) + create_symbolic_link(xrpld${suffix} \ + \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/rippled${suffix}) ") endif () From 496efb71ca1049ca3314f2f49d02e1ea8c2bff75 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 11 Dec 2025 15:30:54 +0000 Subject: [PATCH 05/20] refactor: Move JobQueue and related classes into xrpl.core module (#6121) --- .github/scripts/levelization/README.md | 52 +++++++++++++------ .../scripts/levelization/results/loops.txt | 6 --- .../scripts/levelization/results/ordering.txt | 18 +++++-- cmake/XrplCore.cmake | 11 +++- cmake/XrplInstall.cmake | 1 + .../xrpl}/core/ClosureCounter.h | 0 {src/xrpld => include/xrpl}/core/Coro.ipp | 0 {src/xrpld => include/xrpl}/core/Job.h | 5 +- {src/xrpld => include/xrpl}/core/JobQueue.h | 11 ++-- .../xrpld => include/xrpl}/core/JobTypeData.h | 3 +- .../xrpld => include/xrpl}/core/JobTypeInfo.h | 2 +- {src/xrpld => include/xrpl}/core/JobTypes.h | 4 +- {src/xrpld => include/xrpl}/core/LoadEvent.h | 0 .../xrpld => include/xrpl}/core/LoadMonitor.h | 3 +- .../perflog => include/xrpl/core}/PerfLog.h | 11 ++-- .../xrpl}/core/detail/Workers.h | 3 +- .../xrpl}/core/detail/semaphore.h | 0 src/{xrpld => libxrpl}/core/detail/Job.cpp | 3 +- .../core/detail/JobQueue.cpp | 5 +- .../core/detail/LoadEvent.cpp | 5 +- .../core/detail/LoadMonitor.cpp | 3 +- .../core/detail/Workers.cpp | 5 +- src/test/app/Path_test.cpp | 2 +- src/test/app/Transaction_ordering_test.cpp | 2 +- src/test/basics/PerfLog_test.cpp | 2 +- src/test/core/ClosureCounter_test.cpp | 3 +- src/test/core/Coroutine_test.cpp | 2 +- src/test/core/JobQueue_test.cpp | 3 +- src/test/core/Workers_test.cpp | 5 +- src/test/rpc/RobustTransaction_test.cpp | 3 +- src/xrpld/app/consensus/RCLConsensus.h | 2 +- src/xrpld/app/consensus/RCLValidations.cpp | 4 +- src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 2 +- src/xrpld/app/ledger/Ledger.cpp | 2 +- src/xrpld/app/ledger/OrderBookDB.cpp | 2 +- src/xrpld/app/ledger/detail/InboundLedger.cpp | 2 +- .../app/ledger/detail/InboundLedgers.cpp | 4 +- .../app/ledger/detail/InboundTransactions.cpp | 2 +- .../app/ledger/detail/LedgerDeltaAcquire.cpp | 3 +- .../app/ledger/detail/TimeoutCounter.cpp | 3 +- src/xrpld/app/ledger/detail/TimeoutCounter.h | 2 +- src/xrpld/app/main/Application.cpp | 2 +- src/xrpld/app/main/GRPCServer.h | 2 +- src/xrpld/app/main/NodeStoreScheduler.h | 3 +- src/xrpld/app/misc/NetworkOPs.cpp | 2 +- src/xrpld/app/misc/NetworkOPs.h | 2 +- src/xrpld/app/paths/PathRequests.cpp | 2 +- src/xrpld/app/paths/Pathfinder.cpp | 2 +- src/xrpld/app/paths/Pathfinder.h | 2 +- src/xrpld/core/DatabaseCon.h | 3 +- src/xrpld/core/SociDB.h | 3 +- src/xrpld/overlay/detail/OverlayImpl.h | 2 +- src/xrpld/overlay/detail/PeerImp.cpp | 2 +- src/xrpld/overlay/detail/PeerSet.cpp | 3 +- src/xrpld/perflog/detail/PerfLogImp.cpp | 2 +- src/xrpld/perflog/detail/PerfLogImp.h | 2 +- src/xrpld/rpc/Context.h | 2 +- src/xrpld/rpc/RPCSub.h | 3 +- src/xrpld/rpc/ServerHandler.h | 2 +- src/xrpld/rpc/detail/LegacyPathFind.cpp | 5 +- src/xrpld/rpc/detail/RPCHandler.cpp | 4 +- src/xrpld/rpc/detail/ServerHandler.cpp | 2 +- src/xrpld/rpc/handlers/LogRotate.cpp | 2 +- 63 files changed, 139 insertions(+), 116 deletions(-) rename {src/xrpld => include/xrpl}/core/ClosureCounter.h (100%) rename {src/xrpld => include/xrpl}/core/Coro.ipp (100%) rename {src/xrpld => include/xrpl}/core/Job.h (98%) rename {src/xrpld => include/xrpl}/core/JobQueue.h (98%) rename {src/xrpld => include/xrpl}/core/JobTypeData.h (97%) rename {src/xrpld => include/xrpl}/core/JobTypeInfo.h (98%) rename {src/xrpld => include/xrpl}/core/JobTypes.h (99%) rename {src/xrpld => include/xrpl}/core/LoadEvent.h (100%) rename {src/xrpld => include/xrpl}/core/LoadMonitor.h (97%) rename {src/xrpld/perflog => include/xrpl/core}/PerfLog.h (96%) rename {src/xrpld => include/xrpl}/core/detail/Workers.h (99%) rename {src/xrpld => include/xrpl}/core/detail/semaphore.h (100%) rename src/{xrpld => libxrpl}/core/detail/Job.cpp (98%) rename src/{xrpld => libxrpl}/core/detail/JobQueue.cpp (99%) rename src/{xrpld => libxrpl}/core/detail/LoadEvent.cpp (94%) rename src/{xrpld => libxrpl}/core/detail/LoadMonitor.cpp (99%) rename src/{xrpld => libxrpl}/core/detail/Workers.cpp (98%) diff --git a/.github/scripts/levelization/README.md b/.github/scripts/levelization/README.md index f3ba1e2518..3b77a192b9 100644 --- a/.github/scripts/levelization/README.md +++ b/.github/scripts/levelization/README.md @@ -3,21 +3,26 @@ Levelization is the term used to describe efforts to prevent rippled from having or creating cyclic dependencies. -rippled code is organized into directories under `src/rippled` (and +rippled code is organized into directories under `src/xrpld`, `src/libxrpl` (and `src/test`) representing modules. The modules are intended to be organized into "tiers" or "levels" such that a module from one level can only include code from lower levels. Additionally, a module -in one level should never include code in an `impl` folder of any level +in one level should never include code in an `impl` or `detail` folder of any level other than it's own. +The codebase is split into two main areas: + +- **libxrpl** (`src/libxrpl`, `include/xrpl`): Reusable library modules with public interfaces +- **xrpld** (`src/xrpld`): Application-specific implementation code + Unfortunately, over time, enforcement of levelization has been inconsistent, so the current state of the code doesn't necessarily reflect these rules. Whenever possible, developers should refactor any levelization violations they find (by moving files or individual classes). At the very least, don't make things worse. -The table below summarizes the _desired_ division of modules, based on the -state of the rippled code when it was created. The levels are numbered from +The table below summarizes the _desired_ division of modules, based on the current +state of the rippled code. The levels are numbered from the bottom up with the lower level, lower numbered, more independent modules listed first, and the higher level, higher numbered modules with more dependencies listed later. @@ -25,18 +30,33 @@ more dependencies listed later. **tl;dr:** The modules listed first are more independent than the modules listed later. +## libxrpl Modules (Reusable Libraries) + +| Level / Tier | Module(s) | +| ------------ | ----------------------------------- | +| 01 | xrpl/beast | +| 02 | xrpl/basics | +| 03 | xrpl/json xrpl/crypto | +| 04 | xrpl/protocol | +| 05 | xrpl/core xrpl/resource xrpl/server | +| 06 | xrpl/ledger xrpl/nodestore xrpl/net | +| 07 | xrpl/shamap | + +## xrpld Modules (Application Implementation) + +| Level / Tier | Module(s) | +| ------------ | -------------------------------- | +| 05 | xrpld/conditions xrpld/consensus | +| 06 | xrpld/core xrpld/peerfinder | +| 07 | xrpld/shamap xrpld/overlay | +| 08 | xrpld/app | +| 09 | xrpld/rpc | +| 10 | xrpld/perflog | + +## Test Modules + | Level / Tier | Module(s) | | ------------ | -------------------------------------------------------------------------------------------------------- | -| 01 | ripple/beast ripple/unity | -| 02 | ripple/basics | -| 03 | ripple/json ripple/crypto | -| 04 | ripple/protocol | -| 05 | ripple/core ripple/conditions ripple/consensus ripple/resource ripple/server | -| 06 | ripple/peerfinder ripple/ledger ripple/nodestore ripple/net | -| 07 | ripple/shamap ripple/overlay | -| 08 | ripple/app | -| 09 | ripple/rpc | -| 10 | ripple/perflog | | 11 | test/jtx test/beast test/csf | | 12 | test/unit_test | | 13 | test/crypto test/conditions test/json test/resource test/shamap test/peerfinder test/basics test/overlay | @@ -45,8 +65,8 @@ listed later. | 16 | test/rpc test/app | (Note that `test` levelization is _much_ less important and _much_ less -strictly enforced than `ripple` levelization, other than the requirement -that `test` code should _never_ be included in `ripple` code.) +strictly enforced than `xrpl`/`xrpld` levelization, other than the requirement +that `test` code should _never_ be included in `xrpl` or `xrpld` code.) ## Validation diff --git a/.github/scripts/levelization/results/loops.txt b/.github/scripts/levelization/results/loops.txt index d057391be9..d15843ceb0 100644 --- a/.github/scripts/levelization/results/loops.txt +++ b/.github/scripts/levelization/results/loops.txt @@ -19,12 +19,6 @@ Loop: xrpld.app xrpld.rpc Loop: xrpld.app xrpld.shamap xrpld.shamap ~= xrpld.app -Loop: xrpld.core xrpld.perflog - xrpld.perflog == xrpld.core - Loop: xrpld.overlay xrpld.rpc xrpld.rpc ~= xrpld.overlay -Loop: xrpld.perflog xrpld.rpc - xrpld.rpc ~= xrpld.perflog - diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index 251e9c1957..c9c65fb0dd 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -1,4 +1,6 @@ libxrpl.basics > xrpl.basics +libxrpl.core > xrpl.basics +libxrpl.core > xrpl.core libxrpl.crypto > xrpl.basics libxrpl.json > xrpl.basics libxrpl.json > xrpl.json @@ -30,6 +32,7 @@ test.app > test.rpc test.app > test.toplevel test.app > test.unit_test test.app > xrpl.basics +test.app > xrpl.core test.app > xrpld.app test.app > xrpld.core test.app > xrpld.overlay @@ -42,7 +45,7 @@ test.app > xrpl.resource test.basics > test.jtx test.basics > test.unit_test test.basics > xrpl.basics -test.basics > xrpld.perflog +test.basics > xrpl.core test.basics > xrpld.rpc test.basics > xrpl.json test.basics > xrpl.protocol @@ -61,8 +64,8 @@ test.core > test.jtx test.core > test.toplevel test.core > test.unit_test test.core > xrpl.basics +test.core > xrpl.core test.core > xrpld.core -test.core > xrpld.perflog test.core > xrpl.json test.core > xrpl.server test.csf > xrpl.basics @@ -119,6 +122,7 @@ test.resource > xrpl.resource test.rpc > test.jtx test.rpc > test.toplevel test.rpc > xrpl.basics +test.rpc > xrpl.core test.rpc > xrpld.app test.rpc > xrpld.core test.rpc > xrpld.overlay @@ -146,6 +150,8 @@ test.unit_test > xrpl.basics tests.libxrpl > xrpl.basics tests.libxrpl > xrpl.json tests.libxrpl > xrpl.net +xrpl.core > xrpl.basics +xrpl.core > xrpl.json xrpl.json > xrpl.basics xrpl.ledger > xrpl.basics xrpl.ledger > xrpl.protocol @@ -165,9 +171,9 @@ xrpl.shamap > xrpl.nodestore xrpl.shamap > xrpl.protocol xrpld.app > test.unit_test xrpld.app > xrpl.basics +xrpld.app > xrpl.core xrpld.app > xrpld.conditions xrpld.app > xrpld.consensus -xrpld.app > xrpld.perflog xrpld.app > xrpl.json xrpld.app > xrpl.ledger xrpld.app > xrpl.net @@ -181,13 +187,14 @@ xrpld.consensus > xrpl.basics xrpld.consensus > xrpl.json xrpld.consensus > xrpl.protocol xrpld.core > xrpl.basics +xrpld.core > xrpl.core xrpld.core > xrpl.json xrpld.core > xrpl.net xrpld.core > xrpl.protocol xrpld.overlay > xrpl.basics +xrpld.overlay > xrpl.core xrpld.overlay > xrpld.core xrpld.overlay > xrpld.peerfinder -xrpld.overlay > xrpld.perflog xrpld.overlay > xrpl.json xrpld.overlay > xrpl.protocol xrpld.overlay > xrpl.resource @@ -196,8 +203,11 @@ xrpld.peerfinder > xrpl.basics xrpld.peerfinder > xrpld.core xrpld.peerfinder > xrpl.protocol xrpld.perflog > xrpl.basics +xrpld.perflog > xrpl.core +xrpld.perflog > xrpld.rpc xrpld.perflog > xrpl.json xrpld.rpc > xrpl.basics +xrpld.rpc > xrpl.core xrpld.rpc > xrpld.core xrpld.rpc > xrpl.json xrpld.rpc > xrpl.ledger diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index e4f97c46c3..12ba58d499 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -94,10 +94,18 @@ target_link_libraries(xrpl.libxrpl.protocol PUBLIC ) # Level 05 +add_module(xrpl core) +target_link_libraries(xrpl.libxrpl.core PUBLIC + xrpl.libxrpl.basics + xrpl.libxrpl.json + xrpl.libxrpl.protocol +) + +# Level 06 add_module(xrpl resource) target_link_libraries(xrpl.libxrpl.resource PUBLIC xrpl.libxrpl.protocol) -# Level 06 +# Level 07 add_module(xrpl net) target_link_libraries(xrpl.libxrpl.net PUBLIC xrpl.libxrpl.basics @@ -144,6 +152,7 @@ target_sources(xrpl.libxrpl PRIVATE ${sources}) target_link_modules(xrpl PUBLIC basics beast + core crypto json protocol diff --git a/cmake/XrplInstall.cmake b/cmake/XrplInstall.cmake index ca3ad11d74..67aca8f048 100644 --- a/cmake/XrplInstall.cmake +++ b/cmake/XrplInstall.cmake @@ -16,6 +16,7 @@ install ( xrpl.libxrpl xrpl.libxrpl.basics xrpl.libxrpl.beast + xrpl.libxrpl.core xrpl.libxrpl.crypto xrpl.libxrpl.json xrpl.libxrpl.ledger diff --git a/src/xrpld/core/ClosureCounter.h b/include/xrpl/core/ClosureCounter.h similarity index 100% rename from src/xrpld/core/ClosureCounter.h rename to include/xrpl/core/ClosureCounter.h diff --git a/src/xrpld/core/Coro.ipp b/include/xrpl/core/Coro.ipp similarity index 100% rename from src/xrpld/core/Coro.ipp rename to include/xrpl/core/Coro.ipp diff --git a/src/xrpld/core/Job.h b/include/xrpl/core/Job.h similarity index 98% rename from src/xrpld/core/Job.h rename to include/xrpl/core/Job.h index ac6278b3c8..35d42cfd0b 100644 --- a/src/xrpld/core/Job.h +++ b/include/xrpl/core/Job.h @@ -1,10 +1,9 @@ #ifndef XRPL_CORE_JOB_H_INCLUDED #define XRPL_CORE_JOB_H_INCLUDED -#include -#include - #include +#include +#include #include diff --git a/src/xrpld/core/JobQueue.h b/include/xrpl/core/JobQueue.h similarity index 98% rename from src/xrpld/core/JobQueue.h rename to include/xrpl/core/JobQueue.h index c5d36cd993..f8b727471b 100644 --- a/src/xrpld/core/JobQueue.h +++ b/include/xrpl/core/JobQueue.h @@ -1,12 +1,11 @@ #ifndef XRPL_CORE_JOBQUEUE_H_INCLUDED #define XRPL_CORE_JOBQUEUE_H_INCLUDED -#include -#include -#include -#include - #include +#include +#include +#include +#include #include #include @@ -385,7 +384,7 @@ private: } // namespace ripple -#include +#include namespace ripple { diff --git a/src/xrpld/core/JobTypeData.h b/include/xrpl/core/JobTypeData.h similarity index 97% rename from src/xrpld/core/JobTypeData.h rename to include/xrpl/core/JobTypeData.h index 337adcb0da..eb678d1a9a 100644 --- a/src/xrpld/core/JobTypeData.h +++ b/include/xrpl/core/JobTypeData.h @@ -1,10 +1,9 @@ #ifndef XRPL_CORE_JOBTYPEDATA_H_INCLUDED #define XRPL_CORE_JOBTYPEDATA_H_INCLUDED -#include - #include #include +#include namespace ripple { diff --git a/src/xrpld/core/JobTypeInfo.h b/include/xrpl/core/JobTypeInfo.h similarity index 98% rename from src/xrpld/core/JobTypeInfo.h rename to include/xrpl/core/JobTypeInfo.h index a58d5316a8..09c644fc23 100644 --- a/src/xrpld/core/JobTypeInfo.h +++ b/include/xrpl/core/JobTypeInfo.h @@ -1,7 +1,7 @@ #ifndef XRPL_CORE_JOBTYPEINFO_H_INCLUDED #define XRPL_CORE_JOBTYPEINFO_H_INCLUDED -#include +#include namespace ripple { diff --git a/src/xrpld/core/JobTypes.h b/include/xrpl/core/JobTypes.h similarity index 99% rename from src/xrpld/core/JobTypes.h rename to include/xrpl/core/JobTypes.h index bb5a8baf9c..d8e7b23bdf 100644 --- a/src/xrpld/core/JobTypes.h +++ b/include/xrpl/core/JobTypes.h @@ -1,8 +1,8 @@ #ifndef XRPL_CORE_JOBTYPES_H_INCLUDED #define XRPL_CORE_JOBTYPES_H_INCLUDED -#include -#include +#include +#include #include #include diff --git a/src/xrpld/core/LoadEvent.h b/include/xrpl/core/LoadEvent.h similarity index 100% rename from src/xrpld/core/LoadEvent.h rename to include/xrpl/core/LoadEvent.h diff --git a/src/xrpld/core/LoadMonitor.h b/include/xrpl/core/LoadMonitor.h similarity index 97% rename from src/xrpld/core/LoadMonitor.h rename to include/xrpl/core/LoadMonitor.h index a9ed66e0fe..539a4a0b99 100644 --- a/src/xrpld/core/LoadMonitor.h +++ b/include/xrpl/core/LoadMonitor.h @@ -1,10 +1,9 @@ #ifndef XRPL_CORE_LOADMONITOR_H_INCLUDED #define XRPL_CORE_LOADMONITOR_H_INCLUDED -#include - #include #include +#include #include #include diff --git a/src/xrpld/perflog/PerfLog.h b/include/xrpl/core/PerfLog.h similarity index 96% rename from src/xrpld/perflog/PerfLog.h rename to include/xrpl/core/PerfLog.h index f6c3d3b9ac..c74608d82a 100644 --- a/src/xrpld/perflog/PerfLog.h +++ b/include/xrpl/core/PerfLog.h @@ -1,9 +1,8 @@ -#ifndef XRPL_BASICS_PERFLOG_H -#define XRPL_BASICS_PERFLOG_H - -#include -#include +#ifndef XRPL_CORE_PERFLOG_H +#define XRPL_CORE_PERFLOG_H +#include +#include #include #include @@ -190,4 +189,4 @@ measureDurationAndLog( } // namespace perf } // namespace ripple -#endif // XRPL_BASICS_PERFLOG_H +#endif // XRPL_CORE_PERFLOG_H diff --git a/src/xrpld/core/detail/Workers.h b/include/xrpl/core/detail/Workers.h similarity index 99% rename from src/xrpld/core/detail/Workers.h rename to include/xrpl/core/detail/Workers.h index f6fe9226fc..5877638722 100644 --- a/src/xrpld/core/detail/Workers.h +++ b/include/xrpl/core/detail/Workers.h @@ -1,9 +1,8 @@ #ifndef XRPL_CORE_WORKERS_H_INCLUDED #define XRPL_CORE_WORKERS_H_INCLUDED -#include - #include +#include #include #include diff --git a/src/xrpld/core/detail/semaphore.h b/include/xrpl/core/detail/semaphore.h similarity index 100% rename from src/xrpld/core/detail/semaphore.h rename to include/xrpl/core/detail/semaphore.h diff --git a/src/xrpld/core/detail/Job.cpp b/src/libxrpl/core/detail/Job.cpp similarity index 98% rename from src/xrpld/core/detail/Job.cpp rename to src/libxrpl/core/detail/Job.cpp index e1e85d34eb..9caf8d180d 100644 --- a/src/xrpld/core/detail/Job.cpp +++ b/src/libxrpl/core/detail/Job.cpp @@ -1,6 +1,5 @@ -#include - #include +#include namespace ripple { diff --git a/src/xrpld/core/detail/JobQueue.cpp b/src/libxrpl/core/detail/JobQueue.cpp similarity index 99% rename from src/xrpld/core/detail/JobQueue.cpp rename to src/libxrpl/core/detail/JobQueue.cpp index ff5c2211ef..817744cbc1 100644 --- a/src/xrpld/core/detail/JobQueue.cpp +++ b/src/libxrpl/core/detail/JobQueue.cpp @@ -1,7 +1,6 @@ -#include -#include - #include +#include +#include #include diff --git a/src/xrpld/core/detail/LoadEvent.cpp b/src/libxrpl/core/detail/LoadEvent.cpp similarity index 94% rename from src/xrpld/core/detail/LoadEvent.cpp rename to src/libxrpl/core/detail/LoadEvent.cpp index 878bb92d11..3237daabcf 100644 --- a/src/xrpld/core/detail/LoadEvent.cpp +++ b/src/libxrpl/core/detail/LoadEvent.cpp @@ -1,7 +1,6 @@ -#include -#include - #include +#include +#include namespace ripple { diff --git a/src/xrpld/core/detail/LoadMonitor.cpp b/src/libxrpl/core/detail/LoadMonitor.cpp similarity index 99% rename from src/xrpld/core/detail/LoadMonitor.cpp rename to src/libxrpl/core/detail/LoadMonitor.cpp index 5a03ab607b..7a1cce05f3 100644 --- a/src/xrpld/core/detail/LoadMonitor.cpp +++ b/src/libxrpl/core/detail/LoadMonitor.cpp @@ -1,7 +1,6 @@ -#include - #include #include +#include namespace ripple { diff --git a/src/xrpld/core/detail/Workers.cpp b/src/libxrpl/core/detail/Workers.cpp similarity index 98% rename from src/xrpld/core/detail/Workers.cpp rename to src/libxrpl/core/detail/Workers.cpp index 29328533ae..b354353844 100644 --- a/src/xrpld/core/detail/Workers.cpp +++ b/src/libxrpl/core/detail/Workers.cpp @@ -1,8 +1,7 @@ -#include -#include - #include #include +#include +#include namespace ripple { diff --git a/src/test/app/Path_test.cpp b/src/test/app/Path_test.cpp index f84a87ac8c..e481bd673b 100644 --- a/src/test/app/Path_test.cpp +++ b/src/test/app/Path_test.cpp @@ -4,11 +4,11 @@ #include #include -#include #include #include #include +#include #include #include #include diff --git a/src/test/app/Transaction_ordering_test.cpp b/src/test/app/Transaction_ordering_test.cpp index 80e7d43de6..2f67d8b414 100644 --- a/src/test/app/Transaction_ordering_test.cpp +++ b/src/test/app/Transaction_ordering_test.cpp @@ -1,6 +1,6 @@ #include -#include +#include namespace ripple { namespace test { diff --git a/src/test/basics/PerfLog_test.cpp b/src/test/basics/PerfLog_test.cpp index 5862889354..dcb91d0fd3 100644 --- a/src/test/basics/PerfLog_test.cpp +++ b/src/test/basics/PerfLog_test.cpp @@ -1,12 +1,12 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/src/test/core/ClosureCounter_test.cpp b/src/test/core/ClosureCounter_test.cpp index dbe846c02d..23359596fd 100644 --- a/src/test/core/ClosureCounter_test.cpp +++ b/src/test/core/ClosureCounter_test.cpp @@ -1,8 +1,7 @@ #include -#include - #include +#include #include #include diff --git a/src/test/core/Coroutine_test.cpp b/src/test/core/Coroutine_test.cpp index 2b9bd0a248..47bd74a4a6 100644 --- a/src/test/core/Coroutine_test.cpp +++ b/src/test/core/Coroutine_test.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/src/test/core/JobQueue_test.cpp b/src/test/core/JobQueue_test.cpp index 0b6bbb13ae..2451827bda 100644 --- a/src/test/core/JobQueue_test.cpp +++ b/src/test/core/JobQueue_test.cpp @@ -1,8 +1,7 @@ #include -#include - #include +#include namespace ripple { namespace test { diff --git a/src/test/core/Workers_test.cpp b/src/test/core/Workers_test.cpp index d8152d3ea8..2ba8c2a0e0 100644 --- a/src/test/core/Workers_test.cpp +++ b/src/test/core/Workers_test.cpp @@ -1,7 +1,6 @@ -#include -#include - #include +#include +#include #include #include diff --git a/src/test/rpc/RobustTransaction_test.cpp b/src/test/rpc/RobustTransaction_test.cpp index 29305092c4..d52e08f7ac 100644 --- a/src/test/rpc/RobustTransaction_test.cpp +++ b/src/test/rpc/RobustTransaction_test.cpp @@ -1,9 +1,8 @@ #include #include -#include - #include +#include #include namespace ripple { diff --git a/src/xrpld/app/consensus/RCLConsensus.h b/src/xrpld/app/consensus/RCLConsensus.h index b9580be08a..a6a15395a3 100644 --- a/src/xrpld/app/consensus/RCLConsensus.h +++ b/src/xrpld/app/consensus/RCLConsensus.h @@ -8,9 +8,9 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/xrpld/app/consensus/RCLValidations.cpp b/src/xrpld/app/consensus/RCLValidations.cpp index d24f24a5f1..827c417ba8 100644 --- a/src/xrpld/app/consensus/RCLValidations.cpp +++ b/src/xrpld/app/consensus/RCLValidations.cpp @@ -4,12 +4,12 @@ #include #include #include -#include #include -#include #include #include +#include +#include #include diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index fbac9c8553..d248a36987 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -2,9 +2,9 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index 055d9ddc9d..bf5f442eee 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -7,12 +7,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/OrderBookDB.cpp b/src/xrpld/app/ledger/OrderBookDB.cpp index 1a407d0d3d..00907ee2ce 100644 --- a/src/xrpld/app/ledger/OrderBookDB.cpp +++ b/src/xrpld/app/ledger/OrderBookDB.cpp @@ -4,9 +4,9 @@ #include #include #include -#include #include +#include #include namespace ripple { diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index 24de3cce14..cd42b4fe82 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -4,10 +4,10 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/InboundLedgers.cpp b/src/xrpld/app/ledger/detail/InboundLedgers.cpp index 7e1ba88094..fafcdb9161 100644 --- a/src/xrpld/app/ledger/detail/InboundLedgers.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedgers.cpp @@ -2,13 +2,13 @@ #include #include #include -#include -#include #include #include #include #include +#include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index 93e0fbdec0..b84a03e7bb 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -3,9 +3,9 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index c803c0bdd4..9c190ee376 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -4,9 +4,10 @@ #include #include #include -#include #include +#include + namespace ripple { LedgerDeltaAcquire::LedgerDeltaAcquire( diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp index 6db280ce8e..d4e7e9a73c 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp @@ -1,5 +1,6 @@ #include -#include + +#include namespace ripple { diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.h b/src/xrpld/app/ledger/detail/TimeoutCounter.h index e97882ef1e..1ce4c48415 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.h +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.h @@ -2,9 +2,9 @@ #define XRPL_APP_LEDGER_TIMEOUTCOUNTER_H_INCLUDED #include -#include #include +#include #include diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 79b48e42b1..e28cd559e9 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -41,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index 1ea8706e40..eba666cc35 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -2,13 +2,13 @@ #define XRPL_CORE_GRPCSERVER_H_INCLUDED #include -#include #include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/main/NodeStoreScheduler.h b/src/xrpld/app/main/NodeStoreScheduler.h index c1234a84c4..6a5cb8e8ee 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.h +++ b/src/xrpld/app/main/NodeStoreScheduler.h @@ -1,8 +1,7 @@ #ifndef XRPL_APP_MAIN_NODESTORESCHEDULER_H_INCLUDED #define XRPL_APP_MAIN_NODESTORESCHEDULER_H_INCLUDED -#include - +#include #include namespace ripple { diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 1b0b4e5143..39ec0b78c9 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 544e6bfe93..15545153c7 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -3,9 +3,9 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/xrpld/app/paths/PathRequests.cpp b/src/xrpld/app/paths/PathRequests.cpp index d489dafcea..2d5b52d1f9 100644 --- a/src/xrpld/app/paths/PathRequests.cpp +++ b/src/xrpld/app/paths/PathRequests.cpp @@ -1,9 +1,9 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/xrpld/app/paths/Pathfinder.cpp b/src/xrpld/app/paths/Pathfinder.cpp index 2debdc76b2..d3ed3fc38c 100644 --- a/src/xrpld/app/paths/Pathfinder.cpp +++ b/src/xrpld/app/paths/Pathfinder.cpp @@ -4,10 +4,10 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/src/xrpld/app/paths/Pathfinder.h b/src/xrpld/app/paths/Pathfinder.h index d019a8307e..91c0a033f1 100644 --- a/src/xrpld/app/paths/Pathfinder.h +++ b/src/xrpld/app/paths/Pathfinder.h @@ -3,9 +3,9 @@ #include #include -#include #include +#include #include #include diff --git a/src/xrpld/core/DatabaseCon.h b/src/xrpld/core/DatabaseCon.h index 84d2c375e0..b2f400780b 100644 --- a/src/xrpld/core/DatabaseCon.h +++ b/src/xrpld/core/DatabaseCon.h @@ -4,7 +4,8 @@ #include #include #include -#include + +#include #include diff --git a/src/xrpld/core/SociDB.h b/src/xrpld/core/SociDB.h index bf209d79f7..7e2c7323d8 100644 --- a/src/xrpld/core/SociDB.h +++ b/src/xrpld/core/SociDB.h @@ -14,9 +14,8 @@ #pragma clang diagnostic ignored "-Wdeprecated" #endif -#include - #include +#include #define SOCI_USE_BOOST #include diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 765d2f38eb..18f2aa0c3f 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -2,7 +2,6 @@ #define XRPL_OVERLAY_OVERLAYIMPL_H_INCLUDED #include -#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 097eaae4d9..7adfef4064 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -12,12 +12,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/PeerSet.cpp b/src/xrpld/overlay/detail/PeerSet.cpp index ecf1164b2c..9f5b810ffc 100644 --- a/src/xrpld/overlay/detail/PeerSet.cpp +++ b/src/xrpld/overlay/detail/PeerSet.cpp @@ -1,8 +1,9 @@ #include -#include #include #include +#include + namespace ripple { class PeerSetImpl : public PeerSet diff --git a/src/xrpld/perflog/detail/PerfLogImp.cpp b/src/xrpld/perflog/detail/PerfLogImp.cpp index 170da708eb..8d6d68137a 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.cpp +++ b/src/xrpld/perflog/detail/PerfLogImp.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include +#include #include #include diff --git a/src/xrpld/perflog/detail/PerfLogImp.h b/src/xrpld/perflog/detail/PerfLogImp.h index ec4c87c29d..d8e5e7943d 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.h +++ b/src/xrpld/perflog/detail/PerfLogImp.h @@ -1,10 +1,10 @@ #ifndef XRPL_BASICS_PERFLOGIMP_H #define XRPL_BASICS_PERFLOGIMP_H -#include #include #include +#include #include diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 0e15da3a39..1faafa1627 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -1,11 +1,11 @@ #ifndef XRPL_RPC_CONTEXT_H_INCLUDED #define XRPL_RPC_CONTEXT_H_INCLUDED -#include #include #include #include +#include namespace ripple { diff --git a/src/xrpld/rpc/RPCSub.h b/src/xrpld/rpc/RPCSub.h index db96ae79ee..ea0cc993e8 100644 --- a/src/xrpld/rpc/RPCSub.h +++ b/src/xrpld/rpc/RPCSub.h @@ -1,9 +1,10 @@ #ifndef XRPL_NET_RPCSUB_H_INCLUDED #define XRPL_NET_RPCSUB_H_INCLUDED -#include #include +#include + #include namespace ripple { diff --git a/src/xrpld/rpc/ServerHandler.h b/src/xrpld/rpc/ServerHandler.h index c499411366..4cf5a0ce88 100644 --- a/src/xrpld/rpc/ServerHandler.h +++ b/src/xrpld/rpc/ServerHandler.h @@ -3,9 +3,9 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/xrpld/rpc/detail/LegacyPathFind.cpp b/src/xrpld/rpc/detail/LegacyPathFind.cpp index 7bf4758e37..c3bcd928cd 100644 --- a/src/xrpld/rpc/detail/LegacyPathFind.cpp +++ b/src/xrpld/rpc/detail/LegacyPathFind.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +#include +#include + namespace ripple { namespace RPC { diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index c712430f92..fca926a1c7 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include #include #include @@ -14,6 +12,8 @@ #include #include +#include +#include #include #include #include diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index 8a42153105..de44f93749 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/LogRotate.cpp b/src/xrpld/rpc/handlers/LogRotate.cpp index 379d694c0f..595d84b191 100644 --- a/src/xrpld/rpc/handlers/LogRotate.cpp +++ b/src/xrpld/rpc/handlers/LogRotate.cpp @@ -1,8 +1,8 @@ #include -#include #include #include +#include namespace ripple { From 1eb0fdac6543706b4b9ddca57fd4102928a1f871 Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 11 Dec 2025 11:51:49 -0500 Subject: [PATCH 06/20] refactor: Rename `ripple` namespace to `xrpl` (#5982) This change renames all occurrences of `namespace ripple` and `ripple::` to `namespace xrpl` and `xrpl::`, respectively, as well as the names of test suites. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts. --- .github/scripts/rename/README.md | 3 + .github/scripts/rename/namespace.sh | 58 +++++++++ .github/workflows/reusable-check-rename.yml | 2 + CONTRIBUTING.md | 2 +- include/xrpl/basics/Archive.h | 4 +- include/xrpl/basics/BasicConfig.h | 4 +- include/xrpl/basics/Blob.h | 4 +- include/xrpl/basics/Buffer.h | 6 +- include/xrpl/basics/ByteUtilities.h | 4 +- include/xrpl/basics/CompressionAlgorithms.h | 4 +- include/xrpl/basics/CountedObject.h | 4 +- include/xrpl/basics/DecayingSample.h | 4 +- include/xrpl/basics/Expected.h | 4 +- include/xrpl/basics/FileUtilities.h | 4 +- include/xrpl/basics/IntrusivePointer.h | 4 +- include/xrpl/basics/IntrusivePointer.ipp | 8 +- include/xrpl/basics/IntrusiveRefCounts.h | 26 ++-- include/xrpl/basics/KeyCache.h | 4 +- include/xrpl/basics/LocalValue.h | 4 +- include/xrpl/basics/Log.h | 4 +- include/xrpl/basics/MathUtilities.h | 4 +- include/xrpl/basics/Number.h | 4 +- include/xrpl/basics/README.md | 8 +- include/xrpl/basics/RangeSet.h | 6 +- include/xrpl/basics/Resolver.h | 4 +- include/xrpl/basics/ResolverAsio.h | 4 +- include/xrpl/basics/SHAMapHash.h | 4 +- include/xrpl/basics/SharedWeakCachePointer.h | 4 +- .../xrpl/basics/SharedWeakCachePointer.ipp | 4 +- include/xrpl/basics/SlabAllocator.h | 10 +- include/xrpl/basics/Slice.h | 6 +- include/xrpl/basics/StringUtilities.h | 4 +- include/xrpl/basics/TaggedCache.h | 4 +- include/xrpl/basics/TaggedCache.ipp | 4 +- include/xrpl/basics/ToString.h | 4 +- include/xrpl/basics/UnorderedContainers.h | 4 +- include/xrpl/basics/UptimeClock.h | 4 +- include/xrpl/basics/algorithm.h | 4 +- include/xrpl/basics/base64.h | 4 +- include/xrpl/basics/base_uint.h | 10 +- include/xrpl/basics/chrono.h | 4 +- include/xrpl/basics/comparators.h | 4 +- include/xrpl/basics/contract.h | 4 +- include/xrpl/basics/hardened_hash.h | 4 +- include/xrpl/basics/join.h | 4 +- include/xrpl/basics/make_SSLContext.h | 4 +- include/xrpl/basics/mulDiv.h | 4 +- .../xrpl/basics/partitioned_unordered_map.h | 6 +- include/xrpl/basics/random.h | 6 +- include/xrpl/basics/safe_cast.h | 4 +- include/xrpl/basics/scope.h | 6 +- include/xrpl/basics/spinlock.h | 6 +- include/xrpl/basics/strHex.h | 4 +- include/xrpl/basics/tagged_integer.h | 6 +- include/xrpl/core/ClosureCounter.h | 4 +- include/xrpl/core/Coro.ipp | 9 +- include/xrpl/core/Job.h | 4 +- include/xrpl/core/JobQueue.h | 8 +- include/xrpl/core/JobTypeData.h | 4 +- include/xrpl/core/JobTypeInfo.h | 4 +- include/xrpl/core/JobTypes.h | 10 +- include/xrpl/core/LoadEvent.h | 4 +- include/xrpl/core/LoadMonitor.h | 4 +- include/xrpl/core/PerfLog.h | 4 +- include/xrpl/core/detail/Workers.h | 4 +- include/xrpl/core/detail/semaphore.h | 6 +- include/xrpl/crypto/RFC1751.h | 4 +- include/xrpl/crypto/csprng.h | 4 +- include/xrpl/crypto/secure_erase.h | 4 +- include/xrpl/json/JsonPropertyStream.h | 4 +- include/xrpl/json/Writer.h | 2 +- include/xrpl/json/detail/json_assert.h | 2 +- include/xrpl/json/json_value.h | 4 +- include/xrpl/ledger/ApplyView.h | 6 +- include/xrpl/ledger/ApplyViewImpl.h | 4 +- include/xrpl/ledger/BookDirs.h | 4 +- include/xrpl/ledger/CachedSLEs.h | 2 +- include/xrpl/ledger/CachedView.h | 4 +- include/xrpl/ledger/CredentialHelpers.h | 4 +- include/xrpl/ledger/Dir.h | 4 +- include/xrpl/ledger/OpenView.h | 4 +- include/xrpl/ledger/PaymentSandbox.h | 4 +- include/xrpl/ledger/RawView.h | 4 +- include/xrpl/ledger/ReadView.h | 4 +- include/xrpl/ledger/Sandbox.h | 4 +- include/xrpl/ledger/View.h | 4 +- include/xrpl/ledger/detail/ApplyStateTable.h | 4 +- include/xrpl/ledger/detail/ApplyViewBase.h | 4 +- include/xrpl/ledger/detail/RawStateTable.h | 4 +- include/xrpl/ledger/detail/ReadViewFwdRange.h | 4 +- .../xrpl/ledger/detail/ReadViewFwdRange.ipp | 6 +- include/xrpl/net/AutoSocket.h | 2 +- include/xrpl/net/HTTPClient.h | 4 +- include/xrpl/net/HTTPClientSSLContext.h | 4 +- include/xrpl/net/RegisterSSLCerts.h | 4 +- include/xrpl/nodestore/Backend.h | 4 +- include/xrpl/nodestore/Database.h | 6 +- include/xrpl/nodestore/DatabaseRotating.h | 4 +- include/xrpl/nodestore/DummyScheduler.h | 4 +- include/xrpl/nodestore/Factory.h | 4 +- include/xrpl/nodestore/Manager.h | 4 +- include/xrpl/nodestore/NodeObject.h | 4 +- include/xrpl/nodestore/Scheduler.h | 4 +- include/xrpl/nodestore/Task.h | 4 +- include/xrpl/nodestore/Types.h | 4 +- include/xrpl/nodestore/detail/BatchWriter.h | 4 +- .../xrpl/nodestore/detail/DatabaseNodeImp.h | 6 +- .../nodestore/detail/DatabaseRotatingImp.h | 4 +- include/xrpl/nodestore/detail/DecodedBlob.h | 4 +- include/xrpl/nodestore/detail/EncodedBlob.h | 8 +- include/xrpl/nodestore/detail/ManagerImp.h | 4 +- include/xrpl/nodestore/detail/codec.h | 4 +- include/xrpl/nodestore/detail/varint.h | 4 +- include/xrpl/protocol/AMMCore.h | 4 +- include/xrpl/protocol/AccountID.h | 12 +- include/xrpl/protocol/AmountConversions.h | 15 +-- include/xrpl/protocol/ApiVersion.h | 6 +- include/xrpl/protocol/Asset.h | 4 +- include/xrpl/protocol/Batch.h | 4 +- include/xrpl/protocol/Book.h | 32 ++--- include/xrpl/protocol/BuildInfo.h | 4 +- include/xrpl/protocol/ErrorCodes.h | 4 +- include/xrpl/protocol/Feature.h | 10 +- include/xrpl/protocol/Fees.h | 4 +- include/xrpl/protocol/HashPrefix.h | 4 +- include/xrpl/protocol/IOUAmount.h | 4 +- include/xrpl/protocol/Indexes.h | 6 +- include/xrpl/protocol/InnerObjectFormats.h | 4 +- include/xrpl/protocol/Issue.h | 4 +- include/xrpl/protocol/KeyType.h | 4 +- include/xrpl/protocol/Keylet.h | 4 +- include/xrpl/protocol/KnownFormats.h | 4 +- include/xrpl/protocol/LedgerFormats.h | 4 +- include/xrpl/protocol/LedgerHeader.h | 4 +- include/xrpl/protocol/MPTAmount.h | 4 +- include/xrpl/protocol/MPTIssue.h | 4 +- include/xrpl/protocol/MultiApiJson.h | 8 +- .../xrpl/protocol/NFTSyntheticSerializer.h | 4 +- include/xrpl/protocol/NFTokenID.h | 4 +- include/xrpl/protocol/NFTokenOfferID.h | 4 +- include/xrpl/protocol/PayChan.h | 4 +- include/xrpl/protocol/Permissions.h | 4 +- include/xrpl/protocol/Protocol.h | 4 +- include/xrpl/protocol/PublicKey.h | 10 +- include/xrpl/protocol/Quality.h | 6 +- include/xrpl/protocol/QualityFunction.h | 4 +- include/xrpl/protocol/RPCErr.h | 4 +- include/xrpl/protocol/Rate.h | 4 +- include/xrpl/protocol/RippleLedgerHash.h | 2 +- include/xrpl/protocol/Rules.h | 4 +- include/xrpl/protocol/SField.h | 4 +- include/xrpl/protocol/SOTemplate.h | 4 +- include/xrpl/protocol/STAccount.h | 6 +- include/xrpl/protocol/STAmount.h | 12 +- include/xrpl/protocol/STArray.h | 4 +- include/xrpl/protocol/STBase.h | 4 +- include/xrpl/protocol/STBitString.h | 8 +- include/xrpl/protocol/STBlob.h | 4 +- include/xrpl/protocol/STCurrency.h | 4 +- include/xrpl/protocol/STExchange.h | 4 +- include/xrpl/protocol/STInteger.h | 10 +- include/xrpl/protocol/STIssue.h | 4 +- include/xrpl/protocol/STLedgerEntry.h | 4 +- include/xrpl/protocol/STNumber.h | 4 +- include/xrpl/protocol/STObject.h | 19 ++- include/xrpl/protocol/STParsedJSON.h | 4 +- include/xrpl/protocol/STPathSet.h | 8 +- include/xrpl/protocol/STTx.h | 4 +- include/xrpl/protocol/STValidation.h | 8 +- include/xrpl/protocol/STVector256.h | 4 +- include/xrpl/protocol/STXChainBridge.h | 4 +- include/xrpl/protocol/SecretKey.h | 4 +- include/xrpl/protocol/Seed.h | 4 +- include/xrpl/protocol/SeqProxy.h | 4 +- include/xrpl/protocol/Serializer.h | 9 +- include/xrpl/protocol/Sign.h | 4 +- include/xrpl/protocol/SystemParameters.h | 4 +- include/xrpl/protocol/TER.h | 4 +- include/xrpl/protocol/TxFlags.h | 4 +- include/xrpl/protocol/TxFormats.h | 4 +- include/xrpl/protocol/TxMeta.h | 4 +- include/xrpl/protocol/UintTypes.h | 12 +- include/xrpl/protocol/Units.h | 11 +- include/xrpl/protocol/XChainAttestations.h | 4 +- include/xrpl/protocol/XRPAmount.h | 4 +- include/xrpl/protocol/detail/STVar.h | 4 +- include/xrpl/protocol/detail/b58_utils.h | 12 +- include/xrpl/protocol/detail/secp256k1.h | 4 +- include/xrpl/protocol/detail/token_errors.h | 14 +- include/xrpl/protocol/digest.h | 4 +- include/xrpl/protocol/json_get_or_throw.h | 22 ++-- include/xrpl/protocol/jss.h | 4 +- include/xrpl/protocol/nft.h | 4 +- include/xrpl/protocol/nftPageMask.h | 4 +- include/xrpl/protocol/serialize.h | 4 +- include/xrpl/protocol/tokens.h | 4 +- include/xrpl/resource/Charge.h | 4 +- include/xrpl/resource/Consumer.h | 4 +- include/xrpl/resource/Disposition.h | 4 +- include/xrpl/resource/Fees.h | 4 +- include/xrpl/resource/Gossip.h | 4 +- include/xrpl/resource/ResourceManager.h | 4 +- include/xrpl/resource/Types.h | 4 +- include/xrpl/resource/detail/Entry.h | 4 +- include/xrpl/resource/detail/Import.h | 4 +- include/xrpl/resource/detail/Key.h | 4 +- include/xrpl/resource/detail/Kind.h | 4 +- include/xrpl/resource/detail/Logic.h | 8 +- include/xrpl/resource/detail/Tuning.h | 4 +- include/xrpl/server/Handoff.h | 4 +- include/xrpl/server/Port.h | 4 +- include/xrpl/server/Server.h | 4 +- include/xrpl/server/Session.h | 4 +- include/xrpl/server/SimpleWriter.h | 4 +- include/xrpl/server/WSSession.h | 4 +- include/xrpl/server/Writer.h | 4 +- include/xrpl/server/detail/BaseHTTPPeer.h | 4 +- include/xrpl/server/detail/BasePeer.h | 6 +- include/xrpl/server/detail/BaseWSPeer.h | 8 +- include/xrpl/server/detail/Door.h | 4 +- include/xrpl/server/detail/JSONRPCUtil.h | 4 +- include/xrpl/server/detail/LowestLayer.h | 4 +- include/xrpl/server/detail/PlainHTTPPeer.h | 4 +- include/xrpl/server/detail/PlainWSPeer.h | 4 +- include/xrpl/server/detail/SSLHTTPPeer.h | 4 +- include/xrpl/server/detail/SSLWSPeer.h | 4 +- include/xrpl/server/detail/ServerImpl.h | 4 +- include/xrpl/server/detail/Spawn.h | 4 +- include/xrpl/server/detail/io_list.h | 4 +- include/xrpl/shamap/Family.h | 4 +- include/xrpl/shamap/FullBelowCache.h | 4 +- include/xrpl/shamap/SHAMap.h | 11 +- .../xrpl/shamap/SHAMapAccountStateLeafNode.h | 4 +- include/xrpl/shamap/SHAMapAddNode.h | 4 +- include/xrpl/shamap/SHAMapInnerNode.h | 4 +- include/xrpl/shamap/SHAMapItem.h | 6 +- include/xrpl/shamap/SHAMapLeafNode.h | 4 +- include/xrpl/shamap/SHAMapMissingNode.h | 4 +- include/xrpl/shamap/SHAMapNodeID.h | 4 +- include/xrpl/shamap/SHAMapSyncFilter.h | 4 +- include/xrpl/shamap/SHAMapTreeNode.h | 4 +- include/xrpl/shamap/SHAMapTxLeafNode.h | 4 +- .../xrpl/shamap/SHAMapTxPlusMetaLeafNode.h | 4 +- include/xrpl/shamap/TreeNodeCache.h | 4 +- include/xrpl/shamap/detail/TaggedPointer.h | 4 +- include/xrpl/shamap/detail/TaggedPointer.ipp | 18 +-- src/libxrpl/basics/Archive.cpp | 4 +- src/libxrpl/basics/BasicConfig.cpp | 4 +- src/libxrpl/basics/CountedObject.cpp | 4 +- src/libxrpl/basics/FileUtilities.cpp | 4 +- src/libxrpl/basics/Log.cpp | 12 +- src/libxrpl/basics/Number.cpp | 17 ++- src/libxrpl/basics/ResolverAsio.cpp | 22 ++-- src/libxrpl/basics/StringUtilities.cpp | 4 +- src/libxrpl/basics/UptimeClock.cpp | 4 +- src/libxrpl/basics/base64.cpp | 4 +- src/libxrpl/basics/contract.cpp | 4 +- src/libxrpl/basics/make_SSLContext.cpp | 4 +- src/libxrpl/basics/mulDiv.cpp | 6 +- src/libxrpl/core/detail/Job.cpp | 4 +- src/libxrpl/core/detail/JobQueue.cpp | 50 ++++--- src/libxrpl/core/detail/LoadEvent.cpp | 6 +- src/libxrpl/core/detail/LoadMonitor.cpp | 4 +- src/libxrpl/core/detail/Workers.cpp | 6 +- src/libxrpl/crypto/RFC1751.cpp | 21 ++- src/libxrpl/crypto/csprng.cpp | 4 +- src/libxrpl/crypto/secure_erase.cpp | 4 +- src/libxrpl/json/JsonPropertyStream.cpp | 4 +- src/libxrpl/json/Object.cpp | 4 +- src/libxrpl/json/Writer.cpp | 4 +- src/libxrpl/json/json_reader.cpp | 2 +- src/libxrpl/json/json_value.cpp | 2 +- src/libxrpl/ledger/ApplyStateTable.cpp | 22 ++-- src/libxrpl/ledger/ApplyView.cpp | 10 +- src/libxrpl/ledger/ApplyViewBase.cpp | 4 +- src/libxrpl/ledger/ApplyViewImpl.cpp | 4 +- src/libxrpl/ledger/BookDirs.cpp | 18 +-- src/libxrpl/ledger/CachedView.cpp | 7 +- src/libxrpl/ledger/CredentialHelpers.cpp | 4 +- src/libxrpl/ledger/Dir.cpp | 14 +- src/libxrpl/ledger/OpenView.cpp | 4 +- src/libxrpl/ledger/PaymentSandbox.cpp | 14 +- src/libxrpl/ledger/RawStateTable.cpp | 11 +- src/libxrpl/ledger/ReadView.cpp | 4 +- src/libxrpl/ledger/View.cpp | 122 +++++++++--------- src/libxrpl/net/HTTPClient.cpp | 4 +- src/libxrpl/net/RegisterSSLCerts.cpp | 4 +- src/libxrpl/nodestore/BatchWriter.cpp | 6 +- src/libxrpl/nodestore/Database.cpp | 14 +- src/libxrpl/nodestore/DatabaseNodeImp.cpp | 4 +- src/libxrpl/nodestore/DatabaseRotatingImp.cpp | 4 +- src/libxrpl/nodestore/DecodedBlob.cpp | 6 +- src/libxrpl/nodestore/DummyScheduler.cpp | 4 +- src/libxrpl/nodestore/ManagerImp.cpp | 6 +- src/libxrpl/nodestore/NodeObject.cpp | 4 +- .../nodestore/backend/MemoryFactory.cpp | 10 +- src/libxrpl/nodestore/backend/NuDBFactory.cpp | 6 +- src/libxrpl/nodestore/backend/NullFactory.cpp | 4 +- .../nodestore/backend/RocksDBFactory.cpp | 13 +- src/libxrpl/protocol/AMMCore.cpp | 6 +- src/libxrpl/protocol/AccountID.cpp | 6 +- src/libxrpl/protocol/Asset.cpp | 4 +- src/libxrpl/protocol/Book.cpp | 4 +- src/libxrpl/protocol/BuildInfo.cpp | 4 +- src/libxrpl/protocol/ErrorCodes.cpp | 6 +- src/libxrpl/protocol/Feature.cpp | 16 +-- src/libxrpl/protocol/IOUAmount.cpp | 4 +- src/libxrpl/protocol/Indexes.cpp | 17 ++- src/libxrpl/protocol/InnerObjectFormats.cpp | 4 +- src/libxrpl/protocol/Issue.cpp | 4 +- src/libxrpl/protocol/Keylet.cpp | 6 +- src/libxrpl/protocol/LedgerFormats.cpp | 4 +- src/libxrpl/protocol/LedgerHeader.cpp | 4 +- src/libxrpl/protocol/MPTAmount.cpp | 4 +- src/libxrpl/protocol/MPTIssue.cpp | 4 +- .../protocol/NFTSyntheticSerializer.cpp | 4 +- src/libxrpl/protocol/NFTokenID.cpp | 4 +- src/libxrpl/protocol/NFTokenOfferID.cpp | 4 +- src/libxrpl/protocol/Permissions.cpp | 10 +- src/libxrpl/protocol/PublicKey.cpp | 4 +- src/libxrpl/protocol/Quality.cpp | 25 ++-- src/libxrpl/protocol/QualityFunction.cpp | 4 +- src/libxrpl/protocol/RPCErr.cpp | 4 +- src/libxrpl/protocol/Rate2.cpp | 16 +-- src/libxrpl/protocol/Rules.cpp | 10 +- src/libxrpl/protocol/SField.cpp | 12 +- src/libxrpl/protocol/SOTemplate.cpp | 4 +- src/libxrpl/protocol/STAccount.cpp | 8 +- src/libxrpl/protocol/STAmount.cpp | 38 +++--- src/libxrpl/protocol/STArray.cpp | 4 +- src/libxrpl/protocol/STBase.cpp | 14 +- src/libxrpl/protocol/STBlob.cpp | 8 +- src/libxrpl/protocol/STCurrency.cpp | 4 +- src/libxrpl/protocol/STInteger.cpp | 8 +- src/libxrpl/protocol/STIssue.cpp | 4 +- src/libxrpl/protocol/STLedgerEntry.cpp | 6 +- src/libxrpl/protocol/STNumber.cpp | 11 +- src/libxrpl/protocol/STObject.cpp | 6 +- src/libxrpl/protocol/STParsedJSON.cpp | 4 +- src/libxrpl/protocol/STPathSet.cpp | 8 +- src/libxrpl/protocol/STTx.cpp | 10 +- src/libxrpl/protocol/STValidation.cpp | 6 +- src/libxrpl/protocol/STVar.cpp | 6 +- src/libxrpl/protocol/STVector256.cpp | 8 +- src/libxrpl/protocol/STXChainBridge.cpp | 6 +- src/libxrpl/protocol/SecretKey.cpp | 4 +- src/libxrpl/protocol/Seed.cpp | 4 +- src/libxrpl/protocol/Serializer.cpp | 10 +- src/libxrpl/protocol/Sign.cpp | 4 +- src/libxrpl/protocol/TER.cpp | 4 +- src/libxrpl/protocol/TxFormats.cpp | 4 +- src/libxrpl/protocol/TxMeta.cpp | 23 ++-- src/libxrpl/protocol/UintTypes.cpp | 4 +- src/libxrpl/protocol/XChainAttestations.cpp | 6 +- src/libxrpl/protocol/digest.cpp | 4 +- src/libxrpl/protocol/tokens.cpp | 30 ++--- src/libxrpl/resource/Charge.cpp | 4 +- src/libxrpl/resource/Consumer.cpp | 13 +- src/libxrpl/resource/Fees.cpp | 4 +- src/libxrpl/resource/ResourceManager.cpp | 4 +- src/libxrpl/server/JSONRPCUtil.cpp | 4 +- src/libxrpl/server/Port.cpp | 4 +- src/libxrpl/shamap/SHAMap.cpp | 91 +++++++------ src/libxrpl/shamap/SHAMapDelta.cpp | 12 +- src/libxrpl/shamap/SHAMapInnerNode.cpp | 56 ++++---- src/libxrpl/shamap/SHAMapLeafNode.cpp | 14 +- src/libxrpl/shamap/SHAMapNodeID.cpp | 16 +-- src/libxrpl/shamap/SHAMapSync.cpp | 20 +-- src/libxrpl/shamap/SHAMapTreeNode.cpp | 4 +- src/test/app/AMMCalc_test.cpp | 6 +- src/test/app/AMMClawback_test.cpp | 6 +- src/test/app/AMMExtended_test.cpp | 6 +- src/test/app/AMM_test.cpp | 8 +- src/test/app/AccountDelete_test.cpp | 6 +- src/test/app/AccountTxPaging_test.cpp | 6 +- src/test/app/AmendmentTable_test.cpp | 8 +- src/test/app/Batch_test.cpp | 14 +- src/test/app/Check_test.cpp | 8 +- src/test/app/Clawback_test.cpp | 6 +- src/test/app/Credentials_test.cpp | 9 +- src/test/app/CrossingLimits_test.cpp | 6 +- src/test/app/DID_test.cpp | 6 +- src/test/app/DNS_test.cpp | 12 +- src/test/app/Delegate_test.cpp | 6 +- src/test/app/DeliverMin_test.cpp | 6 +- src/test/app/DepositAuth_test.cpp | 8 +- src/test/app/Discrepancy_test.cpp | 6 +- src/test/app/EscrowToken_test.cpp | 92 ++++++------- src/test/app/Escrow_test.cpp | 34 ++--- src/test/app/FeeVote_test.cpp | 6 +- src/test/app/FixNFTokenPageLinks_test.cpp | 6 +- src/test/app/Flow_test.cpp | 8 +- src/test/app/Freeze_test.cpp | 6 +- src/test/app/HashRouter_test.cpp | 6 +- src/test/app/Invariants_test.cpp | 18 +-- src/test/app/LPTokenTransfer_test.cpp | 6 +- src/test/app/LedgerHistory_test.cpp | 6 +- src/test/app/LedgerLoad_test.cpp | 6 +- src/test/app/LedgerMaster_test.cpp | 6 +- src/test/app/LedgerReplay_test.cpp | 17 ++- src/test/app/LoadFeeTrack_test.cpp | 6 +- src/test/app/LoanBroker_test.cpp | 8 +- src/test/app/Loan_test.cpp | 32 ++--- src/test/app/MPToken_test.cpp | 14 +- src/test/app/Manifest_test.cpp | 6 +- src/test/app/MultiSign_test.cpp | 10 +- src/test/app/NFTokenAuth_test.cpp | 6 +- src/test/app/NFTokenBurn_test.cpp | 6 +- src/test/app/NFTokenDir_test.cpp | 6 +- src/test/app/NFToken_test.cpp | 14 +- src/test/app/NetworkID_test.cpp | 6 +- src/test/app/NetworkOPs_test.cpp | 6 +- src/test/app/OfferStream_test.cpp | 6 +- src/test/app/Offer_test.cpp | 12 +- src/test/app/Oracle_test.cpp | 6 +- src/test/app/OversizeMeta_test.cpp | 12 +- src/test/app/Path_test.cpp | 6 +- src/test/app/PayChan_test.cpp | 10 +- src/test/app/PayStrand_test.cpp | 30 ++--- src/test/app/PermissionedDEX_test.cpp | 6 +- src/test/app/PermissionedDomains_test.cpp | 6 +- src/test/app/PseudoTx_test.cpp | 8 +- src/test/app/RCLValidations_test.cpp | 8 +- src/test/app/ReducedOffer_test.cpp | 6 +- src/test/app/Regression_test.cpp | 10 +- src/test/app/SHAMapStore_test.cpp | 6 +- src/test/app/SetAuth_test.cpp | 6 +- src/test/app/SetRegularKey_test.cpp | 6 +- src/test/app/SetTrust_test.cpp | 6 +- src/test/app/TheoreticalQuality_test.cpp | 6 +- src/test/app/Ticket_test.cpp | 6 +- src/test/app/Transaction_ordering_test.cpp | 6 +- src/test/app/TrustAndBalance_test.cpp | 6 +- src/test/app/TxQ_test.cpp | 30 ++--- src/test/app/ValidatorKeys_test.cpp | 6 +- src/test/app/ValidatorList_test.cpp | 8 +- src/test/app/ValidatorSite_test.cpp | 6 +- src/test/app/Vault_test.cpp | 36 +++--- src/test/app/XChain_test.cpp | 8 +- src/test/app/tx/apply_test.cpp | 6 +- src/test/basics/Buffer_test.cpp | 6 +- src/test/basics/DetectCrash_test.cpp | 4 +- src/test/basics/Expected_test.cpp | 6 +- src/test/basics/FileUtilities_test.cpp | 8 +- src/test/basics/IOUAmount_test.cpp | 8 +- src/test/basics/IntrusiveShared_test.cpp | 6 +- src/test/basics/KeyCache_test.cpp | 6 +- src/test/basics/Number_test.cpp | 6 +- src/test/basics/PerfLog_test.cpp | 8 +- src/test/basics/StringUtilities_test.cpp | 6 +- src/test/basics/TaggedCache_test.cpp | 6 +- src/test/basics/Units_test.cpp | 6 +- src/test/basics/XRPAmount_test.cpp | 8 +- src/test/basics/base58_test.cpp | 38 +++--- src/test/basics/base_uint_test.cpp | 10 +- src/test/basics/hardened_hash_test.cpp | 14 +- src/test/basics/join_test.cpp | 6 +- src/test/beast/IPEndpointCommon.h | 2 +- src/test/beast/IPEndpoint_test.cpp | 2 +- .../beast/beast_CurrentThreadName_test.cpp | 4 +- src/test/conditions/PreimageSha256_test.cpp | 6 +- .../consensus/ByzantineFailureSim_test.cpp | 6 +- src/test/consensus/Consensus_test.cpp | 6 +- .../DistributedValidatorsSim_test.cpp | 6 +- src/test/consensus/LedgerTiming_test.cpp | 6 +- src/test/consensus/LedgerTrie_test.cpp | 6 +- src/test/consensus/NegativeUNL_test.cpp | 20 +-- .../consensus/RCLCensorshipDetector_test.cpp | 6 +- src/test/consensus/ScaleFreeSim_test.cpp | 6 +- src/test/consensus/Validations_test.cpp | 6 +- src/test/core/ClosureCounter_test.cpp | 6 +- src/test/core/Config_test.cpp | 10 +- src/test/core/Coroutine_test.cpp | 6 +- src/test/core/JobQueue_test.cpp | 6 +- src/test/core/SociDB_test.cpp | 6 +- src/test/core/Workers_test.cpp | 6 +- src/test/csf/BasicNetwork.h | 4 +- src/test/csf/BasicNetwork_test.cpp | 6 +- src/test/csf/CollectorRef.h | 4 +- src/test/csf/Digraph.h | 4 +- src/test/csf/Digraph_test.cpp | 6 +- src/test/csf/Histogram.h | 4 +- src/test/csf/Histogram_test.cpp | 6 +- src/test/csf/Peer.h | 4 +- src/test/csf/PeerGroup.h | 4 +- src/test/csf/Proposal.h | 4 +- src/test/csf/Scheduler.h | 4 +- src/test/csf/Scheduler_test.cpp | 6 +- src/test/csf/Sim.h | 4 +- src/test/csf/SimTime.h | 4 +- src/test/csf/TrustGraph.h | 4 +- src/test/csf/Tx.h | 4 +- src/test/csf/Validation.h | 4 +- src/test/csf/collectors.h | 4 +- src/test/csf/events.h | 4 +- src/test/csf/impl/Sim.cpp | 4 +- src/test/csf/impl/ledgers.cpp | 4 +- src/test/csf/ledgers.h | 8 +- src/test/csf/random.h | 4 +- src/test/csf/submitters.h | 4 +- src/test/csf/timers.h | 4 +- src/test/json/Object_test.cpp | 4 +- src/test/json/TestOutputSuite.h | 4 +- src/test/jtx/AMM.h | 4 +- src/test/jtx/AMMTest.h | 4 +- src/test/jtx/AbstractClient.h | 4 +- src/test/jtx/Account.h | 4 +- src/test/jtx/CaptureLogs.h | 4 +- src/test/jtx/CheckMessageLogs.h | 4 +- src/test/jtx/Env.h | 4 +- src/test/jtx/Env_ss.h | 4 +- src/test/jtx/Env_test.cpp | 6 +- src/test/jtx/JSONRPCClient.h | 4 +- src/test/jtx/JTx.h | 4 +- src/test/jtx/ManualTimeKeeper.h | 4 +- src/test/jtx/Oracle.h | 4 +- src/test/jtx/PathSet.h | 4 +- src/test/jtx/SignerUtils.h | 4 +- src/test/jtx/TestHelpers.h | 4 +- src/test/jtx/TestSuite.h | 4 +- src/test/jtx/TrustedPublisherServer.h | 7 +- src/test/jtx/WSClient.h | 4 +- src/test/jtx/WSClient_test.cpp | 6 +- src/test/jtx/account_txn_id.h | 4 +- src/test/jtx/acctdelete.h | 4 +- src/test/jtx/amount.h | 22 ++-- src/test/jtx/attester.h | 4 +- src/test/jtx/balance.h | 4 +- src/test/jtx/basic_prop.h | 4 +- src/test/jtx/batch.h | 4 +- src/test/jtx/check.h | 4 +- src/test/jtx/credentials.h | 4 +- src/test/jtx/delegate.h | 4 +- src/test/jtx/delivermin.h | 4 +- src/test/jtx/deposit.h | 4 +- src/test/jtx/did.h | 4 +- src/test/jtx/directory.h | 4 +- src/test/jtx/domain.h | 4 +- src/test/jtx/envconfig.h | 6 +- src/test/jtx/escrow.h | 4 +- src/test/jtx/fee.h | 4 +- src/test/jtx/flags.h | 4 +- src/test/jtx/impl/AMM.cpp | 6 +- src/test/jtx/impl/AMMTest.cpp | 4 +- src/test/jtx/impl/Account.cpp | 4 +- src/test/jtx/impl/Env.cpp | 4 +- src/test/jtx/impl/JSONRPCClient.cpp | 4 +- src/test/jtx/impl/Oracle.cpp | 4 +- src/test/jtx/impl/TestHelpers.cpp | 4 +- src/test/jtx/impl/WSClient.cpp | 4 +- src/test/jtx/impl/account_txn_id.cpp | 4 +- src/test/jtx/impl/acctdelete.cpp | 4 +- src/test/jtx/impl/amount.cpp | 4 +- src/test/jtx/impl/attester.cpp | 4 +- src/test/jtx/impl/balance.cpp | 4 +- src/test/jtx/impl/batch.cpp | 8 +- src/test/jtx/impl/check.cpp | 4 +- src/test/jtx/impl/creds.cpp | 4 +- src/test/jtx/impl/delegate.cpp | 4 +- src/test/jtx/impl/delivermin.cpp | 4 +- src/test/jtx/impl/deposit.cpp | 4 +- src/test/jtx/impl/dids.cpp | 4 +- src/test/jtx/impl/directory.cpp | 4 +- src/test/jtx/impl/domain.cpp | 4 +- src/test/jtx/impl/envconfig.cpp | 4 +- src/test/jtx/impl/escrow.cpp | 6 +- src/test/jtx/impl/fee.cpp | 4 +- src/test/jtx/impl/flags.cpp | 4 +- src/test/jtx/impl/invoice_id.cpp | 4 +- src/test/jtx/impl/jtx_json.cpp | 4 +- src/test/jtx/impl/last_ledger_sequence.cpp | 4 +- src/test/jtx/impl/ledgerStateFixes.cpp | 4 +- src/test/jtx/impl/memo.cpp | 4 +- src/test/jtx/impl/mpt.cpp | 6 +- src/test/jtx/impl/multisign.cpp | 6 +- src/test/jtx/impl/offer.cpp | 4 +- src/test/jtx/impl/owners.cpp | 4 +- src/test/jtx/impl/paths.cpp | 4 +- src/test/jtx/impl/pay.cpp | 4 +- src/test/jtx/impl/permissioned_dex.cpp | 4 +- src/test/jtx/impl/permissioned_domains.cpp | 4 +- src/test/jtx/impl/quality2.cpp | 4 +- src/test/jtx/impl/rate.cpp | 4 +- src/test/jtx/impl/regkey.cpp | 4 +- src/test/jtx/impl/sendmax.cpp | 4 +- src/test/jtx/impl/seq.cpp | 4 +- src/test/jtx/impl/sig.cpp | 4 +- src/test/jtx/impl/tag.cpp | 4 +- src/test/jtx/impl/testline.cpp | 4 +- src/test/jtx/impl/ticket.cpp | 4 +- src/test/jtx/impl/token.cpp | 6 +- src/test/jtx/impl/trust.cpp | 4 +- src/test/jtx/impl/txflags.cpp | 4 +- src/test/jtx/impl/utility.cpp | 6 +- src/test/jtx/impl/vault.cpp | 4 +- src/test/jtx/impl/xchain_bridge.cpp | 4 +- src/test/jtx/invoice_id.h | 4 +- src/test/jtx/jtx_json.h | 4 +- src/test/jtx/last_ledger_sequence.h | 4 +- src/test/jtx/ledgerStateFix.h | 4 +- src/test/jtx/memo.h | 4 +- src/test/jtx/mpt.h | 4 +- src/test/jtx/multisign.h | 4 +- src/test/jtx/noop.h | 4 +- src/test/jtx/offer.h | 4 +- src/test/jtx/owners.h | 4 +- src/test/jtx/paths.h | 4 +- src/test/jtx/pay.h | 4 +- src/test/jtx/permissioned_dex.h | 4 +- src/test/jtx/permissioned_domains.h | 6 +- src/test/jtx/prop.h | 4 +- src/test/jtx/quality.h | 4 +- src/test/jtx/rate.h | 4 +- src/test/jtx/regkey.h | 4 +- src/test/jtx/require.h | 4 +- src/test/jtx/requires.h | 4 +- src/test/jtx/rpc.h | 4 +- src/test/jtx/sendmax.h | 4 +- src/test/jtx/seq.h | 4 +- src/test/jtx/sig.h | 4 +- src/test/jtx/tag.h | 4 +- src/test/jtx/tags.h | 4 +- src/test/jtx/ter.h | 4 +- src/test/jtx/testline.h | 4 +- src/test/jtx/ticket.h | 4 +- src/test/jtx/token.h | 4 +- src/test/jtx/trust.h | 4 +- src/test/jtx/txflags.h | 4 +- src/test/jtx/utility.h | 4 +- src/test/jtx/vault.h | 4 +- src/test/jtx/xchain_bridge.h | 4 +- src/test/ledger/BookDirs_test.cpp | 6 +- src/test/ledger/Directory_test.cpp | 6 +- src/test/ledger/PaymentSandbox_test.cpp | 6 +- src/test/ledger/PendingSaves_test.cpp | 6 +- src/test/ledger/SkipList_test.cpp | 6 +- src/test/ledger/View_test.cpp | 8 +- src/test/nodestore/Backend_test.cpp | 6 +- src/test/nodestore/Basics_test.cpp | 6 +- src/test/nodestore/Database_test.cpp | 10 +- src/test/nodestore/NuDBFactory_test.cpp | 6 +- src/test/nodestore/TestBase.h | 4 +- src/test/nodestore/Timing_test.cpp | 6 +- src/test/nodestore/import_test.cpp | 6 +- src/test/nodestore/varint_test.cpp | 6 +- src/test/overlay/ProtocolVersion_test.cpp | 6 +- src/test/overlay/cluster_test.cpp | 8 +- src/test/overlay/compression_test.cpp | 48 +++---- src/test/overlay/handshake_test.cpp | 6 +- src/test/overlay/reduce_relay_test.cpp | 12 +- src/test/overlay/short_read_test.cpp | 6 +- src/test/overlay/traffic_count_test.cpp | 6 +- src/test/overlay/tx_reduce_relay_test.cpp | 6 +- src/test/peerfinder/Livecache_test.cpp | 14 +- src/test/peerfinder/PeerFinder_test.cpp | 10 +- src/test/protocol/ApiVersion_test.cpp | 6 +- src/test/protocol/BuildInfo_test.cpp | 6 +- src/test/protocol/Hooks_test.cpp | 6 +- src/test/protocol/InnerObjectFormats_test.cpp | 6 +- src/test/protocol/Issue_test.cpp | 6 +- src/test/protocol/Memo_test.cpp | 6 +- src/test/protocol/MultiApiJson_test.cpp | 8 +- src/test/protocol/PublicKey_test.cpp | 6 +- src/test/protocol/Quality_test.cpp | 6 +- src/test/protocol/STAccount_test.cpp | 6 +- src/test/protocol/STAmount_test.cpp | 6 +- src/test/protocol/STInteger_test.cpp | 6 +- src/test/protocol/STIssue_test.cpp | 6 +- src/test/protocol/STNumber_test.cpp | 6 +- src/test/protocol/STObject_test.cpp | 8 +- src/test/protocol/STParsedJSON_test.cpp | 6 +- src/test/protocol/STTx_test.cpp | 36 +++--- src/test/protocol/STValidation_test.cpp | 14 +- src/test/protocol/SecretKey_test.cpp | 6 +- src/test/protocol/Seed_test.cpp | 6 +- src/test/protocol/SeqProxy_test.cpp | 6 +- src/test/protocol/Serializer_test.cpp | 6 +- src/test/protocol/TER_test.cpp | 6 +- src/test/resource/Logic_test.cpp | 6 +- src/test/rpc/AMMInfo_test.cpp | 6 +- src/test/rpc/AccountCurrencies_test.cpp | 6 +- src/test/rpc/AccountInfo_test.cpp | 9 +- src/test/rpc/AccountLines_test.cpp | 6 +- src/test/rpc/AccountObjects_test.cpp | 6 +- src/test/rpc/AccountOffers_test.cpp | 6 +- src/test/rpc/AccountSet_test.cpp | 9 +- src/test/rpc/AccountTx_test.cpp | 6 +- src/test/rpc/AmendmentBlocked_test.cpp | 6 +- src/test/rpc/BookChanges_test.cpp | 6 +- src/test/rpc/Book_test.cpp | 6 +- src/test/rpc/Connect_test.cpp | 6 +- src/test/rpc/DeliveredAmount_test.cpp | 6 +- src/test/rpc/DepositAuthorized_test.cpp | 6 +- src/test/rpc/Feature_test.cpp | 26 ++-- src/test/rpc/GRPCTestClientBase.h | 4 +- src/test/rpc/GatewayBalances_test.cpp | 6 +- src/test/rpc/GetAggregatePrice_test.cpp | 6 +- src/test/rpc/GetCounts_test.cpp | 6 +- src/test/rpc/Handler_test.cpp | 8 +- src/test/rpc/JSONRPC_test.cpp | 6 +- src/test/rpc/KeyGeneration_test.cpp | 8 +- src/test/rpc/LedgerClosed_test.cpp | 6 +- src/test/rpc/LedgerData_test.cpp | 6 +- src/test/rpc/LedgerEntry_test.cpp | 16 +-- src/test/rpc/LedgerHeader_test.cpp | 6 +- src/test/rpc/LedgerRPC_test.cpp | 6 +- src/test/rpc/LedgerRequest_test.cpp | 6 +- src/test/rpc/ManifestRPC_test.cpp | 6 +- src/test/rpc/NoRippleCheck_test.cpp | 12 +- src/test/rpc/NoRipple_test.cpp | 6 +- src/test/rpc/OwnerInfo_test.cpp | 6 +- src/test/rpc/Peers_test.cpp | 6 +- src/test/rpc/RPCCall_test.cpp | 6 +- src/test/rpc/RPCHelpers_test.cpp | 6 +- src/test/rpc/RPCOverload_test.cpp | 6 +- src/test/rpc/RobustTransaction_test.cpp | 6 +- src/test/rpc/Roles_test.cpp | 6 +- src/test/rpc/ServerDefinitions_test.cpp | 6 +- src/test/rpc/ServerInfo_test.cpp | 6 +- src/test/rpc/Simulate_test.cpp | 6 +- src/test/rpc/Status_test.cpp | 4 +- src/test/rpc/Subscribe_test.cpp | 6 +- src/test/rpc/TransactionEntry_test.cpp | 6 +- src/test/rpc/TransactionHistory_test.cpp | 6 +- src/test/rpc/Transaction_test.cpp | 6 +- src/test/rpc/ValidatorInfo_test.cpp | 6 +- src/test/rpc/ValidatorRPC_test.cpp | 6 +- src/test/rpc/Version_test.cpp | 6 +- src/test/server/ServerStatus_test.cpp | 6 +- src/test/server/Server_test.cpp | 6 +- src/test/shamap/FetchPack_test.cpp | 8 +- src/test/shamap/SHAMapSync_test.cpp | 6 +- src/test/shamap/SHAMap_test.cpp | 8 +- src/test/shamap/common.h | 4 +- src/test/unit_test/FileDirGuard.h | 4 +- src/test/unit_test/SuiteJournal.h | 4 +- src/test/unit_test/multi_runner.cpp | 4 +- src/test/unit_test/multi_runner.h | 4 +- src/tests/libxrpl/basics/RangeSet.cpp | 2 +- src/tests/libxrpl/basics/Slice.cpp | 2 +- src/tests/libxrpl/basics/base64.cpp | 2 +- src/tests/libxrpl/basics/contract.cpp | 2 +- src/tests/libxrpl/basics/mulDiv.cpp | 2 +- src/tests/libxrpl/basics/scope.cpp | 2 +- src/tests/libxrpl/basics/tagged_integer.cpp | 2 +- src/tests/libxrpl/crypto/csprng.cpp | 2 +- src/tests/libxrpl/json/Output.cpp | 2 +- src/tests/libxrpl/json/Value.cpp | 4 +- src/tests/libxrpl/json/Writer.cpp | 2 +- src/tests/libxrpl/net/HTTPClient.cpp | 2 +- .../app/consensus/RCLCensorshipDetector.h | 4 +- src/xrpld/app/consensus/RCLConsensus.cpp | 20 +-- src/xrpld/app/consensus/RCLConsensus.h | 4 +- src/xrpld/app/consensus/RCLCxLedger.h | 8 +- src/xrpld/app/consensus/RCLCxPeerPos.cpp | 6 +- src/xrpld/app/consensus/RCLCxPeerPos.h | 4 +- src/xrpld/app/consensus/RCLCxTx.h | 8 +- src/xrpld/app/consensus/RCLValidations.cpp | 12 +- src/xrpld/app/consensus/RCLValidations.h | 8 +- .../app/ledger/AbstractFetchPackContainer.h | 4 +- src/xrpld/app/ledger/AcceptedLedger.cpp | 4 +- src/xrpld/app/ledger/AcceptedLedger.h | 4 +- src/xrpld/app/ledger/AcceptedLedgerTx.cpp | 8 +- src/xrpld/app/ledger/AcceptedLedgerTx.h | 4 +- src/xrpld/app/ledger/AccountStateSF.cpp | 4 +- src/xrpld/app/ledger/AccountStateSF.h | 4 +- src/xrpld/app/ledger/BookListeners.cpp | 4 +- src/xrpld/app/ledger/BookListeners.h | 4 +- src/xrpld/app/ledger/BuildLedger.h | 4 +- src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 8 +- src/xrpld/app/ledger/ConsensusTransSetSF.h | 4 +- src/xrpld/app/ledger/InboundLedger.h | 4 +- src/xrpld/app/ledger/InboundLedgers.h | 4 +- src/xrpld/app/ledger/InboundTransactions.h | 4 +- src/xrpld/app/ledger/Ledger.cpp | 26 ++-- src/xrpld/app/ledger/Ledger.h | 4 +- src/xrpld/app/ledger/LedgerCleaner.h | 4 +- src/xrpld/app/ledger/LedgerHistory.cpp | 32 +++-- src/xrpld/app/ledger/LedgerHistory.h | 4 +- src/xrpld/app/ledger/LedgerHolder.h | 4 +- src/xrpld/app/ledger/LedgerMaster.h | 4 +- src/xrpld/app/ledger/LedgerReplay.h | 4 +- src/xrpld/app/ledger/LedgerReplayTask.h | 4 +- src/xrpld/app/ledger/LedgerReplayer.h | 4 +- src/xrpld/app/ledger/LedgerToJson.h | 4 +- src/xrpld/app/ledger/LocalTxs.h | 4 +- src/xrpld/app/ledger/OpenLedger.h | 6 +- src/xrpld/app/ledger/OrderBookDB.cpp | 6 +- src/xrpld/app/ledger/OrderBookDB.h | 4 +- src/xrpld/app/ledger/PendingSaves.h | 4 +- src/xrpld/app/ledger/TransactionMaster.h | 4 +- src/xrpld/app/ledger/TransactionStateSF.cpp | 6 +- src/xrpld/app/ledger/TransactionStateSF.h | 4 +- src/xrpld/app/ledger/detail/BuildLedger.cpp | 10 +- src/xrpld/app/ledger/detail/InboundLedger.cpp | 21 ++- .../app/ledger/detail/InboundLedgers.cpp | 13 +- .../app/ledger/detail/InboundTransactions.cpp | 4 +- src/xrpld/app/ledger/detail/LedgerCleaner.cpp | 9 +- .../app/ledger/detail/LedgerDeltaAcquire.cpp | 10 +- .../app/ledger/detail/LedgerDeltaAcquire.h | 4 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 30 ++--- src/xrpld/app/ledger/detail/LedgerReplay.cpp | 4 +- .../ledger/detail/LedgerReplayMsgHandler.cpp | 4 +- .../ledger/detail/LedgerReplayMsgHandler.h | 4 +- .../app/ledger/detail/LedgerReplayTask.cpp | 12 +- .../app/ledger/detail/LedgerReplayer.cpp | 6 +- src/xrpld/app/ledger/detail/LedgerToJson.cpp | 4 +- src/xrpld/app/ledger/detail/LocalTxs.cpp | 4 +- src/xrpld/app/ledger/detail/OpenLedger.cpp | 6 +- .../app/ledger/detail/SkipListAcquire.cpp | 8 +- src/xrpld/app/ledger/detail/SkipListAcquire.h | 8 +- .../app/ledger/detail/TimeoutCounter.cpp | 6 +- src/xrpld/app/ledger/detail/TimeoutCounter.h | 6 +- .../app/ledger/detail/TransactionAcquire.cpp | 4 +- .../app/ledger/detail/TransactionAcquire.h | 4 +- .../app/ledger/detail/TransactionMaster.cpp | 4 +- src/xrpld/app/main/Application.cpp | 35 +++-- src/xrpld/app/main/Application.h | 4 +- src/xrpld/app/main/CollectorManager.cpp | 4 +- src/xrpld/app/main/CollectorManager.h | 4 +- src/xrpld/app/main/DBInit.h | 4 +- src/xrpld/app/main/GRPCServer.cpp | 8 +- src/xrpld/app/main/GRPCServer.h | 4 +- src/xrpld/app/main/LoadManager.cpp | 7 +- src/xrpld/app/main/LoadManager.h | 4 +- src/xrpld/app/main/Main.cpp | 10 +- src/xrpld/app/main/NodeIdentity.cpp | 4 +- src/xrpld/app/main/NodeIdentity.h | 4 +- src/xrpld/app/main/NodeStoreScheduler.cpp | 4 +- src/xrpld/app/main/NodeStoreScheduler.h | 4 +- src/xrpld/app/main/Tuning.h | 4 +- src/xrpld/app/misc/AMMHelpers.h | 4 +- src/xrpld/app/misc/AMMUtils.h | 4 +- src/xrpld/app/misc/AmendmentTable.h | 4 +- src/xrpld/app/misc/CanonicalTXSet.cpp | 4 +- src/xrpld/app/misc/CanonicalTXSet.h | 4 +- src/xrpld/app/misc/DelegateUtils.h | 4 +- src/xrpld/app/misc/DeliverMax.h | 4 +- src/xrpld/app/misc/FeeVote.h | 4 +- src/xrpld/app/misc/FeeVoteImpl.cpp | 6 +- src/xrpld/app/misc/HashRouter.cpp | 6 +- src/xrpld/app/misc/HashRouter.h | 4 +- src/xrpld/app/misc/LendingHelpers.h | 6 +- src/xrpld/app/misc/LoadFeeTrack.h | 4 +- src/xrpld/app/misc/Manifest.h | 4 +- src/xrpld/app/misc/NegativeUNLVote.cpp | 11 +- src/xrpld/app/misc/NegativeUNLVote.h | 4 +- src/xrpld/app/misc/NetworkOPs.cpp | 53 ++++---- src/xrpld/app/misc/NetworkOPs.h | 4 +- src/xrpld/app/misc/PermissionedDEXHelpers.cpp | 4 +- src/xrpld/app/misc/PermissionedDEXHelpers.h | 4 +- src/xrpld/app/misc/SHAMapStore.h | 4 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 16 +-- src/xrpld/app/misc/SHAMapStoreImp.h | 4 +- src/xrpld/app/misc/Transaction.h | 4 +- src/xrpld/app/misc/TxQ.h | 4 +- src/xrpld/app/misc/ValidatorKeys.h | 4 +- src/xrpld/app/misc/ValidatorList.h | 9 +- src/xrpld/app/misc/ValidatorSite.h | 4 +- src/xrpld/app/misc/detail/AMMHelpers.cpp | 6 +- src/xrpld/app/misc/detail/AMMUtils.cpp | 6 +- src/xrpld/app/misc/detail/AccountTxPaging.cpp | 4 +- src/xrpld/app/misc/detail/AccountTxPaging.h | 4 +- src/xrpld/app/misc/detail/AmendmentTable.cpp | 12 +- src/xrpld/app/misc/detail/DelegateUtils.cpp | 4 +- src/xrpld/app/misc/detail/DeliverMax.cpp | 4 +- src/xrpld/app/misc/detail/LendingHelpers.cpp | 118 +++++++++-------- src/xrpld/app/misc/detail/LoadFeeTrack.cpp | 4 +- src/xrpld/app/misc/detail/Manifest.cpp | 13 +- src/xrpld/app/misc/detail/Transaction.cpp | 6 +- src/xrpld/app/misc/detail/TxQ.cpp | 62 +++++---- src/xrpld/app/misc/detail/ValidatorKeys.cpp | 4 +- src/xrpld/app/misc/detail/ValidatorList.cpp | 65 +++++----- src/xrpld/app/misc/detail/ValidatorSite.cpp | 8 +- src/xrpld/app/misc/detail/Work.h | 4 +- src/xrpld/app/misc/detail/WorkBase.h | 6 +- src/xrpld/app/misc/detail/WorkFile.h | 6 +- src/xrpld/app/misc/detail/WorkPlain.h | 4 +- src/xrpld/app/misc/detail/WorkSSL.cpp | 4 +- src/xrpld/app/misc/detail/WorkSSL.h | 4 +- src/xrpld/app/paths/AMMContext.h | 4 +- src/xrpld/app/paths/AMMLiquidity.h | 4 +- src/xrpld/app/paths/AMMOffer.h | 4 +- src/xrpld/app/paths/AccountCurrencies.cpp | 4 +- src/xrpld/app/paths/AccountCurrencies.h | 4 +- src/xrpld/app/paths/Credit.cpp | 12 +- src/xrpld/app/paths/Credit.h | 4 +- src/xrpld/app/paths/Flow.cpp | 6 +- src/xrpld/app/paths/Flow.h | 4 +- src/xrpld/app/paths/PathRequest.cpp | 7 +- src/xrpld/app/paths/PathRequest.h | 4 +- src/xrpld/app/paths/PathRequests.cpp | 4 +- src/xrpld/app/paths/PathRequests.h | 4 +- src/xrpld/app/paths/Pathfinder.cpp | 16 +-- src/xrpld/app/paths/Pathfinder.h | 4 +- src/xrpld/app/paths/RippleCalc.cpp | 4 +- src/xrpld/app/paths/RippleCalc.h | 4 +- src/xrpld/app/paths/RippleLineCache.cpp | 10 +- src/xrpld/app/paths/RippleLineCache.h | 6 +- src/xrpld/app/paths/TrustLine.cpp | 4 +- src/xrpld/app/paths/TrustLine.h | 4 +- src/xrpld/app/paths/detail/AMMLiquidity.cpp | 6 +- src/xrpld/app/paths/detail/AMMOffer.cpp | 4 +- src/xrpld/app/paths/detail/AmountSpec.h | 17 ++- src/xrpld/app/paths/detail/BookStep.cpp | 21 ++- src/xrpld/app/paths/detail/DirectStep.cpp | 14 +- src/xrpld/app/paths/detail/FlatSets.h | 4 +- src/xrpld/app/paths/detail/FlowDebugInfo.h | 12 +- src/xrpld/app/paths/detail/PathfinderUtils.h | 4 +- src/xrpld/app/paths/detail/PaySteps.cpp | 14 +- src/xrpld/app/paths/detail/StepChecks.h | 6 +- src/xrpld/app/paths/detail/Steps.h | 6 +- src/xrpld/app/paths/detail/StrandFlow.h | 20 +-- .../app/paths/detail/XRPEndpointStep.cpp | 10 +- src/xrpld/app/rdb/PeerFinder.h | 4 +- src/xrpld/app/rdb/RelationalDatabase.h | 6 +- src/xrpld/app/rdb/State.h | 4 +- src/xrpld/app/rdb/Vacuum.h | 4 +- src/xrpld/app/rdb/Wallet.h | 4 +- src/xrpld/app/rdb/backend/SQLiteDatabase.h | 4 +- src/xrpld/app/rdb/backend/detail/Node.cpp | 12 +- src/xrpld/app/rdb/backend/detail/Node.h | 4 +- .../app/rdb/backend/detail/SQLiteDatabase.cpp | 10 +- src/xrpld/app/rdb/detail/PeerFinder.cpp | 4 +- .../app/rdb/detail/RelationalDatabase.cpp | 4 +- src/xrpld/app/rdb/detail/State.cpp | 4 +- src/xrpld/app/rdb/detail/Vacuum.cpp | 4 +- src/xrpld/app/rdb/detail/Wallet.cpp | 4 +- src/xrpld/app/tx/apply.h | 4 +- src/xrpld/app/tx/applySteps.h | 4 +- src/xrpld/app/tx/detail/AMMBid.cpp | 8 +- src/xrpld/app/tx/detail/AMMBid.h | 4 +- src/xrpld/app/tx/detail/AMMClawback.cpp | 4 +- src/xrpld/app/tx/detail/AMMClawback.h | 4 +- src/xrpld/app/tx/detail/AMMCreate.cpp | 4 +- src/xrpld/app/tx/detail/AMMCreate.h | 4 +- src/xrpld/app/tx/detail/AMMDelete.cpp | 4 +- src/xrpld/app/tx/detail/AMMDelete.h | 4 +- src/xrpld/app/tx/detail/AMMDeposit.cpp | 6 +- src/xrpld/app/tx/detail/AMMDeposit.h | 4 +- src/xrpld/app/tx/detail/AMMVote.cpp | 6 +- src/xrpld/app/tx/detail/AMMVote.h | 4 +- src/xrpld/app/tx/detail/AMMWithdraw.cpp | 6 +- src/xrpld/app/tx/detail/AMMWithdraw.h | 4 +- src/xrpld/app/tx/detail/ApplyContext.cpp | 6 +- src/xrpld/app/tx/detail/ApplyContext.h | 4 +- src/xrpld/app/tx/detail/Batch.cpp | 8 +- src/xrpld/app/tx/detail/Batch.h | 4 +- src/xrpld/app/tx/detail/BookTip.cpp | 4 +- src/xrpld/app/tx/detail/BookTip.h | 4 +- src/xrpld/app/tx/detail/CancelCheck.cpp | 4 +- src/xrpld/app/tx/detail/CancelCheck.h | 4 +- src/xrpld/app/tx/detail/CancelOffer.cpp | 4 +- src/xrpld/app/tx/detail/CancelOffer.h | 4 +- src/xrpld/app/tx/detail/CashCheck.cpp | 4 +- src/xrpld/app/tx/detail/CashCheck.h | 4 +- src/xrpld/app/tx/detail/Change.cpp | 8 +- src/xrpld/app/tx/detail/Change.h | 4 +- src/xrpld/app/tx/detail/Clawback.cpp | 4 +- src/xrpld/app/tx/detail/Clawback.h | 4 +- src/xrpld/app/tx/detail/CreateCheck.cpp | 4 +- src/xrpld/app/tx/detail/CreateCheck.h | 4 +- src/xrpld/app/tx/detail/CreateOffer.cpp | 16 +-- src/xrpld/app/tx/detail/CreateOffer.h | 4 +- src/xrpld/app/tx/detail/CreateTicket.cpp | 4 +- src/xrpld/app/tx/detail/CreateTicket.h | 4 +- src/xrpld/app/tx/detail/Credentials.cpp | 4 +- src/xrpld/app/tx/detail/Credentials.h | 4 +- src/xrpld/app/tx/detail/DID.cpp | 4 +- src/xrpld/app/tx/detail/DID.h | 4 +- src/xrpld/app/tx/detail/DelegateSet.cpp | 4 +- src/xrpld/app/tx/detail/DelegateSet.h | 4 +- src/xrpld/app/tx/detail/DeleteAccount.cpp | 16 +-- src/xrpld/app/tx/detail/DeleteAccount.h | 4 +- src/xrpld/app/tx/detail/DeleteOracle.cpp | 4 +- src/xrpld/app/tx/detail/DeleteOracle.h | 4 +- src/xrpld/app/tx/detail/DepositPreauth.cpp | 4 +- src/xrpld/app/tx/detail/DepositPreauth.h | 4 +- src/xrpld/app/tx/detail/Escrow.cpp | 10 +- src/xrpld/app/tx/detail/Escrow.h | 4 +- src/xrpld/app/tx/detail/InvariantCheck.cpp | 76 ++++++----- src/xrpld/app/tx/detail/InvariantCheck.h | 6 +- src/xrpld/app/tx/detail/LedgerStateFix.cpp | 4 +- src/xrpld/app/tx/detail/LedgerStateFix.h | 4 +- .../app/tx/detail/LoanBrokerCoverClawback.cpp | 4 +- .../app/tx/detail/LoanBrokerCoverClawback.h | 4 +- .../app/tx/detail/LoanBrokerCoverDeposit.cpp | 4 +- .../app/tx/detail/LoanBrokerCoverDeposit.h | 4 +- .../app/tx/detail/LoanBrokerCoverWithdraw.cpp | 4 +- .../app/tx/detail/LoanBrokerCoverWithdraw.h | 4 +- src/xrpld/app/tx/detail/LoanBrokerDelete.cpp | 4 +- src/xrpld/app/tx/detail/LoanBrokerDelete.h | 4 +- src/xrpld/app/tx/detail/LoanBrokerSet.cpp | 4 +- src/xrpld/app/tx/detail/LoanBrokerSet.h | 4 +- src/xrpld/app/tx/detail/LoanDelete.cpp | 6 +- src/xrpld/app/tx/detail/LoanDelete.h | 4 +- src/xrpld/app/tx/detail/LoanManage.cpp | 4 +- src/xrpld/app/tx/detail/LoanManage.h | 4 +- src/xrpld/app/tx/detail/LoanPay.cpp | 44 +++---- src/xrpld/app/tx/detail/LoanPay.h | 4 +- src/xrpld/app/tx/detail/LoanSet.cpp | 16 +-- src/xrpld/app/tx/detail/LoanSet.h | 4 +- src/xrpld/app/tx/detail/MPTokenAuthorize.cpp | 4 +- src/xrpld/app/tx/detail/MPTokenAuthorize.h | 4 +- .../app/tx/detail/MPTokenIssuanceCreate.cpp | 4 +- .../app/tx/detail/MPTokenIssuanceCreate.h | 4 +- .../app/tx/detail/MPTokenIssuanceDestroy.cpp | 4 +- .../app/tx/detail/MPTokenIssuanceDestroy.h | 4 +- .../app/tx/detail/MPTokenIssuanceSet.cpp | 4 +- src/xrpld/app/tx/detail/MPTokenIssuanceSet.h | 4 +- .../app/tx/detail/NFTokenAcceptOffer.cpp | 4 +- src/xrpld/app/tx/detail/NFTokenAcceptOffer.h | 4 +- src/xrpld/app/tx/detail/NFTokenBurn.cpp | 4 +- src/xrpld/app/tx/detail/NFTokenBurn.h | 4 +- .../app/tx/detail/NFTokenCancelOffer.cpp | 4 +- src/xrpld/app/tx/detail/NFTokenCancelOffer.h | 4 +- .../app/tx/detail/NFTokenCreateOffer.cpp | 4 +- src/xrpld/app/tx/detail/NFTokenCreateOffer.h | 4 +- src/xrpld/app/tx/detail/NFTokenMint.cpp | 6 +- src/xrpld/app/tx/detail/NFTokenMint.h | 4 +- src/xrpld/app/tx/detail/NFTokenModify.cpp | 4 +- src/xrpld/app/tx/detail/NFTokenModify.h | 4 +- src/xrpld/app/tx/detail/NFTokenUtils.cpp | 22 ++-- src/xrpld/app/tx/detail/NFTokenUtils.h | 6 +- src/xrpld/app/tx/detail/Offer.h | 6 +- src/xrpld/app/tx/detail/OfferStream.cpp | 6 +- src/xrpld/app/tx/detail/OfferStream.h | 4 +- src/xrpld/app/tx/detail/PayChan.cpp | 8 +- src/xrpld/app/tx/detail/PayChan.h | 4 +- src/xrpld/app/tx/detail/Payment.cpp | 6 +- src/xrpld/app/tx/detail/Payment.h | 4 +- .../tx/detail/PermissionedDomainDelete.cpp | 10 +- .../app/tx/detail/PermissionedDomainDelete.h | 4 +- .../app/tx/detail/PermissionedDomainSet.cpp | 4 +- .../app/tx/detail/PermissionedDomainSet.h | 4 +- src/xrpld/app/tx/detail/SetAccount.cpp | 4 +- src/xrpld/app/tx/detail/SetAccount.h | 4 +- src/xrpld/app/tx/detail/SetOracle.cpp | 4 +- src/xrpld/app/tx/detail/SetOracle.h | 4 +- src/xrpld/app/tx/detail/SetRegularKey.cpp | 4 +- src/xrpld/app/tx/detail/SetRegularKey.h | 4 +- src/xrpld/app/tx/detail/SetSignerList.cpp | 16 +-- src/xrpld/app/tx/detail/SetSignerList.h | 4 +- src/xrpld/app/tx/detail/SetTrust.cpp | 14 +- src/xrpld/app/tx/detail/SetTrust.h | 4 +- src/xrpld/app/tx/detail/SignerEntries.cpp | 4 +- src/xrpld/app/tx/detail/SignerEntries.h | 4 +- src/xrpld/app/tx/detail/Transactor.cpp | 30 ++--- src/xrpld/app/tx/detail/Transactor.h | 6 +- src/xrpld/app/tx/detail/VaultClawback.cpp | 8 +- src/xrpld/app/tx/detail/VaultClawback.h | 4 +- src/xrpld/app/tx/detail/VaultCreate.cpp | 4 +- src/xrpld/app/tx/detail/VaultCreate.h | 4 +- src/xrpld/app/tx/detail/VaultDelete.cpp | 4 +- src/xrpld/app/tx/detail/VaultDelete.h | 4 +- src/xrpld/app/tx/detail/VaultDeposit.cpp | 8 +- src/xrpld/app/tx/detail/VaultDeposit.h | 4 +- src/xrpld/app/tx/detail/VaultSet.cpp | 4 +- src/xrpld/app/tx/detail/VaultSet.h | 4 +- src/xrpld/app/tx/detail/VaultWithdraw.cpp | 6 +- src/xrpld/app/tx/detail/VaultWithdraw.h | 4 +- src/xrpld/app/tx/detail/XChainBridge.cpp | 10 +- src/xrpld/app/tx/detail/XChainBridge.h | 4 +- src/xrpld/app/tx/detail/apply.cpp | 4 +- src/xrpld/app/tx/detail/applySteps.cpp | 15 +-- src/xrpld/conditions/Condition.h | 4 +- src/xrpld/conditions/Fulfillment.h | 4 +- src/xrpld/conditions/detail/Condition.cpp | 4 +- src/xrpld/conditions/detail/Fulfillment.cpp | 4 +- src/xrpld/conditions/detail/PreimageSha256.h | 4 +- src/xrpld/conditions/detail/error.cpp | 4 +- src/xrpld/conditions/detail/error.h | 6 +- src/xrpld/conditions/detail/utils.h | 4 +- src/xrpld/consensus/Consensus.cpp | 4 +- src/xrpld/consensus/Consensus.h | 23 ++-- src/xrpld/consensus/ConsensusParms.h | 6 +- src/xrpld/consensus/ConsensusProposal.h | 4 +- src/xrpld/consensus/ConsensusTypes.h | 6 +- src/xrpld/consensus/DisputedTx.h | 4 +- src/xrpld/consensus/LedgerTiming.h | 4 +- src/xrpld/consensus/LedgerTrie.h | 22 ++-- src/xrpld/consensus/Validations.h | 8 +- src/xrpld/core/Config.h | 4 +- src/xrpld/core/ConfigSections.h | 4 +- src/xrpld/core/DatabaseCon.h | 6 +- src/xrpld/core/SociDB.h | 4 +- src/xrpld/core/TimeKeeper.h | 4 +- src/xrpld/core/detail/Config.cpp | 27 ++-- src/xrpld/core/detail/DatabaseCon.cpp | 6 +- src/xrpld/core/detail/SociDB.cpp | 6 +- src/xrpld/overlay/Cluster.h | 4 +- src/xrpld/overlay/ClusterNode.h | 4 +- src/xrpld/overlay/Compression.h | 12 +- src/xrpld/overlay/Message.h | 4 +- src/xrpld/overlay/Overlay.h | 4 +- src/xrpld/overlay/Peer.h | 4 +- src/xrpld/overlay/PeerReservationTable.h | 4 +- src/xrpld/overlay/PeerSet.h | 4 +- src/xrpld/overlay/ReduceRelayCommon.h | 4 +- src/xrpld/overlay/Slot.h | 8 +- src/xrpld/overlay/Squelch.h | 4 +- src/xrpld/overlay/detail/Cluster.cpp | 4 +- src/xrpld/overlay/detail/ConnectAttempt.cpp | 10 +- src/xrpld/overlay/detail/ConnectAttempt.h | 4 +- src/xrpld/overlay/detail/Handshake.cpp | 8 +- src/xrpld/overlay/detail/Handshake.h | 4 +- src/xrpld/overlay/detail/Message.cpp | 14 +- src/xrpld/overlay/detail/OverlayImpl.cpp | 22 ++-- src/xrpld/overlay/detail/OverlayImpl.h | 8 +- src/xrpld/overlay/detail/PeerImp.cpp | 46 +++---- src/xrpld/overlay/detail/PeerImp.h | 6 +- .../overlay/detail/PeerReservationTable.cpp | 4 +- src/xrpld/overlay/detail/PeerSet.cpp | 6 +- src/xrpld/overlay/detail/ProtocolMessage.h | 12 +- src/xrpld/overlay/detail/ProtocolVersion.cpp | 4 +- src/xrpld/overlay/detail/ProtocolVersion.h | 4 +- src/xrpld/overlay/detail/TrafficCount.cpp | 4 +- src/xrpld/overlay/detail/TrafficCount.h | 6 +- src/xrpld/overlay/detail/Tuning.h | 4 +- src/xrpld/overlay/detail/TxMetrics.cpp | 4 +- src/xrpld/overlay/detail/TxMetrics.h | 4 +- src/xrpld/overlay/detail/ZeroCopyStream.h | 6 +- src/xrpld/overlay/make_Overlay.h | 4 +- src/xrpld/overlay/predicates.h | 4 +- src/xrpld/peerfinder/PeerfinderManager.h | 6 +- src/xrpld/peerfinder/Slot.h | 4 +- src/xrpld/peerfinder/detail/Bootcache.cpp | 4 +- src/xrpld/peerfinder/detail/Bootcache.h | 8 +- src/xrpld/peerfinder/detail/Checker.h | 4 +- src/xrpld/peerfinder/detail/Counts.h | 12 +- src/xrpld/peerfinder/detail/Endpoint.cpp | 4 +- src/xrpld/peerfinder/detail/Fixed.h | 4 +- src/xrpld/peerfinder/detail/Handouts.h | 6 +- src/xrpld/peerfinder/detail/Livecache.h | 10 +- src/xrpld/peerfinder/detail/Logic.h | 26 ++-- .../peerfinder/detail/PeerfinderConfig.cpp | 6 +- .../peerfinder/detail/PeerfinderManager.cpp | 4 +- src/xrpld/peerfinder/detail/SlotImp.cpp | 16 +-- src/xrpld/peerfinder/detail/SlotImp.h | 4 +- src/xrpld/peerfinder/detail/Source.h | 4 +- src/xrpld/peerfinder/detail/SourceStrings.cpp | 4 +- src/xrpld/peerfinder/detail/SourceStrings.h | 4 +- src/xrpld/peerfinder/detail/Store.h | 4 +- src/xrpld/peerfinder/detail/StoreSqdb.h | 4 +- src/xrpld/peerfinder/detail/Tuning.h | 4 +- src/xrpld/peerfinder/make_Manager.h | 4 +- src/xrpld/perflog/detail/PerfLogImp.cpp | 23 ++-- src/xrpld/perflog/detail/PerfLogImp.h | 6 +- src/xrpld/rpc/BookChanges.h | 4 +- src/xrpld/rpc/CTID.h | 4 +- src/xrpld/rpc/Context.h | 4 +- src/xrpld/rpc/DeliveredAmount.h | 4 +- src/xrpld/rpc/GRPCHandlers.h | 4 +- src/xrpld/rpc/InfoSub.h | 4 +- src/xrpld/rpc/MPTokenIssuanceID.h | 4 +- src/xrpld/rpc/Output.h | 4 +- src/xrpld/rpc/README.md | 2 +- src/xrpld/rpc/RPCCall.h | 4 +- src/xrpld/rpc/RPCHandler.h | 4 +- src/xrpld/rpc/RPCSub.h | 4 +- src/xrpld/rpc/Request.h | 4 +- src/xrpld/rpc/Role.h | 4 +- src/xrpld/rpc/ServerHandler.h | 4 +- src/xrpld/rpc/Status.h | 8 +- src/xrpld/rpc/detail/DeliveredAmount.cpp | 4 +- src/xrpld/rpc/detail/Handler.cpp | 12 +- src/xrpld/rpc/detail/Handler.h | 4 +- src/xrpld/rpc/detail/InfoSub.cpp | 6 +- src/xrpld/rpc/detail/LegacyPathFind.cpp | 4 +- src/xrpld/rpc/detail/LegacyPathFind.h | 4 +- src/xrpld/rpc/detail/MPTokenIssuanceID.cpp | 4 +- src/xrpld/rpc/detail/RPCCall.cpp | 12 +- src/xrpld/rpc/detail/RPCHandler.cpp | 4 +- src/xrpld/rpc/detail/RPCHelpers.cpp | 8 +- src/xrpld/rpc/detail/RPCHelpers.h | 4 +- src/xrpld/rpc/detail/RPCLedgerHelpers.cpp | 16 +-- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 4 +- src/xrpld/rpc/detail/RPCSub.cpp | 4 +- src/xrpld/rpc/detail/Role.cpp | 6 +- src/xrpld/rpc/detail/ServerHandler.cpp | 4 +- src/xrpld/rpc/detail/Status.cpp | 8 +- src/xrpld/rpc/detail/TransactionSign.cpp | 8 +- src/xrpld/rpc/detail/TransactionSign.h | 4 +- src/xrpld/rpc/detail/Tuning.h | 4 +- src/xrpld/rpc/detail/WSInfoSub.h | 4 +- src/xrpld/rpc/handlers/AMMInfo.cpp | 10 +- src/xrpld/rpc/handlers/AccountChannels.cpp | 6 +- .../rpc/handlers/AccountCurrenciesHandler.cpp | 4 +- src/xrpld/rpc/handlers/AccountInfo.cpp | 6 +- src/xrpld/rpc/handlers/AccountLines.cpp | 6 +- src/xrpld/rpc/handlers/AccountObjects.cpp | 4 +- src/xrpld/rpc/handlers/AccountOffers.cpp | 6 +- src/xrpld/rpc/handlers/AccountTx.cpp | 11 +- src/xrpld/rpc/handlers/BlackList.cpp | 4 +- src/xrpld/rpc/handlers/BookOffers.cpp | 4 +- src/xrpld/rpc/handlers/CanDelete.cpp | 4 +- src/xrpld/rpc/handlers/Connect.cpp | 4 +- src/xrpld/rpc/handlers/ConsensusInfo.cpp | 4 +- src/xrpld/rpc/handlers/DepositAuthorized.cpp | 4 +- src/xrpld/rpc/handlers/DoManifest.cpp | 4 +- src/xrpld/rpc/handlers/Feature1.cpp | 4 +- src/xrpld/rpc/handlers/Fee1.cpp | 6 +- src/xrpld/rpc/handlers/FetchInfo.cpp | 4 +- src/xrpld/rpc/handlers/GatewayBalances.cpp | 4 +- src/xrpld/rpc/handlers/GetAggregatePrice.cpp | 4 +- src/xrpld/rpc/handlers/GetCounts.cpp | 4 +- src/xrpld/rpc/handlers/GetCounts.h | 2 +- src/xrpld/rpc/handlers/Handlers.h | 4 +- src/xrpld/rpc/handlers/LedgerAccept.cpp | 4 +- .../rpc/handlers/LedgerCleanerHandler.cpp | 4 +- src/xrpld/rpc/handlers/LedgerClosed.cpp | 6 +- src/xrpld/rpc/handlers/LedgerCurrent.cpp | 4 +- src/xrpld/rpc/handlers/LedgerData.cpp | 4 +- src/xrpld/rpc/handlers/LedgerDiff.cpp | 6 +- src/xrpld/rpc/handlers/LedgerEntry.cpp | 4 +- src/xrpld/rpc/handlers/LedgerEntryHelpers.h | 4 +- src/xrpld/rpc/handlers/LedgerHandler.cpp | 8 +- src/xrpld/rpc/handlers/LedgerHandler.h | 4 +- src/xrpld/rpc/handlers/LedgerHeader.cpp | 4 +- src/xrpld/rpc/handlers/LedgerRequest.cpp | 4 +- src/xrpld/rpc/handlers/LogLevel.cpp | 4 +- src/xrpld/rpc/handlers/LogRotate.cpp | 4 +- src/xrpld/rpc/handlers/NFTOffers.cpp | 4 +- src/xrpld/rpc/handlers/NoRippleCheck.cpp | 4 +- src/xrpld/rpc/handlers/OwnerInfo.cpp | 4 +- src/xrpld/rpc/handlers/PathFind.cpp | 4 +- src/xrpld/rpc/handlers/PayChanClaim.cpp | 6 +- src/xrpld/rpc/handlers/Peers.cpp | 4 +- src/xrpld/rpc/handlers/Ping.cpp | 4 +- src/xrpld/rpc/handlers/Print.cpp | 4 +- src/xrpld/rpc/handlers/Random.cpp | 4 +- src/xrpld/rpc/handlers/Reservations.cpp | 4 +- src/xrpld/rpc/handlers/RipplePathFind.cpp | 4 +- src/xrpld/rpc/handlers/ServerDefinitions.cpp | 8 +- src/xrpld/rpc/handlers/ServerInfo.cpp | 4 +- src/xrpld/rpc/handlers/ServerState.cpp | 4 +- src/xrpld/rpc/handlers/SignFor.cpp | 4 +- src/xrpld/rpc/handlers/SignHandler.cpp | 4 +- src/xrpld/rpc/handlers/Simulate.cpp | 4 +- src/xrpld/rpc/handlers/Stop.cpp | 4 +- src/xrpld/rpc/handlers/Submit.cpp | 4 +- src/xrpld/rpc/handlers/SubmitMultiSigned.cpp | 4 +- src/xrpld/rpc/handlers/Subscribe.cpp | 4 +- src/xrpld/rpc/handlers/TransactionEntry.cpp | 4 +- src/xrpld/rpc/handlers/Tx.cpp | 6 +- src/xrpld/rpc/handlers/TxHistory.cpp | 4 +- src/xrpld/rpc/handlers/TxReduceRelay.cpp | 4 +- src/xrpld/rpc/handlers/UnlList.cpp | 4 +- src/xrpld/rpc/handlers/Unsubscribe.cpp | 4 +- src/xrpld/rpc/handlers/ValidationCreate.cpp | 4 +- src/xrpld/rpc/handlers/ValidatorInfo.cpp | 4 +- src/xrpld/rpc/handlers/ValidatorListSites.cpp | 4 +- src/xrpld/rpc/handlers/Validators.cpp | 4 +- src/xrpld/rpc/handlers/VaultInfo.cpp | 4 +- src/xrpld/rpc/handlers/Version.h | 4 +- src/xrpld/rpc/handlers/WalletPropose.cpp | 4 +- src/xrpld/rpc/handlers/WalletPropose.h | 4 +- src/xrpld/rpc/json_body.h | 4 +- src/xrpld/shamap/NodeFamily.cpp | 4 +- src/xrpld/shamap/NodeFamily.h | 4 +- tests/conan/src/example.cpp | 2 +- 1261 files changed, 4220 insertions(+), 4235 deletions(-) create mode 100755 .github/scripts/rename/namespace.sh diff --git a/.github/scripts/rename/README.md b/.github/scripts/rename/README.md index 836f3606ba..392f0b1efc 100644 --- a/.github/scripts/rename/README.md +++ b/.github/scripts/rename/README.md @@ -29,6 +29,8 @@ run from the repository root. 4. `.github/scripts/rename/binary.sh`: This script will rename the binary from `rippled` to `xrpld`, and reverses the symlink so that `rippled` points to the `xrpld` binary. +5. `.github/scripts/rename/namespace.sh`: This script will rename the C++ + namespaces from `ripple` to `xrpl`. You can run all these scripts from the repository root as follows: @@ -37,4 +39,5 @@ You can run all these scripts from the repository root as follows: ./.github/scripts/rename/copyright.sh . ./.github/scripts/rename/cmake.sh . ./.github/scripts/rename/binary.sh . +./.github/scripts/rename/namespace.sh . ``` diff --git a/.github/scripts/rename/namespace.sh b/.github/scripts/rename/namespace.sh new file mode 100755 index 0000000000..30fd91bf2c --- /dev/null +++ b/.github/scripts/rename/namespace.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# Exit the script as soon as an error occurs. +set -e + +# On MacOS, ensure that GNU sed is installed and available as `gsed`. +SED_COMMAND=sed +if [[ "${OSTYPE}" == 'darwin'* ]]; then + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed +fi + +# This script renames the `ripple` namespace to `xrpl` in this project. +# Specifically, it renames all occurrences of `namespace ripple` and `ripple::` +# to `namespace xrpl` and `xrpl::`, respectively, by scanning all header and +# source files in the specified directory and its subdirectories, as well as any +# occurrences in the documentation. It also renames them in the test suites. +# Usage: .github/scripts/rename/namespace.sh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +DIRECTORY=$1 +echo "Processing directory: ${DIRECTORY}" +if [ ! -d "${DIRECTORY}" ]; then + echo "Error: Directory '${DIRECTORY}' does not exist." + exit 1 +fi +pushd ${DIRECTORY} + +DIRECTORIES=("include" "src" "tests") +for DIRECTORY in "${DIRECTORIES[@]}"; do + echo "Processing directory: ${DIRECTORY}" + + find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}" + ${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}" + done +done + +# Special case for NuDBFactory that has ripple twice in the test suite name. +${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' src/test/nodestore/NuDBFactory_test.cpp + +DIRECTORY=$1 +find "${DIRECTORY}" -type f -name "*.md" | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}" +done + +popd +echo "Renaming complete." diff --git a/.github/workflows/reusable-check-rename.yml b/.github/workflows/reusable-check-rename.yml index 00ef7c6f14..fb9ed2c6a8 100644 --- a/.github/workflows/reusable-check-rename.yml +++ b/.github/workflows/reusable-check-rename.yml @@ -27,6 +27,8 @@ jobs: run: .github/scripts/rename/cmake.sh . - name: Check binary name run: .github/scripts/rename/binary.sh . + - name: Check namespaces + run: .github/scripts/rename/namespace.sh . - name: Check for differences env: MESSAGE: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86cfa9dc6d..5b578b7f13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -304,7 +304,7 @@ For this reason: - Example **bad** name `"RFC1751::insert(char* s, int x, int start, int length) : length is greater than or equal zero"` (missing namespace, unnecessary full function signature, description too verbose). - Good name: `"ripple::RFC1751::insert : minimum length"`. + Good name: `"xrpl::RFC1751::insert : minimum length"`. - In **few** well-justified cases a non-standard name can be used, in which case a comment should be placed to explain the rationale (example in `contract.cpp`) - Do **not** rename a contract without a good reason (e.g. the name no longer diff --git a/include/xrpl/basics/Archive.h b/include/xrpl/basics/Archive.h index 6dbb31f426..5f7c624084 100644 --- a/include/xrpl/basics/Archive.h +++ b/include/xrpl/basics/Archive.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Extract a tar archive compressed with lz4 @@ -17,6 +17,6 @@ extractTarLz4( boost::filesystem::path const& src, boost::filesystem::path const& dst); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/BasicConfig.h b/include/xrpl/basics/BasicConfig.h index 153936430a..573b26ae75 100644 --- a/include/xrpl/basics/BasicConfig.h +++ b/include/xrpl/basics/BasicConfig.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { using IniFileSections = std::unordered_map>; @@ -380,6 +380,6 @@ get_if_exists(Section const& section, std::string const& name, bool& v) return stat; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Blob.h b/include/xrpl/basics/Blob.h index c87a834fd4..986f829371 100644 --- a/include/xrpl/basics/Blob.h +++ b/include/xrpl/basics/Blob.h @@ -3,13 +3,13 @@ #include -namespace ripple { +namespace xrpl { /** Storage for linear binary data. Blocks of binary data appear often in various idioms and structures. */ using Blob = std::vector; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Buffer.h b/include/xrpl/basics/Buffer.h index c72ebba174..8ae745f6d1 100644 --- a/include/xrpl/basics/Buffer.h +++ b/include/xrpl/basics/Buffer.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Like std::vector but better. Meets the requirements of BufferFactory. @@ -96,7 +96,7 @@ public: XRPL_ASSERT( s.size() == 0 || size_ == 0 || s.data() < p_.get() || s.data() >= p_.get() + size_, - "ripple::Buffer::operator=(Slice) : input not a subset"); + "xrpl::Buffer::operator=(Slice) : input not a subset"); if (auto p = alloc(s.size())) std::memcpy(p, s.data(), s.size()); @@ -215,6 +215,6 @@ operator!=(Buffer const& lhs, Buffer const& rhs) noexcept return !(lhs == rhs); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/ByteUtilities.h b/include/xrpl/basics/ByteUtilities.h index 45df242720..88bb297346 100644 --- a/include/xrpl/basics/ByteUtilities.h +++ b/include/xrpl/basics/ByteUtilities.h @@ -1,7 +1,7 @@ #ifndef XRPL_BASICS_BYTEUTILITIES_H_INCLUDED #define XRPL_BASICS_BYTEUTILITIES_H_INCLUDED -namespace ripple { +namespace xrpl { template constexpr auto @@ -19,6 +19,6 @@ megabytes(T value) noexcept static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048"); static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728"); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/CompressionAlgorithms.h b/include/xrpl/basics/CompressionAlgorithms.h index 77747e1684..b373ac4605 100644 --- a/include/xrpl/basics/CompressionAlgorithms.h +++ b/include/xrpl/basics/CompressionAlgorithms.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace compression_algorithms { @@ -144,6 +144,6 @@ lz4Decompress( } // namespace compression_algorithms -} // namespace ripple +} // namespace xrpl #endif // XRPL_COMPRESSIONALGORITHMS_H_INCLUDED diff --git a/include/xrpl/basics/CountedObject.h b/include/xrpl/basics/CountedObject.h index d3a4f53caa..e464e470af 100644 --- a/include/xrpl/basics/CountedObject.h +++ b/include/xrpl/basics/CountedObject.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Manages all counted object types. */ class CountedObjects @@ -133,6 +133,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/DecayingSample.h b/include/xrpl/basics/DecayingSample.h index 78a50e9df2..c5e38d2e9a 100644 --- a/include/xrpl/basics/DecayingSample.h +++ b/include/xrpl/basics/DecayingSample.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Sampling function using exponential decay to provide a continuous value. @tparam The number of seconds in the decay window. @@ -131,6 +131,6 @@ private: time_point when_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Expected.h b/include/xrpl/basics/Expected.h index 8f3d026d9c..8cf479c1b6 100644 --- a/include/xrpl/basics/Expected.h +++ b/include/xrpl/basics/Expected.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** Expected is an approximation of std::expected (hoped for in C++23) @@ -232,6 +232,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_EXPECTED_H_INCLUDED diff --git a/include/xrpl/basics/FileUtilities.h b/include/xrpl/basics/FileUtilities.h index 8fb1368bfd..c4bc2cbe68 100644 --- a/include/xrpl/basics/FileUtilities.h +++ b/include/xrpl/basics/FileUtilities.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { std::string getFileContents( @@ -20,6 +20,6 @@ writeFileContents( boost::filesystem::path const& destPath, std::string const& contents); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/IntrusivePointer.h b/include/xrpl/basics/IntrusivePointer.h index 9e34c901f3..24521b95a7 100644 --- a/include/xrpl/basics/IntrusivePointer.h +++ b/include/xrpl/basics/IntrusivePointer.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { //------------------------------------------------------------------------------ @@ -492,5 +492,5 @@ dynamic_pointer_cast(TT const& v) return SharedPtr(DynamicCastTagSharedIntrusive{}, v); } } // namespace intr_ptr -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/IntrusivePointer.ipp b/include/xrpl/basics/IntrusivePointer.ipp index 7b0787634c..cfebb559fd 100644 --- a/include/xrpl/basics/IntrusivePointer.ipp +++ b/include/xrpl/basics/IntrusivePointer.ipp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { template template @@ -608,7 +608,7 @@ SharedWeakUnion::convertToStrong() [[maybe_unused]] auto action = p->releaseWeakRef(); XRPL_ASSERT( (action == ReleaseWeakRefAction::noop), - "ripple::SharedWeakUnion::convertToStrong : " + "xrpl::SharedWeakUnion::convertToStrong : " "action is noop"); unsafeSetRawPtr(p, RefStrength::strong); return true; @@ -637,7 +637,7 @@ SharedWeakUnion::convertToWeak() // We just added a weak ref. How could we destroy? // LCOV_EXCL_START UNREACHABLE( - "ripple::SharedWeakUnion::convertToWeak : destroying freshly " + "xrpl::SharedWeakUnion::convertToWeak : destroying freshly " "added ref"); delete p; unsafeSetRawPtr(nullptr); @@ -719,5 +719,5 @@ SharedWeakUnion::unsafeReleaseNoStore() } } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/IntrusiveRefCounts.h b/include/xrpl/basics/IntrusiveRefCounts.h index 653d149843..630c08395d 100644 --- a/include/xrpl/basics/IntrusiveRefCounts.h +++ b/include/xrpl/basics/IntrusiveRefCounts.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Action to perform when releasing a strong pointer. @@ -34,7 +34,7 @@ enum class ReleaseWeakRefAction { noop, destroy }; /** Implement the strong count, weak count, and bit flags for an intrusive pointer. - A class can satisfy the requirements of a ripple::IntrusivePointer by + A class can satisfy the requirements of a xrpl::IntrusivePointer by inheriting from this class. */ struct IntrusiveRefCounts @@ -257,7 +257,7 @@ IntrusiveRefCounts::releaseStrongRef() const RefCountPair const prevVal{prevIntVal}; XRPL_ASSERT( (prevVal.strong >= strongDelta), - "ripple::IntrusiveRefCounts::releaseStrongRef : previous ref " + "xrpl::IntrusiveRefCounts::releaseStrongRef : previous ref " "higher than new"); auto nextIntVal = prevIntVal - strongDelta; ReleaseStrongRefAction action = noop; @@ -282,7 +282,7 @@ IntrusiveRefCounts::releaseStrongRef() const // twice. XRPL_ASSERT( (action == noop) || !(prevIntVal & partialDestroyStartedMask), - "ripple::IntrusiveRefCounts::releaseStrongRef : not in partial " + "xrpl::IntrusiveRefCounts::releaseStrongRef : not in partial " "destroy"); return action; } @@ -314,7 +314,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const // can't happen twice. XRPL_ASSERT( (!prevVal.partialDestroyStartedBit), - "ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not in " + "xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not in " "partial destroy"); auto nextIntVal = prevIntVal + delta; @@ -336,7 +336,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const { XRPL_ASSERT( (!(prevIntVal & partialDestroyStartedMask)), - "ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not " + "xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not " "started partial destroy"); return action; } @@ -408,11 +408,11 @@ inline IntrusiveRefCounts::~IntrusiveRefCounts() noexcept auto v = refCounts.load(std::memory_order_acquire); XRPL_ASSERT( (!(v & valueMask)), - "ripple::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero"); + "xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero"); auto t = v & tagMask; XRPL_ASSERT( (!t || t == tagMask), - "ripple::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag"); + "xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag"); #endif } @@ -427,7 +427,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair( { XRPL_ASSERT( (strong < checkStrongMaxValue && weak < checkWeakMaxValue), - "ripple::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside " + "xrpl::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside " "range"); } @@ -438,7 +438,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair( { XRPL_ASSERT( (strong < checkStrongMaxValue && weak < checkWeakMaxValue), - "ripple::IntrusiveRefCounts::RefCountPair(CountType, CountType) : " + "xrpl::IntrusiveRefCounts::RefCountPair(CountType, CountType) : " "inputs inside range"); } @@ -447,7 +447,7 @@ IntrusiveRefCounts::RefCountPair::combinedValue() const noexcept { XRPL_ASSERT( (strong < checkStrongMaxValue && weak < checkWeakMaxValue), - "ripple::IntrusiveRefCounts::RefCountPair::combinedValue : inputs " + "xrpl::IntrusiveRefCounts::RefCountPair::combinedValue : inputs " "inside range"); return (static_cast(weak) << IntrusiveRefCounts::StrongCountNumBits) | @@ -465,7 +465,7 @@ partialDestructorFinished(T** o) XRPL_ASSERT( (!p.partialDestroyFinishedBit && p.partialDestroyStartedBit && !p.strong), - "ripple::partialDestructorFinished : not a weak ref"); + "xrpl::partialDestructorFinished : not a weak ref"); if (!p.weak) { // There was a weak count before the partial destructor ran (or we would @@ -479,5 +479,5 @@ partialDestructorFinished(T** o) } //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/KeyCache.h b/include/xrpl/basics/KeyCache.h index 1ab908256f..038bf7b9b7 100644 --- a/include/xrpl/basics/KeyCache.h +++ b/include/xrpl/basics/KeyCache.h @@ -4,10 +4,10 @@ #include #include -namespace ripple { +namespace xrpl { using KeyCache = TaggedCache; -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_KEYCACHE_H diff --git a/include/xrpl/basics/LocalValue.h b/include/xrpl/basics/LocalValue.h index 56026231ac..cc7c646fb0 100644 --- a/include/xrpl/basics/LocalValue.h +++ b/include/xrpl/basics/LocalValue.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -109,6 +109,6 @@ LocalValue::operator*() .emplace(this, std::make_unique>(t_)) .first->second->get()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Log.h b/include/xrpl/basics/Log.h index 134f1695d3..9443e8afdf 100644 --- a/include/xrpl/basics/Log.h +++ b/include/xrpl/basics/Log.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { // DEPRECATED use beast::severities::Severity instead enum LogSeverity { @@ -271,6 +271,6 @@ setDebugLogSink(std::unique_ptr sink); beast::Journal debugLog(); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/MathUtilities.h b/include/xrpl/basics/MathUtilities.h index 99d99a15cd..bd8ea883fb 100644 --- a/include/xrpl/basics/MathUtilities.h +++ b/include/xrpl/basics/MathUtilities.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Calculate one number divided by another number in percentage. * The result is rounded up to the next integer, and capped in the range [0,100] @@ -44,6 +44,6 @@ static_assert(calculatePercent(50'000'000, 100'000'000) == 50); static_assert(calculatePercent(50'000'001, 100'000'000) == 51); static_assert(calculatePercent(99'999'999, 100'000'000) == 100); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index 4a4ee1cacb..4420530239 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Number; @@ -402,6 +402,6 @@ public: operator=(NumberRoundModeGuard const&) = delete; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_NUMBER_H_INCLUDED diff --git a/include/xrpl/basics/README.md b/include/xrpl/basics/README.md index 290bb7ad0c..f8b19522cd 100644 --- a/include/xrpl/basics/README.md +++ b/include/xrpl/basics/README.md @@ -21,11 +21,11 @@ ripple/basic should contain no dependencies on other modules. - `std::set` - For sorted containers. -- `ripple::hash_set` +- `xrpl::hash_set` - Where inserts and contains need to be O(1). - For "small" sets, `std::set` might be faster and smaller. -- `ripple::hardened_hash_set` +- `xrpl::hardened_hash_set` - For data sets where the key could be manipulated by an attacker in an attempt to mount an algorithmic complexity attack: see http://en.wikipedia.org/wiki/Algorithmic_complexity_attack @@ -33,5 +33,5 @@ ripple/basic should contain no dependencies on other modules. The following container is deprecated - `std::unordered_set` -- Use `ripple::hash_set` instead, which uses a better hashing algorithm. -- Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks. +- Use `xrpl::hash_set` instead, which uses a better hashing algorithm. +- Or use `xrpl::hardened_hash_set` to prevent algorithmic complexity attacks. diff --git a/include/xrpl/basics/RangeSet.h b/include/xrpl/basics/RangeSet.h index a77c5b403e..ee95577271 100644 --- a/include/xrpl/basics/RangeSet.h +++ b/include/xrpl/basics/RangeSet.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A closed interval over the domain T. @@ -85,7 +85,7 @@ to_string(RangeSet const& rs) std::string s; for (auto const& interval : rs) - s += ripple::to_string(interval) + ","; + s += xrpl::to_string(interval) + ","; s.pop_back(); return s; @@ -172,6 +172,6 @@ prevMissing(RangeSet const& rs, T t, T minVal = 0) return boost::icl::last(tgt); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/Resolver.h b/include/xrpl/basics/Resolver.h index fc529887b0..088b2e1d5b 100644 --- a/include/xrpl/basics/Resolver.h +++ b/include/xrpl/basics/Resolver.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Resolver { @@ -47,6 +47,6 @@ public: /** @} */ }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/ResolverAsio.h b/include/xrpl/basics/ResolverAsio.h index b609c11b1b..f2a3da0d58 100644 --- a/include/xrpl/basics/ResolverAsio.h +++ b/include/xrpl/basics/ResolverAsio.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { class ResolverAsio : public Resolver { @@ -17,6 +17,6 @@ public: New(boost::asio::io_context&, beast::Journal); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/SHAMapHash.h b/include/xrpl/basics/SHAMapHash.h index 12aef37dd0..eb635b516c 100644 --- a/include/xrpl/basics/SHAMapHash.h +++ b/include/xrpl/basics/SHAMapHash.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { // A SHAMapHash is the hash of a node in a SHAMap, and also the // type of the hash of the entire SHAMap. @@ -97,6 +97,6 @@ extract(SHAMapHash const& key) return *reinterpret_cast(key.as_uint256().data()); } -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_SHAMAP_HASH_H_INCLUDED diff --git a/include/xrpl/basics/SharedWeakCachePointer.h b/include/xrpl/basics/SharedWeakCachePointer.h index dbac85a2a9..49369265eb 100644 --- a/include/xrpl/basics/SharedWeakCachePointer.h +++ b/include/xrpl/basics/SharedWeakCachePointer.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A combination of a std::shared_ptr and a std::weak_pointer. @@ -112,5 +112,5 @@ public: private: std::variant, std::weak_ptr> combo_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/SharedWeakCachePointer.ipp b/include/xrpl/basics/SharedWeakCachePointer.ipp index 59f5882637..376bf73251 100644 --- a/include/xrpl/basics/SharedWeakCachePointer.ipp +++ b/include/xrpl/basics/SharedWeakCachePointer.ipp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { template SharedWeakCachePointer::SharedWeakCachePointer( SharedWeakCachePointer const& rhs) = default; @@ -169,5 +169,5 @@ SharedWeakCachePointer::convertToWeak() return false; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/SlabAllocator.h b/include/xrpl/basics/SlabAllocator.h index d27616ecdd..c67d1ee318 100644 --- a/include/xrpl/basics/SlabAllocator.h +++ b/include/xrpl/basics/SlabAllocator.h @@ -22,7 +22,7 @@ #include #endif -namespace ripple { +namespace xrpl { template class SlabAllocator @@ -128,7 +128,7 @@ class SlabAllocator { XRPL_ASSERT( own(ptr), - "ripple::SlabAllocator::SlabBlock::deallocate : own input"); + "xrpl::SlabAllocator::SlabBlock::deallocate : own input"); std::lock_guard l(m_); @@ -173,7 +173,7 @@ public: { XRPL_ASSERT( (itemAlignment_ & (itemAlignment_ - 1)) == 0, - "ripple::SlabAllocator::SlabAllocator : valid alignment"); + "xrpl::SlabAllocator::SlabAllocator : valid alignment"); } SlabAllocator(SlabAllocator const& other) = delete; @@ -285,7 +285,7 @@ public: { XRPL_ASSERT( ptr, - "ripple::SlabAllocator::SlabAllocator::deallocate : non-null " + "xrpl::SlabAllocator::SlabAllocator::deallocate : non-null " "input"); for (auto slab = slabs_.load(); slab != nullptr; slab = slab->next_) @@ -419,6 +419,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_SLABALLOCATOR_H_INCLUDED diff --git a/include/xrpl/basics/Slice.h b/include/xrpl/basics/Slice.h index 7733acab8e..aa98b0a358 100644 --- a/include/xrpl/basics/Slice.h +++ b/include/xrpl/basics/Slice.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { /** An immutable linear range of bytes. @@ -87,7 +87,7 @@ public: { XRPL_ASSERT( i < size_, - "ripple::Slice::operator[](std::size_t) const : valid input"); + "xrpl::Slice::operator[](std::size_t) const : valid input"); return data_[i]; } @@ -243,6 +243,6 @@ makeSlice(std::basic_string const& s) return Slice(s.data(), s.size()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/StringUtilities.h b/include/xrpl/basics/StringUtilities.h index a38107909a..ebe07e43bc 100644 --- a/include/xrpl/basics/StringUtilities.h +++ b/include/xrpl/basics/StringUtilities.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Format arbitrary binary data as an SQLite "blob literal". @@ -132,6 +132,6 @@ to_uint64(std::string const& s); bool isProperlyFormedTomlDomain(std::string_view domain); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/TaggedCache.h b/include/xrpl/basics/TaggedCache.h index 77b8b3c6d4..c1d4d26800 100644 --- a/include/xrpl/basics/TaggedCache.h +++ b/include/xrpl/basics/TaggedCache.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Map/cache combination. This class implements a cache and a map. The cache keeps objects alive @@ -315,6 +315,6 @@ private: std::uint64_t m_misses; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/TaggedCache.ipp b/include/xrpl/basics/TaggedCache.ipp index 558198883c..5114479921 100644 --- a/include/xrpl/basics/TaggedCache.ipp +++ b/include/xrpl/basics/TaggedCache.ipp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { template < class Key, @@ -1005,6 +1005,6 @@ TaggedCache< }); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/ToString.h b/include/xrpl/basics/ToString.h index dc6903aa8a..fe3a6a0893 100644 --- a/include/xrpl/basics/ToString.h +++ b/include/xrpl/basics/ToString.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** to_string() generalizes std::to_string to handle bools, chars, and strings. @@ -43,6 +43,6 @@ to_string(char const* s) return s; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/UnorderedContainers.h b/include/xrpl/basics/UnorderedContainers.h index 3b847e4fbb..fdd2518b1e 100644 --- a/include/xrpl/basics/UnorderedContainers.h +++ b/include/xrpl/basics/UnorderedContainers.h @@ -22,7 +22,7 @@ * what container it is. */ -namespace ripple { +namespace xrpl { // hash containers @@ -102,6 +102,6 @@ template < using hardened_hash_multiset = std::unordered_multiset; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/UptimeClock.h b/include/xrpl/basics/UptimeClock.h index 36f4897663..9e1ef10d19 100644 --- a/include/xrpl/basics/UptimeClock.h +++ b/include/xrpl/basics/UptimeClock.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Tracks program uptime to seconds precision. @@ -45,6 +45,6 @@ private: start_clock(); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/algorithm.h b/include/xrpl/basics/algorithm.h index ad59e9c282..d62ff17a75 100644 --- a/include/xrpl/basics/algorithm.h +++ b/include/xrpl/basics/algorithm.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // Requires: [first1, last1) and [first2, last2) are ordered ranges according to // comp. @@ -95,6 +95,6 @@ remove_if_intersect_or_match( return first1; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/base64.h b/include/xrpl/basics/base64.h index 0aa19e9e61..340e282f87 100644 --- a/include/xrpl/basics/base64.h +++ b/include/xrpl/basics/base64.h @@ -38,7 +38,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string base64_encode(std::uint8_t const* data, std::size_t len); @@ -53,6 +53,6 @@ base64_encode(std::string const& s) std::string base64_decode(std::string_view data); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 4be4b35af3..a1ed223674 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -23,7 +23,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -275,7 +275,7 @@ public: { XRPL_ASSERT( c.size() * sizeof(typename Container::value_type) == size(), - "ripple::base_uint::base_uint(Container auto) : input size match"); + "xrpl::base_uint::base_uint(Container auto) : input size match"); std::memcpy(data_.data(), c.data(), size()); } @@ -288,7 +288,7 @@ public: { XRPL_ASSERT( c.size() * sizeof(typename Container::value_type) == size(), - "ripple::base_uint::operator=(Container auto) : input size match"); + "xrpl::base_uint::operator=(Container auto) : input size match"); std::memcpy(data_.data(), c.data(), size()); return *this; } @@ -648,12 +648,12 @@ static_assert(sizeof(uint192) == 192 / 8, "There should be no padding bytes"); static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes"); #endif -} // namespace ripple +} // namespace xrpl namespace beast { template -struct is_uniquely_represented> +struct is_uniquely_represented> : public std::true_type { explicit is_uniquely_represented() = default; diff --git a/include/xrpl/basics/chrono.h b/include/xrpl/basics/chrono.h index 46b36ffb57..e343e8b49f 100644 --- a/include/xrpl/basics/chrono.h +++ b/include/xrpl/basics/chrono.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { // A few handy aliases @@ -104,6 +104,6 @@ stopwatch() return beast::get_abstract_clock(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/comparators.h b/include/xrpl/basics/comparators.h index 4858a0ad74..7c848f0b3b 100644 --- a/include/xrpl/basics/comparators.h +++ b/include/xrpl/basics/comparators.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { #ifdef _MSC_VER @@ -52,6 +52,6 @@ using equal_to = std::equal_to; #endif -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/contract.h b/include/xrpl/basics/contract.h index a0409ee6d7..63d1bb5a84 100644 --- a/include/xrpl/basics/contract.h +++ b/include/xrpl/basics/contract.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /* Programming By Contract @@ -52,6 +52,6 @@ Throw(Args&&... args) [[noreturn]] void LogicError(std::string const& how) noexcept; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/hardened_hash.h b/include/xrpl/basics/hardened_hash.h index c21cd48053..a25dcb3c34 100644 --- a/include/xrpl/basics/hardened_hash.h +++ b/include/xrpl/basics/hardened_hash.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -92,6 +92,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/join.h b/include/xrpl/basics/join.h index a4a537d6d0..79f716ec43 100644 --- a/include/xrpl/basics/join.h +++ b/include/xrpl/basics/join.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { template Stream& @@ -85,6 +85,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/make_SSLContext.h b/include/xrpl/basics/make_SSLContext.h index 6e25cfcac1..fb91dd40a9 100644 --- a/include/xrpl/basics/make_SSLContext.h +++ b/include/xrpl/basics/make_SSLContext.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Create a self-signed SSL context that allows anonymous Diffie Hellman. */ std::shared_ptr @@ -19,6 +19,6 @@ make_SSLContextAuthed( std::string const& chainFile, std::string const& cipherList); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/mulDiv.h b/include/xrpl/basics/mulDiv.h index 0ac9bb5ebc..fb38d0cd63 100644 --- a/include/xrpl/basics/mulDiv.h +++ b/include/xrpl/basics/mulDiv.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { auto constexpr muldiv_max = std::numeric_limits::max(); /** Return value*mul/div accurately. @@ -21,6 +21,6 @@ auto constexpr muldiv_max = std::numeric_limits::max(); std::optional mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index 01872963fd..518686c533 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { template static std::size_t @@ -242,7 +242,7 @@ public: map_.resize(partitions_); XRPL_ASSERT( partitions_, - "ripple::partitioned_unordered_map::partitioned_unordered_map : " + "xrpl::partitioned_unordered_map::partitioned_unordered_map : " "nonzero partitions"); } @@ -401,6 +401,6 @@ private: mutable partition_map_type map_{}; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index 19f8b57285..737b8fef59 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { #ifndef __INTELLISENSE__ static_assert( @@ -95,7 +95,7 @@ std::enable_if_t< Integral> rand_int(Engine& engine, Integral min, Integral max) { - XRPL_ASSERT(max > min, "ripple::rand_int : max over min inputs"); + XRPL_ASSERT(max > min, "xrpl::rand_int : max over min inputs"); // This should have no state and constructing it should // be very cheap. If that turns out not to be the case @@ -186,6 +186,6 @@ rand_bool() } /** @} */ -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_RANDOM_H_INCLUDED diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index 1da44920ac..89de0eda6a 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // safe_cast adds compile-time checks to a static_cast to ensure that // the destination can hold all values of the source. This is particularly @@ -80,6 +80,6 @@ inline constexpr std:: return unsafe_cast(static_cast>(s)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/scope.h b/include/xrpl/basics/scope.h index 710b31ec80..b7299a28fc 100644 --- a/include/xrpl/basics/scope.h +++ b/include/xrpl/basics/scope.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { // RAII scope helpers. As specified in Library Fundamental, Version 3 // Basic design of idea: https://www.youtube.com/watch?v=WjTrfoiB0MQ @@ -218,7 +218,7 @@ public: { XRPL_ASSERT( plock->owns_lock(), - "ripple::scope_unlock::scope_unlock : mutex must be locked"); + "xrpl::scope_unlock::scope_unlock : mutex must be locked"); plock->unlock(); } @@ -236,6 +236,6 @@ public: template scope_unlock(std::unique_lock&) -> scope_unlock; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/spinlock.h b/include/xrpl/basics/spinlock.h index 9ae7b0bb70..71ab29f381 100644 --- a/include/xrpl/basics/spinlock.h +++ b/include/xrpl/basics/spinlock.h @@ -13,7 +13,7 @@ #include #endif -namespace ripple { +namespace xrpl { namespace detail { /** Inform the processor that we are in a tight spin-wait loop. @@ -105,7 +105,7 @@ public: { XRPL_ASSERT( index >= 0 && (mask_ != 0), - "ripple::packed_spinlock::packed_spinlock : valid index and mask"); + "xrpl::packed_spinlock::packed_spinlock : valid index and mask"); } [[nodiscard]] bool @@ -206,6 +206,6 @@ public: }; /** @} */ -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/strHex.h b/include/xrpl/basics/strHex.h index bfba76003e..1c1d94bf32 100644 --- a/include/xrpl/basics/strHex.h +++ b/include/xrpl/basics/strHex.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { template std::string @@ -28,6 +28,6 @@ strHex(T const& from) return strHex(from.begin(), from.end()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/basics/tagged_integer.h b/include/xrpl/basics/tagged_integer.h index 1ad5279469..1d40b31cce 100644 --- a/include/xrpl/basics/tagged_integer.h +++ b/include/xrpl/basics/tagged_integer.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A type-safe wrap around standard integral types @@ -197,11 +197,11 @@ public: } }; -} // namespace ripple +} // namespace xrpl namespace beast { template -struct is_contiguously_hashable, HashAlgorithm> +struct is_contiguously_hashable, HashAlgorithm> : public is_contiguously_hashable { explicit is_contiguously_hashable() = default; diff --git a/include/xrpl/core/ClosureCounter.h b/include/xrpl/core/ClosureCounter.h index 6050e32618..d2be76fa8c 100644 --- a/include/xrpl/core/ClosureCounter.h +++ b/include/xrpl/core/ClosureCounter.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * The role of a `ClosureCounter` is to assist in shutdown by letting callers @@ -202,6 +202,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_CORE_CLOSURE_COUNTER_H_INCLUDED diff --git a/include/xrpl/core/Coro.ipp b/include/xrpl/core/Coro.ipp index 8e14e88592..9f73d80647 100644 --- a/include/xrpl/core/Coro.ipp +++ b/include/xrpl/core/Coro.ipp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { template JobQueue::Coro::Coro( @@ -34,7 +34,7 @@ JobQueue::Coro::Coro( inline JobQueue::Coro::~Coro() { #ifndef NDEBUG - XRPL_ASSERT(finished_, "ripple::JobQueue::Coro::~Coro : is finished"); + XRPL_ASSERT(finished_, "xrpl::JobQueue::Coro::~Coro : is finished"); #endif } @@ -85,8 +85,7 @@ JobQueue::Coro::resume() detail::getLocalValues().reset(&lvs_); std::lock_guard lock(mutex_); XRPL_ASSERT( - static_cast(coro_), - "ripple::JobQueue::Coro::resume : is runnable"); + static_cast(coro_), "xrpl::JobQueue::Coro::resume : is runnable"); coro_(); detail::getLocalValues().release(); detail::getLocalValues().reset(saved); @@ -129,6 +128,6 @@ JobQueue::Coro::join() cv_.wait(lk, [this]() { return running_ == false; }); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/Job.h b/include/xrpl/core/Job.h index 35d42cfd0b..cb597b3860 100644 --- a/include/xrpl/core/Job.h +++ b/include/xrpl/core/Job.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { // Note that this queue should only be used for CPU-bound jobs // It is primarily intended for signature checking @@ -131,6 +131,6 @@ private: using JobCounter = ClosureCounter; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/JobQueue.h b/include/xrpl/core/JobQueue.h index f8b727471b..2a22b7f5c9 100644 --- a/include/xrpl/core/JobQueue.h +++ b/include/xrpl/core/JobQueue.h @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { namespace perf { class PerfLog; @@ -382,11 +382,11 @@ private: lock is released which only happens after the coroutine completes. */ -} // namespace ripple +} // namespace xrpl #include -namespace ripple { +namespace xrpl { template std::shared_ptr @@ -408,6 +408,6 @@ JobQueue::postCoro(JobType t, std::string const& name, F&& f) return coro; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/JobTypeData.h b/include/xrpl/core/JobTypeData.h index eb678d1a9a..377309aa3c 100644 --- a/include/xrpl/core/JobTypeData.h +++ b/include/xrpl/core/JobTypeData.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { struct JobTypeData { @@ -83,6 +83,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/JobTypeInfo.h b/include/xrpl/core/JobTypeInfo.h index 09c644fc23..a726fb276b 100644 --- a/include/xrpl/core/JobTypeInfo.h +++ b/include/xrpl/core/JobTypeInfo.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Holds all the 'static' information about a job, which does not change */ class JobTypeInfo @@ -78,6 +78,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/JobTypes.h b/include/xrpl/core/JobTypes.h index d8e7b23bdf..f7952ca9a2 100644 --- a/include/xrpl/core/JobTypes.h +++ b/include/xrpl/core/JobTypes.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class JobTypes { @@ -35,7 +35,7 @@ private: std::chrono::milliseconds peakLatency) { XRPL_ASSERT( m_map.find(jt) == m_map.end(), - "ripple::JobTypes::JobTypes::add : unique job type input"); + "xrpl::JobTypes::JobTypes::add : unique job type input"); [[maybe_unused]] auto const inserted = m_map @@ -48,7 +48,7 @@ private: XRPL_ASSERT( inserted == true, - "ripple::JobTypes::JobTypes::add : input is inserted"); + "xrpl::JobTypes::JobTypes::add : input is inserted"); }; // clang-format off @@ -122,7 +122,7 @@ public: get(JobType jt) const { Map::const_iterator const iter(m_map.find(jt)); - XRPL_ASSERT(iter != m_map.end(), "ripple::JobTypes::get : valid input"); + XRPL_ASSERT(iter != m_map.end(), "xrpl::JobTypes::get : valid input"); if (iter != m_map.end()) return iter->second; @@ -170,6 +170,6 @@ public: Map m_map; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/LoadEvent.h b/include/xrpl/core/LoadEvent.h index b6cd0ab500..8422fe883e 100644 --- a/include/xrpl/core/LoadEvent.h +++ b/include/xrpl/core/LoadEvent.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class LoadMonitor; @@ -65,6 +65,6 @@ private: std::chrono::steady_clock::duration timeRunning_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/LoadMonitor.h b/include/xrpl/core/LoadMonitor.h index 539a4a0b99..54cd607d5b 100644 --- a/include/xrpl/core/LoadMonitor.h +++ b/include/xrpl/core/LoadMonitor.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { // Monitors load levels and response times @@ -67,6 +67,6 @@ private: beast::Journal const j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/PerfLog.h b/include/xrpl/core/PerfLog.h index c74608d82a..eb009de433 100644 --- a/include/xrpl/core/PerfLog.h +++ b/include/xrpl/core/PerfLog.h @@ -17,7 +17,7 @@ namespace beast { class Journal; } -namespace ripple { +namespace xrpl { class Application; namespace perf { @@ -187,6 +187,6 @@ measureDurationAndLog( } } // namespace perf -} // namespace ripple +} // namespace xrpl #endif // XRPL_CORE_PERFLOG_H diff --git a/include/xrpl/core/detail/Workers.h b/include/xrpl/core/detail/Workers.h index 5877638722..3a77f9e769 100644 --- a/include/xrpl/core/detail/Workers.h +++ b/include/xrpl/core/detail/Workers.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace perf { class PerfLog; @@ -214,6 +214,6 @@ private: m_paused; // holds just paused workers }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/core/detail/semaphore.h b/include/xrpl/core/detail/semaphore.h index 8b784e3685..4249b3b860 100644 --- a/include/xrpl/core/detail/semaphore.h +++ b/include/xrpl/core/detail/semaphore.h @@ -1,6 +1,6 @@ /** * - * TODO: Remove ripple::basic_semaphore (and this file) and use + * TODO: Remove xrpl::basic_semaphore (and this file) and use * std::counting_semaphore. * * Background: @@ -32,7 +32,7 @@ #include #include -namespace ripple { +namespace xrpl { template class basic_semaphore @@ -87,6 +87,6 @@ public: using semaphore = basic_semaphore; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/crypto/RFC1751.h b/include/xrpl/crypto/RFC1751.h index 14c49d7fa9..a413c2ac8a 100644 --- a/include/xrpl/crypto/RFC1751.h +++ b/include/xrpl/crypto/RFC1751.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class RFC1751 { @@ -42,6 +42,6 @@ private: static char const* s_dictionary[]; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/crypto/csprng.h b/include/xrpl/crypto/csprng.h index cc5545750d..dc89da4f61 100644 --- a/include/xrpl/crypto/csprng.h +++ b/include/xrpl/crypto/csprng.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** A cryptographically secure random number engine @@ -70,6 +70,6 @@ public: csprng_engine& crypto_prng(); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/crypto/secure_erase.h b/include/xrpl/crypto/secure_erase.h index 586a8e50e6..3ecde0c7fa 100644 --- a/include/xrpl/crypto/secure_erase.h +++ b/include/xrpl/crypto/secure_erase.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Attempts to clear the given blob of memory. @@ -22,6 +22,6 @@ namespace ripple { void secure_erase(void* dest, std::size_t bytes); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/json/JsonPropertyStream.h b/include/xrpl/json/JsonPropertyStream.h index a7fe52dfb8..54cfcbfa04 100644 --- a/include/xrpl/json/JsonPropertyStream.h +++ b/include/xrpl/json/JsonPropertyStream.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A PropertyStream::Sink which produces a Json::Value of type objectValue. */ class JsonPropertyStream : public beast::PropertyStream @@ -66,6 +66,6 @@ protected: add(std::string const& v) override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/json/Writer.h b/include/xrpl/json/Writer.h index 12599a14d3..ab52427a5b 100644 --- a/include/xrpl/json/Writer.h +++ b/include/xrpl/json/Writer.h @@ -234,7 +234,7 @@ inline void check(bool condition, std::string const& message) { if (!condition) - ripple::Throw(message); + xrpl::Throw(message); } } // namespace Json diff --git a/include/xrpl/json/detail/json_assert.h b/include/xrpl/json/detail/json_assert.h index bd111ad90f..3092b65452 100644 --- a/include/xrpl/json/detail/json_assert.h +++ b/include/xrpl/json/detail/json_assert.h @@ -6,6 +6,6 @@ #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) \ - ripple::Throw(message); + xrpl::Throw(message); #endif diff --git a/include/xrpl/json/json_value.h b/include/xrpl/json/json_value.h index c14d5d5127..2e38f2e75e 100644 --- a/include/xrpl/json/json_value.h +++ b/include/xrpl/json/json_value.h @@ -199,7 +199,7 @@ public: Value(UInt value); Value(double value); Value(char const* value); - Value(ripple::Number const& value); + Value(xrpl::Number const& value); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for @@ -430,7 +430,7 @@ private: }; inline Value -to_json(ripple::Number const& number) +to_json(xrpl::Number const& number) { return to_string(number); } diff --git a/include/xrpl/ledger/ApplyView.h b/include/xrpl/ledger/ApplyView.h index 5e283641da..393af2a7fd 100644 --- a/include/xrpl/ledger/ApplyView.h +++ b/include/xrpl/ledger/ApplyView.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { enum ApplyFlags : std::uint32_t { tapNONE = 0x00, @@ -267,7 +267,7 @@ public: { // LCOV_EXCL_START UNREACHABLE( - "ripple::ApplyView::dirAppend : only Offers are appended to " + "xrpl::ApplyView::dirAppend : only Offers are appended to " "book directories"); // Only Offers are appended to book directories. Call dirInsert() // instead @@ -407,6 +407,6 @@ insertPage( std::function const&)> const& describe); } // namespace directory -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/ApplyViewImpl.h b/include/xrpl/ledger/ApplyViewImpl.h index c1e9ccd359..0c11726135 100644 --- a/include/xrpl/ledger/ApplyViewImpl.h +++ b/include/xrpl/ledger/ApplyViewImpl.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Editable, discardable view that can build metadata for one tx. @@ -75,6 +75,6 @@ private: std::optional deliver_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/BookDirs.h b/include/xrpl/ledger/BookDirs.h index 1019d02f52..daa1ef172a 100644 --- a/include/xrpl/ledger/BookDirs.h +++ b/include/xrpl/ledger/BookDirs.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class BookDirs { @@ -89,6 +89,6 @@ private: static beast::Journal j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/CachedSLEs.h b/include/xrpl/ledger/CachedSLEs.h index 0bec37f233..b478b78b7d 100644 --- a/include/xrpl/ledger/CachedSLEs.h +++ b/include/xrpl/ledger/CachedSLEs.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { using CachedSLEs = TaggedCache; } diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index b78c046f58..c1d66ecfc9 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -164,6 +164,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/CredentialHelpers.h b/include/xrpl/ledger/CredentialHelpers.h index 42376846ae..52ddfe33aa 100644 --- a/include/xrpl/ledger/CredentialHelpers.h +++ b/include/xrpl/ledger/CredentialHelpers.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace credentials { // These function will be used by the code that use DepositPreauth / Credentials @@ -93,6 +93,6 @@ verifyDepositPreauth( std::shared_ptr const& sleDst, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/Dir.h b/include/xrpl/ledger/Dir.h index b421ac85e6..4b7327a015 100644 --- a/include/xrpl/ledger/Dir.h +++ b/include/xrpl/ledger/Dir.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A class that simplifies iterating ledger directory pages @@ -108,6 +108,6 @@ private: std::vector::const_iterator it_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index 2b4bd8a31f..bd90dbef18 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Open ledger construction tag. @@ -252,6 +252,6 @@ public: std::shared_ptr const& metaData) override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/PaymentSandbox.h b/include/xrpl/ledger/PaymentSandbox.h index 03f1ec2d00..e1d197380d 100644 --- a/include/xrpl/ledger/PaymentSandbox.h +++ b/include/xrpl/ledger/PaymentSandbox.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -188,6 +188,6 @@ private: PaymentSandbox const* ps_ = nullptr; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/RawView.h b/include/xrpl/ledger/RawView.h index 94668b42a1..c0e81fb833 100644 --- a/include/xrpl/ledger/RawView.h +++ b/include/xrpl/ledger/RawView.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Interface for ledger entry changes. @@ -87,6 +87,6 @@ public: std::shared_ptr const& metaData) = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/ReadView.h b/include/xrpl/ledger/ReadView.h index 70a5fbc006..d2b6796ec9 100644 --- a/include/xrpl/ledger/ReadView.h +++ b/include/xrpl/ledger/ReadView.h @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { //------------------------------------------------------------------------------ @@ -258,7 +258,7 @@ makeRulesGivenLedger( DigestAwareReadView const& ledger, std::unordered_set> const& presets); -} // namespace ripple +} // namespace xrpl #include diff --git a/include/xrpl/ledger/Sandbox.h b/include/xrpl/ledger/Sandbox.h index 9c341c15c4..1e4a816529 100644 --- a/include/xrpl/ledger/Sandbox.h +++ b/include/xrpl/ledger/Sandbox.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Discardable, editable view to a ledger. @@ -39,6 +39,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/View.h b/include/xrpl/ledger/View.h index fc16d53e61..767622596b 100644 --- a/include/xrpl/ledger/View.h +++ b/include/xrpl/ledger/View.h @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { enum class WaiveTransferFee : bool { No = false, Yes }; enum class SkipEntry : bool { No = false, Yes }; @@ -1197,6 +1197,6 @@ sharesToAssetsWithdraw( bool after(NetClock::time_point now, std::uint32_t mark); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/detail/ApplyStateTable.h b/include/xrpl/ledger/detail/ApplyStateTable.h index 887e2e7770..f5ec0c9f51 100644 --- a/include/xrpl/ledger/detail/ApplyStateTable.h +++ b/include/xrpl/ledger/detail/ApplyStateTable.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { // Helper class that buffers modifications @@ -139,6 +139,6 @@ private: }; } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index a75f94ac16..9992d73ad1 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { class ApplyViewBase : public ApplyView, public RawView @@ -106,6 +106,6 @@ protected: }; } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/detail/RawStateTable.h b/include/xrpl/ledger/detail/RawStateTable.h index b89e6e58a9..19d2882a63 100644 --- a/include/xrpl/ledger/detail/RawStateTable.h +++ b/include/xrpl/ledger/detail/RawStateTable.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { // Helper class that buffers raw modifications @@ -118,6 +118,6 @@ private: }; } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/detail/ReadViewFwdRange.h b/include/xrpl/ledger/detail/ReadViewFwdRange.h index 66984c8665..557bba4987 100644 --- a/include/xrpl/ledger/detail/ReadViewFwdRange.h +++ b/include/xrpl/ledger/detail/ReadViewFwdRange.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class ReadView; @@ -130,6 +130,6 @@ protected: }; } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/ledger/detail/ReadViewFwdRange.ipp b/include/xrpl/ledger/detail/ReadViewFwdRange.ipp index 451d612486..e86246133a 100644 --- a/include/xrpl/ledger/detail/ReadViewFwdRange.ipp +++ b/include/xrpl/ledger/detail/ReadViewFwdRange.ipp @@ -1,7 +1,7 @@ #ifndef XRPL_LEDGER_READVIEWFWDRANGEINL_H_INCLUDED #define XRPL_LEDGER_READVIEWFWDRANGEINL_H_INCLUDED -namespace ripple { +namespace xrpl { namespace detail { template @@ -63,7 +63,7 @@ ReadViewFwdRange::iterator::operator==(iterator const& other) const { XRPL_ASSERT( view_ == other.view_, - "ripple::detail::ReadViewFwdRange::iterator::operator==(iterator) " + "xrpl::detail::ReadViewFwdRange::iterator::operator==(iterator) " "const : input view match"); if (impl_ != nullptr && other.impl_ != nullptr) @@ -115,6 +115,6 @@ ReadViewFwdRange::iterator::operator++(int) -> iterator } } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/net/AutoSocket.h b/include/xrpl/net/AutoSocket.h index 7cdef5ddd1..2fcba5780c 100644 --- a/include/xrpl/net/AutoSocket.h +++ b/include/xrpl/net/AutoSocket.h @@ -269,7 +269,7 @@ protected: error_code const& ec, size_t bytesTransferred) { - using namespace ripple; + using namespace xrpl; if (ec) { diff --git a/include/xrpl/net/HTTPClient.h b/include/xrpl/net/HTTPClient.h index fc0d416f02..6e4d4ce685 100644 --- a/include/xrpl/net/HTTPClient.h +++ b/include/xrpl/net/HTTPClient.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Provides an asynchronous HTTP client implementation with optional SSL. */ @@ -75,6 +75,6 @@ public: beast::Journal& j); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/net/HTTPClientSSLContext.h b/include/xrpl/net/HTTPClientSSLContext.h index a22ee839b8..b8dfbd3e09 100644 --- a/include/xrpl/net/HTTPClientSSLContext.h +++ b/include/xrpl/net/HTTPClientSSLContext.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { class HTTPClientSSLContext { @@ -176,6 +176,6 @@ private: bool const verify_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/net/RegisterSSLCerts.h b/include/xrpl/net/RegisterSSLCerts.h index 5b0879fe4d..f9b865c3aa 100644 --- a/include/xrpl/net/RegisterSSLCerts.h +++ b/include/xrpl/net/RegisterSSLCerts.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Register default SSL certificates. Register the system default SSL root certificates. On linux/mac, @@ -19,6 +19,6 @@ registerSSLCerts( boost::system::error_code&, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Backend.h b/include/xrpl/nodestore/Backend.h index 741145c9c9..0ea8835f61 100644 --- a/include/xrpl/nodestore/Backend.h +++ b/include/xrpl/nodestore/Backend.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** A backend used for the NodeStore. @@ -143,6 +143,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Database.h b/include/xrpl/nodestore/Database.h index b27bccf0f1..474f873876 100644 --- a/include/xrpl/nodestore/Database.h +++ b/include/xrpl/nodestore/Database.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -230,7 +230,7 @@ protected: { XRPL_ASSERT( count <= sz, - "ripple::NodeStore::Database::storeStats : valid inputs"); + "xrpl::NodeStore::Database::storeStats : valid inputs"); storeCount_ += count; storeSz_ += sz; } @@ -291,6 +291,6 @@ private: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/DatabaseRotating.h b/include/xrpl/nodestore/DatabaseRotating.h index ea4a966dde..85202e7a84 100644 --- a/include/xrpl/nodestore/DatabaseRotating.h +++ b/include/xrpl/nodestore/DatabaseRotating.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { /* This class has two key-value store Backend objects for persisting SHAMap @@ -39,6 +39,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/DummyScheduler.h b/include/xrpl/nodestore/DummyScheduler.h index a8d6fcec18..9ffe5ad80d 100644 --- a/include/xrpl/nodestore/DummyScheduler.h +++ b/include/xrpl/nodestore/DummyScheduler.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** Simple NodeStore Scheduler that just peforms the tasks synchronously. */ @@ -21,6 +21,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Factory.h b/include/xrpl/nodestore/Factory.h index 2309a0bf90..d6d33c4b64 100644 --- a/include/xrpl/nodestore/Factory.h +++ b/include/xrpl/nodestore/Factory.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -61,6 +61,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Manager.h b/include/xrpl/nodestore/Manager.h index 6764967353..fe4b1c614e 100644 --- a/include/xrpl/nodestore/Manager.h +++ b/include/xrpl/nodestore/Manager.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -83,6 +83,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/NodeObject.h b/include/xrpl/nodestore/NodeObject.h index 6e4eae2c81..6a69245fd2 100644 --- a/include/xrpl/nodestore/NodeObject.h +++ b/include/xrpl/nodestore/NodeObject.h @@ -7,7 +7,7 @@ // VFALCO NOTE Intentionally not in the NodeStore namespace -namespace ripple { +namespace xrpl { /** The types of node objects. */ enum NodeObjectType : std::uint32_t { @@ -81,6 +81,6 @@ private: Blob const mData; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Scheduler.h b/include/xrpl/nodestore/Scheduler.h index b9a9f8b5f4..0835e08fa2 100644 --- a/include/xrpl/nodestore/Scheduler.h +++ b/include/xrpl/nodestore/Scheduler.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { enum class FetchType { synchronous, async }; @@ -66,6 +66,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Task.h b/include/xrpl/nodestore/Task.h index 44b28ec9c6..bd21e61975 100644 --- a/include/xrpl/nodestore/Task.h +++ b/include/xrpl/nodestore/Task.h @@ -1,7 +1,7 @@ #ifndef XRPL_NODESTORE_TASK_H_INCLUDED #define XRPL_NODESTORE_TASK_H_INCLUDED -namespace ripple { +namespace xrpl { namespace NodeStore { /** Derived classes perform scheduled tasks. */ @@ -17,6 +17,6 @@ struct Task }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/Types.h b/include/xrpl/nodestore/Types.h index 38481c14e8..6763196860 100644 --- a/include/xrpl/nodestore/Types.h +++ b/include/xrpl/nodestore/Types.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { enum { @@ -37,6 +37,6 @@ using Batch = std::vector>; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/BatchWriter.h b/include/xrpl/nodestore/detail/BatchWriter.h index 3776029c25..f1faf0a612 100644 --- a/include/xrpl/nodestore/detail/BatchWriter.h +++ b/include/xrpl/nodestore/detail/BatchWriter.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** Batch-writing assist logic. @@ -78,6 +78,6 @@ private: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/DatabaseNodeImp.h b/include/xrpl/nodestore/detail/DatabaseNodeImp.h index b70fbf640b..bf222129cc 100644 --- a/include/xrpl/nodestore/detail/DatabaseNodeImp.h +++ b/include/xrpl/nodestore/detail/DatabaseNodeImp.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { class DatabaseNodeImp : public Database @@ -59,7 +59,7 @@ public: XRPL_ASSERT( backend_, - "ripple::NodeStore::DatabaseNodeImp::DatabaseNodeImp : non-null " + "xrpl::NodeStore::DatabaseNodeImp::DatabaseNodeImp : non-null " "backend"); } @@ -138,6 +138,6 @@ private: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h index 847bc08dbc..63d628a30a 100644 --- a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h +++ b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { class DatabaseRotatingImp : public DatabaseRotating @@ -79,6 +79,6 @@ private: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/DecodedBlob.h b/include/xrpl/nodestore/detail/DecodedBlob.h index ed39bab39c..0eaa169269 100644 --- a/include/xrpl/nodestore/detail/DecodedBlob.h +++ b/include/xrpl/nodestore/detail/DecodedBlob.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** Parsed key/value blob into NodeObject components. @@ -43,6 +43,6 @@ private: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/EncodedBlob.h b/include/xrpl/nodestore/detail/EncodedBlob.h index 64442bf8c6..2cd35a7b6f 100644 --- a/include/xrpl/nodestore/detail/EncodedBlob.h +++ b/include/xrpl/nodestore/detail/EncodedBlob.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** Convert a NodeObject from in-memory to database format. @@ -64,7 +64,7 @@ public: : size_([&obj]() { XRPL_ASSERT( obj, - "ripple::NodeStore::EncodedBlob::EncodedBlob : non-null input"); + "xrpl::NodeStore::EncodedBlob::EncodedBlob : non-null input"); if (!obj) throw std::runtime_error( @@ -87,7 +87,7 @@ public: XRPL_ASSERT( ((ptr_ == payload_.data()) && (size_ <= payload_.size())) || ((ptr_ != payload_.data()) && (size_ > payload_.size())), - "ripple::NodeStore::EncodedBlob::~EncodedBlob : valid payload " + "xrpl::NodeStore::EncodedBlob::~EncodedBlob : valid payload " "pointer"); if (ptr_ != payload_.data()) @@ -114,6 +114,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/ManagerImp.h b/include/xrpl/nodestore/detail/ManagerImp.h index 139ca903c2..fd3de8a7ca 100644 --- a/include/xrpl/nodestore/detail/ManagerImp.h +++ b/include/xrpl/nodestore/detail/ManagerImp.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -50,6 +50,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/codec.h b/include/xrpl/nodestore/detail/codec.h index f3e80c5a6a..e02d3963bd 100644 --- a/include/xrpl/nodestore/detail/codec.h +++ b/include/xrpl/nodestore/detail/codec.h @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { template @@ -322,6 +322,6 @@ filter_inner(void* in, std::size_t in_size) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/nodestore/detail/varint.h b/include/xrpl/nodestore/detail/varint.h index a8f19d0871..7cf9fbaf4b 100644 --- a/include/xrpl/nodestore/detail/varint.h +++ b/include/xrpl/nodestore/detail/varint.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { // This is a variant of the base128 varint format from @@ -118,6 +118,6 @@ write(nudb::detail::ostream& os, std::size_t t) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/AMMCore.h b/include/xrpl/protocol/AMMCore.h index a55ae5490d..e259089367 100644 --- a/include/xrpl/protocol/AMMCore.h +++ b/include/xrpl/protocol/AMMCore.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { std::uint16_t constexpr TRADING_FEE_THRESHOLD = 1000; // 1% @@ -102,6 +102,6 @@ feeMultHalf(std::uint16_t tfee) return 1 - getFee(tfee) / 2; } -} // namespace ripple +} // namespace xrpl #endif // XRPL_PROTOCOL_AMMCORE_H_INCLUDED diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index ddf044e2aa..d61938e2a7 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -103,15 +103,15 @@ operator<<(std::ostream& os, AccountID const& x) void initAccountIdCache(std::size_t count); -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ namespace Json { template <> -inline ripple::AccountID -getOrThrow(Json::Value const& v, ripple::SField const& field) +inline xrpl::AccountID +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; std::string const b58 = getOrThrow(v, field); if (auto const r = parseBase58(b58)) @@ -127,7 +127,7 @@ namespace std { // DEPRECATED // VFALCO Use beast::uhash or a hardened container template <> -struct hash : ripple::AccountID::hasher +struct hash : xrpl::AccountID::hasher { hash() = default; }; diff --git a/include/xrpl/protocol/AmountConversions.h b/include/xrpl/protocol/AmountConversions.h index 3c870ed4b1..195e373fa0 100644 --- a/include/xrpl/protocol/AmountConversions.h +++ b/include/xrpl/protocol/AmountConversions.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { inline STAmount toSTAmount(IOUAmount const& iou, Issue const& iss) @@ -35,8 +35,7 @@ inline STAmount toSTAmount(XRPAmount const& xrp, Issue const& iss) { XRPL_ASSERT( - isXRP(iss.account) && isXRP(iss.currency), - "ripple::toSTAmount : is XRP"); + isXRP(iss.account) && isXRP(iss.currency), "xrpl::toSTAmount : is XRP"); return toSTAmount(xrp); } @@ -57,12 +56,12 @@ toAmount(STAmount const& amt) { XRPL_ASSERT( amt.mantissa() < std::numeric_limits::max(), - "ripple::toAmount : maximum mantissa"); + "xrpl::toAmount : maximum mantissa"); bool const isNeg = amt.negative(); std::int64_t const sMant = isNeg ? -std::int64_t(amt.mantissa()) : amt.mantissa(); - XRPL_ASSERT(!isXRP(amt), "ripple::toAmount : is not XRP"); + XRPL_ASSERT(!isXRP(amt), "xrpl::toAmount : is not XRP"); return IOUAmount(sMant, amt.exponent()); } @@ -72,12 +71,12 @@ toAmount(STAmount const& amt) { XRPL_ASSERT( amt.mantissa() < std::numeric_limits::max(), - "ripple::toAmount : maximum mantissa"); + "xrpl::toAmount : maximum mantissa"); bool const isNeg = amt.negative(); std::int64_t const sMant = isNeg ? -std::int64_t(amt.mantissa()) : amt.mantissa(); - XRPL_ASSERT(isXRP(amt), "ripple::toAmount : is XRP"); + XRPL_ASSERT(isXRP(amt), "xrpl::toAmount : is XRP"); return XRPAmount(sMant); } @@ -196,6 +195,6 @@ get(STAmount const& a) } } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index d83884008d..b2ee64621e 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * API version numbers used in later API versions @@ -64,7 +64,7 @@ setVersion(JsonObject& parent, unsigned int apiVersion, bool betaEnabled) { XRPL_ASSERT( apiVersion != apiInvalidVersion, - "ripple::RPC::setVersion : input is valid"); + "xrpl::RPC::setVersion : input is valid"); auto& retObj = addObject(parent, jss::version); if (apiVersion == apiVersionIfUnspecified) @@ -167,6 +167,6 @@ forAllApiVersions(Fn const& fn, Args&&... args) RPC::apiMaximumValidVersion>(fn, std::forward(args)...); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Asset.h b/include/xrpl/protocol/Asset.h index 7ad1e70256..b72c20d82c 100644 --- a/include/xrpl/protocol/Asset.h +++ b/include/xrpl/protocol/Asset.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Asset; class STAmount; @@ -233,6 +233,6 @@ validJSONAsset(Json::Value const& jv); Asset assetFromJson(Json::Value const& jv); -} // namespace ripple +} // namespace xrpl #endif // XRPL_PROTOCOL_ASSET_H_INCLUDED diff --git a/include/xrpl/protocol/Batch.h b/include/xrpl/protocol/Batch.h index 73dd15e6e2..1404c8069f 100644 --- a/include/xrpl/protocol/Batch.h +++ b/include/xrpl/protocol/Batch.h @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { inline void serializeBatch( @@ -17,4 +17,4 @@ serializeBatch( msg.addBitString(txid); } -} // namespace ripple +} // namespace xrpl diff --git a/include/xrpl/protocol/Book.h b/include/xrpl/protocol/Book.h index cbc6e862b8..ddd315de30 100644 --- a/include/xrpl/protocol/Book.h +++ b/include/xrpl/protocol/Book.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** Specifies an order book. The order book is a pair of Issues called in and out. @@ -87,28 +87,28 @@ operator<=>(Book const& lhs, Book const& rhs) } /** @} */ -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ namespace std { template <> -struct hash - : private boost::base_from_member, 0>, - private boost::base_from_member, 1> +struct hash + : private boost::base_from_member, 0>, + private boost::base_from_member, 1> { private: using currency_hash_type = - boost::base_from_member, 0>; + boost::base_from_member, 0>; using issuer_hash_type = - boost::base_from_member, 1>; + boost::base_from_member, 1>; public: hash() = default; using value_type = std::size_t; - using argument_type = ripple::Issue; + using argument_type = xrpl::Issue; value_type operator()(argument_type const& value) const @@ -124,11 +124,11 @@ public: //------------------------------------------------------------------------------ template <> -struct hash +struct hash { private: - using issue_hasher = std::hash; - using uint256_hasher = ripple::uint256::hasher; + using issue_hasher = std::hash; + using uint256_hasher = xrpl::uint256::hasher; issue_hasher m_issue_hasher; uint256_hasher m_uint256_hasher; @@ -137,7 +137,7 @@ public: hash() = default; using value_type = std::size_t; - using argument_type = ripple::Book; + using argument_type = xrpl::Book; value_type operator()(argument_type const& value) const @@ -159,21 +159,21 @@ public: namespace boost { template <> -struct hash : std::hash +struct hash : std::hash { hash() = default; - using Base = std::hash; + using Base = std::hash; // VFALCO NOTE broken in vs2012 // using Base::Base; // inherit ctors }; template <> -struct hash : std::hash +struct hash : std::hash { hash() = default; - using Base = std::hash; + using Base = std::hash; // VFALCO NOTE broken in vs2012 // using Base::Base; // inherit ctors }; diff --git a/include/xrpl/protocol/BuildInfo.h b/include/xrpl/protocol/BuildInfo.h index 8e692f7ca4..0b75f8b0a1 100644 --- a/include/xrpl/protocol/BuildInfo.h +++ b/include/xrpl/protocol/BuildInfo.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Versioning information for this build. */ // VFALCO The namespace is deprecated @@ -79,6 +79,6 @@ isNewerVersion(std::uint64_t version); } // namespace BuildInfo -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/ErrorCodes.h b/include/xrpl/protocol/ErrorCodes.h index 709a26093d..8d5d871aa1 100644 --- a/include/xrpl/protocol/ErrorCodes.h +++ b/include/xrpl/protocol/ErrorCodes.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { // VFALCO NOTE These are outside the RPC namespace @@ -360,6 +360,6 @@ error_code_http_status(error_code_i code); std::string rpcErrorString(Json::Value const& jv); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index 193f0665dc..317bde3ee6 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -63,7 +63,7 @@ * */ -namespace ripple { +namespace xrpl { enum class VoteBehavior : int { Obsolete = -1, DefaultNo = 0, DefaultYes }; enum class AmendmentSupport : int { Retired = -1, Supported = 0, Unsupported }; @@ -177,7 +177,7 @@ public: { XRPL_ASSERT( b.count() == count(), - "ripple::FeatureBitset::FeatureBitset(base) : count match"); + "xrpl::FeatureBitset::FeatureBitset(base) : count match"); } template @@ -186,7 +186,7 @@ public: initFromFeatures(f, std::forward(fs)...); XRPL_ASSERT( count() == (sizeof...(fs) + 1), - "ripple::FeatureBitset::FeatureBitset(uint256) : count and " + "xrpl::FeatureBitset::FeatureBitset(uint256) : count and " "sizeof... do match"); } @@ -197,7 +197,7 @@ public: set(featureToBitsetIndex(f)); XRPL_ASSERT( fs.size() == count(), - "ripple::FeatureBitset::FeatureBitset(Container auto) : count and " + "xrpl::FeatureBitset::FeatureBitset(Container auto) : count and " "size do match"); } @@ -365,6 +365,6 @@ foreachFeature(FeatureBitset bs, F&& f) #undef XRPL_FEATURE #pragma pop_macro("XRPL_FEATURE") -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Fees.h b/include/xrpl/protocol/Fees.h index 43ba6c9552..8c7cb51777 100644 --- a/include/xrpl/protocol/Fees.h +++ b/include/xrpl/protocol/Fees.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Reflects the fee settings for a particular ledger. @@ -33,6 +33,6 @@ struct Fees } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/HashPrefix.h b/include/xrpl/protocol/HashPrefix.h index 8c0cb53b5d..77529e9212 100644 --- a/include/xrpl/protocol/HashPrefix.h +++ b/include/xrpl/protocol/HashPrefix.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -82,6 +82,6 @@ hash_append(Hasher& h, HashPrefix const& hp) noexcept hash_append(h, static_cast(hp)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/IOUAmount.h b/include/xrpl/protocol/IOUAmount.h index da2dbb3fa7..60a61a5825 100644 --- a/include/xrpl/protocol/IOUAmount.h +++ b/include/xrpl/protocol/IOUAmount.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Floating point representation of amounts with high dynamic range @@ -208,6 +208,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Indexes.h b/include/xrpl/protocol/Indexes.h index 69418fbd25..1cb22b4d6c 100644 --- a/include/xrpl/protocol/Indexes.h +++ b/include/xrpl/protocol/Indexes.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { class SeqProxy; /** Keylet computation funclets. @@ -203,7 +203,7 @@ inline Keylet page(Keylet const& root, std::uint64_t index = 0) noexcept { XRPL_ASSERT( - root.type == ltDIR_NODE, "ripple::keylet::page : valid root type"); + root.type == ltDIR_NODE, "xrpl::keylet::page : valid root type"); return page(root.key, index); } /** @} */ @@ -393,6 +393,6 @@ std::array, 6> const directAccountKeylets{ MPTID makeMptID(std::uint32_t sequence, AccountID const& account); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/InnerObjectFormats.h b/include/xrpl/protocol/InnerObjectFormats.h index 36ed515147..6d656d0065 100644 --- a/include/xrpl/protocol/InnerObjectFormats.h +++ b/include/xrpl/protocol/InnerObjectFormats.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Manages the list of known inner object formats. */ @@ -23,6 +23,6 @@ public: findSOTemplateBySField(SField const& sField) const; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Issue.h b/include/xrpl/protocol/Issue.h index c079f6d121..519d7a96f3 100644 --- a/include/xrpl/protocol/Issue.h +++ b/include/xrpl/protocol/Issue.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A currency issued by an account. @see Currency, AccountID, Issue, Book @@ -113,6 +113,6 @@ isXRP(Issue const& issue) return issue.native(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/KeyType.h b/include/xrpl/protocol/KeyType.h index 055c2c1efa..454c88780d 100644 --- a/include/xrpl/protocol/KeyType.h +++ b/include/xrpl/protocol/KeyType.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { enum class KeyType { secp256k1 = 0, @@ -42,6 +42,6 @@ operator<<(Stream& s, KeyType type) return s << to_string(type); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Keylet.h b/include/xrpl/protocol/Keylet.h index 0508287574..4380fdfdac 100644 --- a/include/xrpl/protocol/Keylet.h +++ b/include/xrpl/protocol/Keylet.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class STLedgerEntry; @@ -30,6 +30,6 @@ struct Keylet check(STLedgerEntry const&) const; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/KnownFormats.h b/include/xrpl/protocol/KnownFormats.h index ebb159163f..a928ed52be 100644 --- a/include/xrpl/protocol/KnownFormats.h +++ b/include/xrpl/protocol/KnownFormats.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Manages a list of known formats. @@ -183,6 +183,6 @@ private: boost::container::flat_map types_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/LedgerFormats.h b/include/xrpl/protocol/LedgerFormats.h index 64ae604f64..b52a25af17 100644 --- a/include/xrpl/protocol/LedgerFormats.h +++ b/include/xrpl/protocol/LedgerFormats.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Identifiers for on-ledger objects. @@ -210,6 +210,6 @@ public: getInstance(); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/LedgerHeader.h b/include/xrpl/protocol/LedgerHeader.h index 80a481f7d1..641f794cdb 100644 --- a/include/xrpl/protocol/LedgerHeader.h +++ b/include/xrpl/protocol/LedgerHeader.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Information about the notional ledger backing the view. */ struct LedgerHeader @@ -73,6 +73,6 @@ deserializeHeader(Slice data, bool hasHash = false); LedgerHeader deserializePrefixedHeader(Slice data, bool hasHash = false); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/MPTAmount.h b/include/xrpl/protocol/MPTAmount.h index af14786501..cc9528a923 100644 --- a/include/xrpl/protocol/MPTAmount.h +++ b/include/xrpl/protocol/MPTAmount.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { class MPTAmount : private boost::totally_ordered, private boost::additive, @@ -150,6 +150,6 @@ mulRatio( return MPTAmount(r.convert_to()); } -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_MPTAMOUNT_H_INCLUDED diff --git a/include/xrpl/protocol/MPTIssue.h b/include/xrpl/protocol/MPTIssue.h index b8e184d3cd..b89b59ee0d 100644 --- a/include/xrpl/protocol/MPTIssue.h +++ b/include/xrpl/protocol/MPTIssue.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /* Adapt MPTID to provide the same interface as Issue. Enables using static * polymorphism by Asset and other classes. MPTID is a 192-bit concatenation @@ -77,6 +77,6 @@ to_string(MPTIssue const& mptIssue); MPTIssue mptIssueFromJson(Json::Value const& jv); -} // namespace ripple +} // namespace xrpl #endif // XRPL_PROTOCOL_MPTISSUE_H_INCLUDED diff --git a/include/xrpl/protocol/MultiApiJson.h b/include/xrpl/protocol/MultiApiJson.h index e8738e2f9e..edf19b6f37 100644 --- a/include/xrpl/protocol/MultiApiJson.h +++ b/include/xrpl/protocol/MultiApiJson.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { template @@ -141,7 +141,7 @@ struct MultiApiJson { XRPL_ASSERT( valid(version) && index(version) >= 0 && index(version) < size, - "ripple::detail::MultiApiJson::operator() : valid " + "xrpl::detail::MultiApiJson::operator() : valid " "version"); return std::invoke( fn, @@ -161,7 +161,7 @@ struct MultiApiJson { XRPL_ASSERT( valid(version) && index(version) >= 0 && index(version) < size, - "ripple::detail::MultiApiJson::operator() : valid version"); + "xrpl::detail::MultiApiJson::operator() : valid version"); return std::invoke(fn, json.val[index(version)]); } } visitor = {}; @@ -217,6 +217,6 @@ struct MultiApiJson using MultiApiJson = detail:: MultiApiJson; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/NFTSyntheticSerializer.h b/include/xrpl/protocol/NFTSyntheticSerializer.h index 390d386410..7068ae34cd 100644 --- a/include/xrpl/protocol/NFTSyntheticSerializer.h +++ b/include/xrpl/protocol/NFTSyntheticSerializer.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -24,6 +24,6 @@ insertNFTSyntheticInJson( /** @} */ } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/NFTokenID.h b/include/xrpl/protocol/NFTokenID.h index 762af14d2f..03e30794d0 100644 --- a/include/xrpl/protocol/NFTokenID.h +++ b/include/xrpl/protocol/NFTokenID.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Add a `nftoken_ids` field to the `meta` output parameter. @@ -38,6 +38,6 @@ insertNFTokenID( TxMeta const& transactionMeta); /** @} */ -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/NFTokenOfferID.h b/include/xrpl/protocol/NFTokenOfferID.h index cf6427d201..5663653690 100644 --- a/include/xrpl/protocol/NFTokenOfferID.h +++ b/include/xrpl/protocol/NFTokenOfferID.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Add an `offer_id` field to the `meta` output parameter. @@ -33,6 +33,6 @@ insertNFTokenOfferID( TxMeta const& transactionMeta); /** @} */ -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/PayChan.h b/include/xrpl/protocol/PayChan.h index 5dcaa676a8..ad70913c45 100644 --- a/include/xrpl/protocol/PayChan.h +++ b/include/xrpl/protocol/PayChan.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { inline void serializePayChanAuthorization( @@ -19,6 +19,6 @@ serializePayChanAuthorization( msg.add64(amt.drops()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Permissions.h b/include/xrpl/protocol/Permissions.h index 16ee729fe4..252605e641 100644 --- a/include/xrpl/protocol/Permissions.h +++ b/include/xrpl/protocol/Permissions.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * We have both transaction type permissions and granular type permissions. * Since we will reuse the TransactionFormats to parse the Transaction @@ -83,6 +83,6 @@ public: permissionToTxType(uint32_t const& value) const; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Protocol.h b/include/xrpl/protocol/Protocol.h index ded16cad6d..fb315eace4 100644 --- a/include/xrpl/protocol/Protocol.h +++ b/include/xrpl/protocol/Protocol.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** Protocol specific constants. @@ -297,6 +297,6 @@ std::size_t constexpr permissionMaxSize = 10; /** The maximum number of transactions that can be in a batch. */ std::size_t constexpr maxBatchTxCount = 8; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/PublicKey.h b/include/xrpl/protocol/PublicKey.h index 8d8062408b..51a7683ebc 100644 --- a/include/xrpl/protocol/PublicKey.h +++ b/include/xrpl/protocol/PublicKey.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A public key. @@ -260,16 +260,16 @@ getFingerprint( } return ss.str(); } -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ namespace Json { template <> -inline ripple::PublicKey -getOrThrow(Json::Value const& v, ripple::SField const& field) +inline xrpl::PublicKey +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; std::string const b58 = getOrThrow(v, field); if (auto pubKeyBlob = strUnHex(b58); publicKeyType(makeSlice(*pubKeyBlob))) { diff --git a/include/xrpl/protocol/Quality.h b/include/xrpl/protocol/Quality.h index 0e748e9b26..1fafa5e321 100644 --- a/include/xrpl/protocol/Quality.h +++ b/include/xrpl/protocol/Quality.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents a pair of input and output currencies. @@ -281,7 +281,7 @@ public: { XRPL_ASSERT( q1.m_value > 0 && q2.m_value > 0, - "ripple::Quality::relativeDistance : minimum inputs"); + "xrpl::Quality::relativeDistance : minimum inputs"); if (q1.m_value == q2.m_value) // make expected common case fast return 0; @@ -395,6 +395,6 @@ Quality::ceil_out_strict( Quality composed_quality(Quality const& lhs, Quality const& rhs); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/QualityFunction.h b/include/xrpl/protocol/QualityFunction.h index 8013f0bf7b..b7ec11fa69 100644 --- a/include/xrpl/protocol/QualityFunction.h +++ b/include/xrpl/protocol/QualityFunction.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Average quality of a path as a function of `out`: q(out) = m * out + b, * where m = -1 / poolGets, b = poolPays / poolGets. If CLOB offer then @@ -83,6 +83,6 @@ QualityFunction::QualityFunction( b_ = amounts.out * cfee / amounts.in; } -} // namespace ripple +} // namespace xrpl #endif // XRPL_PROTOCOL_QUALITYFUNCTION_H_INCLUDED diff --git a/include/xrpl/protocol/RPCErr.h b/include/xrpl/protocol/RPCErr.h index 3436384d01..90df1562e7 100644 --- a/include/xrpl/protocol/RPCErr.h +++ b/include/xrpl/protocol/RPCErr.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // VFALCO NOTE these are deprecated bool @@ -11,6 +11,6 @@ isRpcError(Json::Value jvResult); Json::Value rpcError(int iError); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Rate.h b/include/xrpl/protocol/Rate.h index b0c641c499..b8173a9392 100644 --- a/include/xrpl/protocol/Rate.h +++ b/include/xrpl/protocol/Rate.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents a transfer rate @@ -83,6 +83,6 @@ transferFeeAsRate(std::uint16_t fee); /** A transfer rate signifying a 1:1 exchange */ extern Rate const parityRate; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/RippleLedgerHash.h b/include/xrpl/protocol/RippleLedgerHash.h index 4653e1a558..516ab49029 100644 --- a/include/xrpl/protocol/RippleLedgerHash.h +++ b/include/xrpl/protocol/RippleLedgerHash.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { using LedgerHash = uint256; diff --git a/include/xrpl/protocol/Rules.h b/include/xrpl/protocol/Rules.h index 40b84d1d3f..0ae6680d07 100644 --- a/include/xrpl/protocol/Rules.h +++ b/include/xrpl/protocol/Rules.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { bool isFeatureEnabled(uint256 const& feature); @@ -111,5 +111,5 @@ private: std::optional saved_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/SField.h b/include/xrpl/protocol/SField.h index 82619b1ced..b1d353196d 100644 --- a/include/xrpl/protocol/SField.h +++ b/include/xrpl/protocol/SField.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /* @@ -374,6 +374,6 @@ extern SField const sfGeneric; #undef UNTYPED_SFIELD #pragma pop_macro("UNTYPED_SFIELD") -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/SOTemplate.h b/include/xrpl/protocol/SOTemplate.h index 35e3b356be..559117c274 100644 --- a/include/xrpl/protocol/SOTemplate.h +++ b/include/xrpl/protocol/SOTemplate.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Kind of element in each entry of an SOTemplate. */ enum SOEStyle { @@ -154,6 +154,6 @@ private: std::vector indices_; // field num -> index }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STAccount.h b/include/xrpl/protocol/STAccount.h index b981ef91c2..7c193d3425 100644 --- a/include/xrpl/protocol/STAccount.h +++ b/include/xrpl/protocol/STAccount.h @@ -7,14 +7,14 @@ #include -namespace ripple { +namespace xrpl { class STAccount final : public STBase, public CountedObject { private: // The original implementation of STAccount kept the value in an STBlob. // But an STAccount is always 160 bits, so we can store it with less - // overhead in a ripple::uint160. However, so the serialized format of the + // overhead in a xrpl::uint160. However, so the serialized format of the // STAccount stays unchanged, we serialize and deserialize like an STBlob. AccountID value_; bool default_; @@ -112,6 +112,6 @@ operator<(AccountID const& lhs, STAccount const& rhs) return lhs < rhs.value(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index 3ea45cc05b..79cbf51436 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { // Internal form: // 1: If amount is zero, then value is zero and offset is -100 @@ -347,7 +347,7 @@ STAmount::STAmount( // mValue is uint64, but needs to fit in the range of int64 XRPL_ASSERT( mValue <= std::numeric_limits::max(), - "ripple::STAmount::STAmount(SField, A, std::uint64_t, int, bool) : " + "xrpl::STAmount::STAmount(SField, A, std::uint64_t, int, bool) : " "maximum mantissa input"); canonicalize(); } @@ -748,15 +748,15 @@ canAdd(STAmount const& amt1, STAmount const& amt2); bool canSubtract(STAmount const& amt1, STAmount const& amt2); -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ namespace Json { template <> -inline ripple::STAmount -getOrThrow(Json::Value const& v, ripple::SField const& field) +inline xrpl::STAmount +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; Json::StaticString const& key = field.getJsonName(); if (!v.isMember(key)) Throw(key); diff --git a/include/xrpl/protocol/STArray.h b/include/xrpl/protocol/STArray.h index 88d2b04511..fb37e07226 100644 --- a/include/xrpl/protocol/STArray.h +++ b/include/xrpl/protocol/STArray.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class STArray final : public STBase, public CountedObject { @@ -291,6 +291,6 @@ STArray::erase(const_iterator first, const_iterator last) return v_.erase(first, last); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STBase.h b/include/xrpl/protocol/STBase.h index 64bd4f7ab8..f100b52426 100644 --- a/include/xrpl/protocol/STBase.h +++ b/include/xrpl/protocol/STBase.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { /// Note, should be treated as flags that can be | and & struct JsonOptions @@ -219,6 +219,6 @@ STBase::emplace(std::size_t n, void* buf, T&& val) return new (buf) U(std::forward(val)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STBitString.h b/include/xrpl/protocol/STBitString.h index 10c6fd95a0..2d26fe4bd7 100644 --- a/include/xrpl/protocol/STBitString.h +++ b/include/xrpl/protocol/STBitString.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { // The template parameter could be an unsigned type, however there's a bug in // gdb (last checked in gdb 12.1) that prevents gdb from finding the RTTI @@ -152,10 +152,10 @@ void STBitString::add(Serializer& s) const { XRPL_ASSERT( - getFName().isBinary(), "ripple::STBitString::add : field is binary"); + getFName().isBinary(), "xrpl::STBitString::add : field is binary"); XRPL_ASSERT( getFName().fieldType == getSType(), - "ripple::STBitString::add : field type match"); + "xrpl::STBitString::add : field type match"); s.addBitString(value_); } @@ -187,6 +187,6 @@ STBitString::isDefault() const return value_ == beast::zero; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STBlob.h b/include/xrpl/protocol/STBlob.h index 46b91d6ebb..dc3f95e218 100644 --- a/include/xrpl/protocol/STBlob.h +++ b/include/xrpl/protocol/STBlob.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { // variable length byte string class STBlob : public STBase, public CountedObject @@ -126,6 +126,6 @@ STBlob::setValue(Buffer&& b) value_ = std::move(b); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STCurrency.h b/include/xrpl/protocol/STCurrency.h index acb0e40019..1c59d48beb 100644 --- a/include/xrpl/protocol/STCurrency.h +++ b/include/xrpl/protocol/STCurrency.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class STCurrency final : public STBase { @@ -114,6 +114,6 @@ operator<(STCurrency const& lhs, Currency const& rhs) return lhs.currency() < rhs; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STExchange.h b/include/xrpl/protocol/STExchange.h index 771f6bd109..5f7e405599 100644 --- a/include/xrpl/protocol/STExchange.h +++ b/include/xrpl/protocol/STExchange.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Convert between serialized type U and C++ type T. */ template @@ -155,6 +155,6 @@ erase(STObject& st, TypedField const& f) st.makeFieldAbsent(f); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STInteger.h b/include/xrpl/protocol/STInteger.h index 7513733e47..9c8af4c08c 100644 --- a/include/xrpl/protocol/STInteger.h +++ b/include/xrpl/protocol/STInteger.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { template class STInteger : public STBase, public CountedObject> @@ -54,7 +54,7 @@ private: STBase* move(std::size_t n, void* buf) override; - friend class ripple::detail::STVar; + friend class xrpl::detail::STVar; }; using STUInt8 = STInteger; @@ -94,10 +94,10 @@ inline void STInteger::add(Serializer& s) const { XRPL_ASSERT( - getFName().isBinary(), "ripple::STInteger::add : field is binary"); + getFName().isBinary(), "xrpl::STInteger::add : field is binary"); XRPL_ASSERT( getFName().fieldType == getSType(), - "ripple::STInteger::add : field type match"); + "xrpl::STInteger::add : field type match"); s.addInteger(value_); } @@ -144,6 +144,6 @@ inline STInteger::operator Integer() const return value_; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STIssue.h b/include/xrpl/protocol/STIssue.h index 4f8509710c..6480482d08 100644 --- a/include/xrpl/protocol/STIssue.h +++ b/include/xrpl/protocol/STIssue.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class STIssue final : public STBase, CountedObject { @@ -150,6 +150,6 @@ operator<=>(STIssue const& lhs, Asset const& rhs) return lhs.asset_ <=> rhs; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STLedgerEntry.h b/include/xrpl/protocol/STLedgerEntry.h index 20a5ceda54..83e0f2cd27 100644 --- a/include/xrpl/protocol/STLedgerEntry.h +++ b/include/xrpl/protocol/STLedgerEntry.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class Rules; namespace test { @@ -108,6 +108,6 @@ STLedgerEntry::getType() const return type_; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STNumber.h b/include/xrpl/protocol/STNumber.h index 2ec3d66fd1..dfdb16af93 100644 --- a/include/xrpl/protocol/STNumber.h +++ b/include/xrpl/protocol/STNumber.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** * A serializable number. @@ -84,6 +84,6 @@ partsFromString(std::string const& number); STNumber numberFromJson(SField const& field, Json::Value const& value); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index 1a553e0fbf..c6ca133e89 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { class STArray; @@ -772,7 +772,7 @@ STObject::Proxy::assign(U&& u) t = dynamic_cast(st_->getPField(*f_, true)); else t = dynamic_cast(st_->makeFieldPresent(*f_)); - XRPL_ASSERT(t, "ripple::STObject::Proxy::assign : type cast succeeded"); + XRPL_ASSERT(t, "xrpl::STObject::Proxy::assign : type cast succeeded"); *t = std::forward(u); } @@ -1064,18 +1064,17 @@ STObject::at(TypedField const& f) const return u->value(); XRPL_ASSERT( - mType, - "ripple::STObject::at(TypedField auto) : field template non-null"); + mType, "xrpl::STObject::at(TypedField auto) : field template non-null"); XRPL_ASSERT( b->getSType() == STI_NOTPRESENT, - "ripple::STObject::at(TypedField auto) : type not present"); + "xrpl::STObject::at(TypedField auto) : type not present"); if (mType->style(f) == soeOPTIONAL) Throw("Missing optional field: " + f.getName()); XRPL_ASSERT( mType->style(f) == soeDEFAULT, - "ripple::STObject::at(TypedField auto) : template style is default"); + "xrpl::STObject::at(TypedField auto) : template style is default"); // Used to help handle the case where value_type is a const reference, // otherwise we would return the address of a temporary. @@ -1095,16 +1094,16 @@ STObject::at(OptionaledField const& of) const { XRPL_ASSERT( mType, - "ripple::STObject::at(OptionaledField auto) : field template " + "xrpl::STObject::at(OptionaledField auto) : field template " "non-null"); XRPL_ASSERT( b->getSType() == STI_NOTPRESENT, - "ripple::STObject::at(OptionaledField auto) : type not present"); + "xrpl::STObject::at(OptionaledField auto) : type not present"); if (mType->style(*of.f) == soeOPTIONAL) return std::nullopt; XRPL_ASSERT( mType->style(*of.f) == soeDEFAULT, - "ripple::STObject::at(OptionaledField auto) : template style is " + "xrpl::STObject::at(OptionaledField auto) : template style is " "default"); return typename T::value_type{}; } @@ -1264,6 +1263,6 @@ STObject::peekField(SField const& field) return *cf; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STParsedJSON.h b/include/xrpl/protocol/STParsedJSON.h index 9bc8524f11..4be10840bd 100644 --- a/include/xrpl/protocol/STParsedJSON.h +++ b/include/xrpl/protocol/STParsedJSON.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Holds the serialized result of parsing an input JSON object. This does validation and checking on the provided JSON. @@ -35,6 +35,6 @@ public: Json::Value error; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STPathSet.h b/include/xrpl/protocol/STPathSet.h index 4b16e9cb1f..cb7db2edf0 100644 --- a/include/xrpl/protocol/STPathSet.h +++ b/include/xrpl/protocol/STPathSet.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { class STPathElement final : public CountedObject { @@ -241,7 +241,7 @@ inline STPathElement::STPathElement( mType |= typeAccount; XRPL_ASSERT( mAccountID != noAccount(), - "ripple::STPathElement::STPathElement : account is set"); + "xrpl::STPathElement::STPathElement : account is set"); } if (currency) @@ -256,7 +256,7 @@ inline STPathElement::STPathElement( mType |= typeIssuer; XRPL_ASSERT( mIssuerID != noAccount(), - "ripple::STPathElement::STPathElement : issuer is set"); + "xrpl::STPathElement::STPathElement : issuer is set"); } hash_value_ = get_hash(*this); @@ -504,6 +504,6 @@ STPathSet::emplace_back(Args&&... args) value.emplace_back(std::forward(args)...); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STTx.h b/include/xrpl/protocol/STTx.h index 02f865e349..182e13433d 100644 --- a/include/xrpl/protocol/STTx.h +++ b/include/xrpl/protocol/STTx.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { enum TxnSql : char { txnSqlNew = 'N', @@ -201,6 +201,6 @@ STTx::getTransactionID() const return tid_; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STValidation.h b/include/xrpl/protocol/STValidation.h index 07aef8316c..4d09397eaa 100644 --- a/include/xrpl/protocol/STValidation.h +++ b/include/xrpl/protocol/STValidation.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { // Validation flags @@ -175,7 +175,7 @@ STValidation::STValidation( XRPL_ASSERT( nodeID_.isNonZero(), - "ripple::STValidation::STValidation(SerialIter) : nonzero node"); + "xrpl::STValidation::STValidation(SerialIter) : nonzero node"); } /** Construct, sign and trust a new STValidation issued by this node. @@ -200,7 +200,7 @@ STValidation::STValidation( { XRPL_ASSERT( nodeID_.isNonZero(), - "ripple::STValidation::STValidation(PublicKey, SecretKey) : nonzero " + "xrpl::STValidation::STValidation(PublicKey, SecretKey) : nonzero " "node"); // First, set our own public key: @@ -267,6 +267,6 @@ STValidation::setSeen(NetClock::time_point s) seenTime_ = s; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STVector256.h b/include/xrpl/protocol/STVector256.h index dc2276a250..94b16db90b 100644 --- a/include/xrpl/protocol/STVector256.h +++ b/include/xrpl/protocol/STVector256.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class STVector256 : public STBase, public CountedObject { @@ -237,6 +237,6 @@ STVector256::clear() noexcept return mValue.clear(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/STXChainBridge.h b/include/xrpl/protocol/STXChainBridge.h index e7e687c2c9..89c6d60c13 100644 --- a/include/xrpl/protocol/STXChainBridge.h +++ b/include/xrpl/protocol/STXChainBridge.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Serializer; class STObject; @@ -212,6 +212,6 @@ STXChainBridge::dstChain(bool wasLockingChainSend) return ChainType::locking; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/SecretKey.h b/include/xrpl/protocol/SecretKey.h index fd36ce1a5b..d5f1ce303f 100644 --- a/include/xrpl/protocol/SecretKey.h +++ b/include/xrpl/protocol/SecretKey.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A secret key. */ class SecretKey @@ -162,6 +162,6 @@ sign(KeyType type, SecretKey const& sk, Slice const& message) } /** @} */ -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Seed.h b/include/xrpl/protocol/Seed.h index cda1a8e018..36b2bbfee3 100644 --- a/include/xrpl/protocol/Seed.h +++ b/include/xrpl/protocol/Seed.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Seeds are used to generate deterministic secret keys. */ class Seed @@ -117,6 +117,6 @@ toBase58(Seed const& seed) return encodeBase58Token(TokenType::FamilySeed, seed.data(), seed.size()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/SeqProxy.h b/include/xrpl/protocol/SeqProxy.h index 8ed2c45289..8dde232e75 100644 --- a/include/xrpl/protocol/SeqProxy.h +++ b/include/xrpl/protocol/SeqProxy.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A type that represents either a sequence value or a ticket value. @@ -146,6 +146,6 @@ public: return os; } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index 44c4498cb7..f46073a977 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { class Serializer { @@ -38,7 +38,7 @@ public: { XRPL_ASSERT( data, - "ripple::Serializer::Serializer(void const*) : non-null input"); + "xrpl::Serializer::Serializer(void const*) : non-null input"); std::memcpy(mData.data(), data, size); } } @@ -314,8 +314,7 @@ Serializer::addVL(Iter begin, Iter end, int len) len -= begin->size(); #endif } - XRPL_ASSERT( - len == 0, "ripple::Serializer::addVL : length matches distance"); + XRPL_ASSERT(len == 0, "xrpl::Serializer::addVL : length matches distance"); return ret; } @@ -453,6 +452,6 @@ SerialIter::getBitString() return base_uint::fromVoid(x); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/Sign.h b/include/xrpl/protocol/Sign.h index 9a27290924..6df4c55b65 100644 --- a/include/xrpl/protocol/Sign.h +++ b/include/xrpl/protocol/Sign.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Sign an STObject @@ -67,6 +67,6 @@ finishMultiSigningData(AccountID const& signingID, Serializer& s) s.addBitString(signingID); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/SystemParameters.h b/include/xrpl/protocol/SystemParameters.h index de78b65265..c0732bc9fe 100644 --- a/include/xrpl/protocol/SystemParameters.h +++ b/include/xrpl/protocol/SystemParameters.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { // Various protocol and system specific constant globals. @@ -60,7 +60,7 @@ constexpr std::ratio<80, 100> amendmentMajorityCalcThreshold; /** The minimum amount of time an amendment must hold a majority */ constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2}; -} // namespace ripple +} // namespace xrpl /** Default peer port (IANA registered) */ inline std::uint16_t constexpr DEFAULT_PEER_PORT{2459}; diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index ad0719dbb1..de2f596127 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { // See https://xrpl.org/transaction-results.html // @@ -685,6 +685,6 @@ transHuman(TER code); std::optional transCode(std::string const& token); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/TxFlags.h b/include/xrpl/protocol/TxFlags.h index d4faed192c..194c4c6af1 100644 --- a/include/xrpl/protocol/TxFlags.h +++ b/include/xrpl/protocol/TxFlags.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Transaction flags. @@ -294,6 +294,6 @@ constexpr std::uint32_t const tfLoanManageMask = ~(tfUniversal | tfLoanDefault | // clang-format on -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/TxFormats.h b/include/xrpl/protocol/TxFormats.h index cf60b5081d..05f03c5cdc 100644 --- a/include/xrpl/protocol/TxFormats.h +++ b/include/xrpl/protocol/TxFormats.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Transaction type identifiers. @@ -76,6 +76,6 @@ public: getInstance(); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/TxMeta.h b/include/xrpl/protocol/TxMeta.h index 3ab58c9d0a..5b6716e380 100644 --- a/include/xrpl/protocol/TxMeta.h +++ b/include/xrpl/protocol/TxMeta.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { class TxMeta { @@ -117,6 +117,6 @@ private: STArray nodes_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/UintTypes.h b/include/xrpl/protocol/UintTypes.h index 480d8640ca..daa66e8286 100644 --- a/include/xrpl/protocol/UintTypes.h +++ b/include/xrpl/protocol/UintTypes.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { class CurrencyTag @@ -96,30 +96,30 @@ operator<<(std::ostream& os, Currency const& x) return os; } -} // namespace ripple +} // namespace xrpl namespace std { template <> -struct hash : ripple::Currency::hasher +struct hash : xrpl::Currency::hasher { hash() = default; }; template <> -struct hash : ripple::NodeID::hasher +struct hash : xrpl::NodeID::hasher { hash() = default; }; template <> -struct hash : ripple::Directory::hasher +struct hash : xrpl::Directory::hasher { hash() = default; }; template <> -struct hash : ripple::uint256::hasher +struct hash : xrpl::uint256::hasher { hash() = default; }; diff --git a/include/xrpl/protocol/Units.h b/include/xrpl/protocol/Units.h index e41f93b5b0..72114ad8fe 100644 --- a/include/xrpl/protocol/Units.h +++ b/include/xrpl/protocol/Units.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace unit { @@ -388,11 +388,10 @@ mulDivU(Source1 value, Dest mul, Source2 div) // split the asserts so if one hits, the user can tell which // without a debugger. XRPL_ASSERT( - value.value() >= 0, "ripple::unit::mulDivU : minimum value input"); + value.value() >= 0, "xrpl::unit::mulDivU : minimum value input"); XRPL_ASSERT( - mul.value() >= 0, "ripple::unit::mulDivU : minimum mul input"); - XRPL_ASSERT( - div.value() > 0, "ripple::unit::mulDivU : minimum div input"); + mul.value() >= 0, "xrpl::unit::mulDivU : minimum mul input"); + XRPL_ASSERT(div.value() > 0, "xrpl::unit::mulDivU : minimum div input"); return std::nullopt; } @@ -532,6 +531,6 @@ unsafe_cast(Src s) noexcept return Dest{unsafe_cast(s)}; } -} // namespace ripple +} // namespace xrpl #endif // PROTOCOL_UNITS_H_INCLUDED diff --git a/include/xrpl/protocol/XChainAttestations.h b/include/xrpl/protocol/XChainAttestations.h index 0b368aaa58..4dc9cfcf6a 100644 --- a/include/xrpl/protocol/XChainAttestations.h +++ b/include/xrpl/protocol/XChainAttestations.h @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Attestations { @@ -478,6 +478,6 @@ class XChainCreateAccountAttestations final using TBase::TBase; }; -} // namespace ripple +} // namespace xrpl #endif // STXCHAINATTESTATIONS_H_ diff --git a/include/xrpl/protocol/XRPAmount.h b/include/xrpl/protocol/XRPAmount.h index e102a3707f..ef283f4154 100644 --- a/include/xrpl/protocol/XRPAmount.h +++ b/include/xrpl/protocol/XRPAmount.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { class XRPAmount : private boost::totally_ordered, private boost::additive, @@ -287,6 +287,6 @@ mulRatio( return XRPAmount(r.convert_to()); } -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_XRPAMOUNT_H_INCLUDED diff --git a/include/xrpl/protocol/detail/STVar.h b/include/xrpl/protocol/detail/STVar.h index 9a8d85717f..540ba2bf77 100644 --- a/include/xrpl/protocol/detail/STVar.h +++ b/include/xrpl/protocol/detail/STVar.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { struct defaultObject_t @@ -162,6 +162,6 @@ operator!=(STVar const& lhs, STVar const& rhs) } } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/detail/b58_utils.h b/include/xrpl/protocol/detail/b58_utils.h index b96e34ebc5..4ea00e6d5e 100644 --- a/include/xrpl/protocol/detail/b58_utils.h +++ b/include/xrpl/protocol/detail/b58_utils.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { template using Result = boost::outcome_v2::result; @@ -112,7 +112,7 @@ inplace_bigint_div_rem(std::span numerator, std::uint64_t divisor) // the a null set of numbers to be zero, so the remainder is also zero. // LCOV_EXCL_START UNREACHABLE( - "ripple::b58_fast::detail::inplace_bigint_div_rem : empty " + "xrpl::b58_fast::detail::inplace_bigint_div_rem : empty " "numerator"); return 0; // LCOV_EXCL_STOP @@ -132,11 +132,11 @@ inplace_bigint_div_rem(std::span numerator, std::uint64_t divisor) unsigned __int128 const r = num - (denom128 * d); XRPL_ASSERT( d >> 64 == 0, - "ripple::b58_fast::detail::inplace_bigint_div_rem::div_rem_64 : " + "xrpl::b58_fast::detail::inplace_bigint_div_rem::div_rem_64 : " "valid division result"); XRPL_ASSERT( r >> 64 == 0, - "ripple::b58_fast::detail::inplace_bigint_div_rem::div_rem_64 : " + "xrpl::b58_fast::detail::inplace_bigint_div_rem::div_rem_64 : " "valid remainder"); return {static_cast(d), static_cast(r)}; }; @@ -163,7 +163,7 @@ b58_10_to_b58_be(std::uint64_t input) 430804206899405824; // 58^10; XRPL_ASSERT( input < B_58_10, - "ripple::b58_fast::detail::b58_10_to_b58_be : valid input"); + "xrpl::b58_fast::detail::b58_10_to_b58_be : valid input"); constexpr std::size_t resultSize = 10; std::array result{}; int i = 0; @@ -181,5 +181,5 @@ b58_10_to_b58_be(std::uint64_t input) } // namespace b58_fast #endif -} // namespace ripple +} // namespace xrpl #endif // XRPL_PROTOCOL_B58_UTILS_H_INCLUDED diff --git a/include/xrpl/protocol/detail/secp256k1.h b/include/xrpl/protocol/detail/secp256k1.h index c93734a539..c3ac76d7ed 100644 --- a/include/xrpl/protocol/detail/secp256k1.h +++ b/include/xrpl/protocol/detail/secp256k1.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { template secp256k1_context const* @@ -27,6 +27,6 @@ secp256k1Context() return h.impl; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/detail/token_errors.h b/include/xrpl/protocol/detail/token_errors.h index a40e992aec..1d5276e78b 100644 --- a/include/xrpl/protocol/detail/token_errors.h +++ b/include/xrpl/protocol/detail/token_errors.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { enum class TokenCodecErrc { success = 0, inputTooLarge, @@ -20,12 +20,12 @@ enum class TokenCodecErrc { namespace std { template <> -struct is_error_code_enum : true_type +struct is_error_code_enum : true_type { }; } // namespace std -namespace ripple { +namespace xrpl { namespace detail { class TokenCodecErrcCategory : public std::error_category { @@ -67,17 +67,17 @@ public: }; } // namespace detail -inline ripple::detail::TokenCodecErrcCategory const& +inline xrpl::detail::TokenCodecErrcCategory const& TokenCodecErrcCategory() { - static ripple::detail::TokenCodecErrcCategory c; + static xrpl::detail::TokenCodecErrcCategory c; return c; } inline std::error_code -make_error_code(ripple::TokenCodecErrc e) +make_error_code(xrpl::TokenCodecErrc e) { return {static_cast(e), TokenCodecErrcCategory()}; } -} // namespace ripple +} // namespace xrpl #endif // TOKEN_ERRORS_H_ diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index c42fe479da..bafac699f5 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { /** Message digest functions used in the codebase @@ -226,6 +226,6 @@ sha512Half_s(Args const&... args) return static_cast(h); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/json_get_or_throw.h b/include/xrpl/protocol/json_get_or_throw.h index 74d1779339..bdf572bed6 100644 --- a/include/xrpl/protocol/json_get_or_throw.h +++ b/include/xrpl/protocol/json_get_or_throw.h @@ -53,16 +53,16 @@ struct JsonTypeMismatchError : std::exception template T -getOrThrow(Json::Value const& v, ripple::SField const& field) +getOrThrow(Json::Value const& v, xrpl::SField const& field) { static_assert(sizeof(T) == -1, "This function must be specialized"); } template <> inline std::string -getOrThrow(Json::Value const& v, ripple::SField const& field) +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; Json::StaticString const& key = field.getJsonName(); if (!v.isMember(key)) Throw(key); @@ -76,9 +76,9 @@ getOrThrow(Json::Value const& v, ripple::SField const& field) // Note, this allows integer numeric fields to act as bools template <> inline bool -getOrThrow(Json::Value const& v, ripple::SField const& field) +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; Json::StaticString const& key = field.getJsonName(); if (!v.isMember(key)) Throw(key); @@ -93,9 +93,9 @@ getOrThrow(Json::Value const& v, ripple::SField const& field) template <> inline std::uint64_t -getOrThrow(Json::Value const& v, ripple::SField const& field) +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; Json::StaticString const& key = field.getJsonName(); if (!v.isMember(key)) Throw(key); @@ -125,10 +125,10 @@ getOrThrow(Json::Value const& v, ripple::SField const& field) } template <> -inline ripple::Buffer -getOrThrow(Json::Value const& v, ripple::SField const& field) +inline xrpl::Buffer +getOrThrow(Json::Value const& v, xrpl::SField const& field) { - using namespace ripple; + using namespace xrpl; std::string const hex = getOrThrow(v, field); if (auto const r = strUnHex(hex)) { @@ -141,7 +141,7 @@ getOrThrow(Json::Value const& v, ripple::SField const& field) // This function may be used by external projects (like the witness server). template std::optional -getOptional(Json::Value const& v, ripple::SField const& field) +getOptional(Json::Value const& v, xrpl::SField const& field) { try { diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index b9a8945d21..d86ca9bf1f 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace jss { // JSON static strings @@ -725,6 +725,6 @@ JSS(write_load); // out: GetCounts #undef JSS } // namespace jss -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/nft.h b/include/xrpl/protocol/nft.h index 2681be4aad..3a8cdcd6e2 100644 --- a/include/xrpl/protocol/nft.h +++ b/include/xrpl/protocol/nft.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace nft { // Separate taxons from regular integers. @@ -104,6 +104,6 @@ getIssuer(uint256 const& id) } } // namespace nft -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/nftPageMask.h b/include/xrpl/protocol/nftPageMask.h index 800899f7a7..4d23e45f53 100644 --- a/include/xrpl/protocol/nftPageMask.h +++ b/include/xrpl/protocol/nftPageMask.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace nft { // NFT directory pages order their contents based only on the low 96 bits of @@ -14,6 +14,6 @@ uint256 constexpr pageMask(std::string_view( "0000000000000000000000000000000000000000ffffffffffffffffffffffff")); } // namespace nft -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/serialize.h b/include/xrpl/protocol/serialize.h index ea93505736..eedf041baa 100644 --- a/include/xrpl/protocol/serialize.h +++ b/include/xrpl/protocol/serialize.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Serialize an object to a blob. */ template @@ -24,6 +24,6 @@ serializeHex(STObject const& o) return strHex(serializeBlob(o)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/protocol/tokens.h b/include/xrpl/protocol/tokens.h index 5e3fc222e8..ac13a10e06 100644 --- a/include/xrpl/protocol/tokens.h +++ b/include/xrpl/protocol/tokens.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { template using B58Result = Expected; @@ -111,6 +111,6 @@ b58_to_b256_be(std::string_view input, std::span out); } // namespace b58_fast #endif // _MSC_VER -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Charge.h b/include/xrpl/resource/Charge.h index 2236a60cd4..1edaca28b4 100644 --- a/include/xrpl/resource/Charge.h +++ b/include/xrpl/resource/Charge.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { /** A consumption charge. */ @@ -49,6 +49,6 @@ std::ostream& operator<<(std::ostream& os, Charge const& v); } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Consumer.h b/include/xrpl/resource/Consumer.h index 903e0e97a5..6e973d824c 100644 --- a/include/xrpl/resource/Consumer.h +++ b/include/xrpl/resource/Consumer.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { struct Entry; @@ -81,6 +81,6 @@ std::ostream& operator<<(std::ostream& os, Consumer const& v); } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Disposition.h b/include/xrpl/resource/Disposition.h index 5915b0059d..81675e8376 100644 --- a/include/xrpl/resource/Disposition.h +++ b/include/xrpl/resource/Disposition.h @@ -1,7 +1,7 @@ #ifndef XRPL_RESOURCE_DISPOSITION_H_INCLUDED #define XRPL_RESOURCE_DISPOSITION_H_INCLUDED -namespace ripple { +namespace xrpl { namespace Resource { /** The disposition of a consumer after applying a load charge. */ @@ -19,6 +19,6 @@ enum Disposition { }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Fees.h b/include/xrpl/resource/Fees.h index 4a099b9019..643a8e624c 100644 --- a/include/xrpl/resource/Fees.h +++ b/include/xrpl/resource/Fees.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { // clang-format off @@ -40,6 +40,6 @@ extern Charge const feeDrop; // The cost of being dropped for // clang-format on } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Gossip.h b/include/xrpl/resource/Gossip.h index 214e0e8c4d..dfd04288fc 100644 --- a/include/xrpl/resource/Gossip.h +++ b/include/xrpl/resource/Gossip.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { /** Data format for exchanging consumption information across peers. */ @@ -26,6 +26,6 @@ struct Gossip }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/ResourceManager.h b/include/xrpl/resource/ResourceManager.h index 7d29059292..19690d6bc4 100644 --- a/include/xrpl/resource/ResourceManager.h +++ b/include/xrpl/resource/ResourceManager.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { /** Tracks load and resource consumption. */ @@ -66,6 +66,6 @@ make_Manager( beast::Journal journal); } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/Types.h b/include/xrpl/resource/Types.h index 64628cf54a..8923933f0f 100644 --- a/include/xrpl/resource/Types.h +++ b/include/xrpl/resource/Types.h @@ -1,13 +1,13 @@ #ifndef XRPL_RESOURCE_TYPES_H_INCLUDED #define XRPL_RESOURCE_TYPES_H_INCLUDED -namespace ripple { +namespace xrpl { namespace Resource { struct Key; struct Entry; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Entry.h b/include/xrpl/resource/detail/Entry.h index b89d85d1f3..ce55c46064 100644 --- a/include/xrpl/resource/detail/Entry.h +++ b/include/xrpl/resource/detail/Entry.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { using clock_type = beast::abstract_clock; @@ -93,6 +93,6 @@ operator<<(std::ostream& os, Entry const& v) } } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Import.h b/include/xrpl/resource/detail/Import.h index a9711be3fc..d33bd5f156 100644 --- a/include/xrpl/resource/detail/Import.h +++ b/include/xrpl/resource/detail/Import.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { /** A set of imported consumer data from a gossip origin. */ @@ -31,6 +31,6 @@ struct Import }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Key.h b/include/xrpl/resource/detail/Key.h index 3df47d5afb..e63d2827ea 100644 --- a/include/xrpl/resource/detail/Key.h +++ b/include/xrpl/resource/detail/Key.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { // The consumer key @@ -47,6 +47,6 @@ struct Key }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Kind.h b/include/xrpl/resource/detail/Kind.h index 0a04b8e627..0e55b65780 100644 --- a/include/xrpl/resource/detail/Kind.h +++ b/include/xrpl/resource/detail/Kind.h @@ -1,7 +1,7 @@ #ifndef XRPL_RESOURCE_KIND_H_INCLUDED #define XRPL_RESOURCE_KIND_H_INCLUDED -namespace ripple { +namespace xrpl { namespace Resource { /** @@ -15,6 +15,6 @@ namespace Resource { enum Kind { kindInbound, kindOutbound, kindUnlimited }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Logic.h b/include/xrpl/resource/detail/Logic.h index a0c541b300..b1f90e0282 100644 --- a/include/xrpl/resource/detail/Logic.h +++ b/include/xrpl/resource/detail/Logic.h @@ -16,7 +16,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { class Logic @@ -385,7 +385,7 @@ public: Entry& entry(iter->second); XRPL_ASSERT( entry.refcount == 0, - "ripple::Resource::Logic::erase : entry not used"); + "xrpl::Resource::Logic::erase : entry not used"); inactive_.erase(inactive_.iterator_to(entry)); table_.erase(iter); } @@ -419,7 +419,7 @@ public: default: // LCOV_EXCL_START UNREACHABLE( - "ripple::Resource::Logic::release : invalid entry " + "xrpl::Resource::Logic::release : invalid entry " "kind"); break; // LCOV_EXCL_STOP @@ -568,6 +568,6 @@ public: }; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/resource/detail/Tuning.h b/include/xrpl/resource/detail/Tuning.h index 3013bb0e45..9d7ba31303 100644 --- a/include/xrpl/resource/detail/Tuning.h +++ b/include/xrpl/resource/detail/Tuning.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { /** Tunable constants. */ @@ -32,6 +32,6 @@ std::chrono::seconds constexpr secondsUntilExpiration{300}; std::chrono::seconds constexpr gossipExpirationSeconds{30}; } // namespace Resource -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/Handoff.h b/include/xrpl/server/Handoff.h index 993d61aec8..49a5851251 100644 --- a/include/xrpl/server/Handoff.h +++ b/include/xrpl/server/Handoff.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { using http_request_type = boost::beast::http::request; @@ -36,6 +36,6 @@ struct Handoff } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/Port.h b/include/xrpl/server/Port.h index 37b130ae04..995401f8fd 100644 --- a/include/xrpl/server/Port.h +++ b/include/xrpl/server/Port.h @@ -24,7 +24,7 @@ class context; } // namespace asio } // namespace boost -namespace ripple { +namespace xrpl { /** Configuration information for a Server listening port. */ struct Port @@ -104,6 +104,6 @@ struct ParsedPort void parse_Port(ParsedPort& port, Section const& section, std::ostream& log); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/Server.h b/include/xrpl/server/Server.h index 5dc6face66..b553b9e72a 100644 --- a/include/xrpl/server/Server.h +++ b/include/xrpl/server/Server.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { /** Create the HTTP server using the specified handler. */ template @@ -21,6 +21,6 @@ make_Server( return std::make_unique>(handler, io_context, journal); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/Session.h b/include/xrpl/server/Session.h index 52aa37572a..4570e90f7e 100644 --- a/include/xrpl/server/Session.h +++ b/include/xrpl/server/Session.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Persistent state information for a connection session. These values are preserved between calls for efficiency. @@ -111,6 +111,6 @@ public: websocketUpgrade() = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/SimpleWriter.h b/include/xrpl/server/SimpleWriter.h index 96e834df6a..cf41f1c82a 100644 --- a/include/xrpl/server/SimpleWriter.h +++ b/include/xrpl/server/SimpleWriter.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { /// Deprecated: Writer that serializes a HTTP/1 message class SimpleWriter : public Writer @@ -55,6 +55,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/WSSession.h b/include/xrpl/server/WSSession.h index 05558f1774..fb8af7118c 100644 --- a/include/xrpl/server/WSSession.h +++ b/include/xrpl/server/WSSession.h @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { class WSMsg { @@ -125,6 +125,6 @@ struct WSSession complete() = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/Writer.h b/include/xrpl/server/Writer.h index 7948547279..7e0c304ea9 100644 --- a/include/xrpl/server/Writer.h +++ b/include/xrpl/server/Writer.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Writer { @@ -37,6 +37,6 @@ public: data() = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index c68b7d91ec..5b7327c6b9 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -26,7 +26,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents an active connection. */ template @@ -511,6 +511,6 @@ BaseHTTPPeer::close(bool graceful) boost::beast::get_lowest_layer(impl().stream_).close(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/BasePeer.h b/include/xrpl/server/detail/BasePeer.h index 3b524cbdd5..fa82a1bb37 100644 --- a/include/xrpl/server/detail/BasePeer.h +++ b/include/xrpl/server/detail/BasePeer.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { // Common part of all peers template @@ -85,9 +85,9 @@ BasePeer::close() return post( strand_, std::bind(&BasePeer::close, impl().shared_from_this())); error_code ec; - ripple::get_lowest_layer(impl().ws_).socket().close(ec); + xrpl::get_lowest_layer(impl().ws_).socket().close(ec); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/BaseWSPeer.h b/include/xrpl/server/detail/BaseWSPeer.h index dbf8d95cba..f0649b221c 100644 --- a/include/xrpl/server/detail/BaseWSPeer.h +++ b/include/xrpl/server/detail/BaseWSPeer.h @@ -19,7 +19,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents an active WebSocket connection. */ template @@ -508,17 +508,17 @@ BaseWSPeer::fail(error_code ec, String const& what) { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::BaseWSPeer::fail : strand in this thread"); + "xrpl::BaseWSPeer::fail : strand in this thread"); cancel_timer(); if (!ec_ && ec != boost::asio::error::operation_aborted) { ec_ = ec; JLOG(this->j_.trace()) << what << ": " << ec.message(); - ripple::get_lowest_layer(impl().ws_).socket().close(ec); + xrpl::get_lowest_layer(impl().ws_).socket().close(ec); } } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/Door.h b/include/xrpl/server/detail/Door.h index aef4b4d9d2..140afb1808 100644 --- a/include/xrpl/server/detail/Door.h +++ b/include/xrpl/server/detail/Door.h @@ -35,7 +35,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A listening socket. */ template @@ -500,6 +500,6 @@ Door::should_throttle_for_fds() #endif } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/JSONRPCUtil.h b/include/xrpl/server/detail/JSONRPCUtil.h index 8b2bfa4ac7..d75825a1ea 100644 --- a/include/xrpl/server/detail/JSONRPCUtil.h +++ b/include/xrpl/server/detail/JSONRPCUtil.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { void HTTPReply( @@ -14,6 +14,6 @@ HTTPReply( Json::Output const&, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/LowestLayer.h b/include/xrpl/server/detail/LowestLayer.h index c7430b5d9f..57647867e3 100644 --- a/include/xrpl/server/detail/LowestLayer.h +++ b/include/xrpl/server/detail/LowestLayer.h @@ -7,7 +7,7 @@ #include #endif -namespace ripple { +namespace xrpl { // Before boost 1.70, get_lowest_layer required an explicit templat parameter template @@ -21,6 +21,6 @@ get_lowest_layer(T& t) noexcept #endif } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/PlainHTTPPeer.h b/include/xrpl/server/detail/PlainHTTPPeer.h index cf2c871635..8f7d86f8e5 100644 --- a/include/xrpl/server/detail/PlainHTTPPeer.h +++ b/include/xrpl/server/detail/PlainHTTPPeer.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { template class PlainHTTPPeer @@ -154,6 +154,6 @@ PlainHTTPPeer::do_close() socket_.shutdown(socket_type::shutdown_send, ec); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/PlainWSPeer.h b/include/xrpl/server/detail/PlainWSPeer.h index 60223c896d..4d5c57533b 100644 --- a/include/xrpl/server/detail/PlainWSPeer.h +++ b/include/xrpl/server/detail/PlainWSPeer.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { template class PlainWSPeer : public BaseWSPeer>, @@ -58,6 +58,6 @@ PlainWSPeer::PlainWSPeer( { } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/SSLHTTPPeer.h b/include/xrpl/server/detail/SSLHTTPPeer.h index f60f7e82d9..56b2d1c52f 100644 --- a/include/xrpl/server/detail/SSLHTTPPeer.h +++ b/include/xrpl/server/detail/SSLHTTPPeer.h @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { template class SSLHTTPPeer : public BaseHTTPPeer>, @@ -204,6 +204,6 @@ SSLHTTPPeer::on_shutdown(error_code ec) stream_.next_layer().close(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/SSLWSPeer.h b/include/xrpl/server/detail/SSLWSPeer.h index c2076ed6a5..bb5da1c6e7 100644 --- a/include/xrpl/server/detail/SSLWSPeer.h +++ b/include/xrpl/server/detail/SSLWSPeer.h @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { template class SSLWSPeer : public BaseWSPeer>, @@ -67,6 +67,6 @@ SSLWSPeer::SSLWSPeer( { } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/ServerImpl.h b/include/xrpl/server/detail/ServerImpl.h index a42966edd6..6ff93e83cb 100644 --- a/include/xrpl/server/detail/ServerImpl.h +++ b/include/xrpl/server/detail/ServerImpl.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { using Endpoints = std::unordered_map; @@ -189,6 +189,6 @@ ServerImpl::closed() { return ios_.closed(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/server/detail/Spawn.h b/include/xrpl/server/detail/Spawn.h index 2e80393af6..4c424a1956 100644 --- a/include/xrpl/server/detail/Spawn.h +++ b/include/xrpl/server/detail/Spawn.h @@ -9,7 +9,7 @@ #include #include -namespace ripple::util { +namespace xrpl::util { namespace impl { template @@ -84,6 +84,6 @@ spawn(Ctx&& ctx, F&& func) } } -} // namespace ripple::util +} // namespace xrpl::util #endif diff --git a/include/xrpl/server/detail/io_list.h b/include/xrpl/server/detail/io_list.h index 6b8e440d40..0e67595dbe 100644 --- a/include/xrpl/server/detail/io_list.h +++ b/include/xrpl/server/detail/io_list.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Manages a set of objects performing asynchronous I/O. */ class io_list final @@ -243,6 +243,6 @@ io_list::join() cv_.wait(lock, [&] { return closed_ && n_ == 0; }); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/Family.h b/include/xrpl/shamap/Family.h index e566145bec..6638d67df8 100644 --- a/include/xrpl/shamap/Family.h +++ b/include/xrpl/shamap/Family.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class Family { @@ -65,6 +65,6 @@ public: reset() = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/FullBelowCache.h b/include/xrpl/shamap/FullBelowCache.h index 81061cef59..9434b40011 100644 --- a/include/xrpl/shamap/FullBelowCache.h +++ b/include/xrpl/shamap/FullBelowCache.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -129,6 +129,6 @@ private: using FullBelowCache = detail::BasicFullBelowCache; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMap.h b/include/xrpl/shamap/SHAMap.h index 07db489a8f..94fd926718 100644 --- a/include/xrpl/shamap/SHAMap.h +++ b/include/xrpl/shamap/SHAMap.h @@ -19,7 +19,7 @@ #include #include -namespace ripple { +namespace xrpl { class SHAMapNodeID; class SHAMapSyncFilter; @@ -584,7 +584,7 @@ SHAMap::setImmutable() { XRPL_ASSERT( state_ != SHAMapState::Invalid, - "ripple::SHAMap::setImmutable : state is valid"); + "xrpl::SHAMap::setImmutable : state is valid"); state_ = SHAMapState::Immutable; } @@ -666,8 +666,7 @@ private: inline SHAMap::const_iterator::const_iterator(SHAMap const* map) : map_(map) { XRPL_ASSERT( - map_, - "ripple::SHAMap::const_iterator::const_iterator : non-null input"); + map_, "xrpl::SHAMap::const_iterator::const_iterator : non-null input"); if (auto temp = map_->peekFirstItem(stack_)) item_ = temp->peekItem().get(); @@ -721,7 +720,7 @@ operator==(SHAMap::const_iterator const& x, SHAMap::const_iterator const& y) { XRPL_ASSERT( x.map_ == y.map_, - "ripple::operator==(SHAMap::const_iterator, SHAMap::const_iterator) : " + "xrpl::operator==(SHAMap::const_iterator, SHAMap::const_iterator) : " "inputs map do match"); return x.item_ == y.item_; } @@ -744,6 +743,6 @@ SHAMap::end() const return const_iterator(this, nullptr); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h index 2486432453..288fc416b5 100644 --- a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h +++ b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A leaf node for a state object. */ class SHAMapAccountStateLeafNode final @@ -68,6 +68,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapAddNode.h b/include/xrpl/shamap/SHAMapAddNode.h index 73e7a2efac..0385f64f52 100644 --- a/include/xrpl/shamap/SHAMapAddNode.h +++ b/include/xrpl/shamap/SHAMapAddNode.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // results of adding nodes class SHAMapAddNode @@ -161,6 +161,6 @@ SHAMapAddNode::get() const return ret; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapInnerNode.h b/include/xrpl/shamap/SHAMapInnerNode.h index 9488a12e6d..72a7fe52d4 100644 --- a/include/xrpl/shamap/SHAMapInnerNode.h +++ b/include/xrpl/shamap/SHAMapInnerNode.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { class SHAMapInnerNode final : public SHAMapTreeNode, public CountedObject @@ -202,5 +202,5 @@ SHAMapInnerNode::setFullBelowGen(std::uint32_t gen) fullBelowGen_ = gen; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapItem.h b/include/xrpl/shamap/SHAMapItem.h index f76a37e733..a69f40113d 100644 --- a/include/xrpl/shamap/SHAMapItem.h +++ b/include/xrpl/shamap/SHAMapItem.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { // an item stored in a SHAMap class SHAMapItem : public CountedObject @@ -143,7 +143,7 @@ make_shamapitem(uint256 const& tag, Slice data) { XRPL_ASSERT( data.size() <= megabytes(16), - "ripple::make_shamapitem : maximum input size"); + "xrpl::make_shamapitem : maximum input size"); std::uint8_t* raw = detail::slabber.allocate(data.size()); @@ -168,6 +168,6 @@ make_shamapitem(SHAMapItem const& other) return make_shamapitem(other.key(), other.slice()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapLeafNode.h b/include/xrpl/shamap/SHAMapLeafNode.h index 127e8c3680..d87ede16ad 100644 --- a/include/xrpl/shamap/SHAMapLeafNode.h +++ b/include/xrpl/shamap/SHAMapLeafNode.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { class SHAMapLeafNode : public SHAMapTreeNode { @@ -59,6 +59,6 @@ public: getString(SHAMapNodeID const&) const final override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapMissingNode.h b/include/xrpl/shamap/SHAMapMissingNode.h index 18c2636654..0cb18238af 100644 --- a/include/xrpl/shamap/SHAMapMissingNode.h +++ b/include/xrpl/shamap/SHAMapMissingNode.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { enum class SHAMapType { TRANSACTION = 1, // A tree of transactions @@ -50,6 +50,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapNodeID.h b/include/xrpl/shamap/SHAMapNodeID.h index dfac4fceb6..2a9e4446f4 100644 --- a/include/xrpl/shamap/SHAMapNodeID.h +++ b/include/xrpl/shamap/SHAMapNodeID.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Identifies a node inside a SHAMap */ class SHAMapNodeID : public CountedObject @@ -139,6 +139,6 @@ deserializeSHAMapNodeID(std::string const& s) [[nodiscard]] unsigned int selectBranch(SHAMapNodeID const& id, uint256 const& hash); -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapSyncFilter.h b/include/xrpl/shamap/SHAMapSyncFilter.h index 88c7eeec99..16b2389745 100644 --- a/include/xrpl/shamap/SHAMapSyncFilter.h +++ b/include/xrpl/shamap/SHAMapSyncFilter.h @@ -6,7 +6,7 @@ #include /** Callback for filtering SHAMap during sync. */ -namespace ripple { +namespace xrpl { class SHAMapSyncFilter { @@ -30,6 +30,6 @@ public: getNode(SHAMapHash const& nodeHash) const = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapTreeNode.h b/include/xrpl/shamap/SHAMapTreeNode.h index 245f8c8a7a..75992a9bce 100644 --- a/include/xrpl/shamap/SHAMapTreeNode.h +++ b/include/xrpl/shamap/SHAMapTreeNode.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { // These are wire-protocol identifiers used during serialization to encode the // type of a node. They should not be arbitrarily be changed. @@ -170,6 +170,6 @@ private: makeTransactionWithMeta(Slice data, SHAMapHash const& hash, bool hashValid); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapTxLeafNode.h b/include/xrpl/shamap/SHAMapTxLeafNode.h index e7dbd10fd6..e7b73ecde9 100644 --- a/include/xrpl/shamap/SHAMapTxLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxLeafNode.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A leaf node for a transaction. No metadata is included. */ class SHAMapTxLeafNode final : public SHAMapLeafNode, @@ -64,6 +64,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h index 915c02e7f6..c38277ef73 100644 --- a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A leaf node for a transaction and its associated metadata. */ class SHAMapTxPlusMetaLeafNode final @@ -68,6 +68,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/TreeNodeCache.h b/include/xrpl/shamap/TreeNodeCache.h index bb6120e4a6..bf9797c745 100644 --- a/include/xrpl/shamap/TreeNodeCache.h +++ b/include/xrpl/shamap/TreeNodeCache.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { using TreeNodeCache = TaggedCache< uint256, @@ -13,6 +13,6 @@ using TreeNodeCache = TaggedCache< /*IsKeyCache*/ false, intr_ptr::SharedWeakUnionPtr, intr_ptr::SharedPtr>; -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/detail/TaggedPointer.h b/include/xrpl/shamap/detail/TaggedPointer.h index f3a616c052..53a53960d4 100644 --- a/include/xrpl/shamap/detail/TaggedPointer.h +++ b/include/xrpl/shamap/detail/TaggedPointer.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** TaggedPointer is a combination of a pointer and a mask stored in the lowest two bits. @@ -226,6 +226,6 @@ popcnt16(std::uint16_t a) #endif } -} // namespace ripple +} // namespace xrpl #endif diff --git a/include/xrpl/shamap/detail/TaggedPointer.ipp b/include/xrpl/shamap/detail/TaggedPointer.ipp index f3bd561e06..e88b4b11c4 100644 --- a/include/xrpl/shamap/detail/TaggedPointer.ipp +++ b/include/xrpl/shamap/detail/TaggedPointer.ipp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace { // Sparse array size boundaries. @@ -61,7 +61,7 @@ numAllocatedChildren(std::uint8_t n) { XRPL_ASSERT( n <= SHAMapInnerNode::branchFactor, - "ripple::numAllocatedChildren : valid input"); + "xrpl::numAllocatedChildren : valid input"); return *std::lower_bound(boundaries.begin(), boundaries.end(), n); } @@ -70,7 +70,7 @@ boundariesIndex(std::uint8_t numChildren) { XRPL_ASSERT( numChildren <= SHAMapInnerNode::branchFactor, - "ripple::boundariesIndex : valid input"); + "xrpl::boundariesIndex : valid input"); return std::distance( boundaries.begin(), std::lower_bound(boundaries.begin(), boundaries.end(), numChildren)); @@ -142,7 +142,7 @@ deallocateArrays(std::uint8_t boundaryIndex, void* p) { XRPL_ASSERT( isFromArrayFuns[boundaryIndex](p), - "ripple::deallocateArrays : valid inputs"); + "xrpl::deallocateArrays : valid inputs"); freeArrayFuns[boundaryIndex](p); } @@ -258,12 +258,12 @@ inline TaggedPointer::TaggedPointer(RawAllocateTag, std::uint8_t numChildren) auto [tag, p] = allocateArrays(numChildren); XRPL_ASSERT( tag < boundaries.size(), - "ripple::TaggedPointer::TaggedPointer(RawAllocateTag, std::uint8_t) : " + "xrpl::TaggedPointer::TaggedPointer(RawAllocateTag, std::uint8_t) : " "maximum tag"); XRPL_ASSERT( (reinterpret_cast(p) & ptrMask) == reinterpret_cast(p), - "ripple::TaggedPointer::TaggedPointer(RawAllocateTag, std::uint8_t) : " + "xrpl::TaggedPointer::TaggedPointer(RawAllocateTag, std::uint8_t) : " "valid pointer"); tp_ = reinterpret_cast(p) + tag; } @@ -276,7 +276,7 @@ inline TaggedPointer::TaggedPointer( { XRPL_ASSERT( toAllocate >= popcnt16(dstBranches), - "ripple::TaggedPointer::TaggedPointer(TaggedPointer&& ...) : minimum " + "xrpl::TaggedPointer::TaggedPointer(TaggedPointer&& ...) : minimum " "toAllocate input"); if (other.capacity() == numAllocatedChildren(toAllocate)) @@ -427,7 +427,7 @@ inline TaggedPointer::TaggedPointer( // If sparse, may need to run additional constructors XRPL_ASSERT( !dstIsDense || dstIndex == dstNumAllocated, - "ripple::TaggedPointer::TaggedPointer(TaggedPointer&& ...) : " + "xrpl::TaggedPointer::TaggedPointer(TaggedPointer&& ...) : " "non-sparse or valid sparse"); for (int i = dstIndex; i < dstNumAllocated; ++i) { @@ -575,4 +575,4 @@ inline TaggedPointer::~TaggedPointer() destroyHashesAndChildren(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/Archive.cpp b/src/libxrpl/basics/Archive.cpp index 14a043aff8..8ee23afda0 100644 --- a/src/libxrpl/basics/Archive.cpp +++ b/src/libxrpl/basics/Archive.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { void extractTarLz4( @@ -99,4 +99,4 @@ extractTarLz4( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/BasicConfig.cpp b/src/libxrpl/basics/BasicConfig.cpp index 63a001bcc3..a5ad7730dd 100644 --- a/src/libxrpl/basics/BasicConfig.cpp +++ b/src/libxrpl/basics/BasicConfig.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { Section::Section(std::string const& name) : name_(name) { @@ -183,4 +183,4 @@ operator<<(std::ostream& ss, BasicConfig const& c) return ss; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/CountedObject.cpp b/src/libxrpl/basics/CountedObject.cpp index 05ee345a54..bcdca9dfa4 100644 --- a/src/libxrpl/basics/CountedObject.cpp +++ b/src/libxrpl/basics/CountedObject.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { CountedObjects& CountedObjects::getInstance() noexcept @@ -36,4 +36,4 @@ CountedObjects::getCounts(int minimumThreshold) const return counts; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/FileUtilities.cpp b/src/libxrpl/basics/FileUtilities.cpp index 239a760999..981fdd5360 100644 --- a/src/libxrpl/basics/FileUtilities.cpp +++ b/src/libxrpl/basics/FileUtilities.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string getFileContents( @@ -85,4 +85,4 @@ writeFileContents( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/Log.cpp b/src/libxrpl/basics/Log.cpp index 0a0bb20135..33d6f6559e 100644 --- a/src/libxrpl/basics/Log.cpp +++ b/src/libxrpl/basics/Log.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { Logs::Sink::Sink( std::string const& partition, @@ -222,7 +222,7 @@ Logs::fromSeverity(beast::severities::Severity level) // LCOV_EXCL_START default: - UNREACHABLE("ripple::Logs::fromSeverity : invalid severity"); + UNREACHABLE("xrpl::Logs::fromSeverity : invalid severity"); [[fallthrough]]; // LCOV_EXCL_STOP case kFatal: @@ -250,7 +250,7 @@ Logs::toSeverity(LogSeverity level) return kError; // LCOV_EXCL_START default: - UNREACHABLE("ripple::Logs::toSeverity : invalid severity"); + UNREACHABLE("xrpl::Logs::toSeverity : invalid severity"); [[fallthrough]]; // LCOV_EXCL_STOP case lsFATAL: @@ -279,7 +279,7 @@ Logs::toString(LogSeverity s) return "Fatal"; // LCOV_EXCL_START default: - UNREACHABLE("ripple::Logs::toString : invalid severity"); + UNREACHABLE("xrpl::Logs::toString : invalid severity"); return "Unknown"; // LCOV_EXCL_STOP } @@ -345,7 +345,7 @@ Logs::format( break; // LCOV_EXCL_START default: - UNREACHABLE("ripple::Logs::format : invalid severity"); + UNREACHABLE("xrpl::Logs::format : invalid severity"); [[fallthrough]]; // LCOV_EXCL_STOP case kFatal: @@ -459,4 +459,4 @@ debugLog() return beast::Journal(debugSink().get()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index 797ca83b67..96c13c9db8 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -20,7 +20,7 @@ using uint128_t = boost::multiprecision::uint128_t; using uint128_t = __uint128_t; #endif // !defined(_MSC_VER) -namespace ripple { +namespace xrpl { thread_local Number::rounding_mode Number::mode_ = Number::to_nearest; @@ -280,7 +280,7 @@ Number::operator+=(Number const& y) } XRPL_ASSERT( isnormal() && y.isnormal(), - "ripple::Number::operator+=(Number) : is normal"); + "xrpl::Number::operator+=(Number) : is normal"); auto xm = mantissa(); auto xe = exponent(); int xn = 1; @@ -396,7 +396,7 @@ Number::operator*=(Number const& y) } XRPL_ASSERT( isnormal() && y.isnormal(), - "ripple::Number::operator*=(Number) : is normal"); + "xrpl::Number::operator*=(Number) : is normal"); auto xm = mantissa(); auto xe = exponent(); int xn = 1; @@ -437,7 +437,7 @@ Number::operator*=(Number const& y) exponent_ = xe; XRPL_ASSERT( isnormal() || *this == Number{}, - "ripple::Number::operator*=(Number) : result is normal"); + "xrpl::Number::operator*=(Number) : result is normal"); return *this; } @@ -548,7 +548,7 @@ to_string(Number const& amount) } XRPL_ASSERT( - exponent + 43 > 0, "ripple::to_string(Number) : minimum exponent"); + exponent + 43 > 0, "xrpl::to_string(Number) : minimum exponent"); ptrdiff_t const pad_prefix = 27; ptrdiff_t const pad_suffix = 23; @@ -575,8 +575,7 @@ to_string(Number const& amount) pre_from += pad_prefix; XRPL_ASSERT( - post_to >= post_from, - "ripple::to_string(Number) : first distance check"); + post_to >= post_from, "xrpl::to_string(Number) : first distance check"); pre_from = std::find_if(pre_from, pre_to, [](char c) { return c != '0'; }); @@ -587,7 +586,7 @@ to_string(Number const& amount) XRPL_ASSERT( post_to >= post_from, - "ripple::to_string(Number) : second distance check"); + "xrpl::to_string(Number) : second distance check"); post_to = std::find_if( std::make_reverse_iterator(post_to), @@ -772,4 +771,4 @@ power(Number const& f, unsigned n, unsigned d) return root(power(f, n), d); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/ResolverAsio.cpp b/src/libxrpl/basics/ResolverAsio.cpp index d8275e0893..8b9b2a9c4c 100644 --- a/src/libxrpl/basics/ResolverAsio.cpp +++ b/src/libxrpl/basics/ResolverAsio.cpp @@ -26,7 +26,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Mix-in to track when all pending I/O is complete. Derived classes must be callable with this signature: @@ -46,7 +46,7 @@ public: // Destroying the object with I/O pending? Not a clean exit! XRPL_ASSERT( m_pending.load() == 0, - "ripple::AsyncObject::~AsyncObject : nothing pending"); + "xrpl::AsyncObject::~AsyncObject : nothing pending"); } /** RAII container that maintains the count of pending I/O. @@ -153,9 +153,9 @@ public: { XRPL_ASSERT( m_work.empty(), - "ripple::ResolverAsioImpl::~ResolverAsioImpl : no pending work"); + "xrpl::ResolverAsioImpl::~ResolverAsioImpl : no pending work"); XRPL_ASSERT( - m_stopped, "ripple::ResolverAsioImpl::~ResolverAsioImpl : stopped"); + m_stopped, "xrpl::ResolverAsioImpl::~ResolverAsioImpl : stopped"); } //------------------------------------------------------------------------- @@ -178,10 +178,10 @@ public: start() override { XRPL_ASSERT( - m_stopped == true, "ripple::ResolverAsioImpl::start : stopped"); + m_stopped == true, "xrpl::ResolverAsioImpl::start : stopped"); XRPL_ASSERT( m_stop_called == false, - "ripple::ResolverAsioImpl::start : not stopping"); + "xrpl::ResolverAsioImpl::start : not stopping"); if (m_stopped.exchange(false) == true) { @@ -229,10 +229,10 @@ public: { XRPL_ASSERT( m_stop_called == false, - "ripple::ResolverAsioImpl::resolve : not stopping"); + "xrpl::ResolverAsioImpl::resolve : not stopping"); XRPL_ASSERT( !names.empty(), - "ripple::ResolverAsioImpl::resolve : names non-empty"); + "xrpl::ResolverAsioImpl::resolve : names non-empty"); // TODO NIKB use rvalue references to construct and move // reducing cost. @@ -255,7 +255,7 @@ public: { XRPL_ASSERT( m_stop_called == true, - "ripple::ResolverAsioImpl::do_stop : stopping"); + "xrpl::ResolverAsioImpl::do_stop : stopping"); if (m_stopped.exchange(true) == false) { @@ -415,7 +415,7 @@ public: { XRPL_ASSERT( !names.empty(), - "ripple::ResolverAsioImpl::do_resolve : names non-empty"); + "xrpl::ResolverAsioImpl::do_resolve : names non-empty"); if (m_stop_called == false) { @@ -450,4 +450,4 @@ ResolverAsio::New(boost::asio::io_context& io_context, beast::Journal journal) //----------------------------------------------------------------------------- Resolver::~Resolver() = default; -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/StringUtilities.cpp b/src/libxrpl/basics/StringUtilities.cpp index 6d7ab326af..96b5cfdb9b 100644 --- a/src/libxrpl/basics/StringUtilities.cpp +++ b/src/libxrpl/basics/StringUtilities.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string sqlBlobLiteral(Blob const& blob) @@ -136,4 +136,4 @@ isProperlyFormedTomlDomain(std::string_view domain) return boost::regex_match(domain.begin(), domain.end(), re); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/UptimeClock.cpp b/src/libxrpl/basics/UptimeClock.cpp index dbfc0046a2..521a6a1313 100644 --- a/src/libxrpl/basics/UptimeClock.cpp +++ b/src/libxrpl/basics/UptimeClock.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { std::atomic UptimeClock::now_{0}; // seconds since start std::atomic UptimeClock::stop_{false}; // stop update thread @@ -54,4 +54,4 @@ UptimeClock::now() return time_point{duration{now_}}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/base64.cpp b/src/libxrpl/basics/base64.cpp index d0d11c85bb..4a5cbacaef 100644 --- a/src/libxrpl/basics/base64.cpp +++ b/src/libxrpl/basics/base64.cpp @@ -40,7 +40,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace base64 { @@ -232,4 +232,4 @@ base64_decode(std::string_view data) return dest; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/contract.cpp b/src/libxrpl/basics/contract.cpp index 81674de3c8..562d3a0944 100644 --- a/src/libxrpl/basics/contract.cpp +++ b/src/libxrpl/basics/contract.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { void LogThrow(std::string const& title) @@ -30,4 +30,4 @@ LogicError(std::string const& s) noexcept // LCOV_EXCL_STOP } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/make_SSLContext.cpp b/src/libxrpl/basics/make_SSLContext.cpp index 000f4375ab..579edb0f71 100644 --- a/src/libxrpl/basics/make_SSLContext.cpp +++ b/src/libxrpl/basics/make_SSLContext.cpp @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace openssl { namespace detail { @@ -385,4 +385,4 @@ make_SSLContextAuthed( return context; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/basics/mulDiv.cpp b/src/libxrpl/basics/mulDiv.cpp index 993cff7eb6..d8988b474e 100644 --- a/src/libxrpl/basics/mulDiv.cpp +++ b/src/libxrpl/basics/mulDiv.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { std::optional mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div) @@ -17,10 +17,10 @@ mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div) result /= div; - if (result > ripple::muldiv_max) + if (result > xrpl::muldiv_max) return std::nullopt; return static_cast(result); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/core/detail/Job.cpp b/src/libxrpl/core/detail/Job.cpp index 9caf8d180d..3968c3ede4 100644 --- a/src/libxrpl/core/detail/Job.cpp +++ b/src/libxrpl/core/detail/Job.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { Job::Job() : mType(jtINVALID), mJobIndex(0) { @@ -100,4 +100,4 @@ Job::operator<=(Job const& j) const return mJobIndex <= j.mJobIndex; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/core/detail/JobQueue.cpp b/src/libxrpl/core/detail/JobQueue.cpp index 817744cbc1..7393278fef 100644 --- a/src/libxrpl/core/detail/JobQueue.cpp +++ b/src/libxrpl/core/detail/JobQueue.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { JobQueue::JobQueue( int threadCount, @@ -38,8 +38,7 @@ JobQueue::JobQueue( std::forward_as_tuple(jt.type()), std::forward_as_tuple(jt, m_collector, logs))); XRPL_ASSERT( - result.second == true, - "ripple::JobQueue::JobQueue : jobs added"); + result.second == true, "xrpl::JobQueue::JobQueue : jobs added"); (void)result.second; } } @@ -66,12 +65,12 @@ JobQueue::addRefCountedJob( { XRPL_ASSERT( type != jtINVALID, - "ripple::JobQueue::addRefCountedJob : valid input job type"); + "xrpl::JobQueue::addRefCountedJob : valid input job type"); auto iter(m_jobData.find(type)); XRPL_ASSERT( iter != m_jobData.end(), - "ripple::JobQueue::addRefCountedJob : job type found in jobs"); + "xrpl::JobQueue::addRefCountedJob : job type found in jobs"); if (iter == m_jobData.end()) return false; @@ -84,7 +83,7 @@ JobQueue::addRefCountedJob( XRPL_ASSERT( (type >= jtCLIENT && type <= jtCLIENT_WEBSOCKET) || m_workers.getNumberOfThreads() > 0, - "ripple::JobQueue::addRefCountedJob : threads available or job " + "xrpl::JobQueue::addRefCountedJob : threads available or job " "requires no threads"); { @@ -96,10 +95,10 @@ JobQueue::addRefCountedJob( JobType const type(job.getType()); XRPL_ASSERT( type != jtINVALID, - "ripple::JobQueue::addRefCountedJob : has valid job type"); + "xrpl::JobQueue::addRefCountedJob : has valid job type"); XRPL_ASSERT( m_jobSet.find(job) != m_jobSet.end(), - "ripple::JobQueue::addRefCountedJob : job found"); + "xrpl::JobQueue::addRefCountedJob : job found"); perfLog_.jobQueue(type); JobTypeData& data(getJobTypeData(type)); @@ -161,7 +160,7 @@ JobQueue::makeLoadEvent(JobType t, std::string const& name) JobDataMap::iterator iter(m_jobData.find(t)); XRPL_ASSERT( iter != m_jobData.end(), - "ripple::JobQueue::makeLoadEvent : valid job type input"); + "xrpl::JobQueue::makeLoadEvent : valid job type input"); if (iter == m_jobData.end()) return {}; @@ -178,7 +177,7 @@ JobQueue::addLoadEvents(JobType t, int count, std::chrono::milliseconds elapsed) JobDataMap::iterator iter(m_jobData.find(t)); XRPL_ASSERT( iter != m_jobData.end(), - "ripple::JobQueue::addLoadEvents : valid job type input"); + "xrpl::JobQueue::addLoadEvents : valid job type input"); iter->second.load().addSamples(count, elapsed); } @@ -205,7 +204,7 @@ JobQueue::getJson(int c) for (auto& x : m_jobData) { XRPL_ASSERT( - x.first != jtINVALID, "ripple::JobQueue::getJson : valid job type"); + x.first != jtINVALID, "xrpl::JobQueue::getJson : valid job type"); if (x.first == jtGENERIC) continue; @@ -262,7 +261,7 @@ JobQueue::getJobTypeData(JobType type) JobDataMap::iterator c(m_jobData.find(type)); XRPL_ASSERT( c != m_jobData.end(), - "ripple::JobQueue::getJobTypeData : valid job type input"); + "xrpl::JobQueue::getJobTypeData : valid job type input"); // NIKB: This is ugly and I hate it. We must remove jtINVALID completely // and use something sane. @@ -289,11 +288,11 @@ JobQueue::stop() lock, [this] { return m_processCount == 0 && m_jobSet.empty(); }); XRPL_ASSERT( m_processCount == 0, - "ripple::JobQueue::stop : all processes completed"); + "xrpl::JobQueue::stop : all processes completed"); XRPL_ASSERT( - m_jobSet.empty(), "ripple::JobQueue::stop : all jobs completed"); + m_jobSet.empty(), "xrpl::JobQueue::stop : all jobs completed"); XRPL_ASSERT( - nSuspend_ == 0, "ripple::JobQueue::stop : no coros suspended"); + nSuspend_ == 0, "xrpl::JobQueue::stop : no coros suspended"); stopped_ = true; } } @@ -308,26 +307,26 @@ void JobQueue::getNextJob(Job& job) { XRPL_ASSERT( - !m_jobSet.empty(), "ripple::JobQueue::getNextJob : non-empty jobs"); + !m_jobSet.empty(), "xrpl::JobQueue::getNextJob : non-empty jobs"); std::set::const_iterator iter; for (iter = m_jobSet.begin(); iter != m_jobSet.end(); ++iter) { JobType const type = iter->getType(); XRPL_ASSERT( - type != jtINVALID, "ripple::JobQueue::getNextJob : valid job type"); + type != jtINVALID, "xrpl::JobQueue::getNextJob : valid job type"); JobTypeData& data(getJobTypeData(type)); XRPL_ASSERT( data.running <= getJobLimit(type), - "ripple::JobQueue::getNextJob : maximum jobs running"); + "xrpl::JobQueue::getNextJob : maximum jobs running"); // Run this job if we're running below the limit. if (data.running < getJobLimit(data.type())) { XRPL_ASSERT( data.waiting > 0, - "ripple::JobQueue::getNextJob : positive data waiting"); + "xrpl::JobQueue::getNextJob : positive data waiting"); --data.waiting; ++data.running; break; @@ -335,8 +334,7 @@ JobQueue::getNextJob(Job& job) } XRPL_ASSERT( - iter != m_jobSet.end(), - "ripple::JobQueue::getNextJob : found next job"); + iter != m_jobSet.end(), "xrpl::JobQueue::getNextJob : found next job"); job = *iter; m_jobSet.erase(iter); } @@ -345,8 +343,7 @@ void JobQueue::finishJob(JobType type) { XRPL_ASSERT( - type != jtINVALID, - "ripple::JobQueue::finishJob : valid input job type"); + type != jtINVALID, "xrpl::JobQueue::finishJob : valid input job type"); JobTypeData& data = getJobTypeData(type); @@ -355,7 +352,7 @@ JobQueue::finishJob(JobType type) { XRPL_ASSERT( data.running + data.waiting >= getJobLimit(type), - "ripple::JobQueue::finishJob : job limit"); + "xrpl::JobQueue::finishJob : job limit"); --data.deferred; m_workers.addTask(); @@ -422,10 +419,9 @@ JobQueue::getJobLimit(JobType type) { JobTypeInfo const& j(JobTypes::instance().get(type)); XRPL_ASSERT( - j.type() != jtINVALID, - "ripple::JobQueue::getJobLimit : valid job type"); + j.type() != jtINVALID, "xrpl::JobQueue::getJobLimit : valid job type"); return j.limit(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/core/detail/LoadEvent.cpp b/src/libxrpl/core/detail/LoadEvent.cpp index 3237daabcf..43a2c491c3 100644 --- a/src/libxrpl/core/detail/LoadEvent.cpp +++ b/src/libxrpl/core/detail/LoadEvent.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { LoadEvent::LoadEvent( LoadMonitor& monitor, @@ -63,7 +63,7 @@ LoadEvent::start() void LoadEvent::stop() { - XRPL_ASSERT(running_, "ripple::LoadEvent::stop : is running"); + XRPL_ASSERT(running_, "xrpl::LoadEvent::stop : is running"); auto const now = std::chrono::steady_clock::now(); @@ -74,4 +74,4 @@ LoadEvent::stop() monitor_.addLoadSample(*this); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/core/detail/LoadMonitor.cpp b/src/libxrpl/core/detail/LoadMonitor.cpp index 7a1cce05f3..fe2bb9e359 100644 --- a/src/libxrpl/core/detail/LoadMonitor.cpp +++ b/src/libxrpl/core/detail/LoadMonitor.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { /* @@ -182,4 +182,4 @@ LoadMonitor::getStats() return stats; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/core/detail/Workers.cpp b/src/libxrpl/core/detail/Workers.cpp index b354353844..aa4731a0ff 100644 --- a/src/libxrpl/core/detail/Workers.cpp +++ b/src/libxrpl/core/detail/Workers.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { Workers::Workers( Callback& callback, @@ -102,7 +102,7 @@ Workers::stop() XRPL_ASSERT( numberOfCurrentlyRunningTasks() == 0, - "ripple::Workers::stop : zero running tasks"); + "xrpl::Workers::stop : zero running tasks"); } void @@ -260,4 +260,4 @@ Workers::Worker::run() } while (!shouldExit); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/crypto/RFC1751.cpp b/src/libxrpl/crypto/RFC1751.cpp index 2b41e2ef38..86ee8ad382 100644 --- a/src/libxrpl/crypto/RFC1751.cpp +++ b/src/libxrpl/crypto/RFC1751.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { // // RFC 1751 code converted to C++/Boost. @@ -260,12 +260,12 @@ RFC1751::extract(char const* s, int start, int length) unsigned char cr; unsigned long x; - XRPL_ASSERT(length <= 11, "ripple::RFC1751::extract : maximum length"); - XRPL_ASSERT(start >= 0, "ripple::RFC1751::extract : minimum start"); - XRPL_ASSERT(length >= 0, "ripple::RFC1751::extract : minimum length"); + XRPL_ASSERT(length <= 11, "xrpl::RFC1751::extract : maximum length"); + XRPL_ASSERT(start >= 0, "xrpl::RFC1751::extract : minimum start"); + XRPL_ASSERT(length >= 0, "xrpl::RFC1751::extract : minimum length"); XRPL_ASSERT( start + length <= 66, - "ripple::RFC1751::extract : maximum start + length"); + "xrpl::RFC1751::extract : maximum start + length"); int const shiftR = 24 - (length + (start % 8)); cl = s[start / 8]; // get components @@ -312,12 +312,11 @@ RFC1751::insert(char* s, int x, int start, int length) unsigned long y; int shift; - XRPL_ASSERT(length <= 11, "ripple::RFC1751::insert : maximum length"); - XRPL_ASSERT(start >= 0, "ripple::RFC1751::insert : minimum start"); - XRPL_ASSERT(length >= 0, "ripple::RFC1751::insert : minimum length"); + XRPL_ASSERT(length <= 11, "xrpl::RFC1751::insert : maximum length"); + XRPL_ASSERT(start >= 0, "xrpl::RFC1751::insert : minimum start"); + XRPL_ASSERT(length >= 0, "xrpl::RFC1751::insert : minimum length"); XRPL_ASSERT( - start + length <= 66, - "ripple::RFC1751::insert : maximum start + length"); + start + length <= 66, "xrpl::RFC1751::insert : maximum start + length"); shift = ((8 - ((start + length) % 8)) % 8); y = (long)x << shift; @@ -508,4 +507,4 @@ RFC1751::getWordFromBlob(void const* blob, size_t bytes) [hash % (sizeof(s_dictionary) / sizeof(s_dictionary[0]))]; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/crypto/csprng.cpp b/src/libxrpl/crypto/csprng.cpp index e89129bfb0..5ee1700d7f 100644 --- a/src/libxrpl/crypto/csprng.cpp +++ b/src/libxrpl/crypto/csprng.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { csprng_engine::csprng_engine() { @@ -87,4 +87,4 @@ crypto_prng() return engine; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/crypto/secure_erase.cpp b/src/libxrpl/crypto/secure_erase.cpp index 6e27de59d0..5b65b342ec 100644 --- a/src/libxrpl/crypto/secure_erase.cpp +++ b/src/libxrpl/crypto/secure_erase.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { void secure_erase(void* dest, std::size_t bytes) @@ -12,4 +12,4 @@ secure_erase(void* dest, std::size_t bytes) OPENSSL_cleanse(dest, bytes); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/json/JsonPropertyStream.cpp b/src/libxrpl/json/JsonPropertyStream.cpp index fd4c0d575d..fb5a7b32a4 100644 --- a/src/libxrpl/json/JsonPropertyStream.cpp +++ b/src/libxrpl/json/JsonPropertyStream.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { JsonPropertyStream::JsonPropertyStream() : m_top(Json::objectValue) { @@ -161,4 +161,4 @@ JsonPropertyStream::add(std::string const& v) m_stack.back()->append(v); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/json/Object.cpp b/src/libxrpl/json/Object.cpp index ee63acc327..ea5e5a32d8 100644 --- a/src/libxrpl/json/Object.cpp +++ b/src/libxrpl/json/Object.cpp @@ -52,9 +52,9 @@ void Collection::checkWritable(std::string const& label) { if (!enabled_) - ripple::Throw(label + ": not enabled"); + xrpl::Throw(label + ": not enabled"); if (!writer_) - ripple::Throw(label + ": not writable"); + xrpl::Throw(label + ": not writable"); } //------------------------------------------------------------------------------ diff --git a/src/libxrpl/json/Writer.cpp b/src/libxrpl/json/Writer.cpp index e1ca1900f0..fcdceb7253 100644 --- a/src/libxrpl/json/Writer.cpp +++ b/src/libxrpl/json/Writer.cpp @@ -263,14 +263,14 @@ Writer::output(Json::Value const& value) void Writer::output(float f) { - auto s = ripple::to_string(f); + auto s = xrpl::to_string(f); impl_->output({s.data(), lengthWithoutTrailingZeros(s)}); } void Writer::output(double f) { - auto s = ripple::to_string(f); + auto s = xrpl::to_string(f); impl_->output({s.data(), lengthWithoutTrailingZeros(s)}); } diff --git a/src/libxrpl/json/json_reader.cpp b/src/libxrpl/json/json_reader.cpp index 4af0ed6ef0..c0843ca929 100644 --- a/src/libxrpl/json/json_reader.cpp +++ b/src/libxrpl/json/json_reader.cpp @@ -941,7 +941,7 @@ operator>>(std::istream& sin, Value& root) // XRPL_ASSERT(ok, "Json::operator>>() : parse succeeded"); if (!ok) - ripple::Throw(reader.getFormatedErrorMessages()); + xrpl::Throw(reader.getFormatedErrorMessages()); return sin; } diff --git a/src/libxrpl/json/json_value.cpp b/src/libxrpl/json/json_value.cpp index 1580e68255..b738774d79 100644 --- a/src/libxrpl/json/json_value.cpp +++ b/src/libxrpl/json/json_value.cpp @@ -218,7 +218,7 @@ Value::Value(char const* value) : type_(stringValue), allocated_(true) value_.string_ = valueAllocator()->duplicateStringValue(value); } -Value::Value(ripple::Number const& value) : type_(stringValue), allocated_(true) +Value::Value(xrpl::Number const& value) : type_(stringValue), allocated_(true) { auto const tmp = to_string(value); value_.string_ = diff --git a/src/libxrpl/ledger/ApplyStateTable.cpp b/src/libxrpl/ledger/ApplyStateTable.cpp index c236f0d1b5..94fd9d7273 100644 --- a/src/libxrpl/ledger/ApplyStateTable.cpp +++ b/src/libxrpl/ledger/ApplyStateTable.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { void @@ -143,7 +143,7 @@ ApplyStateTable::apply( { XRPL_ASSERT( origNode && curNode, - "ripple::detail::ApplyStateTable::apply : valid nodes for " + "xrpl::detail::ApplyStateTable::apply : valid nodes for " "deletion"); threadOwners(to, meta, origNode, newMod, j); @@ -178,7 +178,7 @@ ApplyStateTable::apply( { XRPL_ASSERT( curNode && origNode, - "ripple::detail::ApplyStateTable::apply : valid nodes for " + "xrpl::detail::ApplyStateTable::apply : valid nodes for " "modification"); if (curNode->isThreadedType( @@ -216,7 +216,7 @@ ApplyStateTable::apply( { XRPL_ASSERT( curNode && !origNode, - "ripple::detail::ApplyStateTable::apply : valid nodes for " + "xrpl::detail::ApplyStateTable::apply : valid nodes for " "creation"); threadOwners(to, meta, curNode, newMod, j); @@ -242,7 +242,7 @@ ApplyStateTable::apply( { // LCOV_EXCL_START UNREACHABLE( - "ripple::detail::ApplyStateTable::apply : unsupported " + "xrpl::detail::ApplyStateTable::apply : unsupported " "operation type"); // LCOV_EXCL_STOP } @@ -547,7 +547,7 @@ ApplyStateTable::threadItem(TxMeta& meta, std::shared_ptr const& sle) { XRPL_ASSERT( node.getFieldIndex(sfPreviousTxnLgrSeq) == -1, - "ripple::ApplyStateTable::threadItem : previous ledger is not " + "xrpl::ApplyStateTable::threadItem : previous ledger is not " "set"); node.setFieldH256(sfPreviousTxnID, prevTxID); node.setFieldU32(sfPreviousTxnLgrSeq, prevLgrID); @@ -555,11 +555,11 @@ ApplyStateTable::threadItem(TxMeta& meta, std::shared_ptr const& sle) XRPL_ASSERT( node.getFieldH256(sfPreviousTxnID) == prevTxID, - "ripple::ApplyStateTable::threadItem : previous transaction is a " + "xrpl::ApplyStateTable::threadItem : previous transaction is a " "match"); XRPL_ASSERT( node.getFieldU32(sfPreviousTxnLgrSeq) == prevLgrID, - "ripple::ApplyStateTable::threadItem : previous ledger is a match"); + "xrpl::ApplyStateTable::threadItem : previous ledger is a match"); } } @@ -576,7 +576,7 @@ ApplyStateTable::getForMod( { XRPL_ASSERT( miter->second, - "ripple::ApplyStateTable::getForMod : non-null result"); + "xrpl::ApplyStateTable::getForMod : non-null result"); return miter->second; } } @@ -634,7 +634,7 @@ ApplyStateTable::threadTx( // threadItem only applied to AccountRoot XRPL_ASSERT( sle->isThreadedType(base.rules()), - "ripple::ApplyStateTable::threadTx : SLE is threaded"); + "xrpl::ApplyStateTable::threadTx : SLE is threaded"); threadItem(meta, sle); } @@ -671,4 +671,4 @@ ApplyStateTable::threadOwners( } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/ApplyView.cpp b/src/libxrpl/ledger/ApplyView.cpp index 911bec1722..cfdbbbcb4d 100644 --- a/src/libxrpl/ledger/ApplyView.cpp +++ b/src/libxrpl/ledger/ApplyView.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace directory { @@ -135,9 +135,7 @@ insertPage( if (page != 1) node->setFieldU64(sfIndexPrevious, page - 1); XRPL_ASSERT_PARTS( - !nextPage, - "ripple::directory::insertPage", - "nextPage has default value"); + !nextPage, "xrpl::directory::insertPage", "nextPage has default value"); /* Reserved for future use when directory pages may be inserted in * between two other pages instead of only at the end of the chain. if (nextPage) @@ -193,7 +191,7 @@ ApplyView::emptyDirDelete(Keylet const& directory) node->getFieldH256(sfRootIndex) != directory.key) { // LCOV_EXCL_START - UNREACHABLE("ripple::ApplyView::emptyDirDelete : invalid node type"); + UNREACHABLE("xrpl::ApplyView::emptyDirDelete : invalid node type"); return false; // LCOV_EXCL_STOP } @@ -435,4 +433,4 @@ ApplyView::dirDelete( return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/ApplyViewBase.cpp b/src/libxrpl/ledger/ApplyViewBase.cpp index 554822acda..51abd8e4a6 100644 --- a/src/libxrpl/ledger/ApplyViewBase.cpp +++ b/src/libxrpl/ledger/ApplyViewBase.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace detail { ApplyViewBase::ApplyViewBase(ReadView const* base, ApplyFlags flags) @@ -155,4 +155,4 @@ ApplyViewBase::rawDestroyXRP(XRPAmount const& fee) } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/ApplyViewImpl.cpp b/src/libxrpl/ledger/ApplyViewImpl.cpp index 90652dd45b..b0aeb70228 100644 --- a/src/libxrpl/ledger/ApplyViewImpl.cpp +++ b/src/libxrpl/ledger/ApplyViewImpl.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { ApplyViewImpl::ApplyViewImpl(ReadView const* base, ApplyFlags flags) : ApplyViewBase(base, flags) @@ -37,4 +37,4 @@ ApplyViewImpl::visit( items_.visit(to, func); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/BookDirs.cpp b/src/libxrpl/ledger/BookDirs.cpp index 72387650ec..6dda4ffe51 100644 --- a/src/libxrpl/ledger/BookDirs.cpp +++ b/src/libxrpl/ledger/BookDirs.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { BookDirs::BookDirs(ReadView const& view, Book const& book) : view_(&view) @@ -11,13 +11,13 @@ BookDirs::BookDirs(ReadView const& view, Book const& book) , key_(view_->succ(root_, next_quality_).value_or(beast::zero)) { XRPL_ASSERT( - root_ != beast::zero, "ripple::BookDirs::BookDirs : nonzero root"); + root_ != beast::zero, "xrpl::BookDirs::BookDirs : nonzero root"); if (key_ != beast::zero) { if (!cdirFirst(*view_, key_, sle_, entry_, index_)) { // LCOV_EXCL_START - UNREACHABLE("ripple::BookDirs::BookDirs : directory is empty"); + UNREACHABLE("xrpl::BookDirs::BookDirs : directory is empty"); // LCOV_EXCL_STOP } } @@ -55,7 +55,7 @@ BookDirs::const_iterator::operator==( XRPL_ASSERT( view_ == other.view_ && root_ == other.root_, - "ripple::BookDirs::const_iterator::operator== : views and roots are " + "xrpl::BookDirs::const_iterator::operator== : views and roots are " "matching"); return entry_ == other.entry_ && cur_key_ == other.cur_key_ && index_ == other.index_; @@ -66,7 +66,7 @@ BookDirs::const_iterator::operator*() const { XRPL_ASSERT( index_ != beast::zero, - "ripple::BookDirs::const_iterator::operator* : nonzero index"); + "xrpl::BookDirs::const_iterator::operator* : nonzero index"); if (!cache_) cache_ = view_->read(keylet::offer(index_)); return *cache_; @@ -79,7 +79,7 @@ BookDirs::const_iterator::operator++() XRPL_ASSERT( index_ != zero, - "ripple::BookDirs::const_iterator::operator++ : nonzero index"); + "xrpl::BookDirs::const_iterator::operator++ : nonzero index"); if (!cdirNext(*view_, cur_key_, sle_, entry_, index_)) { if (index_ != 0 || @@ -94,7 +94,7 @@ BookDirs::const_iterator::operator++() { // LCOV_EXCL_START UNREACHABLE( - "ripple::BookDirs::const_iterator::operator++ : directory is " + "xrpl::BookDirs::const_iterator::operator++ : directory is " "empty"); // LCOV_EXCL_STOP } @@ -109,10 +109,10 @@ BookDirs::const_iterator::operator++(int) { XRPL_ASSERT( index_ != beast::zero, - "ripple::BookDirs::const_iterator::operator++(int) : nonzero index"); + "xrpl::BookDirs::const_iterator::operator++(int) : nonzero index"); const_iterator tmp(*this); ++(*this); return tmp; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/CachedView.cpp b/src/libxrpl/ledger/CachedView.cpp index 6463779845..19d4baa861 100644 --- a/src/libxrpl/ledger/CachedView.cpp +++ b/src/libxrpl/ledger/CachedView.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { bool @@ -39,8 +39,7 @@ CachedViewImpl::read(Keylet const& k) const }); // If the sle is null, then a failure must have occurred in base_.read() XRPL_ASSERT( - sle || baseRead, - "ripple::CachedView::read : null SLE result from base"); + sle || baseRead, "xrpl::CachedView::read : null SLE result from base"); if (cacheHit && baseRead) hitsexpired.increment(); else if (cacheHit) @@ -62,4 +61,4 @@ CachedViewImpl::read(Keylet const& k) const } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/CredentialHelpers.cpp b/src/libxrpl/ledger/CredentialHelpers.cpp index aea783b676..a0f1dce7d8 100644 --- a/src/libxrpl/ledger/CredentialHelpers.cpp +++ b/src/libxrpl/ledger/CredentialHelpers.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace credentials { bool @@ -374,4 +374,4 @@ verifyDepositPreauth( return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/Dir.cpp b/src/libxrpl/ledger/Dir.cpp index ef128b7c3d..d834216d24 100644 --- a/src/libxrpl/ledger/Dir.cpp +++ b/src/libxrpl/ledger/Dir.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { using const_iterator = Dir::const_iterator; @@ -43,7 +43,7 @@ const_iterator::operator==(const_iterator const& other) const XRPL_ASSERT( view_ == other.view_ && root_.key == other.root_.key, - "ripple::const_iterator::operator== : views and roots are matching"); + "xrpl::const_iterator::operator== : views and roots are matching"); return page_.key == other.page_.key && index_ == other.index_; } @@ -52,7 +52,7 @@ const_iterator::operator*() const { XRPL_ASSERT( index_ != beast::zero, - "ripple::const_iterator::operator* : nonzero index"); + "xrpl::const_iterator::operator* : nonzero index"); if (!cache_) cache_ = view_->read(keylet::child(index_)); return *cache_; @@ -63,7 +63,7 @@ const_iterator::operator++() { XRPL_ASSERT( index_ != beast::zero, - "ripple::const_iterator::operator++ : nonzero index"); + "xrpl::const_iterator::operator++ : nonzero index"); if (++it_ != std::end(*indexes_)) { index_ = *it_; @@ -79,7 +79,7 @@ const_iterator::operator++(int) { XRPL_ASSERT( index_ != beast::zero, - "ripple::const_iterator::operator++(int) : nonzero index"); + "xrpl::const_iterator::operator++(int) : nonzero index"); const_iterator tmp(*this); ++(*this); return tmp; @@ -98,7 +98,7 @@ const_iterator::next_page() { page_ = keylet::page(root_, next); sle_ = view_->read(page_); - XRPL_ASSERT(sle_, "ripple::const_iterator::next_page : non-null SLE"); + XRPL_ASSERT(sle_, "xrpl::const_iterator::next_page : non-null SLE"); indexes_ = &sle_->getFieldV256(sfIndexes); if (indexes_->empty()) { @@ -120,4 +120,4 @@ const_iterator::page_size() return indexes_->size(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/OpenView.cpp b/src/libxrpl/ledger/OpenView.cpp index 8ddb11abd0..5df3ed7cda 100644 --- a/src/libxrpl/ledger/OpenView.cpp +++ b/src/libxrpl/ledger/OpenView.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { class OpenView::txs_iter_impl : public txs_type::iter_base { @@ -250,4 +250,4 @@ OpenView::rawTxInsert( LogicError("rawTxInsert: duplicate TX id: " + to_string(key)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/PaymentSandbox.cpp b/src/libxrpl/ledger/PaymentSandbox.cpp index 94d30529bf..09600ae623 100644 --- a/src/libxrpl/ledger/PaymentSandbox.cpp +++ b/src/libxrpl/ledger/PaymentSandbox.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -28,10 +28,10 @@ DeferredCredits::credit( { XRPL_ASSERT( sender != receiver, - "ripple::detail::DeferredCredits::credit : sender is not receiver"); + "xrpl::detail::DeferredCredits::credit : sender is not receiver"); XRPL_ASSERT( !amount.negative(), - "ripple::detail::DeferredCredits::credit : positive amount"); + "xrpl::detail::DeferredCredits::credit : positive amount"); auto const k = makeKey(sender, receiver, amount.getCurrency()); auto i = credits_.find(k); @@ -234,14 +234,14 @@ PaymentSandbox::adjustOwnerCountHook( void PaymentSandbox::apply(RawView& to) { - XRPL_ASSERT(!ps_, "ripple::PaymentSandbox::apply : non-null sandbox"); + XRPL_ASSERT(!ps_, "xrpl::PaymentSandbox::apply : non-null sandbox"); items_.apply(to); } void PaymentSandbox::apply(PaymentSandbox& to) { - XRPL_ASSERT(ps_ == &to, "ripple::PaymentSandbox::apply : matching sandbox"); + XRPL_ASSERT(ps_ == &to, "xrpl::PaymentSandbox::apply : matching sandbox"); items_.apply(to); tab_.apply(to.tab_); } @@ -327,7 +327,7 @@ PaymentSandbox::balanceChanges(ReadView const& view) const auto const at = after->getType(); XRPL_ASSERT( at == before->getType(), - "ripple::PaymentSandbox::balanceChanges : after and before " + "xrpl::PaymentSandbox::balanceChanges : after and before " "types matching"); switch (at) { @@ -377,4 +377,4 @@ PaymentSandbox::xrpDestroyed() const return items_.dropsDestroyed(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/RawStateTable.cpp b/src/libxrpl/ledger/RawStateTable.cpp index 8ba97b76c2..b958e94c54 100644 --- a/src/libxrpl/ledger/RawStateTable.cpp +++ b/src/libxrpl/ledger/RawStateTable.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { class RawStateTable::sles_iter_impl : public ReadView::sles_type::iter_base @@ -46,7 +46,7 @@ public: { XRPL_ASSERT( end1_ == p->end1_ && end0_ == p->end0_, - "ripple::detail::RawStateTable::equal : matching end " + "xrpl::detail::RawStateTable::equal : matching end " "iterators"); return iter1_ == p->iter1_ && iter0_ == p->iter0_; } @@ -59,7 +59,7 @@ public: { XRPL_ASSERT( sle1_ || sle0_, - "ripple::detail::RawStateTable::increment : either SLE is " + "xrpl::detail::RawStateTable::increment : either SLE is " "non-null"); if (sle1_ && !sle0_) @@ -167,8 +167,7 @@ bool RawStateTable::exists(ReadView const& base, Keylet const& k) const { XRPL_ASSERT( - k.key.isNonZero(), - "ripple::detail::RawStateTable::exists : nonzero key"); + k.key.isNonZero(), "xrpl::detail::RawStateTable::exists : nonzero key"); auto const iter = items_.find(k.key); if (iter == items_.end()) return base.exists(k); @@ -339,4 +338,4 @@ RawStateTable::slesUpperBound(ReadView const& base, uint256 const& key) const } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/ReadView.cpp b/src/libxrpl/ledger/ReadView.cpp index 0d72a80b3c..e0764d6c81 100644 --- a/src/libxrpl/ledger/ReadView.cpp +++ b/src/libxrpl/ledger/ReadView.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { ReadView::sles_type::sles_type(ReadView const& view) : ReadViewFwdRange(view) { @@ -68,4 +68,4 @@ makeRulesGivenLedger( return Rules(presets); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/ledger/View.cpp b/src/libxrpl/ledger/View.cpp index d5297479e8..c817a85b65 100644 --- a/src/libxrpl/ledger/View.cpp +++ b/src/libxrpl/ledger/View.cpp @@ -19,7 +19,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -40,7 +40,7 @@ internalDirNext( auto const& svIndexes = page->getFieldV256(sfIndexes); XRPL_ASSERT( index <= svIndexes.size(), - "ripple::detail::internalDirNext : index inside range"); + "xrpl::detail::internalDirNext : index inside range"); if (index >= svIndexes.size()) { @@ -57,7 +57,7 @@ internalDirNext( else page = view.peek(keylet::page(root, next)); - XRPL_ASSERT(page, "ripple::detail::internalDirNext : non-null root"); + XRPL_ASSERT(page, "xrpl::detail::internalDirNext : non-null root"); if (!page) return false; @@ -307,7 +307,7 @@ isVaultPseudoAccountFrozen( if (mptIssuer == nullptr) { // LCOV_EXCL_START - UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null MPToken issuer"); + UNREACHABLE("xrpl::isVaultPseudoAccountFrozen : null MPToken issuer"); return false; // LCOV_EXCL_STOP } @@ -319,7 +319,7 @@ isVaultPseudoAccountFrozen( view.read(keylet::vault(mptIssuer->getFieldH256(sfVaultID))); if (vault == nullptr) { // LCOV_EXCL_START - UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null vault"); + UNREACHABLE("xrpl::isVaultPseudoAccountFrozen : null vault"); return false; // LCOV_EXCL_STOP } @@ -711,7 +711,7 @@ confineOwnerCount( << "Account " << *id << " owner count set below 0!"; } adjusted = 0; - XRPL_ASSERT(!id, "ripple::confineOwnerCount : id is not set"); + XRPL_ASSERT(!id, "xrpl::confineOwnerCount : id is not set"); } } return adjusted; @@ -761,8 +761,7 @@ forEachItem( Keylet const& root, std::function const&)> const& f) { - XRPL_ASSERT( - root.type == ltDIR_NODE, "ripple::forEachItem : valid root type"); + XRPL_ASSERT(root.type == ltDIR_NODE, "xrpl::forEachItem : valid root type"); if (root.type != ltDIR_NODE) return; @@ -793,7 +792,7 @@ forEachItemAfter( std::function const&)> const& f) { XRPL_ASSERT( - root.type == ltDIR_NODE, "ripple::forEachItemAfter : valid root type"); + root.type == ltDIR_NODE, "xrpl::forEachItemAfter : valid root type"); if (root.type != ltDIR_NODE) return false; @@ -1084,7 +1083,7 @@ hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal) XRPL_ASSERT( hashIndex->getFieldU32(sfLastLedgerSequence) == (ledger.seq() - 1), - "ripple::hashOfSeq : matching ledger sequence"); + "xrpl::hashOfSeq : matching ledger sequence"); STVector256 vec = hashIndex->getFieldV256(sfHashes); if (vec.size() >= diff) return vec[vec.size() - diff]; @@ -1112,9 +1111,9 @@ hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal) if (hashIndex) { auto const lastSeq = hashIndex->getFieldU32(sfLastLedgerSequence); - XRPL_ASSERT(lastSeq >= seq, "ripple::hashOfSeq : minimum last ledger"); + XRPL_ASSERT(lastSeq >= seq, "xrpl::hashOfSeq : minimum last ledger"); XRPL_ASSERT( - (lastSeq & 0xff) == 0, "ripple::hashOfSeq : valid last ledger"); + (lastSeq & 0xff) == 0, "xrpl::hashOfSeq : valid last ledger"); auto const diff = (lastSeq - seq) >> 8; STVector256 vec = hashIndex->getFieldV256(sfHashes); if (vec.size() > diff) @@ -1140,7 +1139,7 @@ adjustOwnerCount( { if (!sle) return; - XRPL_ASSERT(amount, "ripple::adjustOwnerCount : nonzero amount input"); + XRPL_ASSERT(amount, "xrpl::adjustOwnerCount : nonzero amount input"); std::uint32_t const current{sle->getFieldU32(sfOwnerCount)}; AccountID const id = (*sle)[sfAccount]; std::uint32_t const adjusted = confineOwnerCount(current, amount, id, j); @@ -1205,7 +1204,7 @@ getPseudoAccountFields() { // LCOV_EXCL_START LogicError( - "ripple::getPseudoAccountFields : unable to find account root " + "xrpl::getPseudoAccountFields : unable to find account root " "ledger " "format"); // LCOV_EXCL_STOP @@ -1258,7 +1257,7 @@ createPseudoAccount( [&ownerField](SField const* sf) -> bool { return *sf == ownerField; }) == 1, - "ripple::createPseudoAccount : valid owner field"); + "xrpl::createPseudoAccount : valid owner field"); auto const accountId = pseudoAccountAddress(view, pseudoOwnerKey); if (accountId == beast::zero) @@ -1577,7 +1576,7 @@ authorizeMPToken( { // LCOV_EXCL_START UNREACHABLE( - "ripple::authorizeMPToken : invalid issuance or issuers token"); + "xrpl::authorizeMPToken : invalid issuance or issuers token"); if (view.rules().enabled(featureLendingProtocol)) return tecINTERNAL; // LCOV_EXCL_STOP @@ -1661,7 +1660,7 @@ trustCreate( if (uLowAccountID == uHighAccountID) { // LCOV_EXCL_START - UNREACHABLE("ripple::trustCreate : trust line to self"); + UNREACHABLE("xrpl::trustCreate : trust line to self"); if (view.rules().enabled(featureLendingProtocol)) return tecINTERNAL; // LCOV_EXCL_STOP @@ -1689,14 +1688,14 @@ trustCreate( bool const bSetDst = saLimit.getIssuer() == uDstAccountID; bool const bSetHigh = bSrcHigh ^ bSetDst; - XRPL_ASSERT(sleAccount, "ripple::trustCreate : non-null SLE"); + XRPL_ASSERT(sleAccount, "xrpl::trustCreate : non-null SLE"); if (!sleAccount) return tefINTERNAL; // LCOV_EXCL_LINE XRPL_ASSERT( sleAccount->getAccountID(sfAccount) == (bSetHigh ? uHighAccountID : uLowAccountID), - "ripple::trustCreate : matching account ID"); + "xrpl::trustCreate : matching account ID"); auto const slePeer = view.peek(keylet::account(bSetHigh ? uLowAccountID : uHighAccountID)); if (!slePeer) @@ -1933,7 +1932,7 @@ offerDelete(ApplyView& view, std::shared_ptr const& sle, beast::Journal j) { XRPL_ASSERT( sle->isFlag(lsfHybrid) && sle->isFieldPresent(sfDomainID), - "ripple::offerDelete : should be a hybrid domain offer"); + "xrpl::offerDelete : should be a hybrid domain offer"); auto const& additionalBookDirs = sle->getFieldArray(sfAdditionalBooks); @@ -1976,23 +1975,23 @@ rippleCreditIOU( // Make sure issuer is involved. XRPL_ASSERT( !bCheckIssuer || uSenderID == issuer || uReceiverID == issuer, - "ripple::rippleCreditIOU : matching issuer or don't care"); + "xrpl::rippleCreditIOU : matching issuer or don't care"); (void)issuer; // Disallow sending to self. XRPL_ASSERT( uSenderID != uReceiverID, - "ripple::rippleCreditIOU : sender is not receiver"); + "xrpl::rippleCreditIOU : sender is not receiver"); bool const bSenderHigh = uSenderID > uReceiverID; auto const index = keylet::line(uSenderID, uReceiverID, currency); XRPL_ASSERT( !isXRP(uSenderID) && uSenderID != noAccount(), - "ripple::rippleCreditIOU : sender is not XRP"); + "xrpl::rippleCreditIOU : sender is not XRP"); XRPL_ASSERT( !isXRP(uReceiverID) && uReceiverID != noAccount(), - "ripple::rippleCreditIOU : receiver is not XRP"); + "xrpl::rippleCreditIOU : receiver is not XRP"); // If the line exists, modify it accordingly. if (auto const sleRippleState = view.peek(index)) @@ -2129,10 +2128,10 @@ rippleSendIOU( XRPL_ASSERT( !isXRP(uSenderID) && !isXRP(uReceiverID), - "ripple::rippleSendIOU : neither sender nor receiver is XRP"); + "xrpl::rippleSendIOU : neither sender nor receiver is XRP"); XRPL_ASSERT( uSenderID != uReceiverID, - "ripple::rippleSendIOU : sender is not receiver"); + "xrpl::rippleSendIOU : sender is not receiver"); if (uSenderID == issuer || uReceiverID == issuer || issuer == noAccount()) { @@ -2183,7 +2182,7 @@ rippleSendMultiIOU( auto const& issuer = issue.getIssuer(); XRPL_ASSERT( - !isXRP(senderID), "ripple::rippleSendMultiIOU : sender is not XRP"); + !isXRP(senderID), "xrpl::rippleSendMultiIOU : sender is not XRP"); // These may diverge STAmount takeFromSender{issue}; @@ -2203,7 +2202,7 @@ rippleSendMultiIOU( XRPL_ASSERT( !isXRP(receiverID), - "ripple::rippleSendMultiIOU : receiver is not XRP"); + "xrpl::rippleSendMultiIOU : receiver is not XRP"); if (senderID == issuer || receiverID == issuer || issuer == noAccount()) { @@ -2269,7 +2268,7 @@ accountSendIOU( // LCOV_EXCL_START XRPL_ASSERT( saAmount >= beast::zero && !saAmount.holds(), - "ripple::accountSendIOU : minimum amount and not MPT"); + "xrpl::accountSendIOU : minimum amount and not MPT"); // LCOV_EXCL_STOP } @@ -2383,7 +2382,7 @@ accountSendMultiIOU( { XRPL_ASSERT_PARTS( receivers.size() > 1, - "ripple::accountSendMultiIOU", + "xrpl::accountSendMultiIOU", "multiple recipients provided"); if (!issue.native()) @@ -2584,7 +2583,7 @@ rippleSendMPT( { XRPL_ASSERT( uSenderID != uReceiverID, - "ripple::rippleSendMPT : sender is not receiver"); + "xrpl::rippleSendMPT : sender is not receiver"); // Safe to get MPT since rippleSendMPT is only called by accountSendMPT auto const& issuer = saAmount.getIssuer(); @@ -2745,7 +2744,7 @@ accountSendMPT( { XRPL_ASSERT( saAmount >= beast::zero && saAmount.holds(), - "ripple::accountSendMPT : minimum amount and MPT"); + "xrpl::accountSendMPT : minimum amount and MPT"); /* If we aren't sending anything or if the sender is the same as the * receiver then we don't need to do anything. @@ -2806,7 +2805,7 @@ accountSendMulti( { XRPL_ASSERT_PARTS( receivers.size() > 1, - "ripple::accountSendMulti", + "xrpl::accountSendMulti", "multiple recipients provided"); return std::visit( [&](TIss const& issue) { @@ -2883,14 +2882,14 @@ issueIOU( { XRPL_ASSERT( !isXRP(account) && !isXRP(issue.account), - "ripple::issueIOU : neither account nor issuer is XRP"); + "xrpl::issueIOU : neither account nor issuer is XRP"); // Consistency check - XRPL_ASSERT(issue == amount.issue(), "ripple::issueIOU : matching issue"); + XRPL_ASSERT(issue == amount.issue(), "xrpl::issueIOU : matching issue"); // Can't send to self! XRPL_ASSERT( - issue.account != account, "ripple::issueIOU : not issuer account"); + issue.account != account, "xrpl::issueIOU : not issuer account"); JLOG(j.trace()) << "issueIOU: " << to_string(account) << ": " << amount.getFullText(); @@ -2983,14 +2982,14 @@ redeemIOU( { XRPL_ASSERT( !isXRP(account) && !isXRP(issue.account), - "ripple::redeemIOU : neither account nor issuer is XRP"); + "xrpl::redeemIOU : neither account nor issuer is XRP"); // Consistency check - XRPL_ASSERT(issue == amount.issue(), "ripple::redeemIOU : matching issue"); + XRPL_ASSERT(issue == amount.issue(), "xrpl::redeemIOU : matching issue"); // Can't send to self! XRPL_ASSERT( - issue.account != account, "ripple::redeemIOU : not issuer account"); + issue.account != account, "xrpl::redeemIOU : not issuer account"); JLOG(j.trace()) << "redeemIOU: " << to_string(account) << ": " << amount.getFullText(); @@ -3057,10 +3056,10 @@ transferXRP( beast::Journal j) { XRPL_ASSERT( - from != beast::zero, "ripple::transferXRP : nonzero from account"); - XRPL_ASSERT(to != beast::zero, "ripple::transferXRP : nonzero to account"); - XRPL_ASSERT(from != to, "ripple::transferXRP : sender is not receiver"); - XRPL_ASSERT(amount.native(), "ripple::transferXRP : amount is XRP"); + from != beast::zero, "xrpl::transferXRP : nonzero from account"); + XRPL_ASSERT(to != beast::zero, "xrpl::transferXRP : nonzero to account"); + XRPL_ASSERT(from != to, "xrpl::transferXRP : sender is not receiver"); + XRPL_ASSERT(amount.native(), "xrpl::transferXRP : amount is XRP"); SLE::pointer const sender = view.peek(keylet::account(from)); SLE::pointer const receiver = view.peek(keylet::account(to)); @@ -3194,7 +3193,7 @@ requireAuth( { XRPL_ASSERT( sleIssuance->getFieldU32(sfFlags) & lsfMPTRequireAuth, - "ripple::requireAuth : issuance requires authorization"); + "xrpl::requireAuth : issuance requires authorization"); // ter = tefINTERNAL | tecOBJECT_NOT_FOUND | tecNO_AUTH | tecEXPIRED if (auto const ter = credentials::validDomain(view, *maybeDomainID, account); @@ -3235,7 +3234,7 @@ enforceMPTokenAuthorization( XRPL_ASSERT( sleIssuance->isFlag(lsfMPTRequireAuth), - "ripple::enforceMPTokenAuthorization : authorization required"); + "xrpl::enforceMPTokenAuthorization : authorization required"); if (account == sleIssuance->at(sfIssuer)) return tefINTERNAL; // LCOV_EXCL_LINE @@ -3281,7 +3280,7 @@ enforceMPTokenAuthorization( // MPToken which requires authorization by the token issuer. XRPL_ASSERT( sleToken != nullptr && !maybeDomainID.has_value(), - "ripple::enforceMPTokenAuthorization : found MPToken"); + "xrpl::enforceMPTokenAuthorization : found MPToken"); if (sleToken->isFlag(lsfMPTAuthorized)) return tesSUCCESS; @@ -3293,7 +3292,7 @@ enforceMPTokenAuthorization( // lsfMPTAuthorized because it is meaningless. Return tesSUCCESS XRPL_ASSERT( maybeDomainID.has_value(), - "ripple::enforceMPTokenAuthorization : found MPToken for domain"); + "xrpl::enforceMPTokenAuthorization : found MPToken for domain"); return tesSUCCESS; } else if (authorizedByDomain) @@ -3302,7 +3301,7 @@ enforceMPTokenAuthorization( // authorized by domain. Proceed to create it, then return tesSUCCESS XRPL_ASSERT( maybeDomainID.has_value() && sleToken == nullptr, - "ripple::enforceMPTokenAuthorization : new MPToken for domain"); + "xrpl::enforceMPTokenAuthorization : new MPToken for domain"); if (auto const err = authorizeMPToken( view, priorBalance, // priorBalance @@ -3317,7 +3316,7 @@ enforceMPTokenAuthorization( // LCOV_EXCL_START UNREACHABLE( - "ripple::enforceMPTokenAuthorization : condition list is incomplete"); + "xrpl::enforceMPTokenAuthorization : condition list is incomplete"); return tefINTERNAL; // LCOV_EXCL_STOP } @@ -3441,7 +3440,7 @@ cleanupOnAccountDelete( // back to 'it' to "un-invalidate" the iterator. XRPL_ASSERT( uDirEntry >= 1, - "ripple::cleanupOnAccountDelete : minimum dir entries"); + "xrpl::cleanupOnAccountDelete : minimum dir entries"); if (uDirEntry == 0) { // LCOV_EXCL_START @@ -3529,8 +3528,7 @@ rippleCredit( else { XRPL_ASSERT( - !bCheckIssuer, - "ripple::rippleCredit : not checking issuer"); + !bCheckIssuer, "xrpl::rippleCredit : not checking issuer"); return rippleCreditMPT( view, uSenderID, uReceiverID, saAmount, j); } @@ -3546,10 +3544,10 @@ assetsToSharesDeposit( { XRPL_ASSERT( !assets.negative(), - "ripple::assetsToSharesDeposit : non-negative assets"); + "xrpl::assetsToSharesDeposit : non-negative assets"); XRPL_ASSERT( assets.asset() == vault->at(sfAsset), - "ripple::assetsToSharesDeposit : assets and vault match"); + "xrpl::assetsToSharesDeposit : assets and vault match"); if (assets.negative() || assets.asset() != vault->at(sfAsset)) return std::nullopt; // LCOV_EXCL_LINE @@ -3574,10 +3572,10 @@ sharesToAssetsDeposit( { XRPL_ASSERT( !shares.negative(), - "ripple::sharesToAssetsDeposit : non-negative shares"); + "xrpl::sharesToAssetsDeposit : non-negative shares"); XRPL_ASSERT( shares.asset() == vault->at(sfShareMPTID), - "ripple::sharesToAssetsDeposit : shares and vault match"); + "xrpl::sharesToAssetsDeposit : shares and vault match"); if (shares.negative() || shares.asset() != vault->at(sfShareMPTID)) return std::nullopt; // LCOV_EXCL_LINE @@ -3604,10 +3602,10 @@ assetsToSharesWithdraw( { XRPL_ASSERT( !assets.negative(), - "ripple::assetsToSharesDeposit : non-negative assets"); + "xrpl::assetsToSharesDeposit : non-negative assets"); XRPL_ASSERT( assets.asset() == vault->at(sfAsset), - "ripple::assetsToSharesWithdraw : assets and vault match"); + "xrpl::assetsToSharesWithdraw : assets and vault match"); if (assets.negative() || assets.asset() != vault->at(sfAsset)) return std::nullopt; // LCOV_EXCL_LINE @@ -3632,10 +3630,10 @@ sharesToAssetsWithdraw( { XRPL_ASSERT( !shares.negative(), - "ripple::sharesToAssetsDeposit : non-negative shares"); + "xrpl::sharesToAssetsDeposit : non-negative shares"); XRPL_ASSERT( shares.asset() == vault->at(sfShareMPTID), - "ripple::sharesToAssetsWithdraw : shares and vault match"); + "xrpl::sharesToAssetsWithdraw : shares and vault match"); if (shares.negative() || shares.asset() != vault->at(sfShareMPTID)) return std::nullopt; // LCOV_EXCL_LINE @@ -3758,7 +3756,7 @@ rippleUnlockEscrowMPT( if (!view.rules().enabled(fixTokenEscrowV1)) XRPL_ASSERT( netAmount == grossAmount, - "ripple::rippleUnlockEscrowMPT : netAmount == grossAmount"); + "xrpl::rippleUnlockEscrowMPT : netAmount == grossAmount"); auto const& issuer = netAmount.getIssuer(); auto const& mptIssue = netAmount.get(); @@ -3926,4 +3924,4 @@ after(NetClock::time_point now, std::uint32_t mark) return now.time_since_epoch().count() > mark; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/net/HTTPClient.cpp b/src/libxrpl/net/HTTPClient.cpp index 807b5f9823..6057d81a1e 100644 --- a/src/libxrpl/net/HTTPClient.cpp +++ b/src/libxrpl/net/HTTPClient.cpp @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { static std::optional httpClientSSLContext; @@ -605,4 +605,4 @@ HTTPClient::request( client->request(bSSL, deqSites, setRequest, timeout, complete); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/net/RegisterSSLCerts.cpp b/src/libxrpl/net/RegisterSSLCerts.cpp index b93e70463b..f489cf29a3 100644 --- a/src/libxrpl/net/RegisterSSLCerts.cpp +++ b/src/libxrpl/net/RegisterSSLCerts.cpp @@ -13,7 +13,7 @@ #include #endif -namespace ripple { +namespace xrpl { void registerSSLCerts( @@ -89,7 +89,7 @@ registerSSLCerts( #endif } -} // namespace ripple +} // namespace xrpl // There is a very unpleasant interaction between and // openssl x509 types (namely the former has macros that stomp diff --git a/src/libxrpl/nodestore/BatchWriter.cpp b/src/libxrpl/nodestore/BatchWriter.cpp index cb5f7bb436..3ce7900480 100644 --- a/src/libxrpl/nodestore/BatchWriter.cpp +++ b/src/libxrpl/nodestore/BatchWriter.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { BatchWriter::BatchWriter(Callback& callback, Scheduler& scheduler) @@ -66,7 +66,7 @@ BatchWriter::writeBatch() mWriteSet.swap(set); XRPL_ASSERT( mWriteSet.empty(), - "ripple::NodeStore::BatchWriter::writeBatch : writes not set"); + "xrpl::NodeStore::BatchWriter::writeBatch : writes not set"); mWriteLoad = set.size(); if (set.empty()) @@ -102,4 +102,4 @@ BatchWriter::waitForWriting() } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/Database.cpp b/src/libxrpl/nodestore/Database.cpp index e80efee115..41e8ac8632 100644 --- a/src/libxrpl/nodestore/Database.cpp +++ b/src/libxrpl/nodestore/Database.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { Database::Database( @@ -24,7 +24,7 @@ Database::Database( { XRPL_ASSERT( readThreads, - "ripple::NodeStore::Database::Database : nonzero threads input"); + "xrpl::NodeStore::Database::Database : nonzero threads input"); if (earliestLedgerSeq_ < 1) Throw("Invalid earliest_seq"); @@ -73,7 +73,7 @@ Database::Database( { XRPL_ASSERT( !it->second.empty(), - "ripple::NodeStore::Database::Database : non-empty " + "xrpl::NodeStore::Database::Database : non-empty " "data"); auto const& hash = it->first; @@ -150,7 +150,7 @@ Database::stop() { XRPL_ASSERT( steady_clock::now() - start < 30s, - "ripple::NodeStore::Database::stop : maximum stop duration"); + "xrpl::NodeStore::Database::stop : maximum stop duration"); std::this_thread::yield(); } @@ -203,7 +203,7 @@ Database::importInternal(Backend& dstBackend, Database& srcDB) srcDB.for_each([&](std::shared_ptr nodeObject) { XRPL_ASSERT( nodeObject, - "ripple::NodeStore::Database::importInternal : non-null node"); + "xrpl::NodeStore::Database::importInternal : non-null node"); if (!nodeObject) // This should never happen return; @@ -249,7 +249,7 @@ Database::getCountsJson(Json::Value& obj) { XRPL_ASSERT( obj.isObject(), - "ripple::NodeStore::Database::getCountsJson : valid input type"); + "xrpl::NodeStore::Database::getCountsJson : valid input type"); { std::unique_lock lock(readLock_); @@ -269,4 +269,4 @@ Database::getCountsJson(Json::Value& obj) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DatabaseNodeImp.cpp b/src/libxrpl/nodestore/DatabaseNodeImp.cpp index a83d531b66..0578351e58 100644 --- a/src/libxrpl/nodestore/DatabaseNodeImp.cpp +++ b/src/libxrpl/nodestore/DatabaseNodeImp.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { void @@ -194,4 +194,4 @@ DatabaseNodeImp::fetchBatch(std::vector const& hashes) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp index dabe38ec8b..f51771f023 100644 --- a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp +++ b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { DatabaseRotatingImp::DatabaseRotatingImp( @@ -192,4 +192,4 @@ DatabaseRotatingImp::for_each( } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DecodedBlob.cpp b/src/libxrpl/nodestore/DecodedBlob.cpp index 11387ed8c8..e3d54fae78 100644 --- a/src/libxrpl/nodestore/DecodedBlob.cpp +++ b/src/libxrpl/nodestore/DecodedBlob.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { DecodedBlob::DecodedBlob(void const* key, void const* value, int valueBytes) @@ -56,7 +56,7 @@ DecodedBlob::createObject() { XRPL_ASSERT( m_success, - "ripple::NodeStore::DecodedBlob::createObject : valid object type"); + "xrpl::NodeStore::DecodedBlob::createObject : valid object type"); std::shared_ptr object; @@ -72,4 +72,4 @@ DecodedBlob::createObject() } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DummyScheduler.cpp b/src/libxrpl/nodestore/DummyScheduler.cpp index 9ba7c25cfb..21c1b5c92e 100644 --- a/src/libxrpl/nodestore/DummyScheduler.cpp +++ b/src/libxrpl/nodestore/DummyScheduler.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { void @@ -21,4 +21,4 @@ DummyScheduler::onBatchWrite(BatchWriteReport const& report) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/ManagerImp.cpp b/src/libxrpl/nodestore/ManagerImp.cpp index 627550c4e9..b53d03e668 100644 --- a/src/libxrpl/nodestore/ManagerImp.cpp +++ b/src/libxrpl/nodestore/ManagerImp.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -95,7 +95,7 @@ ManagerImp::erase(Factory& factory) }); XRPL_ASSERT( iter != list_.end(), - "ripple::NodeStore::ManagerImp::erase : valid input"); + "xrpl::NodeStore::ManagerImp::erase : valid input"); list_.erase(iter); } @@ -121,4 +121,4 @@ Manager::instance() } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/NodeObject.cpp b/src/libxrpl/nodestore/NodeObject.cpp index 953a23b70e..3758862e18 100644 --- a/src/libxrpl/nodestore/NodeObject.cpp +++ b/src/libxrpl/nodestore/NodeObject.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { //------------------------------------------------------------------------------ @@ -40,4 +40,4 @@ NodeObject::getData() const return mData; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/MemoryFactory.cpp b/src/libxrpl/nodestore/backend/MemoryFactory.cpp index d4f14b7560..923ae95ebb 100644 --- a/src/libxrpl/nodestore/backend/MemoryFactory.cpp +++ b/src/libxrpl/nodestore/backend/MemoryFactory.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { struct MemoryDB @@ -122,7 +122,7 @@ public: fetch(void const* key, std::shared_ptr* pObject) override { XRPL_ASSERT( - db_, "ripple::NodeStore::MemoryBackend::fetch : non-null database"); + db_, "xrpl::NodeStore::MemoryBackend::fetch : non-null database"); uint256 const hash(uint256::fromVoid(key)); std::lock_guard _(db_->mutex); @@ -159,7 +159,7 @@ public: store(std::shared_ptr const& object) override { XRPL_ASSERT( - db_, "ripple::NodeStore::MemoryBackend::store : non-null database"); + db_, "xrpl::NodeStore::MemoryBackend::store : non-null database"); std::lock_guard _(db_->mutex); db_->table.emplace(object->getHash(), object); } @@ -181,7 +181,7 @@ public: { XRPL_ASSERT( db_, - "ripple::NodeStore::MemoryBackend::for_each : non-null database"); + "xrpl::NodeStore::MemoryBackend::for_each : non-null database"); for (auto const& e : db_->table) f(e.second); } @@ -229,4 +229,4 @@ MemoryFactory::createInstance( } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/NuDBFactory.cpp b/src/libxrpl/nodestore/backend/NuDBFactory.cpp index 9d4297ac27..71a5811162 100644 --- a/src/libxrpl/nodestore/backend/NuDBFactory.cpp +++ b/src/libxrpl/nodestore/backend/NuDBFactory.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { class NuDBBackend : public Backend @@ -113,7 +113,7 @@ public: { // LCOV_EXCL_START UNREACHABLE( - "ripple::NodeStore::NuDBBackend::open : database is already " + "xrpl::NodeStore::NuDBBackend::open : database is already " "open"); JLOG(j_.error()) << "database is already open"; return; @@ -455,4 +455,4 @@ registerNuDBFactory(Manager& manager) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/NullFactory.cpp b/src/libxrpl/nodestore/backend/NullFactory.cpp index f533693416..ffe1eb931f 100644 --- a/src/libxrpl/nodestore/backend/NullFactory.cpp +++ b/src/libxrpl/nodestore/backend/NullFactory.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { class NullBackend : public Backend @@ -126,4 +126,4 @@ registerNullFactory(Manager& manager) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/RocksDBFactory.cpp b/src/libxrpl/nodestore/backend/RocksDBFactory.cpp index 01e87f338e..97d5484554 100644 --- a/src/libxrpl/nodestore/backend/RocksDBFactory.cpp +++ b/src/libxrpl/nodestore/backend/RocksDBFactory.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { class RocksDBEnv : public rocksdb::EnvWrapper @@ -213,7 +213,7 @@ public: { // LCOV_EXCL_START UNREACHABLE( - "ripple::NodeStore::RocksDBBackend::open : database is already " + "xrpl::NodeStore::RocksDBBackend::open : database is already " "open"); JLOG(m_journal.error()) << "database is already open"; return; @@ -261,8 +261,7 @@ public: fetch(void const* key, std::shared_ptr* pObject) override { XRPL_ASSERT( - m_db, - "ripple::NodeStore::RocksDBBackend::fetch : non-null database"); + m_db, "xrpl::NodeStore::RocksDBBackend::fetch : non-null database"); pObject->reset(); Status status(ok); @@ -340,7 +339,7 @@ public: { XRPL_ASSERT( m_db, - "ripple::NodeStore::RocksDBBackend::storeBatch : non-null " + "xrpl::NodeStore::RocksDBBackend::storeBatch : non-null " "database"); rocksdb::WriteBatch wb; @@ -375,7 +374,7 @@ public: { XRPL_ASSERT( m_db, - "ripple::NodeStore::RocksDBBackend::for_each : non-null database"); + "xrpl::NodeStore::RocksDBBackend::for_each : non-null database"); rocksdb::ReadOptions const options; std::unique_ptr it(m_db->NewIterator(options)); @@ -477,6 +476,6 @@ registerRocksDBFactory(Manager& manager) } } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/libxrpl/protocol/AMMCore.cpp b/src/libxrpl/protocol/AMMCore.cpp index a91da3ff6c..71ce6ea98e 100644 --- a/src/libxrpl/protocol/AMMCore.cpp +++ b/src/libxrpl/protocol/AMMCore.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { Currency ammLPTCurrency(Currency const& cur1, Currency const& cur2) @@ -93,7 +93,7 @@ ammAuctionTimeSlot(std::uint64_t current, STObject const& auctionSlot) auto const expiration = auctionSlot[sfExpiration]; XRPL_ASSERT( expiration >= TOTAL_TIME_SLOT_SECS, - "ripple::ammAuctionTimeSlot : minimum expiration"); + "xrpl::ammAuctionTimeSlot : minimum expiration"); if (expiration >= TOTAL_TIME_SLOT_SECS) { if (auto const start = expiration - TOTAL_TIME_SLOT_SECS; @@ -112,4 +112,4 @@ ammEnabled(Rules const& rules) return rules.enabled(featureAMM) && rules.enabled(fixUniversalNumber); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/AccountID.cpp b/src/libxrpl/protocol/AccountID.cpp index 4032d4f829..779018613f 100644 --- a/src/libxrpl/protocol/AccountID.cpp +++ b/src/libxrpl/protocol/AccountID.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -68,7 +68,7 @@ public: XRPL_ASSERT( ret.size() <= 38, - "ripple::detail::AccountIdCache : maximum result size"); + "xrpl::detail::AccountIdCache : maximum result size"); { std::lock_guard lock(sl); @@ -181,4 +181,4 @@ to_issuer(AccountID& issuer, std::string const& s) return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Asset.cpp b/src/libxrpl/protocol/Asset.cpp index 54c6732825..1a4a94f744 100644 --- a/src/libxrpl/protocol/Asset.cpp +++ b/src/libxrpl/protocol/Asset.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { AccountID const& Asset::getIssuer() const @@ -66,4 +66,4 @@ assetFromJson(Json::Value const& v) return mptIssueFromJson(v); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Book.cpp b/src/libxrpl/protocol/Book.cpp index 0315cf83ae..d26aaf3384 100644 --- a/src/libxrpl/protocol/Book.cpp +++ b/src/libxrpl/protocol/Book.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { bool isConsistent(Book const& book) @@ -32,4 +32,4 @@ reversed(Book const& book) return Book(book.out, book.in, book.domain); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/BuildInfo.cpp b/src/libxrpl/protocol/BuildInfo.cpp index 7690ae586b..472a8cb039 100644 --- a/src/libxrpl/protocol/BuildInfo.cpp +++ b/src/libxrpl/protocol/BuildInfo.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace BuildInfo { @@ -159,4 +159,4 @@ isNewerVersion(std::uint64_t version) } // namespace BuildInfo -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/ErrorCodes.cpp b/src/libxrpl/protocol/ErrorCodes.cpp index 5d7accb4a1..f37ba0c8e4 100644 --- a/src/libxrpl/protocol/ErrorCodes.cpp +++ b/src/libxrpl/protocol/ErrorCodes.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { namespace detail { @@ -205,8 +205,8 @@ rpcErrorString(Json::Value const& jv) { XRPL_ASSERT( RPC::contains_error(jv), - "ripple::RPC::rpcErrorString : input contains an error"); + "xrpl::RPC::rpcErrorString : input contains an error"); return jv[jss::error].asString() + jv[jss::error_message].asString(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Feature.cpp b/src/libxrpl/protocol/Feature.cpp index 10c42ccb8a..dc4fd105b5 100644 --- a/src/libxrpl/protocol/Feature.cpp +++ b/src/libxrpl/protocol/Feature.cpp @@ -19,10 +19,10 @@ #include #include -namespace ripple { +namespace xrpl { inline std::size_t -hash_value(ripple::uint256 const& feature) +hash_value(xrpl::uint256 const& feature) { std::size_t seed = 0; using namespace boost; @@ -205,7 +205,7 @@ public: FeatureCollections::FeatureCollections() { - features.reserve(ripple::detail::numFeatures); + features.reserve(xrpl::detail::numFeatures); } std::optional @@ -213,7 +213,7 @@ FeatureCollections::getRegisteredFeature(std::string const& name) const { XRPL_ASSERT( readOnly.load(), - "ripple::FeatureCollections::getRegisteredFeature : startup completed"); + "xrpl::FeatureCollections::getRegisteredFeature : startup completed"); Feature const* feature = getByName(name); if (feature) return feature->feature; @@ -294,7 +294,7 @@ FeatureCollections::featureToBitsetIndex(uint256 const& f) const { XRPL_ASSERT( readOnly.load(), - "ripple::FeatureCollections::featureToBitsetIndex : startup completed"); + "xrpl::FeatureCollections::featureToBitsetIndex : startup completed"); Feature const* feature = getByFeature(f); if (!feature) @@ -308,7 +308,7 @@ FeatureCollections::bitsetIndexToFeature(size_t i) const { XRPL_ASSERT( readOnly.load(), - "ripple::FeatureCollections::bitsetIndexToFeature : startup completed"); + "xrpl::FeatureCollections::bitsetIndexToFeature : startup completed"); Feature const& feature = getByIndex(i); return feature.feature; } @@ -318,7 +318,7 @@ FeatureCollections::featureToName(uint256 const& f) const { XRPL_ASSERT( readOnly.load(), - "ripple::FeatureCollections::featureToName : startup completed"); + "xrpl::FeatureCollections::featureToName : startup completed"); Feature const* feature = getByFeature(f); return feature ? feature->name : to_string(f); } @@ -452,4 +452,4 @@ featureToName(uint256 const& f) [[maybe_unused]] static bool const readOnlySet = featureCollections.registrationIsDone(); -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/IOUAmount.cpp b/src/libxrpl/protocol/IOUAmount.cpp index 3c893709d7..01283886e1 100644 --- a/src/libxrpl/protocol/IOUAmount.cpp +++ b/src/libxrpl/protocol/IOUAmount.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace { @@ -303,4 +303,4 @@ mulRatio( return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Indexes.cpp b/src/libxrpl/protocol/Indexes.cpp index b80f648c98..77fcd44a3e 100644 --- a/src/libxrpl/protocol/Indexes.cpp +++ b/src/libxrpl/protocol/Indexes.cpp @@ -25,7 +25,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Type-specific prefix for calculating ledger indices. @@ -97,8 +97,7 @@ indexHash(LedgerNameSpace space, Args const&... args) uint256 getBookBase(Book const& book) { - XRPL_ASSERT( - isConsistent(book), "ripple::getBookBase : input is consistent"); + XRPL_ASSERT(isConsistent(book), "xrpl::getBookBase : input is consistent"); auto const index = book.domain ? indexHash( LedgerNameSpace::BOOK_DIR, @@ -145,7 +144,7 @@ getTicketIndex(AccountID const& account, std::uint32_t ticketSeq) uint256 getTicketIndex(AccountID const& account, SeqProxy ticketSeq) { - XRPL_ASSERT(ticketSeq.isTicket(), "ripple::getTicketIndex : valid input"); + XRPL_ASSERT(ticketSeq.isTicket(), "xrpl::getTicketIndex : valid input"); return getTicketIndex(account, ticketSeq.value()); } @@ -232,7 +231,7 @@ line( // There is code in SetTrust that calls us with id0 == id1, to allow users // to locate and delete such "weird" trustlines. If we remove that code, we // could enable this assert: - // XRPL_ASSERT(id0 != id1, "ripple::keylet::line : accounts must be + // XRPL_ASSERT(id0 != id1, "xrpl::keylet::line : accounts must be // different"); // A trust line is shared between two accounts; while we typically think @@ -263,7 +262,7 @@ Keylet quality(Keylet const& k, std::uint64_t q) noexcept { XRPL_ASSERT( - k.type == ltDIR_NODE, "ripple::keylet::quality : valid input type"); + k.type == ltDIR_NODE, "xrpl::keylet::quality : valid input type"); // Indexes are stored in big endian format: they print as hex as stored. // Most significant bytes are first and the least significant bytes @@ -283,7 +282,7 @@ next_t::operator()(Keylet const& k) const { XRPL_ASSERT( k.type == ltDIR_NODE, - "ripple::keylet::next_t::operator() : valid input type"); + "xrpl::keylet::next_t::operator() : valid input type"); return {ltDIR_NODE, getQualityNext(k.key)}; } @@ -402,7 +401,7 @@ Keylet nftpage(Keylet const& k, uint256 const& token) { XRPL_ASSERT( - k.type == ltNFTOKEN_PAGE, "ripple::keylet::nftpage : valid input type"); + k.type == ltNFTOKEN_PAGE, "xrpl::keylet::nftpage : valid input type"); return {ltNFTOKEN_PAGE, (k.key & ~nft::pageMask) + (token & nft::pageMask)}; } @@ -577,4 +576,4 @@ permissionedDomain(uint256 const& domainID) noexcept } // namespace keylet -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/InnerObjectFormats.cpp b/src/libxrpl/protocol/InnerObjectFormats.cpp index d720c6c665..3eb73e7c9b 100644 --- a/src/libxrpl/protocol/InnerObjectFormats.cpp +++ b/src/libxrpl/protocol/InnerObjectFormats.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { InnerObjectFormats::InnerObjectFormats() { @@ -180,4 +180,4 @@ InnerObjectFormats::findSOTemplateBySField(SField const& sField) const return nullptr; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Issue.cpp b/src/libxrpl/protocol/Issue.cpp index 205648fe4d..b858a31e3e 100644 --- a/src/libxrpl/protocol/Issue.cpp +++ b/src/libxrpl/protocol/Issue.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string Issue::getText() const @@ -132,4 +132,4 @@ operator<<(std::ostream& os, Issue const& x) return os; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Keylet.cpp b/src/libxrpl/protocol/Keylet.cpp index 9d2202e19b..2c65bb9ed4 100644 --- a/src/libxrpl/protocol/Keylet.cpp +++ b/src/libxrpl/protocol/Keylet.cpp @@ -3,14 +3,14 @@ #include #include -namespace ripple { +namespace xrpl { bool Keylet::check(STLedgerEntry const& sle) const { XRPL_ASSERT( sle.getType() != ltANY || sle.getType() != ltCHILD, - "ripple::Keylet::check : valid input type"); + "xrpl::Keylet::check : valid input type"); if (type == ltANY) return true; @@ -21,4 +21,4 @@ Keylet::check(STLedgerEntry const& sle) const return sle.getType() == type && sle.key() == key; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/LedgerFormats.cpp b/src/libxrpl/protocol/LedgerFormats.cpp index 908b28ae43..2056cfab7b 100644 --- a/src/libxrpl/protocol/LedgerFormats.cpp +++ b/src/libxrpl/protocol/LedgerFormats.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { LedgerFormats::LedgerFormats() { @@ -40,4 +40,4 @@ LedgerFormats::getInstance() return instance; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/LedgerHeader.cpp b/src/libxrpl/protocol/LedgerHeader.cpp index 84d026b613..5258bdbc22 100644 --- a/src/libxrpl/protocol/LedgerHeader.cpp +++ b/src/libxrpl/protocol/LedgerHeader.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { void addRaw(LedgerHeader const& info, Serializer& s, bool includeHash) @@ -52,4 +52,4 @@ deserializePrefixedHeader(Slice data, bool hasHash) return deserializeHeader(data + 4, hasHash); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/MPTAmount.cpp b/src/libxrpl/protocol/MPTAmount.cpp index 046e81199a..1950407ab5 100644 --- a/src/libxrpl/protocol/MPTAmount.cpp +++ b/src/libxrpl/protocol/MPTAmount.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { MPTAmount& MPTAmount::operator+=(MPTAmount const& other) @@ -46,4 +46,4 @@ MPTAmount::minPositiveAmount() return MPTAmount{1}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/MPTIssue.cpp b/src/libxrpl/protocol/MPTIssue.cpp index c7d54ee6d6..c92ac60b73 100644 --- a/src/libxrpl/protocol/MPTIssue.cpp +++ b/src/libxrpl/protocol/MPTIssue.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { MPTIssue::MPTIssue(MPTID const& issuanceID) : mptID_(issuanceID) { @@ -88,4 +88,4 @@ mptIssueFromJson(Json::Value const& v) return MPTIssue{id}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/NFTSyntheticSerializer.cpp b/src/libxrpl/protocol/NFTSyntheticSerializer.cpp index ee677b798c..e4ce3b7611 100644 --- a/src/libxrpl/protocol/NFTSyntheticSerializer.cpp +++ b/src/libxrpl/protocol/NFTSyntheticSerializer.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { void @@ -22,4 +22,4 @@ insertNFTSyntheticInJson( } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/NFTokenID.cpp b/src/libxrpl/protocol/NFTokenID.cpp index 50a6f30bf8..64fadce3c9 100644 --- a/src/libxrpl/protocol/NFTokenID.cpp +++ b/src/libxrpl/protocol/NFTokenID.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { bool canHaveNFTokenID( @@ -184,4 +184,4 @@ insertNFTokenID( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/NFTokenOfferID.cpp b/src/libxrpl/protocol/NFTokenOfferID.cpp index 77b836207f..b1a08081c0 100644 --- a/src/libxrpl/protocol/NFTokenOfferID.cpp +++ b/src/libxrpl/protocol/NFTokenOfferID.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { bool canHaveNFTokenOfferID( @@ -64,4 +64,4 @@ insertNFTokenOfferID( response[jss::offer_id] = to_string(result.value()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Permissions.cpp b/src/libxrpl/protocol/Permissions.cpp index c73e38304f..a5d447a23c 100644 --- a/src/libxrpl/protocol/Permissions.cpp +++ b/src/libxrpl/protocol/Permissions.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { Permission::Permission() { @@ -71,7 +71,7 @@ Permission::Permission() for ([[maybe_unused]] auto const& permission : granularPermissionMap_) XRPL_ASSERT( permission.second > UINT16_MAX, - "ripple::Permission::granularPermissionMap_ : granular permission " + "xrpl::Permission::granularPermissionMap_ : granular permission " "value must not exceed the maximum uint16_t value."); } @@ -134,7 +134,7 @@ Permission::getTxFeature(TxType txType) const auto const txFeaturesIt = txFeatureMap_.find(txType); XRPL_ASSERT( txFeaturesIt != txFeatureMap_.end(), - "ripple::Permissions::getTxFeature : tx exists in txFeatureMap_"); + "xrpl::Permissions::getTxFeature : tx exists in txFeatureMap_"); if (txFeaturesIt->second == uint256{}) return std::nullopt; @@ -161,7 +161,7 @@ Permission::isDelegatable( auto const txFeaturesIt = txFeatureMap_.find(txType); XRPL_ASSERT( txFeaturesIt != txFeatureMap_.end(), - "ripple::Permissions::isDelegatable : tx exists in txFeatureMap_"); + "xrpl::Permissions::isDelegatable : tx exists in txFeatureMap_"); // Delegation is only allowed if the required amendment for the transaction // is enabled. For transactions that do not require an amendment, delegation @@ -188,4 +188,4 @@ Permission::permissionToTxType(uint32_t const& value) const return static_cast(value - 1); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/PublicKey.cpp b/src/libxrpl/protocol/PublicKey.cpp index 5e3a0b651b..2dcf484adc 100644 --- a/src/libxrpl/protocol/PublicKey.cpp +++ b/src/libxrpl/protocol/PublicKey.cpp @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { std::ostream& operator<<(std::ostream& os, PublicKey const& pk) @@ -301,4 +301,4 @@ calcNodeID(PublicKey const& pk) return NodeID{static_cast(h)}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Quality.cpp b/src/libxrpl/protocol/Quality.cpp index f20145036b..cd56f237fc 100644 --- a/src/libxrpl/protocol/Quality.cpp +++ b/src/libxrpl/protocol/Quality.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { Quality::Quality(std::uint64_t value) : m_value(value) { @@ -21,7 +21,7 @@ Quality::Quality(Amounts const& amount) Quality& Quality::operator++() { - XRPL_ASSERT(m_value > 0, "ripple::Quality::operator++() : minimum value"); + XRPL_ASSERT(m_value > 0, "xrpl::Quality::operator++() : minimum value"); --m_value; return *this; } @@ -39,7 +39,7 @@ Quality::operator--() { XRPL_ASSERT( m_value < std::numeric_limits::max(), - "ripple::Quality::operator--() : maximum value"); + "xrpl::Quality::operator--() : maximum value"); ++m_value; return *this; } @@ -70,11 +70,10 @@ ceil_in_impl( if (result.out > amount.out) result.out = amount.out; XRPL_ASSERT( - result.in == limit, "ripple::ceil_in_impl : result matches limit"); + result.in == limit, "xrpl::ceil_in_impl : result matches limit"); return result; } - XRPL_ASSERT( - amount.in <= limit, "ripple::ceil_in_impl : result inside limit"); + XRPL_ASSERT(amount.in <= limit, "xrpl::ceil_in_impl : result inside limit"); return amount; } @@ -111,12 +110,11 @@ ceil_out_impl( if (result.in > amount.in) result.in = amount.in; XRPL_ASSERT( - result.out == limit, - "ripple::ceil_out_impl : result matches limit"); + result.out == limit, "xrpl::ceil_out_impl : result matches limit"); return result; } XRPL_ASSERT( - amount.out <= limit, "ripple::ceil_out_impl : result inside limit"); + amount.out <= limit, "xrpl::ceil_out_impl : result inside limit"); return amount; } @@ -140,13 +138,12 @@ composed_quality(Quality const& lhs, Quality const& rhs) { STAmount const lhs_rate(lhs.rate()); XRPL_ASSERT( - lhs_rate != beast::zero, - "ripple::composed_quality : nonzero left input"); + lhs_rate != beast::zero, "xrpl::composed_quality : nonzero left input"); STAmount const rhs_rate(rhs.rate()); XRPL_ASSERT( rhs_rate != beast::zero, - "ripple::composed_quality : nonzero right input"); + "xrpl::composed_quality : nonzero right input"); STAmount const rate(mulRound(lhs_rate, rhs_rate, lhs_rate.asset(), true)); @@ -155,7 +152,7 @@ composed_quality(Quality const& lhs, Quality const& rhs) XRPL_ASSERT( (stored_exponent > 0) && (stored_exponent <= 255), - "ripple::composed_quality : valid exponent"); + "xrpl::composed_quality : valid exponent"); return Quality((stored_exponent << (64 - 8)) | stored_mantissa); } @@ -192,4 +189,4 @@ Quality::round(int digits) const return Quality{(exponent << (64 - 8)) | mantissa}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/QualityFunction.cpp b/src/libxrpl/protocol/QualityFunction.cpp index 8273743cfa..b254e1af86 100644 --- a/src/libxrpl/protocol/QualityFunction.cpp +++ b/src/libxrpl/protocol/QualityFunction.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { QualityFunction::QualityFunction( Quality const& quality, @@ -42,4 +42,4 @@ QualityFunction::outFromAvgQ(Quality const& quality) return std::nullopt; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/RPCErr.cpp b/src/libxrpl/protocol/RPCErr.cpp index 4984f91279..658dd06b3d 100644 --- a/src/libxrpl/protocol/RPCErr.cpp +++ b/src/libxrpl/protocol/RPCErr.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { struct RPCErr; @@ -23,4 +23,4 @@ isRpcError(Json::Value jvResult) return jvResult.isObject() && jvResult.isMember(jss::error); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Rate2.cpp b/src/libxrpl/protocol/Rate2.cpp index 36c6ae37f9..511b28cc67 100644 --- a/src/libxrpl/protocol/Rate2.cpp +++ b/src/libxrpl/protocol/Rate2.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { Rate const parityRate(QUALITY_ONE); @@ -33,7 +33,7 @@ transferFeeAsRate(std::uint16_t fee) STAmount multiply(STAmount const& amount, Rate const& rate) { - XRPL_ASSERT(rate.value, "ripple::nft::multiply : nonzero rate input"); + XRPL_ASSERT(rate.value, "xrpl::nft::multiply : nonzero rate input"); if (rate == parityRate) return amount; @@ -44,7 +44,7 @@ multiply(STAmount const& amount, Rate const& rate) STAmount multiplyRound(STAmount const& amount, Rate const& rate, bool roundUp) { - XRPL_ASSERT(rate.value, "ripple::nft::multiplyRound : nonzero rate input"); + XRPL_ASSERT(rate.value, "xrpl::nft::multiplyRound : nonzero rate input"); if (rate == parityRate) return amount; @@ -60,7 +60,7 @@ multiplyRound( bool roundUp) { XRPL_ASSERT( - rate.value, "ripple::nft::multiplyRound(Issue) : nonzero rate input"); + rate.value, "xrpl::nft::multiplyRound(Issue) : nonzero rate input"); if (rate == parityRate) { @@ -73,7 +73,7 @@ multiplyRound( STAmount divide(STAmount const& amount, Rate const& rate) { - XRPL_ASSERT(rate.value, "ripple::nft::divide : nonzero rate input"); + XRPL_ASSERT(rate.value, "xrpl::nft::divide : nonzero rate input"); if (rate == parityRate) return amount; @@ -84,7 +84,7 @@ divide(STAmount const& amount, Rate const& rate) STAmount divideRound(STAmount const& amount, Rate const& rate, bool roundUp) { - XRPL_ASSERT(rate.value, "ripple::nft::divideRound : nonzero rate input"); + XRPL_ASSERT(rate.value, "xrpl::nft::divideRound : nonzero rate input"); if (rate == parityRate) return amount; @@ -100,7 +100,7 @@ divideRound( bool roundUp) { XRPL_ASSERT( - rate.value, "ripple::nft::divideRound(Issue) : nonzero rate input"); + rate.value, "xrpl::nft::divideRound(Issue) : nonzero rate input"); if (rate == parityRate) return amount; @@ -108,4 +108,4 @@ divideRound( return divRound(amount, detail::as_amount(rate), asset, roundUp); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Rules.cpp b/src/libxrpl/protocol/Rules.cpp index 7d84c4e7da..b1f2c2d631 100644 --- a/src/libxrpl/protocol/Rules.cpp +++ b/src/libxrpl/protocol/Rules.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace { // Use a static inside a function to help prevent order-of-initialization issues @@ -82,7 +82,7 @@ public: return false; XRPL_ASSERT( presets_ == other.presets_, - "ripple::Rules::Impl::operator==(Impl) const : input presets do " + "xrpl::Rules::Impl::operator==(Impl) const : input presets do " "match"); return *digest_ == *other.digest_; } @@ -110,7 +110,7 @@ Rules::presets() const bool Rules::enabled(uint256 const& feature) const { - XRPL_ASSERT(impl_, "ripple::Rules::enabled : initialized"); + XRPL_ASSERT(impl_, "xrpl::Rules::enabled : initialized"); return impl_->enabled(feature); } @@ -120,7 +120,7 @@ Rules::operator==(Rules const& other) const { XRPL_ASSERT( impl_ && other.impl_, - "ripple::Rules::operator==(Rules) const : both initialized"); + "xrpl::Rules::operator==(Rules) const : both initialized"); if (impl_.get() == other.impl_.get()) return true; return *impl_ == *other.impl_; @@ -139,4 +139,4 @@ isFeatureEnabled(uint256 const& feature) return rules && rules->enabled(feature); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/SField.cpp b/src/libxrpl/protocol/SField.cpp index 61d7aff930..54402ea6e2 100644 --- a/src/libxrpl/protocol/SField.cpp +++ b/src/libxrpl/protocol/SField.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { // Storage for static const members. SField::IsSigning const SField::notSigning; @@ -84,10 +84,10 @@ SField::SField( { XRPL_ASSERT( !knownCodeToField.contains(fieldCode), - "ripple::SField::SField(tid,fv,fn,meta,signing) : fieldCode is unique"); + "xrpl::SField::SField(tid,fv,fn,meta,signing) : fieldCode is unique"); XRPL_ASSERT( !knownNameToField.contains(fieldName), - "ripple::SField::SField(tid,fv,fn,meta,signing) : fieldName is unique"); + "xrpl::SField::SField(tid,fv,fn,meta,signing) : fieldName is unique"); knownCodeToField[fieldCode] = this; knownNameToField[fieldName] = this; } @@ -104,10 +104,10 @@ SField::SField(private_access_tag_t, int fc, char const* fn) { XRPL_ASSERT( !knownCodeToField.contains(fieldCode), - "ripple::SField::SField(fc,fn) : fieldCode is unique"); + "xrpl::SField::SField(fc,fn) : fieldCode is unique"); XRPL_ASSERT( !knownNameToField.contains(fieldName), - "ripple::SField::SField(fc,fn) : fieldName is unique"); + "xrpl::SField::SField(fc,fn) : fieldName is unique"); knownCodeToField[fieldCode] = this; knownNameToField[fieldName] = this; } @@ -152,4 +152,4 @@ SField::getField(std::string const& fieldName) return sfInvalid; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/SOTemplate.cpp b/src/libxrpl/protocol/SOTemplate.cpp index 6bd5b7a5c6..46edf98710 100644 --- a/src/libxrpl/protocol/SOTemplate.cpp +++ b/src/libxrpl/protocol/SOTemplate.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { SOTemplate::SOTemplate( std::initializer_list uniqueFields, @@ -50,4 +50,4 @@ SOTemplate::getIndex(SField const& sField) const return indices_[sField.getNum()]; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STAccount.cpp b/src/libxrpl/protocol/STAccount.cpp index b452be7ee4..728fb25f6c 100644 --- a/src/libxrpl/protocol/STAccount.cpp +++ b/src/libxrpl/protocol/STAccount.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { STAccount::STAccount() : STBase(), value_(beast::zero), default_(true) { @@ -74,10 +74,10 @@ void STAccount::add(Serializer& s) const { XRPL_ASSERT( - getFName().isBinary(), "ripple::STAccount::add : field is binary"); + getFName().isBinary(), "xrpl::STAccount::add : field is binary"); XRPL_ASSERT( getFName().fieldType == STI_ACCOUNT, - "ripple::STAccount::add : valid field type"); + "xrpl::STAccount::add : valid field type"); // Preserve the serialization behavior of an STBlob: // o If we are default (all zeros) serialize as an empty blob. @@ -107,4 +107,4 @@ STAccount::getText() const return toBase58(value()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STAmount.cpp b/src/libxrpl/protocol/STAmount.cpp index 8b714193cc..824453a4d3 100644 --- a/src/libxrpl/protocol/STAmount.cpp +++ b/src/libxrpl/protocol/STAmount.cpp @@ -47,7 +47,7 @@ #include #include -namespace ripple { +namespace xrpl { static std::uint64_t const tenTo14 = 100000000000000ull; static std::uint64_t const tenTo14m1 = tenTo14 - 1; @@ -60,13 +60,13 @@ getInt64Value(STAmount const& amount, bool valid, char const* error) if (!valid) Throw(error); XRPL_ASSERT( - amount.exponent() == 0, "ripple::getInt64Value : exponent is zero"); + amount.exponent() == 0, "xrpl::getInt64Value : exponent is zero"); auto ret = static_cast(amount.mantissa()); XRPL_ASSERT( static_cast(ret) == amount.mantissa(), - "ripple::getInt64Value : mantissa must roundtrip"); + "xrpl::getInt64Value : mantissa must roundtrip"); if (amount.negative()) ret = -ret; @@ -195,7 +195,7 @@ STAmount::STAmount(SField const& name, std::uint64_t mantissa, bool negative) { XRPL_ASSERT( mValue <= std::numeric_limits::max(), - "ripple::STAmount::STAmount(SField, std::uint64_t, bool) : maximum " + "xrpl::STAmount::STAmount(SField, std::uint64_t, bool) : maximum " "mantissa input"); } @@ -208,7 +208,7 @@ STAmount::STAmount(SField const& name, STAmount const& from) { XRPL_ASSERT( mValue <= std::numeric_limits::max(), - "ripple::STAmount::STAmount(SField, STAmount) : maximum input"); + "xrpl::STAmount::STAmount(SField, STAmount) : maximum input"); canonicalize(); } @@ -222,7 +222,7 @@ STAmount::STAmount(std::uint64_t mantissa, bool negative) { XRPL_ASSERT( mValue <= std::numeric_limits::max(), - "ripple::STAmount::STAmount(std::uint64_t, bool) : maximum mantissa " + "xrpl::STAmount::STAmount(std::uint64_t, bool) : maximum mantissa " "input"); } @@ -268,7 +268,7 @@ STAmount::xrp() const "Cannot return non-native STAmount as XRPAmount"); auto drops = static_cast(mValue); - XRPL_ASSERT(mOffset == 0, "ripple::STAmount::xrp : amount is canonical"); + XRPL_ASSERT(mOffset == 0, "xrpl::STAmount::xrp : amount is canonical"); if (mIsNegative) drops = -drops; @@ -298,7 +298,7 @@ STAmount::mpt() const Throw("Cannot return STAmount as MPTAmount"); auto value = static_cast(mValue); - XRPL_ASSERT(mOffset == 0, "ripple::STAmount::mpt : amount is canonical"); + XRPL_ASSERT(mOffset == 0, "xrpl::STAmount::mpt : amount is canonical"); if (mIsNegative) value = -value; @@ -310,8 +310,7 @@ STAmount& STAmount::operator=(IOUAmount const& iou) { XRPL_ASSERT( - native() == false, - "ripple::STAmount::operator=(IOUAmount) : is not XRP"); + native() == false, "xrpl::STAmount::operator=(IOUAmount) : is not XRP"); mOffset = iou.exponent(); mIsNegative = iou < beast::zero; if (mIsNegative) @@ -452,7 +451,7 @@ getRate(STAmount const& offerOut, STAmount const& offerIn) return 0; XRPL_ASSERT( (r.exponent() >= -100) && (r.exponent() <= 155), - "ripple::getRate : exponent inside range"); + "xrpl::getRate : exponent inside range"); std::uint64_t ret = r.exponent() + 100; return (ret << (64 - 8)) | r.mantissa(); } @@ -689,7 +688,7 @@ STAmount::getText() const return ret; } - XRPL_ASSERT(mOffset + 43 > 0, "ripple::STAmount::getText : minimum offset"); + XRPL_ASSERT(mOffset + 43 > 0, "xrpl::STAmount::getText : minimum offset"); size_t const pad_prefix = 27; size_t const pad_suffix = 23; @@ -714,8 +713,7 @@ STAmount::getText() const pre_from += pad_prefix; XRPL_ASSERT( - post_to >= post_from, - "ripple::STAmount::getText : first distance check"); + post_to >= post_from, "xrpl::STAmount::getText : first distance check"); pre_from = std::find_if(pre_from, pre_to, [](char c) { return c != '0'; }); @@ -726,7 +724,7 @@ STAmount::getText() const XRPL_ASSERT( post_to >= post_from, - "ripple::STAmount::getText : second distance check"); + "xrpl::STAmount::getText : second distance check"); post_to = std::find_if( std::make_reverse_iterator(post_to), @@ -762,7 +760,7 @@ STAmount::add(Serializer& s) const { if (native()) { - XRPL_ASSERT(mOffset == 0, "ripple::STAmount::add : zero offset"); + XRPL_ASSERT(mOffset == 0, "xrpl::STAmount::add : zero offset"); if (!mIsNegative) s.add64(mValue | cPositive); @@ -937,13 +935,13 @@ STAmount::canonicalize() XRPL_ASSERT( (mValue == 0) || ((mValue >= cMinValue) && (mValue <= cMaxValue)), - "ripple::STAmount::canonicalize : value inside range"); + "xrpl::STAmount::canonicalize : value inside range"); XRPL_ASSERT( (mValue == 0) || ((mOffset >= cMinOffset) && (mOffset <= cMaxOffset)), - "ripple::STAmount::canonicalize : offset inside range"); + "xrpl::STAmount::canonicalize : offset inside range"); XRPL_ASSERT( (mValue != 0) || (mOffset != -100), - "ripple::STAmount::canonicalize : value or offset set"); + "xrpl::STAmount::canonicalize : value or offset set"); } void @@ -1748,4 +1746,4 @@ divRoundStrict( return divRoundImpl(num, den, asset, roundUp); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STArray.cpp b/src/libxrpl/protocol/STArray.cpp index 4d60e6f5ce..de1e6905c6 100644 --- a/src/libxrpl/protocol/STArray.cpp +++ b/src/libxrpl/protocol/STArray.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { STArray::STArray(STArray&& other) : STBase(other.getFName()), v_(std::move(other.v_)) @@ -180,4 +180,4 @@ STArray::sort(bool (*compare)(STObject const&, STObject const&)) std::sort(v_.begin(), v_.end(), compare); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STBase.cpp b/src/libxrpl/protocol/STBase.cpp index 0cbe575a2a..d3faf090eb 100644 --- a/src/libxrpl/protocol/STBase.cpp +++ b/src/libxrpl/protocol/STBase.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { STBase::STBase() : fName(&sfGeneric) { @@ -17,7 +17,7 @@ STBase::STBase() : fName(&sfGeneric) STBase::STBase(SField const& n) : fName(&n) { - XRPL_ASSERT(fName, "ripple::STBase::STBase : field is set"); + XRPL_ASSERT(fName, "xrpl::STBase::STBase : field is set"); } STBase& @@ -94,7 +94,7 @@ STBase::add(Serializer& s) const { // Should never be called // LCOV_EXCL_START - UNREACHABLE("ripple::STBase::add : not implemented"); + UNREACHABLE("xrpl::STBase::add : not implemented"); // LCOV_EXCL_STOP } @@ -103,7 +103,7 @@ STBase::isEquivalent(STBase const& t) const { XRPL_ASSERT( getSType() == STI_NOTPRESENT, - "ripple::STBase::isEquivalent : type not present"); + "xrpl::STBase::isEquivalent : type not present"); return t.getSType() == STI_NOTPRESENT; } @@ -117,7 +117,7 @@ void STBase::setFName(SField const& n) { fName = &n; - XRPL_ASSERT(fName, "ripple::STBase::setFName : field is set"); + XRPL_ASSERT(fName, "xrpl::STBase::setFName : field is set"); } SField const& @@ -130,7 +130,7 @@ void STBase::addFieldID(Serializer& s) const { XRPL_ASSERT( - fName->isBinary(), "ripple::STBase::addFieldID : field is binary"); + fName->isBinary(), "xrpl::STBase::addFieldID : field is binary"); s.addFieldID(fName->fieldType, fName->fieldValue); } @@ -142,4 +142,4 @@ operator<<(std::ostream& out, STBase const& t) return out << t.getFullText(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STBlob.cpp b/src/libxrpl/protocol/STBlob.cpp index 5b46f941de..65670a6a9f 100644 --- a/src/libxrpl/protocol/STBlob.cpp +++ b/src/libxrpl/protocol/STBlob.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { STBlob::STBlob(SerialIter& st, SField const& name) : STBase(name), value_(st.getVLBuffer()) @@ -43,11 +43,11 @@ STBlob::getText() const void STBlob::add(Serializer& s) const { - XRPL_ASSERT(getFName().isBinary(), "ripple::STBlob::add : field is binary"); + XRPL_ASSERT(getFName().isBinary(), "xrpl::STBlob::add : field is binary"); XRPL_ASSERT( (getFName().fieldType == STI_VL) || (getFName().fieldType == STI_ACCOUNT), - "ripple::STBlob::add : valid field type"); + "xrpl::STBlob::add : valid field type"); s.addVL(value_.data(), value_.size()); } @@ -64,4 +64,4 @@ STBlob::isDefault() const return value_.empty(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STCurrency.cpp b/src/libxrpl/protocol/STCurrency.cpp index 3b30e1b757..d4c10b48d3 100644 --- a/src/libxrpl/protocol/STCurrency.cpp +++ b/src/libxrpl/protocol/STCurrency.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { STCurrency::STCurrency(SField const& name) : STBase{name} { @@ -102,4 +102,4 @@ currencyFromJson(SField const& name, Json::Value const& v) return STCurrency{name, currency}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STInteger.cpp b/src/libxrpl/protocol/STInteger.cpp index c71e70e1b2..e701fc4203 100644 --- a/src/libxrpl/protocol/STInteger.cpp +++ b/src/libxrpl/protocol/STInteger.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { template <> STInteger::STInteger(SerialIter& sit, SField const& name) @@ -210,14 +210,14 @@ STUInt64::getJson(JsonOptions) const auto convertToString = [](uint64_t const value, int const base) { XRPL_ASSERT( base == 10 || base == 16, - "ripple::STUInt64::getJson : base 10 or 16"); + "xrpl::STUInt64::getJson : base 10 or 16"); std::string str( base == 10 ? 20 : 16, 0); // Allocate space depending on base auto ret = std::to_chars(str.data(), str.data() + str.size(), value, base); XRPL_ASSERT( ret.ec == std::errc(), - "ripple::STUInt64::getJson : to_chars succeeded"); + "xrpl::STUInt64::getJson : to_chars succeeded"); str.resize(std::distance(str.data(), ret.ptr)); return str; }; @@ -259,4 +259,4 @@ STInt32::getJson(JsonOptions) const return value_; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STIssue.cpp b/src/libxrpl/protocol/STIssue.cpp index 346f73d5ae..213c8b7962 100644 --- a/src/libxrpl/protocol/STIssue.cpp +++ b/src/libxrpl/protocol/STIssue.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { STIssue::STIssue(SField const& name) : STBase{name} { @@ -139,4 +139,4 @@ issueFromJson(SField const& name, Json::Value const& v) return STIssue{name, assetFromJson(v)}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STLedgerEntry.cpp b/src/libxrpl/protocol/STLedgerEntry.cpp index 5665bc1508..8ee3669a24 100644 --- a/src/libxrpl/protocol/STLedgerEntry.cpp +++ b/src/libxrpl/protocol/STLedgerEntry.cpp @@ -26,7 +26,7 @@ #include #include -namespace ripple { +namespace xrpl { STLedgerEntry::STLedgerEntry(Keylet const& k) : STObject(sfLedgerEntry), key_(k.key), type_(k.type) @@ -157,7 +157,7 @@ STLedgerEntry::thread( // this transaction is already threaded XRPL_ASSERT( getFieldU32(sfPreviousTxnLgrSeq) == ledgerSeq, - "ripple::STLedgerEntry::thread : ledger sequence match"); + "xrpl::STLedgerEntry::thread : ledger sequence match"); return false; } @@ -168,4 +168,4 @@ STLedgerEntry::thread( return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STNumber.cpp b/src/libxrpl/protocol/STNumber.cpp index c353f6b795..f85bb48e0a 100644 --- a/src/libxrpl/protocol/STNumber.cpp +++ b/src/libxrpl/protocol/STNumber.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { STNumber::STNumber(SField const& field, Number const& value) : STBase(field), value_(value) @@ -45,11 +45,10 @@ STNumber::getText() const void STNumber::add(Serializer& s) const { - XRPL_ASSERT( - getFName().isBinary(), "ripple::STNumber::add : field is binary"); + XRPL_ASSERT(getFName().isBinary(), "xrpl::STNumber::add : field is binary"); XRPL_ASSERT( getFName().fieldType == getSType(), - "ripple::STNumber::add : field type match"); + "xrpl::STNumber::add : field type match"); s.add64(value_.mantissa()); s.add32(value_.exponent()); } @@ -83,7 +82,7 @@ STNumber::isEquivalent(STBase const& t) const { XRPL_ASSERT( t.getSType() == this->getSType(), - "ripple::STNumber::isEquivalent : field type match"); + "xrpl::STNumber::isEquivalent : field type match"); STNumber const& v = dynamic_cast(t); return value_ == v; } @@ -196,4 +195,4 @@ numberFromJson(SField const& field, Json::Value const& value) return STNumber{field, Number{mantissa, parts.exponent}}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STObject.cpp b/src/libxrpl/protocol/STObject.cpp index 1c39eb9108..6007753ed1 100644 --- a/src/libxrpl/protocol/STObject.cpp +++ b/src/libxrpl/protocol/STObject.cpp @@ -39,7 +39,7 @@ #include #include -namespace ripple { +namespace xrpl { STObject::STObject(STObject&& other) : STBase(other.getFName()), v_(std::move(other.v_)), mType(other.mType) @@ -904,7 +904,7 @@ STObject::add(Serializer& s, WhichFields whichFields) const XRPL_ASSERT( (sType != STI_OBJECT) || (field->getFName().fieldType == STI_OBJECT), - "ripple::STObject::add : valid field type"); + "xrpl::STObject::add : valid field type"); field->addFieldID(s); field->add(s); if (sType == STI_ARRAY || sType == STI_OBJECT) @@ -937,4 +937,4 @@ STObject::getSortedFields(STObject const& objToSort, WhichFields whichFields) return sf; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STParsedJSON.cpp b/src/libxrpl/protocol/STParsedJSON.cpp index 8443f92f75..34c8b70e45 100644 --- a/src/libxrpl/protocol/STParsedJSON.cpp +++ b/src/libxrpl/protocol/STParsedJSON.cpp @@ -41,7 +41,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace STParsedJSONDetail { template @@ -1190,4 +1190,4 @@ STParsedJSONObject::STParsedJSONObject( object = parseObject(name, json, sfGeneric, 0, error); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STPathSet.cpp b/src/libxrpl/protocol/STPathSet.cpp index 3132c81cc6..631fd51d8a 100644 --- a/src/libxrpl/protocol/STPathSet.cpp +++ b/src/libxrpl/protocol/STPathSet.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { std::size_t STPathElement::get_hash(STPathElement const& element) @@ -201,10 +201,10 @@ void STPathSet::add(Serializer& s) const { XRPL_ASSERT( - getFName().isBinary(), "ripple::STPathSet::add : field is binary"); + getFName().isBinary(), "xrpl::STPathSet::add : field is binary"); XRPL_ASSERT( getFName().fieldType == STI_PATHSET, - "ripple::STPathSet::add : valid field type"); + "xrpl::STPathSet::add : valid field type"); bool first = true; for (auto const& spPath : value) @@ -234,4 +234,4 @@ STPathSet::add(Serializer& s) const s.add8(STPathElement::typeNone); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index d3b3ab4a88..6640468bd4 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -51,7 +51,7 @@ #include #include -namespace ripple { +namespace xrpl { static auto getTxFormat(TxType type) @@ -150,7 +150,7 @@ STTx::getMentionedAccounts() const { XRPL_ASSERT( !sacc->isDefault(), - "ripple::STTx::getMentionedAccounts : account is set"); + "xrpl::STTx::getMentionedAccounts : account is set"); if (!sacc->isDefault()) list.insert(sacc->value()); } @@ -222,7 +222,7 @@ STTx::sign( { auto const data = getSigningData(*this); - auto const sig = ripple::sign(publicKey, secretKey, makeSlice(data)); + auto const sig = xrpl::sign(publicKey, secretKey, makeSlice(data)); if (signatureTarget) { @@ -375,7 +375,7 @@ STTx::getMetaSQL( std::string rTxn = sqlBlobLiteral(rawTxn.peekData()); auto format = TxFormats::getInstance().findByType(tx_type_); - XRPL_ASSERT(format, "ripple::STTx::getMetaSQL : non-null type format"); + XRPL_ASSERT(format, "xrpl::STTx::getMetaSQL : non-null type format"); return str( boost::format(bfTrans) % to_string(getTransactionID()) % @@ -819,4 +819,4 @@ isPseudoTx(STObject const& tx) return tt == ttAMENDMENT || tt == ttFEE || tt == ttUNL_MODIFY; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STValidation.cpp b/src/libxrpl/protocol/STValidation.cpp index 3c89f31896..f6f89d43e9 100644 --- a/src/libxrpl/protocol/STValidation.cpp +++ b/src/libxrpl/protocol/STValidation.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { STBase* STValidation::copy(std::size_t n, void* buf) const @@ -101,7 +101,7 @@ STValidation::isValid() const noexcept { XRPL_ASSERT( publicKeyType(getSignerPublic()) == KeyType::secp256k1, - "ripple::STValidation::isValid : valid key type"); + "xrpl::STValidation::isValid : valid key type"); valid_ = verifyDigest( getSignerPublic(), @@ -133,4 +133,4 @@ STValidation::getSerialized() const return s.peekData(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STVar.cpp b/src/libxrpl/protocol/STVar.cpp index 2b0e59b4c3..e0df5d51a9 100644 --- a/src/libxrpl/protocol/STVar.cpp +++ b/src/libxrpl/protocol/STVar.cpp @@ -22,7 +22,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { defaultObject_t defaultObject; @@ -109,7 +109,7 @@ STVar::STVar(SerializedTypeID id, SField const& name) { XRPL_ASSERT( (id == STI_NOTPRESENT) || (id == name.fieldType), - "ripple::detail::STVar::STVar(SerializedTypeID) : valid type input"); + "xrpl::detail::STVar::STVar(SerializedTypeID) : valid type input"); constructST(id, 0, name); } @@ -225,4 +225,4 @@ STVar::constructST(SerializedTypeID id, int depth, Args&&... args) } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STVector256.cpp b/src/libxrpl/protocol/STVector256.cpp index ba7cf3252c..17b4895b62 100644 --- a/src/libxrpl/protocol/STVector256.cpp +++ b/src/libxrpl/protocol/STVector256.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { STVector256::STVector256(SerialIter& sit, SField const& name) : STBase(name) { @@ -59,10 +59,10 @@ void STVector256::add(Serializer& s) const { XRPL_ASSERT( - getFName().isBinary(), "ripple::STVector256::add : field is binary"); + getFName().isBinary(), "xrpl::STVector256::add : field is binary"); XRPL_ASSERT( getFName().fieldType == STI_VECTOR256, - "ripple::STVector256::add : valid field type"); + "xrpl::STVector256::add : valid field type"); s.addVL(mValue.begin(), mValue.end(), mValue.size() * (256 / 8)); } @@ -84,4 +84,4 @@ STVector256::getJson(JsonOptions) const return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/STXChainBridge.cpp b/src/libxrpl/protocol/STXChainBridge.cpp index aa10a87bbc..065b87558f 100644 --- a/src/libxrpl/protocol/STXChainBridge.cpp +++ b/src/libxrpl/protocol/STXChainBridge.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { STXChainBridge::STXChainBridge() : STBase{sfXChainBridge} { @@ -66,7 +66,7 @@ STXChainBridge::STXChainBridge(SField const& name, Json::Value const& v) auto checkExtra = [](Json::Value const& v) { static auto const jbridge = - ripple::STXChainBridge().getJson(ripple::JsonOptions::none); + xrpl::STXChainBridge().getJson(xrpl::JsonOptions::none); for (auto it = v.begin(); it != v.end(); ++it) { std::string const name = it.memberName(); @@ -207,4 +207,4 @@ STXChainBridge::move(std::size_t n, void* buf) { return emplace(n, buf, std::move(*this)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/SecretKey.cpp b/src/libxrpl/protocol/SecretKey.cpp index d4a958c600..88404a88a5 100644 --- a/src/libxrpl/protocol/SecretKey.cpp +++ b/src/libxrpl/protocol/SecretKey.cpp @@ -26,7 +26,7 @@ #include #include -namespace ripple { +namespace xrpl { SecretKey::~SecretKey() { @@ -381,4 +381,4 @@ parseBase58(TokenType type, std::string const& s) return SecretKey(makeSlice(result)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Seed.cpp b/src/libxrpl/protocol/Seed.cpp index 9c41a534b9..18e89ef6ca 100644 --- a/src/libxrpl/protocol/Seed.cpp +++ b/src/libxrpl/protocol/Seed.cpp @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { Seed::~Seed() { @@ -124,4 +124,4 @@ seedAs1751(Seed const& seed) return encodedKey; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Serializer.cpp b/src/libxrpl/protocol/Serializer.cpp index 7fbec19bd2..e6c1e6967f 100644 --- a/src/libxrpl/protocol/Serializer.cpp +++ b/src/libxrpl/protocol/Serializer.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { int Serializer::add16(std::uint16_t i) @@ -109,7 +109,7 @@ Serializer::addFieldID(int type, int name) int ret = mData.size(); XRPL_ASSERT( (type > 0) && (type < 256) && (name > 0) && (name < 256), - "ripple::Serializer::addFieldID : inputs inside range"); + "xrpl::Serializer::addFieldID : inputs inside range"); if (type < 16) { @@ -181,7 +181,7 @@ Serializer::addVL(Blob const& vector) XRPL_ASSERT( mData.size() == (ret + vector.size() + encodeLengthLength(vector.size())), - "ripple::Serializer::addVL : size matches expected"); + "xrpl::Serializer::addVL : size matches expected"); return ret; } @@ -486,7 +486,7 @@ SerialIter::getVLDataLength() else { XRPL_ASSERT( - lenLen == 3, "ripple::SerialIter::getVLDataLength : lenLen is 3"); + lenLen == 3, "xrpl::SerialIter::getVLDataLength : lenLen is 3"); int b2 = get8(); int b3 = get8(); datLen = Serializer::decodeVLLength(b1, b2, b3); @@ -519,4 +519,4 @@ SerialIter::getVLBuffer() return getRawHelper(getVLDataLength()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/Sign.cpp b/src/libxrpl/protocol/Sign.cpp index 3a6b52ac84..9edd2bbfa4 100644 --- a/src/libxrpl/protocol/Sign.cpp +++ b/src/libxrpl/protocol/Sign.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { void sign( @@ -90,4 +90,4 @@ startMultiSigningData(STObject const& obj) return s; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/TER.cpp b/src/libxrpl/protocol/TER.cpp index 8cdcced347..6871cf5700 100644 --- a/src/libxrpl/protocol/TER.cpp +++ b/src/libxrpl/protocol/TER.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { std::unordered_map< TERUnderlyingType, @@ -281,4 +281,4 @@ transCode(std::string const& token) return TER::fromInt(r->second); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/TxFormats.cpp b/src/libxrpl/protocol/TxFormats.cpp index 0b42f8cefb..12f92615cd 100644 --- a/src/libxrpl/protocol/TxFormats.cpp +++ b/src/libxrpl/protocol/TxFormats.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { TxFormats::TxFormats() { @@ -55,4 +55,4 @@ TxFormats::getInstance() return instance; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/TxMeta.cpp b/src/libxrpl/protocol/TxMeta.cpp index ebc1d87b14..f0077c7f92 100644 --- a/src/libxrpl/protocol/TxMeta.cpp +++ b/src/libxrpl/protocol/TxMeta.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj) : transactionID_(txid) @@ -31,8 +31,7 @@ TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj) auto affectedNodes = dynamic_cast(obj.peekAtPField(sfAffectedNodes)); XRPL_ASSERT( - affectedNodes, - "ripple::TxMeta::TxMeta(STObject) : type cast succeeded"); + affectedNodes, "xrpl::TxMeta::TxMeta(STObject) : type cast succeeded"); if (affectedNodes) nodes_ = *affectedNodes; @@ -84,7 +83,7 @@ TxMeta::setAffectedNode( XRPL_ASSERT( obj.getFName() == type, - "ripple::TxMeta::setAffectedNode : field type match"); + "xrpl::TxMeta::setAffectedNode : field type match"); obj.setFieldH256(sfLedgerIndex, node); obj.setFieldU16(sfLedgerEntryType, nodeType); } @@ -108,7 +107,7 @@ TxMeta::getAffectedAccounts() const dynamic_cast(&node.peekAtIndex(index)); XRPL_ASSERT( inner, - "ripple::getAffectedAccounts : STObject type cast succeeded"); + "xrpl::getAffectedAccounts : STObject type cast succeeded"); if (inner) { for (auto const& field : *inner) @@ -117,7 +116,7 @@ TxMeta::getAffectedAccounts() const { XRPL_ASSERT( !sa->isDefault(), - "ripple::getAffectedAccounts : account is set"); + "xrpl::getAffectedAccounts : account is set"); if (!sa->isDefault()) list.insert(sa->value()); } @@ -130,7 +129,7 @@ TxMeta::getAffectedAccounts() const auto lim = dynamic_cast(&field); XRPL_ASSERT( lim, - "ripple::getAffectedAccounts : STAmount type cast " + "xrpl::getAffectedAccounts : STAmount type cast " "succeeded"); if (lim != nullptr) @@ -175,7 +174,7 @@ TxMeta::getAffectedNode(SLE::ref node, SField const& type) XRPL_ASSERT( obj.getFName() == type, - "ripple::TxMeta::getAffectedNode(SLE::ref) : field type match"); + "xrpl::TxMeta::getAffectedNode(SLE::ref) : field type match"); obj.setFieldH256(sfLedgerIndex, index); obj.setFieldU16(sfLedgerEntryType, node->getFieldU16(sfLedgerEntryType)); @@ -191,7 +190,7 @@ TxMeta::getAffectedNode(uint256 const& node) return n; } // LCOV_EXCL_START - UNREACHABLE("ripple::TxMeta::getAffectedNode(uint256) : node not found"); + UNREACHABLE("xrpl::TxMeta::getAffectedNode(uint256) : node not found"); Throw("Affected node not found"); return *(nodes_.begin()); // Silence compiler warning. // LCOV_EXCL_STOP @@ -201,7 +200,7 @@ STObject TxMeta::getAsObject() const { STObject metaData(sfTransactionMetaData); - XRPL_ASSERT(result_ != 255, "ripple::TxMeta::getAsObject : result_ is set"); + XRPL_ASSERT(result_ != 255, "xrpl::TxMeta::getAsObject : result_ is set"); metaData.setFieldU8(sfTransactionResult, result_); metaData.setFieldU32(sfTransactionIndex, index_); metaData.emplace_back(nodes_); @@ -221,7 +220,7 @@ TxMeta::addRaw(Serializer& s, TER result, std::uint32_t index) index_ = index; XRPL_ASSERT( (result_ == 0) || ((result_ > 100) && (result_ <= 255)), - "ripple::TxMeta::addRaw : valid TER input"); + "xrpl::TxMeta::addRaw : valid TER input"); nodes_.sort([](STObject const& o1, STObject const& o2) { return o1.getFieldH256(sfLedgerIndex) < o2.getFieldH256(sfLedgerIndex); @@ -230,4 +229,4 @@ TxMeta::addRaw(Serializer& s, TER result, std::uint32_t index) getAsObject().add(s); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/UintTypes.cpp b/src/libxrpl/protocol/UintTypes.cpp index ca7f09b5f5..6c799397ee 100644 --- a/src/libxrpl/protocol/UintTypes.cpp +++ b/src/libxrpl/protocol/UintTypes.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { // For details on the protocol-level serialization please visit // https://xrpl.org/serialization.html#currency-codes @@ -117,4 +117,4 @@ badCurrency() return currency; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/XChainAttestations.cpp b/src/libxrpl/protocol/XChainAttestations.cpp index da5f2d4ccb..89771b63b0 100644 --- a/src/libxrpl/protocol/XChainAttestations.cpp +++ b/src/libxrpl/protocol/XChainAttestations.cpp @@ -22,7 +22,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Attestations { AttestationBase::AttestationBase( @@ -83,7 +83,7 @@ bool AttestationBase::verify(STXChainBridge const& bridge) const { std::vector msg = message(bridge); - return ripple::verify(publicKey, makeSlice(msg), signature); + return xrpl::verify(publicKey, makeSlice(msg), signature); } AttestationBase::AttestationBase(STObject const& o) @@ -742,4 +742,4 @@ XChainAttestationsBase::toSTArray() const template class XChainAttestationsBase; template class XChainAttestationsBase; -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/digest.cpp b/src/libxrpl/protocol/digest.cpp index ca7bab7372..dd4ecd7688 100644 --- a/src/libxrpl/protocol/digest.cpp +++ b/src/libxrpl/protocol/digest.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { openssl_ripemd160_hasher::openssl_ripemd160_hasher() { @@ -86,4 +86,4 @@ openssl_sha256_hasher::operator result_type() noexcept return digest; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/protocol/tokens.cpp b/src/libxrpl/protocol/tokens.cpp index a9a9ddb110..d4253a2df1 100644 --- a/src/libxrpl/protocol/tokens.cpp +++ b/src/libxrpl/protocol/tokens.cpp @@ -119,7 +119,7 @@ of another base), and doing the multi-precision computations with larger coefficients sizes greatly speeds up the multi-precision computations. */ -namespace ripple { +namespace xrpl { static constexpr char const* alphabetForward = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"; @@ -235,7 +235,7 @@ encodeBase58( carry /= 58; } XRPL_ASSERT( - carry == 0, "ripple::b58_ref::detail::encodeBase58 : zero carry"); + carry == 0, "xrpl::b58_ref::detail::encodeBase58 : zero carry"); pbegin++; } @@ -286,7 +286,7 @@ decodeBase58(std::string const& s) carry /= 256; } XRPL_ASSERT( - carry == 0, "ripple::b58_ref::detail::decodeBase58 : zero carry"); + carry == 0, "xrpl::b58_ref::detail::decodeBase58 : zero carry"); ++psz; --remain; } @@ -430,7 +430,7 @@ b256_to_b58_be(std::span input, std::span out) while (cur_2_64_end > 0) { base_58_10_coeff[num_58_10_coeffs] = - ripple::b58_fast::detail::inplace_bigint_div_rem( + xrpl::b58_fast::detail::inplace_bigint_div_rem( base_2_64_coeff.subspan(0, cur_2_64_end), B_58_10); num_58_10_coeffs += 1; if (base_2_64_coeff[cur_2_64_end - 1] == 0) @@ -442,7 +442,7 @@ b256_to_b58_be(std::span input, std::span out) // Translate the result into the alphabet // Put all the zeros at the beginning, then all the values from the output std::fill( - out.begin(), out.begin() + input_zeros, ::ripple::alphabetForward[0]); + out.begin(), out.begin() + input_zeros, ::xrpl::alphabetForward[0]); // iterate through the base 58^10 coeff // convert to base 58 big endian then @@ -461,7 +461,7 @@ b256_to_b58_be(std::span input, std::span out) return Unexpected(TokenCodecErrc::inputTooLarge); } std::array const b58_be = - ripple::b58_fast::detail::b58_10_to_b58_be(base_58_10_coeff[i]); + xrpl::b58_fast::detail::b58_10_to_b58_be(base_58_10_coeff[i]); std::size_t to_skip = 0; std::span b58_be_s{b58_be.data(), b58_be.size()}; if (skip_zeros) @@ -475,7 +475,7 @@ b256_to_b58_be(std::span input, std::span out) } for (auto b58_coeff : b58_be_s.subspan(to_skip)) { - out[out_index] = ::ripple::alphabetForward[b58_coeff]; + out[out_index] = ::xrpl::alphabetForward[b58_coeff]; out_index += 1; } } @@ -504,7 +504,7 @@ b58_to_b256_be(std::string_view input, std::span out) std::size_t count = 0; for (auto const& c : col) { - if (c != ::ripple::alphabetForward[0]) + if (c != ::xrpl::alphabetForward[0]) { return count; } @@ -520,15 +520,15 @@ b58_to_b256_be(std::string_view input, std::span out) // log(2^(38*8),58^10)) ~= 5.18. So 6 coeff are enough std::array b_58_10_coeff{}; auto [num_full_coeffs, partial_coeff_len] = - ripple::b58_fast::detail::div_rem(input.size(), 10); + xrpl::b58_fast::detail::div_rem(input.size(), 10); auto const num_partial_coeffs = partial_coeff_len ? 1 : 0; auto const num_b_58_10_coeffs = num_full_coeffs + num_partial_coeffs; XRPL_ASSERT( num_b_58_10_coeffs <= b_58_10_coeff.size(), - "ripple::b58_fast::detail::b58_to_b256_be : maximum coeff"); + "xrpl::b58_fast::detail::b58_to_b256_be : maximum coeff"); for (unsigned char c : input.substr(0, partial_coeff_len)) { - auto cur_val = ::ripple::alphabetReverse[c]; + auto cur_val = ::xrpl::alphabetReverse[c]; if (cur_val < 0) { return Unexpected(TokenCodecErrc::invalidEncodingChar); @@ -541,7 +541,7 @@ b58_to_b256_be(std::string_view input, std::span out) for (int j = 0; j < num_full_coeffs; ++j) { unsigned char c = input[partial_coeff_len + j * 10 + i]; - auto cur_val = ::ripple::alphabetReverse[c]; + auto cur_val = ::xrpl::alphabetReverse[c]; if (cur_val < 0) { return Unexpected(TokenCodecErrc::invalidEncodingChar); @@ -562,7 +562,7 @@ b58_to_b256_be(std::string_view input, std::span out) std::uint64_t const c = b_58_10_coeff[i]; { - auto code = ripple::b58_fast::detail::inplace_bigint_mul( + auto code = xrpl::b58_fast::detail::inplace_bigint_mul( std::span(&result[0], cur_result_size + 1), B_58_10); if (code != TokenCodecErrc::success) { @@ -570,7 +570,7 @@ b58_to_b256_be(std::string_view input, std::span out) } } { - auto code = ripple::b58_fast::detail::inplace_bigint_add( + auto code = xrpl::b58_fast::detail::inplace_bigint_add( std::span(&result[0], cur_result_size + 1), c); if (code != TokenCodecErrc::success) { @@ -732,4 +732,4 @@ decodeBase58Token(std::string const& s, TokenType type) } // namespace b58_fast #endif // _MSC_VER -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/resource/Charge.cpp b/src/libxrpl/resource/Charge.cpp index 43901d8985..1d88526b65 100644 --- a/src/libxrpl/resource/Charge.cpp +++ b/src/libxrpl/resource/Charge.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { Charge::Charge(value_type cost, std::string const& label) @@ -59,4 +59,4 @@ Charge::operator*(value_type m) const } } // namespace Resource -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/resource/Consumer.cpp b/src/libxrpl/resource/Consumer.cpp index 8f396c5012..c9d8ea6125 100644 --- a/src/libxrpl/resource/Consumer.cpp +++ b/src/libxrpl/resource/Consumer.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { Consumer::Consumer(Logic& logic, Entry& entry) @@ -97,7 +97,7 @@ Consumer::charge(Charge const& what, std::string const& context) bool Consumer::warn() { - XRPL_ASSERT(m_entry, "ripple::Resource::Consumer::warn : non-null entry"); + XRPL_ASSERT(m_entry, "xrpl::Resource::Consumer::warn : non-null entry"); return m_logic->warn(*m_entry); } @@ -105,7 +105,7 @@ bool Consumer::disconnect(beast::Journal const& j) { XRPL_ASSERT( - m_entry, "ripple::Resource::Consumer::disconnect : non-null entry"); + m_entry, "xrpl::Resource::Consumer::disconnect : non-null entry"); bool const d = m_logic->disconnect(*m_entry); if (d) { @@ -117,15 +117,14 @@ Consumer::disconnect(beast::Journal const& j) int Consumer::balance() { - XRPL_ASSERT( - m_entry, "ripple::Resource::Consumer::balance : non-null entry"); + XRPL_ASSERT(m_entry, "xrpl::Resource::Consumer::balance : non-null entry"); return m_logic->balance(*m_entry); } Entry& Consumer::entry() { - XRPL_ASSERT(m_entry, "ripple::Resource::Consumer::entry : non-null entry"); + XRPL_ASSERT(m_entry, "xrpl::Resource::Consumer::entry : non-null entry"); return *m_entry; } @@ -143,4 +142,4 @@ operator<<(std::ostream& os, Consumer const& v) } } // namespace Resource -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/resource/Fees.cpp b/src/libxrpl/resource/Fees.cpp index f300a70d7c..d5999458b7 100644 --- a/src/libxrpl/resource/Fees.cpp +++ b/src/libxrpl/resource/Fees.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { Charge const feeMalformedRequest(200, "malformed request"); @@ -26,4 +26,4 @@ Charge const feeDrop(6000, "dropped"); // See also Resource::Logic::charge for log level cutoff values } // namespace Resource -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/resource/ResourceManager.cpp b/src/libxrpl/resource/ResourceManager.cpp index 5e647cfce9..8582836611 100644 --- a/src/libxrpl/resource/ResourceManager.cpp +++ b/src/libxrpl/resource/ResourceManager.cpp @@ -22,7 +22,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { class ManagerImp : public Manager @@ -171,4 +171,4 @@ make_Manager( } } // namespace Resource -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/server/JSONRPCUtil.cpp b/src/libxrpl/server/JSONRPCUtil.cpp index 1a804677bd..845781374d 100644 --- a/src/libxrpl/server/JSONRPCUtil.cpp +++ b/src/libxrpl/server/JSONRPCUtil.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string getHTTPHeaderTimestamp() @@ -139,4 +139,4 @@ HTTPReply( output("\r\n"); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/server/Port.cpp b/src/libxrpl/server/Port.cpp index 6c7ec04f6f..03a503e940 100644 --- a/src/libxrpl/server/Port.cpp +++ b/src/libxrpl/server/Port.cpp @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { bool Port::secure() const @@ -320,4 +320,4 @@ parse_Port(ParsedPort& port, Section const& section, std::ostream& log) port.pmd_options.memLevel = section.value_or("memory_level", 4); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMap.cpp b/src/libxrpl/shamap/SHAMap.cpp index ef27d37ed3..7cfa66b1ac 100644 --- a/src/libxrpl/shamap/SHAMap.cpp +++ b/src/libxrpl/shamap/SHAMap.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { [[nodiscard]] intr_ptr::SharedPtr makeTypedLeaf( @@ -85,10 +85,10 @@ SHAMap::dirtyUp( XRPL_ASSERT( (state_ != SHAMapState::Synching) && (state_ != SHAMapState::Immutable), - "ripple::SHAMap::dirtyUp : valid state"); + "xrpl::SHAMap::dirtyUp : valid state"); XRPL_ASSERT( child && (child->cowid() == cowid_), - "ripple::SHAMap::dirtyUp : valid child input"); + "xrpl::SHAMap::dirtyUp : valid child input"); while (!stack.empty()) { @@ -96,10 +96,10 @@ SHAMap::dirtyUp( intr_ptr::dynamic_pointer_cast(stack.top().first); SHAMapNodeID nodeID = stack.top().second; stack.pop(); - XRPL_ASSERT(node, "ripple::SHAMap::dirtyUp : non-null node"); + XRPL_ASSERT(node, "xrpl::SHAMap::dirtyUp : non-null node"); int branch = selectBranch(nodeID, target); - XRPL_ASSERT(branch >= 0, "ripple::SHAMap::dirtyUp : valid branch"); + XRPL_ASSERT(branch >= 0, "xrpl::SHAMap::dirtyUp : valid branch"); node = unshareNode(std::move(node), nodeID); node->setChild(branch, std::move(child)); @@ -113,7 +113,7 @@ SHAMap::walkTowardsKey(uint256 const& id, SharedPtrNodeStack* stack) const { XRPL_ASSERT( stack == nullptr || stack->empty(), - "ripple::SHAMap::walkTowardsKey : empty stack input"); + "xrpl::SHAMap::walkTowardsKey : empty stack input"); auto inNode = root_; SHAMapNodeID nodeID; @@ -149,7 +149,7 @@ SHAMap::findKey(uint256 const& id) const intr_ptr::SharedPtr SHAMap::fetchNodeFromDB(SHAMapHash const& hash) const { - XRPL_ASSERT(backed_, "ripple::SHAMap::fetchNodeFromDB : is backed"); + XRPL_ASSERT(backed_, "xrpl::SHAMap::fetchNodeFromDB : is backed"); auto obj = f_.db().fetchNodeObject(hash.as_uint256(), ledgerSeq_); return finishFetch(hash, obj); } @@ -159,7 +159,7 @@ SHAMap::finishFetch( SHAMapHash const& hash, std::shared_ptr const& object) const { - XRPL_ASSERT(backed_, "ripple::SHAMap::finishFetch : is backed"); + XRPL_ASSERT(backed_, "xrpl::SHAMap::finishFetch : is backed"); try { @@ -344,13 +344,13 @@ SHAMap::descend( SHAMapSyncFilter* filter) const { XRPL_ASSERT( - parent->isInner(), "ripple::SHAMap::descend : valid parent input"); + parent->isInner(), "xrpl::SHAMap::descend : valid parent input"); XRPL_ASSERT( (branch >= 0) && (branch < branchFactor), - "ripple::SHAMap::descend : valid branch input"); + "xrpl::SHAMap::descend : valid branch input"); XRPL_ASSERT( !parent->isEmptyBranch(branch), - "ripple::SHAMap::descend : parent branch is non-empty"); + "xrpl::SHAMap::descend : parent branch is non-empty"); SHAMapTreeNode* child = parent->getChildPointer(branch); @@ -420,13 +420,13 @@ SHAMap::unshareNode(intr_ptr::SharedPtr node, SHAMapNodeID const& nodeID) // make sure the node is suitable for the intended operation (copy on write) XRPL_ASSERT( node->cowid() <= cowid_, - "ripple::SHAMap::unshareNode : node valid for cowid"); + "xrpl::SHAMap::unshareNode : node valid for cowid"); if (node->cowid() != cowid_) { // have a CoW XRPL_ASSERT( state_ != SHAMapState::Immutable, - "ripple::SHAMap::unshareNode : not immutable"); + "xrpl::SHAMap::unshareNode : not immutable"); node = intr_ptr::static_pointer_cast(node->clone(cowid_)); if (nodeID.isRoot()) root_ = node; @@ -460,8 +460,7 @@ SHAMap::belowHelper( { node.adopt(descendThrow(inner.get(), i)); XRPL_ASSERT( - !stack.empty(), - "ripple::SHAMap::belowHelper : non-empty stack"); + !stack.empty(), "xrpl::SHAMap::belowHelper : non-empty stack"); if (node->isLeaf()) { auto n = intr_ptr::static_pointer_cast(node); @@ -526,7 +525,7 @@ SHAMap::onlyBelow(SHAMapTreeNode* node) const if (!nextNode) { // LCOV_EXCL_START - UNREACHABLE("ripple::SHAMap::onlyBelow : no next node"); + UNREACHABLE("xrpl::SHAMap::onlyBelow : no next node"); return no_item; // LCOV_EXCL_STOP } @@ -539,7 +538,7 @@ SHAMap::onlyBelow(SHAMapTreeNode* node) const auto const leaf = static_cast(node); XRPL_ASSERT( leaf->peekItem() || (leaf == root_.get()), - "ripple::SHAMap::onlyBelow : valid inner node"); + "xrpl::SHAMap::onlyBelow : valid inner node"); return leaf->peekItem(); } @@ -547,7 +546,7 @@ SHAMapLeafNode const* SHAMap::peekFirstItem(SharedPtrNodeStack& stack) const { XRPL_ASSERT( - stack.empty(), "ripple::SHAMap::peekFirstItem : empty stack input"); + stack.empty(), "xrpl::SHAMap::peekFirstItem : empty stack input"); SHAMapLeafNode* node = firstBelow(root_, stack); if (!node) { @@ -562,17 +561,17 @@ SHAMapLeafNode const* SHAMap::peekNextItem(uint256 const& id, SharedPtrNodeStack& stack) const { XRPL_ASSERT( - !stack.empty(), "ripple::SHAMap::peekNextItem : non-empty stack input"); + !stack.empty(), "xrpl::SHAMap::peekNextItem : non-empty stack input"); XRPL_ASSERT( stack.top().first->isLeaf(), - "ripple::SHAMap::peekNextItem : stack starts with leaf"); + "xrpl::SHAMap::peekNextItem : stack starts with leaf"); stack.pop(); while (!stack.empty()) { auto [node, nodeID] = stack.top(); XRPL_ASSERT( !node->isLeaf(), - "ripple::SHAMap::peekNextItem : another node is not leaf"); + "xrpl::SHAMap::peekNextItem : another node is not leaf"); auto inner = intr_ptr::static_pointer_cast(node); for (auto i = selectBranch(nodeID, id) + 1; i < branchFactor; ++i) { @@ -584,7 +583,7 @@ SHAMap::peekNextItem(uint256 const& id, SharedPtrNodeStack& stack) const Throw(type_, id); XRPL_ASSERT( leaf->isLeaf(), - "ripple::SHAMap::peekNextItem : leaf is valid"); + "xrpl::SHAMap::peekNextItem : leaf is valid"); return leaf; } } @@ -704,7 +703,7 @@ SHAMap::delItem(uint256 const& id) // delete the item with this ID XRPL_ASSERT( state_ != SHAMapState::Immutable, - "ripple::SHAMap::delItem : not immutable"); + "xrpl::SHAMap::delItem : not immutable"); SharedPtrNodeStack stack; walkTowardsKey(id, &stack); @@ -787,10 +786,10 @@ SHAMap::addGiveItem( { XRPL_ASSERT( state_ != SHAMapState::Immutable, - "ripple::SHAMap::addGiveItem : not immutable"); + "xrpl::SHAMap::addGiveItem : not immutable"); XRPL_ASSERT( type != SHAMapNodeType::tnINNER, - "ripple::SHAMap::addGiveItem : valid type input"); + "xrpl::SHAMap::addGiveItem : valid type input"); // add the specified item, does not update uint256 tag = item->key(); @@ -818,7 +817,7 @@ SHAMap::addGiveItem( int branch = selectBranch(nodeID, tag); XRPL_ASSERT( inner->isEmptyBranch(branch), - "ripple::SHAMap::addGiveItem : inner branch is empty"); + "xrpl::SHAMap::addGiveItem : inner branch is empty"); inner->setChild(branch, makeTypedLeaf(type, std::move(item), cowid_)); } else @@ -829,7 +828,7 @@ SHAMap::addGiveItem( auto otherItem = leaf->peekItem(); XRPL_ASSERT( otherItem && (tag != otherItem->key()), - "ripple::SHAMap::addGiveItem : non-null item"); + "xrpl::SHAMap::addGiveItem : non-null item"); node = intr_ptr::make_shared(node->cowid()); @@ -848,7 +847,7 @@ SHAMap::addGiveItem( // we can add the two leaf nodes here XRPL_ASSERT( - node->isInner(), "ripple::SHAMap::addGiveItem : node is inner"); + node->isInner(), "xrpl::SHAMap::addGiveItem : node is inner"); auto inner = static_cast(node.get()); inner->setChild(b1, makeTypedLeaf(type, std::move(item), cowid_)); @@ -889,7 +888,7 @@ SHAMap::updateGiveItem( XRPL_ASSERT( state_ != SHAMapState::Immutable, - "ripple::SHAMap::updateGiveItem : not immutable"); + "xrpl::SHAMap::updateGiveItem : not immutable"); SharedPtrNodeStack stack; walkTowardsKey(tag, &stack); @@ -905,7 +904,7 @@ SHAMap::updateGiveItem( if (!node || (node->peekItem()->key() != tag)) { // LCOV_EXCL_START - UNREACHABLE("ripple::SHAMap::updateGiveItem : invalid node"); + UNREACHABLE("xrpl::SHAMap::updateGiveItem : invalid node"); return false; // LCOV_EXCL_STOP } @@ -953,7 +952,7 @@ SHAMap::fetchRoot(SHAMapHash const& hash, SHAMapSyncFilter* filter) root_ = newRoot; XRPL_ASSERT( root_->getHash() == hash, - "ripple::SHAMap::fetchRoot : root hash do match"); + "xrpl::SHAMap::fetchRoot : root hash do match"); return true; } @@ -977,8 +976,8 @@ SHAMap::writeNode(NodeObjectType t, intr_ptr::SharedPtr node) const { XRPL_ASSERT( - node->cowid() == 0, "ripple::SHAMap::writeNode : valid input node"); - XRPL_ASSERT(backed_, "ripple::SHAMap::writeNode : is backed"); + node->cowid() == 0, "xrpl::SHAMap::writeNode : valid input node"); + XRPL_ASSERT(backed_, "xrpl::SHAMap::writeNode : is backed"); canonicalize(node->getHash(), node); @@ -998,8 +997,7 @@ SHAMap::preFlushNode(intr_ptr::SharedPtr node) const { // A shared node should never need to be flushed // because that would imply someone modified it - XRPL_ASSERT( - node->cowid(), "ripple::SHAMap::preFlushNode : valid input node"); + XRPL_ASSERT(node->cowid(), "xrpl::SHAMap::preFlushNode : valid input node"); if (node->cowid() != cowid_) { @@ -1027,8 +1025,7 @@ SHAMap::flushDirty(NodeObjectType t) int SHAMap::walkSubTree(bool doWrite, NodeObjectType t) { - XRPL_ASSERT( - !doWrite || backed_, "ripple::SHAMap::walkSubTree : valid input"); + XRPL_ASSERT(!doWrite || backed_, "xrpl::SHAMap::walkSubTree : valid input"); int flushed = 0; @@ -1105,7 +1102,7 @@ SHAMap::walkSubTree(bool doWrite, NodeObjectType t) XRPL_ASSERT( node->cowid() == cowid_, - "ripple::SHAMap::walkSubTree : node cowid do " + "xrpl::SHAMap::walkSubTree : node cowid do " "match"); child->updateHash(); child->unshare(); @@ -1141,7 +1138,7 @@ SHAMap::walkSubTree(bool doWrite, NodeObjectType t) // Hook this inner node to its parent XRPL_ASSERT( parent->cowid() == cowid_, - "ripple::SHAMap::walkSubTree : parent cowid do match"); + "xrpl::SHAMap::walkSubTree : parent cowid do match"); parent->shareChild(pos, node); // Continue with parent's next child, if any @@ -1187,7 +1184,7 @@ SHAMap::dump(bool hash) const { XRPL_ASSERT( child->getHash() == inner->getChildHash(i), - "ripple::SHAMap::dump : child hash do match"); + "xrpl::SHAMap::dump : child hash do match"); stack.push({child, nodeID.getChildNodeID(i)}); } } @@ -1206,7 +1203,7 @@ SHAMap::cacheLookup(SHAMapHash const& hash) const auto ret = f_.getTreeNodeCache()->fetch(hash.as_uint256()); XRPL_ASSERT( !ret || !ret->cowid(), - "ripple::SHAMap::cacheLookup : not found or zero cowid"); + "xrpl::SHAMap::cacheLookup : not found or zero cowid"); return ret; } @@ -1215,12 +1212,12 @@ SHAMap::canonicalize( SHAMapHash const& hash, intr_ptr::SharedPtr& node) const { - XRPL_ASSERT(backed_, "ripple::SHAMap::canonicalize : is backed"); + XRPL_ASSERT(backed_, "xrpl::SHAMap::canonicalize : is backed"); XRPL_ASSERT( - node->cowid() == 0, "ripple::SHAMap::canonicalize : valid node input"); + node->cowid() == 0, "xrpl::SHAMap::canonicalize : valid node input"); XRPL_ASSERT( node->getHash() == hash, - "ripple::SHAMap::canonicalize : node hash do match"); + "xrpl::SHAMap::canonicalize : node hash do match"); f_.getTreeNodeCache()->canonicalize_replace_client(hash.as_uint256(), node); } @@ -1230,9 +1227,9 @@ SHAMap::invariants() const { (void)getHash(); // update node hashes auto node = root_.get(); - XRPL_ASSERT(node, "ripple::SHAMap::invariants : non-null root node"); + XRPL_ASSERT(node, "xrpl::SHAMap::invariants : non-null root node"); XRPL_ASSERT( - !node->isLeaf(), "ripple::SHAMap::invariants : root node is not leaf"); + !node->isLeaf(), "xrpl::SHAMap::invariants : root node is not leaf"); SharedPtrNodeStack stack; for (auto leaf = peekFirstItem(stack); leaf != nullptr; leaf = peekNextItem(leaf->peekItem()->key(), stack)) @@ -1240,4 +1237,4 @@ SHAMap::invariants() const node->invariants(true); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapDelta.cpp b/src/libxrpl/shamap/SHAMapDelta.cpp index 063c41993d..d7234bcbab 100644 --- a/src/libxrpl/shamap/SHAMapDelta.cpp +++ b/src/libxrpl/shamap/SHAMapDelta.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // This code is used to compare another node's transaction tree // to our own. It returns a map containing all items that are different @@ -112,7 +112,7 @@ SHAMap::compare(SHAMap const& otherMap, Delta& differences, int maxCount) const XRPL_ASSERT( isValid() && otherMap.isValid(), - "ripple::SHAMap::compare : valid state and valid input"); + "xrpl::SHAMap::compare : valid state and valid input"); if (getHash() == otherMap.getHash()) return true; @@ -130,7 +130,7 @@ SHAMap::compare(SHAMap const& otherMap, Delta& differences, int maxCount) const if (!ourNode || !otherNode) { // LCOV_EXCL_START - UNREACHABLE("ripple::SHAMap::compare : missing a node"); + UNREACHABLE("xrpl::SHAMap::compare : missing a node"); Throw(type_, uint256()); // LCOV_EXCL_STOP } @@ -214,7 +214,7 @@ SHAMap::compare(SHAMap const& otherMap, Delta& differences, int maxCount) const else { // LCOV_EXCL_START - UNREACHABLE("ripple::SHAMap::compare : invalid node"); + UNREACHABLE("xrpl::SHAMap::compare : invalid node"); // LCOV_EXCL_STOP } } @@ -315,7 +315,7 @@ SHAMap::walkMapParallel( std::move(nodeStack.top()); XRPL_ASSERT( node, - "ripple::SHAMap::walkMapParallel : non-null node"); + "xrpl::SHAMap::walkMapParallel : non-null node"); nodeStack.pop(); for (int i = 0; i < 16; ++i) @@ -366,4 +366,4 @@ SHAMap::walkMapParallel( return false; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapInnerNode.cpp b/src/libxrpl/shamap/SHAMapInnerNode.cpp index f17f86bcb1..5d4a0fd27f 100644 --- a/src/libxrpl/shamap/SHAMapInnerNode.cpp +++ b/src/libxrpl/shamap/SHAMapInnerNode.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { SHAMapInnerNode::SHAMapInnerNode( std::uint32_t cowid, @@ -212,7 +212,7 @@ void SHAMapInnerNode::serializeForWire(Serializer& s) const { XRPL_ASSERT( - !isEmpty(), "ripple::SHAMapInnerNode::serializeForWire : is non-empty"); + !isEmpty(), "xrpl::SHAMapInnerNode::serializeForWire : is non-empty"); // If the node is sparse, then only send non-empty branches: if (getBranchCount() < 12) @@ -238,7 +238,7 @@ SHAMapInnerNode::serializeWithPrefix(Serializer& s) const { XRPL_ASSERT( !isEmpty(), - "ripple::SHAMapInnerNode::serializeWithPrefix : is non-empty"); + "xrpl::SHAMapInnerNode::serializeWithPrefix : is non-empty"); s.add32(HashPrefix::innerNode); iterChildren( @@ -265,11 +265,11 @@ SHAMapInnerNode::setChild(int m, intr_ptr::SharedPtr child) { XRPL_ASSERT( (m >= 0) && (m < branchFactor), - "ripple::SHAMapInnerNode::setChild : valid branch input"); - XRPL_ASSERT(cowid_, "ripple::SHAMapInnerNode::setChild : nonzero cowid"); + "xrpl::SHAMapInnerNode::setChild : valid branch input"); + XRPL_ASSERT(cowid_, "xrpl::SHAMapInnerNode::setChild : nonzero cowid"); XRPL_ASSERT( child.get() != this, - "ripple::SHAMapInnerNode::setChild : valid child input"); + "xrpl::SHAMapInnerNode::setChild : valid child input"); auto const dstIsBranch = [&] { if (child) @@ -298,7 +298,7 @@ SHAMapInnerNode::setChild(int m, intr_ptr::SharedPtr child) XRPL_ASSERT( getBranchCount() <= hashesAndChildren_.capacity(), - "ripple::SHAMapInnerNode::setChild : maximum branch count"); + "xrpl::SHAMapInnerNode::setChild : maximum branch count"); } // finished modifying, now make shareable @@ -309,17 +309,17 @@ SHAMapInnerNode::shareChild( { XRPL_ASSERT( (m >= 0) && (m < branchFactor), - "ripple::SHAMapInnerNode::shareChild : valid branch input"); - XRPL_ASSERT(cowid_, "ripple::SHAMapInnerNode::shareChild : nonzero cowid"); + "xrpl::SHAMapInnerNode::shareChild : valid branch input"); + XRPL_ASSERT(cowid_, "xrpl::SHAMapInnerNode::shareChild : nonzero cowid"); XRPL_ASSERT( - child, "ripple::SHAMapInnerNode::shareChild : non-null child input"); + child, "xrpl::SHAMapInnerNode::shareChild : non-null child input"); XRPL_ASSERT( child.get() != this, - "ripple::SHAMapInnerNode::shareChild : valid child input"); + "xrpl::SHAMapInnerNode::shareChild : valid child input"); XRPL_ASSERT( !isEmptyBranch(m), - "ripple::SHAMapInnerNode::shareChild : non-empty branch input"); + "xrpl::SHAMapInnerNode::shareChild : non-empty branch input"); hashesAndChildren_.getChildren()[*getChildIndex(m)] = child; } @@ -328,10 +328,10 @@ SHAMapInnerNode::getChildPointer(int branch) { XRPL_ASSERT( branch >= 0 && branch < branchFactor, - "ripple::SHAMapInnerNode::getChildPointer : valid branch input"); + "xrpl::SHAMapInnerNode::getChildPointer : valid branch input"); XRPL_ASSERT( !isEmptyBranch(branch), - "ripple::SHAMapInnerNode::getChildPointer : non-empty branch input"); + "xrpl::SHAMapInnerNode::getChildPointer : non-empty branch input"); auto const index = *getChildIndex(branch); @@ -345,10 +345,10 @@ SHAMapInnerNode::getChild(int branch) { XRPL_ASSERT( branch >= 0 && branch < branchFactor, - "ripple::SHAMapInnerNode::getChild : valid branch input"); + "xrpl::SHAMapInnerNode::getChild : valid branch input"); XRPL_ASSERT( !isEmptyBranch(branch), - "ripple::SHAMapInnerNode::getChild : non-empty branch input"); + "xrpl::SHAMapInnerNode::getChild : non-empty branch input"); auto const index = *getChildIndex(branch); @@ -362,7 +362,7 @@ SHAMapInnerNode::getChildHash(int m) const { XRPL_ASSERT( (m >= 0) && (m < branchFactor), - "ripple::SHAMapInnerNode::getChildHash : valid branch input"); + "xrpl::SHAMapInnerNode::getChildHash : valid branch input"); if (auto const i = getChildIndex(m)) return hashesAndChildren_.getHashes()[*i]; @@ -376,18 +376,18 @@ SHAMapInnerNode::canonicalizeChild( { XRPL_ASSERT( branch >= 0 && branch < branchFactor, - "ripple::SHAMapInnerNode::canonicalizeChild : valid branch input"); + "xrpl::SHAMapInnerNode::canonicalizeChild : valid branch input"); XRPL_ASSERT( node != nullptr, - "ripple::SHAMapInnerNode::canonicalizeChild : valid node input"); + "xrpl::SHAMapInnerNode::canonicalizeChild : valid node input"); XRPL_ASSERT( !isEmptyBranch(branch), - "ripple::SHAMapInnerNode::canonicalizeChild : non-empty branch input"); + "xrpl::SHAMapInnerNode::canonicalizeChild : non-empty branch input"); auto const childIndex = *getChildIndex(branch); auto [_, hashes, children] = hashesAndChildren_.getHashesAndChildren(); XRPL_ASSERT( node->getHash() == hashes[childIndex], - "ripple::SHAMapInnerNode::canonicalizeChild : node and branch inputs " + "xrpl::SHAMapInnerNode::canonicalizeChild : node and branch inputs " "hash do match"); packed_spinlock sl(lock_, childIndex); @@ -420,7 +420,7 @@ SHAMapInnerNode::invariants(bool is_root) const { XRPL_ASSERT( hashes[i].isNonZero(), - "ripple::SHAMapInnerNode::invariants : nonzero hash in branch"); + "xrpl::SHAMapInnerNode::invariants : nonzero hash in branch"); if (children[i] != nullptr) children[i]->invariants(); ++count; @@ -434,7 +434,7 @@ SHAMapInnerNode::invariants(bool is_root) const { XRPL_ASSERT( (isBranch_ & (1 << i)), - "ripple::SHAMapInnerNode::invariants : valid branch when " + "xrpl::SHAMapInnerNode::invariants : valid branch when " "nonzero hash"); if (children[i] != nullptr) children[i]->invariants(); @@ -444,7 +444,7 @@ SHAMapInnerNode::invariants(bool is_root) const { XRPL_ASSERT( (isBranch_ & (1 << i)) == 0, - "ripple::SHAMapInnerNode::invariants : valid branch when " + "xrpl::SHAMapInnerNode::invariants : valid branch when " "zero hash"); } } @@ -454,13 +454,13 @@ SHAMapInnerNode::invariants(bool is_root) const { XRPL_ASSERT( hash_.isNonZero(), - "ripple::SHAMapInnerNode::invariants : nonzero hash"); + "xrpl::SHAMapInnerNode::invariants : nonzero hash"); XRPL_ASSERT( - count >= 1, "ripple::SHAMapInnerNode::invariants : minimum count"); + count >= 1, "xrpl::SHAMapInnerNode::invariants : minimum count"); } XRPL_ASSERT( (count == 0) ? hash_.isZero() : hash_.isNonZero(), - "ripple::SHAMapInnerNode::invariants : hash and count do match"); + "xrpl::SHAMapInnerNode::invariants : hash and count do match"); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapLeafNode.cpp b/src/libxrpl/shamap/SHAMapLeafNode.cpp index d2fd88ba5a..72e57cd737 100644 --- a/src/libxrpl/shamap/SHAMapLeafNode.cpp +++ b/src/libxrpl/shamap/SHAMapLeafNode.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { SHAMapLeafNode::SHAMapLeafNode( boost::intrusive_ptr item, @@ -9,7 +9,7 @@ SHAMapLeafNode::SHAMapLeafNode( { XRPL_ASSERT( item_->size() >= 12, - "ripple::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<" + "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<" "SHAMapItem const>, std::uint32_t) : minimum input size"); } @@ -21,7 +21,7 @@ SHAMapLeafNode::SHAMapLeafNode( { XRPL_ASSERT( item_->size() >= 12, - "ripple::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<" + "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<" "SHAMapItem const>, std::uint32_t, SHAMapHash const&) : minimum input " "size"); } @@ -35,7 +35,7 @@ SHAMapLeafNode::peekItem() const bool SHAMapLeafNode::setItem(boost::intrusive_ptr item) { - XRPL_ASSERT(cowid_, "ripple::SHAMapLeafNode::setItem : nonzero cowid"); + XRPL_ASSERT(cowid_, "xrpl::SHAMapLeafNode::setItem : nonzero cowid"); item_ = std::move(item); auto const oldHash = hash_; @@ -74,8 +74,8 @@ void SHAMapLeafNode::invariants(bool) const { XRPL_ASSERT( - hash_.isNonZero(), "ripple::SHAMapLeafNode::invariants : nonzero hash"); - XRPL_ASSERT(item_, "ripple::SHAMapLeafNode::invariants : non-null item"); + hash_.isNonZero(), "xrpl::SHAMapLeafNode::invariants : nonzero hash"); + XRPL_ASSERT(item_, "xrpl::SHAMapLeafNode::invariants : non-null item"); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapNodeID.cpp b/src/libxrpl/shamap/SHAMapNodeID.cpp index 33d38ebb03..a32ff5c28e 100644 --- a/src/libxrpl/shamap/SHAMapNodeID.cpp +++ b/src/libxrpl/shamap/SHAMapNodeID.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { static uint256 const& depthMask(unsigned int depth) @@ -39,10 +39,10 @@ SHAMapNodeID::SHAMapNodeID(unsigned int depth, uint256 const& hash) { XRPL_ASSERT( depth <= SHAMap::leafDepth, - "ripple::SHAMapNodeID::SHAMapNodeID : maximum depth input"); + "xrpl::SHAMapNodeID::SHAMapNodeID : maximum depth input"); XRPL_ASSERT( id_ == (id_ & depthMask(depth)), - "ripple::SHAMapNodeID::SHAMapNodeID : hash and depth inputs do match"); + "xrpl::SHAMapNodeID::SHAMapNodeID : hash and depth inputs do match"); } std::string @@ -59,7 +59,7 @@ SHAMapNodeID::getChildNodeID(unsigned int m) const { XRPL_ASSERT( m < SHAMap::branchFactor, - "ripple::SHAMapNodeID::getChildNodeID : valid branch input"); + "xrpl::SHAMapNodeID::getChildNodeID : valid branch input"); // A SHAMap has exactly 65 levels, so nodes must not exceed that // depth; if they do, this breaks the invariant of never allowing @@ -71,7 +71,7 @@ SHAMapNodeID::getChildNodeID(unsigned int m) const // constructing a child node from them would break the above invariant. XRPL_ASSERT( depth_ <= SHAMap::leafDepth, - "ripple::SHAMapNodeID::getChildNodeID : maximum leaf depth"); + "xrpl::SHAMapNodeID::getChildNodeID : maximum leaf depth"); if (depth_ >= SHAMap::leafDepth) Throw( @@ -117,7 +117,7 @@ selectBranch(SHAMapNodeID const& id, uint256 const& hash) branch >>= 4; XRPL_ASSERT( - branch < SHAMap::branchFactor, "ripple::selectBranch : maximum result"); + branch < SHAMap::branchFactor, "xrpl::selectBranch : maximum result"); return branch; } @@ -126,8 +126,8 @@ SHAMapNodeID::createID(int depth, uint256 const& key) { XRPL_ASSERT( (depth >= 0) && (depth < 65), - "ripple::SHAMapNodeID::createID : valid branch input"); + "xrpl::SHAMapNodeID::createID : valid branch input"); return SHAMapNodeID(depth, key & depthMask(depth)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapSync.cpp b/src/libxrpl/shamap/SHAMapSync.cpp index 3bc2d5561e..d9c0846fbf 100644 --- a/src/libxrpl/shamap/SHAMapSync.cpp +++ b/src/libxrpl/shamap/SHAMapSync.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { void SHAMap::visitLeaves( @@ -300,8 +300,8 @@ SHAMap::getMissingNodes(int max, SHAMapSyncFilter* filter) { XRPL_ASSERT( root_->getHash().isNonZero(), - "ripple::SHAMap::getMissingNodes : nonzero root hash"); - XRPL_ASSERT(max > 0, "ripple::SHAMap::getMissingNodes : valid max input"); + "xrpl::SHAMap::getMissingNodes : nonzero root hash"); + XRPL_ASSERT(max > 0, "xrpl::SHAMap::getMissingNodes : valid max input"); MissingNodes mn( max, @@ -362,7 +362,7 @@ SHAMap::getMissingNodes(int max, SHAMapSyncFilter* filter) } XRPL_ASSERT( node, - "ripple::SHAMap::getMissingNodes : first non-null node"); + "xrpl::SHAMap::getMissingNodes : first non-null node"); } } @@ -395,7 +395,7 @@ SHAMap::getMissingNodes(int max, SHAMapSyncFilter* filter) mn.stack_.pop(); XRPL_ASSERT( node, - "ripple::SHAMap::getMissingNodes : second non-null node"); + "xrpl::SHAMap::getMissingNodes : second non-null node"); } } @@ -524,11 +524,11 @@ SHAMap::addRootNode( JLOG(journal_.trace()) << "got root node, already have one"; XRPL_ASSERT( root_->getHash() == hash, - "ripple::SHAMap::addRootNode : valid hash input"); + "xrpl::SHAMap::addRootNode : valid hash input"); return SHAMapAddNode::duplicate(); } - XRPL_ASSERT(cowid_ >= 1, "ripple::SHAMap::addRootNode : valid cowid"); + XRPL_ASSERT(cowid_ >= 1, "xrpl::SHAMap::addRootNode : valid cowid"); auto node = SHAMapTreeNode::makeFromWire(rootNode); if (!node || node->getHash() != hash) return SHAMapAddNode::invalid(); @@ -563,7 +563,7 @@ SHAMap::addKnownNode( SHAMapSyncFilter* filter) { XRPL_ASSERT( - !node.isRoot(), "ripple::SHAMap::addKnownNode : valid node input"); + !node.isRoot(), "xrpl::SHAMap::addKnownNode : valid node input"); if (!isSynching()) { @@ -580,7 +580,7 @@ SHAMap::addKnownNode( (currNodeID.getDepth() < node.getDepth())) { int const branch = selectBranch(currNodeID, node.getNodeID()); - XRPL_ASSERT(branch >= 0, "ripple::SHAMap::addKnownNode : valid branch"); + XRPL_ASSERT(branch >= 0, "xrpl::SHAMap::addKnownNode : valid branch"); auto inner = static_cast(currNode); if (inner->isEmptyBranch(branch)) { @@ -884,4 +884,4 @@ SHAMap::verifyProofPath( return false; } -} // namespace ripple +} // namespace xrpl diff --git a/src/libxrpl/shamap/SHAMapTreeNode.cpp b/src/libxrpl/shamap/SHAMapTreeNode.cpp index 453be08756..854b4c1097 100644 --- a/src/libxrpl/shamap/SHAMapTreeNode.cpp +++ b/src/libxrpl/shamap/SHAMapTreeNode.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { intr_ptr::SharedPtr SHAMapTreeNode::makeTransaction( @@ -164,4 +164,4 @@ SHAMapTreeNode::getString(SHAMapNodeID const& id) const return to_string(id); } -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AMMCalc_test.cpp b/src/test/app/AMMCalc_test.cpp index 998642afb7..abfb548b64 100644 --- a/src/test/app/AMMCalc_test.cpp +++ b/src/test/app/AMMCalc_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { /** AMM Calculator. Uses AMM formulas to simulate the payment engine @@ -439,7 +439,7 @@ class AMMCalc_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE_MANUAL(AMMCalc, app, ripple); +BEAST_DEFINE_TESTSUITE_MANUAL(AMMCalc, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AMMClawback_test.cpp b/src/test/app/AMMClawback_test.cpp index 003bffae8f..e9882ef174 100644 --- a/src/test/app/AMMClawback_test.cpp +++ b/src/test/app/AMMClawback_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class AMMClawback_test : public beast::unit_test::suite { @@ -2447,6 +2447,6 @@ class AMMClawback_test : public beast::unit_test::suite } } }; -BEAST_DEFINE_TESTSUITE(AMMClawback, app, ripple); +BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AMMExtended_test.cpp b/src/test/app/AMMExtended_test.cpp index 080b392ebe..c3bfb46043 100644 --- a/src/test/app/AMMExtended_test.cpp +++ b/src/test/app/AMMExtended_test.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { /** @@ -3822,7 +3822,7 @@ private: } }; -BEAST_DEFINE_TESTSUITE_PRIO(AMMExtended, app, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(AMMExtended, app, xrpl, 1); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index 611932e825..8d64dfed2a 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { /** @@ -7481,7 +7481,7 @@ private: for (int i = 0; i < 256; ++i) { AccountID const accountId = - ripple::pseudoAccountAddress(*env.current(), keylet.key); + xrpl::pseudoAccountAddress(*env.current(), keylet.key); env(pay(env.master.id(), accountId, XRP(1000)), seq(autofill), @@ -7952,7 +7952,7 @@ private: } }; -BEAST_DEFINE_TESTSUITE_PRIO(AMM, app, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(AMM, app, xrpl, 1); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AccountDelete_test.cpp b/src/test/app/AccountDelete_test.cpp index 91164d3e4e..749ed33e28 100644 --- a/src/test/app/AccountDelete_test.cpp +++ b/src/test/app/AccountDelete_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class AccountDelete_test : public beast::unit_test::suite @@ -1104,7 +1104,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, xrpl, 2); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AccountTxPaging_test.cpp b/src/test/app/AccountTxPaging_test.cpp index fe72f1fe1f..5efe307812 100644 --- a/src/test/app/AccountTxPaging_test.cpp +++ b/src/test/app/AccountTxPaging_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { class AccountTxPaging_test : public beast::unit_test::suite { @@ -251,6 +251,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple); +BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/AmendmentTable_test.cpp b/src/test/app/AmendmentTable_test.cpp index 6aad3fa05f..9add892073 100644 --- a/src/test/app/AmendmentTable_test.cpp +++ b/src/test/app/AmendmentTable_test.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { class AmendmentTable_test final : public beast::unit_test::suite { @@ -534,7 +534,7 @@ public: } auto v = std::make_shared( - ripple::NetClock::time_point{}, + xrpl::NetClock::time_point{}, pub, sec, calcNodeID(pub), @@ -1271,6 +1271,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AmendmentTable, app, ripple); +BEAST_DEFINE_TESTSUITE(AmendmentTable, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index f2fae58a9b..06cf5dee0c 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Batch_test : public beast::unit_test::suite @@ -547,7 +547,7 @@ class Batch_test : public beast::unit_test::suite Serializer msg; serializeBatch( msg, tfAllOrNothing, jt.stx->getBatchTransactionIDs()); - auto const sig = ripple::sign(bob.pk(), bob.sk(), msg.slice()); + auto const sig = xrpl::sign(bob.pk(), bob.sk(), msg.slice()); jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName] [sfAccount.jsonName] = bob.human(); jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName] @@ -1378,7 +1378,7 @@ class Batch_test : public beast::unit_test::suite env.app().openLedger().modify( [&](OpenView& view, beast::Journal j) { auto const result = - ripple::apply(env.app(), view, *jt.stx, tapNONE, j); + xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); BEAST_EXPECT( !result.applied && result.ter == temARRAY_TOO_LARGE); return result.applied; @@ -1424,7 +1424,7 @@ class Batch_test : public beast::unit_test::suite env.app().openLedger().modify( [&](OpenView& view, beast::Journal j) { auto const result = - ripple::apply(env.app(), view, *jt.stx, tapNONE, j); + xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); BEAST_EXPECT( !result.applied && result.ter == temARRAY_TOO_LARGE); return result.applied; @@ -3592,7 +3592,7 @@ class Batch_test : public beast::unit_test::suite BEAST_EXPECT(!passesLocalChecks(stx, reason)); BEAST_EXPECT(reason == "Cannot submit pseudo transactions."); env.app().openLedger().modify([&](OpenView& view, beast::Journal j) { - auto const result = ripple::apply(env.app(), view, stx, tapNONE, j); + auto const result = xrpl::apply(env.app(), view, stx, tapNONE, j); BEAST_EXPECT(!result.applied && result.ter == temINVALID_FLAG); return result.applied; }); @@ -4356,7 +4356,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Batch, app, ripple); +BEAST_DEFINE_TESTSUITE(Batch, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Check_test.cpp b/src/test/app/Check_test.cpp index b7d158041b..b3d8249dd0 100644 --- a/src/test/app/Check_test.cpp +++ b/src/test/app/Check_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -1911,7 +1911,7 @@ class Check_test : public beast::unit_test::suite return acct; } - operator ripple::AccountID() const + operator xrpl::AccountID() const { return acct.id(); } @@ -2585,6 +2585,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Check, app, ripple); +BEAST_DEFINE_TESTSUITE(Check, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Clawback_test.cpp b/src/test/app/Clawback_test.cpp index 933e9678aa..c8c4aea757 100644 --- a/src/test/app/Clawback_test.cpp +++ b/src/test/app/Clawback_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Clawback_test : public beast::unit_test::suite { @@ -937,5 +937,5 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Clawback, app, ripple); -} // namespace ripple +BEAST_DEFINE_TESTSUITE(Clawback, app, xrpl); +} // namespace xrpl diff --git a/src/test/app/Credentials_test.cpp b/src/test/app/Credentials_test.cpp index c4a5ee1c7c..7de34e05a1 100644 --- a/src/test/app/Credentials_test.cpp +++ b/src/test/app/Credentials_test.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct Credentials_test : public beast::unit_test::suite @@ -926,8 +926,7 @@ struct Credentials_test : public beast::unit_test::suite testcase("deleteSLE fail, bad SLE."); auto view = std::make_shared( env.current().get(), ApplyFlags::tapNONE); - auto ter = - ripple::credentials::deleteSLE(*view, {}, env.journal); + auto ter = xrpl::credentials::deleteSLE(*view, {}, env.journal); BEAST_EXPECT(ter == tecNO_ENTRY); } } @@ -1108,7 +1107,7 @@ struct Credentials_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Credentials, app, ripple); +BEAST_DEFINE_TESTSUITE(Credentials, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/CrossingLimits_test.cpp b/src/test/app/CrossingLimits_test.cpp index 13d7aef505..9e9b1a3d45 100644 --- a/src/test/app/CrossingLimits_test.cpp +++ b/src/test/app/CrossingLimits_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class CrossingLimits_test : public beast::unit_test::suite @@ -492,7 +492,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, app, ripple, 10); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, app, xrpl, 10); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/DID_test.cpp b/src/test/app/DID_test.cpp index 20d4e3d34d..e7adfee178 100644 --- a/src/test/app/DID_test.cpp +++ b/src/test/app/DID_test.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct DID_test : public beast::unit_test::suite @@ -379,7 +379,7 @@ struct DID_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(DID, app, ripple); +BEAST_DEFINE_TESTSUITE(DID, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/DNS_test.cpp b/src/test/app/DNS_test.cpp index cf5bfb31f7..fc6917e15c 100644 --- a/src/test/app/DNS_test.cpp +++ b/src/test/app/DNS_test.cpp @@ -7,14 +7,14 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class DNS_test : public beast::unit_test::suite { using endpoint_type = boost::asio::ip::tcp::endpoint; using error_code = boost::system::error_code; - std::weak_ptr work_; + std::weak_ptr work_; endpoint_type lastEndpoint_{}; parsedURL pUrl_; std::string port_; @@ -33,14 +33,14 @@ public: { auto onFetch = [&](error_code const& errorCode, endpoint_type const& endpoint, - ripple::detail::response_type&& resp) { + xrpl::detail::response_type&& resp) { BEAST_EXPECT(!errorCode); lastEndpoint_ = endpoint; resolved_[endpoint.address().to_string()]++; cv_.notify_all(); }; - auto sp = std::make_shared( + auto sp = std::make_shared( pUrl_.domain, pUrl_.path, port_, @@ -110,7 +110,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DNS, app, ripple, 20); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DNS, app, xrpl, 20); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Delegate_test.cpp b/src/test/app/Delegate_test.cpp index e36ad9a550..7d58093e43 100644 --- a/src/test/app/Delegate_test.cpp +++ b/src/test/app/Delegate_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Delegate_test : public beast::unit_test::suite { @@ -1806,6 +1806,6 @@ class Delegate_test : public beast::unit_test::suite testTxReqireFeatures(all); } }; -BEAST_DEFINE_TESTSUITE(Delegate, app, ripple); +BEAST_DEFINE_TESTSUITE(Delegate, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/DeliverMin_test.cpp b/src/test/app/DeliverMin_test.cpp index 9a2bc9372e..4d643dfae1 100644 --- a/src/test/app/DeliverMin_test.cpp +++ b/src/test/app/DeliverMin_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class DeliverMin_test : public beast::unit_test::suite @@ -129,7 +129,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple); +BEAST_DEFINE_TESTSUITE(DeliverMin, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/DepositAuth_test.cpp b/src/test/app/DepositAuth_test.cpp index ed727c2fa0..4235c8c9ca 100644 --- a/src/test/app/DepositAuth_test.cpp +++ b/src/test/app/DepositAuth_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { // Helper function that returns the reserve on an account based on @@ -1462,8 +1462,8 @@ struct DepositPreauth_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(DepositAuth, app, ripple); -BEAST_DEFINE_TESTSUITE(DepositPreauth, app, ripple); +BEAST_DEFINE_TESTSUITE(DepositAuth, app, xrpl); +BEAST_DEFINE_TESTSUITE(DepositPreauth, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Discrepancy_test.cpp b/src/test/app/Discrepancy_test.cpp index b7ac66e1df..0e96f3aa1a 100644 --- a/src/test/app/Discrepancy_test.cpp +++ b/src/test/app/Discrepancy_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class Discrepancy_test : public beast::unit_test::suite { @@ -133,6 +133,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Discrepancy, app, ripple); +BEAST_DEFINE_TESTSUITE(Discrepancy, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/EscrowToken_test.cpp b/src/test/app/EscrowToken_test.cpp index f1dc6155f4..ff8b2cfb49 100644 --- a/src/test/app/EscrowToken_test.cpp +++ b/src/test/app/EscrowToken_test.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct EscrowToken_test : public beast::unit_test::suite @@ -1000,14 +1000,14 @@ struct EscrowToken_test : public beast::unit_test::suite auto const aa = env.le(keylet::escrow(alice.id(), aseq)); BEAST_EXPECT(aa); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) != aod.end()); } { - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); BEAST_EXPECT( std::find(iod.begin(), iod.end(), aa) != iod.end()); @@ -1024,14 +1024,14 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(bb); { - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); } { - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5); BEAST_EXPECT( std::find(iod.begin(), iod.end(), bb) != iod.end()); @@ -1045,17 +1045,17 @@ struct EscrowToken_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); BEAST_EXPECT( std::find(iod.begin(), iod.end(), bb) != iod.end()); @@ -1069,12 +1069,12 @@ struct EscrowToken_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) == bod.end()); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); BEAST_EXPECT( std::find(iod.begin(), iod.end(), bb) == iod.end()); @@ -1117,24 +1117,24 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(bc); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) != aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) != bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); BEAST_EXPECT( std::find(cod.begin(), cod.end(), bc) != cod.end()); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5); BEAST_EXPECT( std::find(iod.begin(), iod.end(), ab) != iod.end()); @@ -1148,22 +1148,22 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(env.le(keylet::escrow(bob.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); BEAST_EXPECT( std::find(iod.begin(), iod.end(), ab) == iod.end()); @@ -1177,22 +1177,22 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(!env.le(keylet::escrow(bob.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) == bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); BEAST_EXPECT( std::find(iod.begin(), iod.end(), ab) == iod.end()); @@ -1232,15 +1232,15 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(ag); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ag) != aod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); BEAST_EXPECT( std::find(iod.begin(), iod.end(), ag) != iod.end()); @@ -1251,15 +1251,15 @@ struct EscrowToken_test : public beast::unit_test::suite { BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ag) == aod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 2); BEAST_EXPECT( std::find(iod.begin(), iod.end(), ag) == iod.end()); @@ -2265,7 +2265,7 @@ struct EscrowToken_test : public beast::unit_test::suite env.fund(XRP(10'000), alice, bob, gw); env.close(); - auto const mpt = ripple::test::jtx::MPT( + auto const mpt = xrpl::test::jtx::MPT( alice.name(), makeMptID(env.seq(alice), alice)); Json::Value jv = escrow::create(alice, bob, mpt(2)); jv[jss::Amount][jss::mpt_issuance_id] = @@ -3209,14 +3209,14 @@ struct EscrowToken_test : public beast::unit_test::suite auto const aa = env.le(keylet::escrow(alice.id(), aseq)); BEAST_EXPECT(aa); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) != aod.end()); } { - ripple::Dir iod(*env.current(), keylet::ownerDir(gw.id())); + xrpl::Dir iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 1); BEAST_EXPECT( std::find(iod.begin(), iod.end(), aa) == iod.end()); @@ -3233,7 +3233,7 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(bb); { - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); @@ -3247,12 +3247,12 @@ struct EscrowToken_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); @@ -3266,7 +3266,7 @@ struct EscrowToken_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) == bod.end()); @@ -3314,19 +3314,19 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(bc); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) != aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) != bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); BEAST_EXPECT( std::find(cod.begin(), cod.end(), bc) != cod.end()); @@ -3338,19 +3338,19 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(env.le(keylet::escrow(bob.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); } @@ -3360,19 +3360,19 @@ struct EscrowToken_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(!env.le(keylet::escrow(bob.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bob.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) == bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); } } @@ -3930,7 +3930,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(EscrowToken, app, ripple); +BEAST_DEFINE_TESTSUITE(EscrowToken, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Escrow_test.cpp b/src/test/app/Escrow_test.cpp index e3b2340022..d4a9fc5b9d 100644 --- a/src/test/app/Escrow_test.cpp +++ b/src/test/app/Escrow_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct Escrow_test : public beast::unit_test::suite @@ -1144,7 +1144,7 @@ struct Escrow_test : public beast::unit_test::suite BEAST_EXPECT(aa); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) != aod.end()); @@ -1161,7 +1161,7 @@ struct Escrow_test : public beast::unit_test::suite BEAST_EXPECT(bb); { - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); @@ -1175,12 +1175,12 @@ struct Escrow_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); BEAST_EXPECT( std::find(aod.begin(), aod.end(), aa) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) != bod.end()); @@ -1194,7 +1194,7 @@ struct Escrow_test : public beast::unit_test::suite (*env.meta())[sfTransactionResult] == static_cast(tesSUCCESS)); - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 0); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bb) == bod.end()); @@ -1229,19 +1229,19 @@ struct Escrow_test : public beast::unit_test::suite BEAST_EXPECT(bc); { - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) != aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) != bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); BEAST_EXPECT( std::find(cod.begin(), cod.end(), bc) != cod.end()); @@ -1253,19 +1253,19 @@ struct Escrow_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(env.le(keylet::escrow(bruce.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) != bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); } @@ -1275,19 +1275,19 @@ struct Escrow_test : public beast::unit_test::suite BEAST_EXPECT(!env.le(keylet::escrow(alice.id(), aseq))); BEAST_EXPECT(!env.le(keylet::escrow(bruce.id(), bseq))); - ripple::Dir aod(*env.current(), keylet::ownerDir(alice.id())); + xrpl::Dir aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); BEAST_EXPECT( std::find(aod.begin(), aod.end(), ab) == aod.end()); - ripple::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); + xrpl::Dir bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 0); BEAST_EXPECT( std::find(bod.begin(), bod.end(), ab) == bod.end()); BEAST_EXPECT( std::find(bod.begin(), bod.end(), bc) == bod.end()); - ripple::Dir cod(*env.current(), keylet::ownerDir(carol.id())); + xrpl::Dir cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 0); } } @@ -1678,7 +1678,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Escrow, app, ripple); +BEAST_DEFINE_TESTSUITE(Escrow, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/FeeVote_test.cpp b/src/test/app/FeeVote_test.cpp index 94f753d8f3..c7f33544f9 100644 --- a/src/test/app/FeeVote_test.cpp +++ b/src/test/app/FeeVote_test.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct FeeSettingsFields @@ -780,7 +780,7 @@ class FeeVote_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(FeeVote, app, ripple); +BEAST_DEFINE_TESTSUITE(FeeVote, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/FixNFTokenPageLinks_test.cpp b/src/test/app/FixNFTokenPageLinks_test.cpp index 32d444eea2..baa33b2dc5 100644 --- a/src/test/app/FixNFTokenPageLinks_test.cpp +++ b/src/test/app/FixNFTokenPageLinks_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class FixNFTokenPageLinks_test : public beast::unit_test::suite { @@ -642,6 +642,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(FixNFTokenPageLinks, app, ripple); +BEAST_DEFINE_TESTSUITE(FixNFTokenPageLinks, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index 12dcc91b98..e16a48e02f 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { bool @@ -1329,8 +1329,8 @@ struct Flow_manual_test : public Flow_test } }; -BEAST_DEFINE_TESTSUITE_PRIO(Flow, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Flow_manual, app, ripple, 4); +BEAST_DEFINE_TESTSUITE_PRIO(Flow, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Flow_manual, app, xrpl, 4); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Freeze_test.cpp b/src/test/app/Freeze_test.cpp index 43d7c6d1e4..85c2b5a924 100644 --- a/src/test/app/Freeze_test.cpp +++ b/src/test/app/Freeze_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class Freeze_test : public beast::unit_test::suite { @@ -2088,5 +2088,5 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Freeze, app, ripple); -} // namespace ripple +BEAST_DEFINE_TESTSUITE(Freeze, app, xrpl); +} // namespace xrpl diff --git a/src/test/app/HashRouter_test.cpp b/src/test/app/HashRouter_test.cpp index b3f692c2b0..c428917fdc 100644 --- a/src/test/app/HashRouter_test.cpp +++ b/src/test/app/HashRouter_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class HashRouter_test : public beast::unit_test::suite @@ -404,7 +404,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(HashRouter, app, ripple); +BEAST_DEFINE_TESTSUITE(HashRouter, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index 4e4632e49b..8eb3047dc8 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -20,7 +20,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class Invariants_test : public beast::unit_test::suite @@ -1991,7 +1991,7 @@ class Invariants_test : public beast::unit_test::suite { // Create the directory BEAST_EXPECT( - ::ripple::directory::createRoot( + ::xrpl::directory::createRoot( ac.view(), dirKeylet, loanBrokerKeylet.key, @@ -2018,7 +2018,7 @@ class Invariants_test : public beast::unit_test::suite describeOwnerDir(slePseudo->at(sfAccount)); BEAST_EXPECT( - ::ripple::directory::insertPage( + ::xrpl::directory::insertPage( ac.view(), 0, sleDir, @@ -2051,7 +2051,7 @@ class Invariants_test : public beast::unit_test::suite // Put some extra garbage into the directory for (auto const& key : {slePseudo->key(), sleDir->key()}) { - ::ripple::directory::insertKey( + ::xrpl::directory::insertKey( ac.view(), sleDir, 0, false, indexes, key); } @@ -2082,7 +2082,7 @@ class Invariants_test : public beast::unit_test::suite // Put one meaningless key into the directory auto const key = keylet::account(Account("random").id()).key; - ::ripple::directory::insertKey( + ::xrpl::directory::insertKey( ac.view(), sleDir, 0, false, indexes, key); return true; @@ -2108,7 +2108,7 @@ class Invariants_test : public beast::unit_test::suite // failure. STVector256 indexes; - ::ripple::directory::insertKey( + ::xrpl::directory::insertKey( ac.view(), sleDir, 0, false, indexes, slePseudo->key()); return true; @@ -2165,7 +2165,7 @@ class Invariants_test : public beast::unit_test::suite std::optional accountShares = {}; }; auto constexpr adjust = [&](ApplyView& ac, - ripple::Keylet keylet, + xrpl::Keylet keylet, Adjustments args) { auto sleVault = ac.peek(keylet); if (!sleVault) @@ -3914,7 +3914,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Invariants, app, ripple); +BEAST_DEFINE_TESTSUITE(Invariants, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LPTokenTransfer_test.cpp b/src/test/app/LPTokenTransfer_test.cpp index acce2312ac..b2a6f39ddf 100644 --- a/src/test/app/LPTokenTransfer_test.cpp +++ b/src/test/app/LPTokenTransfer_test.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class LPTokenTransfer_test : public jtx::AMMTest @@ -462,6 +462,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LPTokenTransfer, app, ripple); +BEAST_DEFINE_TESTSUITE(LPTokenTransfer, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LedgerHistory_test.cpp b/src/test/app/LedgerHistory_test.cpp index 3223e9e1d8..b69203f1e0 100644 --- a/src/test/app/LedgerHistory_test.cpp +++ b/src/test/app/LedgerHistory_test.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class LedgerHistory_test : public beast::unit_test::suite @@ -182,7 +182,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerHistory, app, ripple); +BEAST_DEFINE_TESTSUITE(LedgerHistory, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LedgerLoad_test.cpp b/src/test/app/LedgerLoad_test.cpp index ac0fcdba35..d5c37d0404 100644 --- a/src/test/app/LedgerLoad_test.cpp +++ b/src/test/app/LedgerLoad_test.cpp @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { class LedgerLoad_test : public beast::unit_test::suite { @@ -370,6 +370,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerLoad, app, ripple); +BEAST_DEFINE_TESTSUITE(LedgerLoad, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LedgerMaster_test.cpp b/src/test/app/LedgerMaster_test.cpp index 451e4f9068..59e02cbabb 100644 --- a/src/test/app/LedgerMaster_test.cpp +++ b/src/test/app/LedgerMaster_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class LedgerMaster_test : public beast::unit_test::suite @@ -116,7 +116,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerMaster, app, ripple); +BEAST_DEFINE_TESTSUITE(LedgerMaster, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index a468629de9..beb27817a1 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct LedgerReplay_test : public beast::unit_test::suite @@ -1084,8 +1084,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite { testcase("handshake test"); auto handshake = [&](bool client, bool server, bool expecting) -> bool { - auto request = - ripple::makeRequest(true, false, client, false, false); + auto request = xrpl::makeRequest(true, false, client, false, false); http_request_type http_request; http_request.version(request.version()); http_request.base() = request.base(); @@ -1098,7 +1097,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite boost::asio::ip::make_address("172.1.1.100"); jtx::Env serverEnv(*this); serverEnv.app().config().LEDGER_REPLAY = server; - auto http_resp = ripple::makeResponse( + auto http_resp = xrpl::makeResponse( true, http_request, addr, @@ -1596,10 +1595,10 @@ struct LedgerReplayerLong_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(LedgerReplay, app, ripple); -BEAST_DEFINE_TESTSUITE_PRIO(LedgerReplayer, app, ripple, 1); -BEAST_DEFINE_TESTSUITE(LedgerReplayerTimeout, app, ripple); -BEAST_DEFINE_TESTSUITE_MANUAL(LedgerReplayerLong, app, ripple); +BEAST_DEFINE_TESTSUITE(LedgerReplay, app, xrpl); +BEAST_DEFINE_TESTSUITE_PRIO(LedgerReplayer, app, xrpl, 1); +BEAST_DEFINE_TESTSUITE(LedgerReplayerTimeout, app, xrpl); +BEAST_DEFINE_TESTSUITE_MANUAL(LedgerReplayerLong, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LoadFeeTrack_test.cpp b/src/test/app/LoadFeeTrack_test.cpp index 10b51b5c0b..e0638b64bc 100644 --- a/src/test/app/LoadFeeTrack_test.cpp +++ b/src/test/app/LoadFeeTrack_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class LoadFeeTrack_test : public beast::unit_test::suite { @@ -68,6 +68,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LoadFeeTrack, app, ripple); +BEAST_DEFINE_TESTSUITE(LoadFeeTrack, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/LoanBroker_test.cpp b/src/test/app/LoanBroker_test.cpp index 597e2ea75b..72a732d043 100644 --- a/src/test/app/LoanBroker_test.cpp +++ b/src/test/app/LoanBroker_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class LoanBroker_test : public beast::unit_test::suite @@ -638,7 +638,7 @@ class LoanBroker_test : public beast::unit_test::suite } using namespace loanBroker; - using namespace ripple::Lending; + using namespace xrpl::Lending; TenthBips32 const tenthBipsZero{0}; @@ -1456,7 +1456,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LoanBroker, tx, ripple); +BEAST_DEFINE_TESTSUITE(LoanBroker, tx, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index f7672fd380..22159ba4bb 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Loan_test : public beast::unit_test::suite @@ -964,7 +964,7 @@ protected: Number totalFeesPaid = 0; std::size_t totalPaymentsMade = 0; - ripple::LoanState currentTrueState = computeRawLoanState( + xrpl::LoanState currentTrueState = computeRawLoanState( state.periodicPayment, periodicRate, state.paymentRemaining, @@ -1019,7 +1019,7 @@ protected: paymentComponents.trackedInterestPart() + paymentComponents.trackedManagementFeeDelta); - ripple::LoanState const nextTrueState = computeRawLoanState( + xrpl::LoanState const nextTrueState = computeRawLoanState( state.periodicPayment, periodicRate, state.paymentRemaining - 1, @@ -2705,7 +2705,7 @@ protected: Number totalInterestPaid = 0; std::size_t totalPaymentsMade = 0; - ripple::LoanState currentTrueState = computeRawLoanState( + xrpl::LoanState currentTrueState = computeRawLoanState( state.periodicPayment, periodicRate, state.paymentRemaining, @@ -2730,7 +2730,7 @@ protected: paymentComponents.trackedValueDelta <= roundedPeriodicPayment); - ripple::LoanState const nextTrueState = computeRawLoanState( + xrpl::LoanState const nextTrueState = computeRawLoanState( state.periodicPayment, periodicRate, state.paymentRemaining - 1, @@ -3873,7 +3873,7 @@ protected: Serializer ss; ss.add32(HashPrefix::txSign); parse(randomData).addWithoutSigningFields(ss); - auto const sig = ripple::sign(borrower.pk(), borrower.sk(), ss.slice()); + auto const sig = xrpl::sign(borrower.pk(), borrower.sk(), ss.slice()); sigObject[jss::TxnSignature] = strHex(Slice{sig.data(), sig.size()}); forgedLoanSet[Json::StaticString{"CounterpartySignature"}] = sigObject; @@ -3957,7 +3957,7 @@ protected: testLoanPayComputePeriodicPaymentValidRateInvariant() { // From FIND-012 - testcase << "LoanPay ripple::detail::computePeriodicPayment : " + testcase << "LoanPay xrpl::detail::computePeriodicPayment : " "valid rate"; using namespace jtx; @@ -4773,7 +4773,7 @@ protected: testAccountSendMptMinAmountInvariant() { // (From FIND-006) - testcase << "LoanSet trigger ripple::accountSendMPT : minimum amount " + testcase << "LoanSet trigger xrpl::accountSendMPT : minimum amount " "and MPT"; using namespace jtx; @@ -4835,7 +4835,7 @@ protected: testLoanPayDebtDecreaseInvariant() { // From FIND-007 - testcase << "LoanPay ripple::LoanPay::doApply : debtDecrease " + testcase << "LoanPay xrpl::LoanPay::doApply : debtDecrease " "rounding good"; using namespace jtx; @@ -4940,7 +4940,7 @@ protected: testLoanPayComputePeriodicPaymentValidTotalInterestInvariant() { // From FIND-010 - testcase << "ripple::loanComputePaymentParts : valid total interest"; + testcase << "xrpl::loanComputePaymentParts : valid total interest"; using namespace jtx; using namespace std::chrono_literals; @@ -5093,7 +5093,7 @@ protected: testLoanPayComputePeriodicPaymentValidTotalPrincipalPaidInvariant() { // From FIND-009 - testcase << "ripple::loanComputePaymentParts : totalPrincipalPaid " + testcase << "xrpl::loanComputePaymentParts : totalPrincipalPaid " "rounded"; using namespace jtx; @@ -5207,7 +5207,7 @@ protected: testLoanPayComputePeriodicPaymentValidTotalInterestPaidInvariant() { // From FIND-008 - testcase << "ripple::loanComputePaymentParts : loanValueChange rounded"; + testcase << "xrpl::loanComputePaymentParts : loanValueChange rounded"; using namespace jtx; using namespace std::chrono_literals; @@ -7207,9 +7207,9 @@ class LoanArbitrary_test : public LoanBatch_test } }; -BEAST_DEFINE_TESTSUITE(Loan, tx, ripple); -BEAST_DEFINE_TESTSUITE_MANUAL(LoanBatch, tx, ripple); -BEAST_DEFINE_TESTSUITE_MANUAL(LoanArbitrary, tx, ripple); +BEAST_DEFINE_TESTSUITE(Loan, tx, xrpl); +BEAST_DEFINE_TESTSUITE_MANUAL(LoanBatch, tx, xrpl); +BEAST_DEFINE_TESTSUITE_MANUAL(LoanArbitrary, tx, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/MPToken_test.cpp b/src/test/app/MPToken_test.cpp index 7d0126bd65..1de142c2ab 100644 --- a/src/test/app/MPToken_test.cpp +++ b/src/test/app/MPToken_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class MPToken_test : public beast::unit_test::suite @@ -2349,7 +2349,7 @@ class MPToken_test : public beast::unit_test::suite env.close(); auto const USD = alice["USD"]; - auto const mpt = ripple::test::jtx::MPT( + auto const mpt = xrpl::test::jtx::MPT( alice.name(), makeMptID(env.seq(alice), alice)); env(claw(alice, bob["USD"](5), bob), ter(temMALFORMED)); @@ -2372,7 +2372,7 @@ class MPToken_test : public beast::unit_test::suite env.close(); auto const USD = alice["USD"]; - auto const mpt = ripple::test::jtx::MPT( + auto const mpt = xrpl::test::jtx::MPT( alice.name(), makeMptID(env.seq(alice), alice)); // clawing back IOU from a MPT holder fails @@ -2431,7 +2431,7 @@ class MPToken_test : public beast::unit_test::suite env.close(); MPTTester mptAlice(env, alice, {.holders = {bob}}); - auto const fakeMpt = ripple::test::jtx::MPT( + auto const fakeMpt = xrpl::test::jtx::MPT( alice.name(), makeMptID(env.seq(alice), alice)); // issuer tries to clawback MPT where issuance doesn't exist @@ -2470,7 +2470,7 @@ class MPToken_test : public beast::unit_test::suite env.fund(XRP(1000), alice, bob); env.close(); - auto const mpt = ripple::test::jtx::MPT( + auto const mpt = xrpl::test::jtx::MPT( alice.name(), makeMptID(env.seq(alice), alice)); Json::Value jv = claw(alice, mpt(1), bob); @@ -3675,7 +3675,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(MPToken, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(MPToken, app, xrpl, 2); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Manifest_test.cpp b/src/test/app/Manifest_test.cpp index b2c8c859fd..09054658c9 100644 --- a/src/test/app/Manifest_test.cpp +++ b/src/test/app/Manifest_test.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Manifest_test : public beast::unit_test::suite @@ -1066,7 +1066,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Manifest, app, ripple); +BEAST_DEFINE_TESTSUITE(Manifest, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/MultiSign_test.cpp b/src/test/app/MultiSign_test.cpp index 126413d8d0..6e30ed9c13 100644 --- a/src/test/app/MultiSign_test.cpp +++ b/src/test/app/MultiSign_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class MultiSign_test : public beast::unit_test::suite @@ -1481,8 +1481,8 @@ public: uint8_t tag2[] = "hello world some ascii 32b long"; // including 1 byte for NUL - uint256 bogie_tag = ripple::base_uint<256>::fromVoid(tag1); - uint256 demon_tag = ripple::base_uint<256>::fromVoid(tag2); + uint256 bogie_tag = xrpl::base_uint<256>::fromVoid(tag1); + uint256 demon_tag = xrpl::base_uint<256>::fromVoid(tag2); // Attach phantom signers to alice and use them for a transaction. env(signers(alice, 1, {{bogie, 1, bogie_tag}, {demon, 1, demon_tag}})); @@ -1632,7 +1632,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(MultiSign, app, ripple); +BEAST_DEFINE_TESTSUITE(MultiSign, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/NFTokenAuth_test.cpp b/src/test/app/NFTokenAuth_test.cpp index b22a99ce73..dce8da0042 100644 --- a/src/test/app/NFTokenAuth_test.cpp +++ b/src/test/app/NFTokenAuth_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenAuth_test : public beast::unit_test::suite { @@ -600,6 +600,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenAuth, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenAuth, app, xrpl, 2); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/NFTokenBurn_test.cpp b/src/test/app/NFTokenBurn_test.cpp index 319cdba564..828539f4b1 100644 --- a/src/test/app/NFTokenBurn_test.cpp +++ b/src/test/app/NFTokenBurn_test.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenBurn_test : public beast::unit_test::suite { @@ -1259,6 +1259,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn, app, ripple, 3); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn, app, xrpl, 3); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/NFTokenDir_test.cpp b/src/test/app/NFTokenDir_test.cpp index fdc488d5da..9718a5d073 100644 --- a/src/test/app/NFTokenDir_test.cpp +++ b/src/test/app/NFTokenDir_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenDir_test : public beast::unit_test::suite { @@ -1060,9 +1060,9 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDir, app, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDir, app, xrpl, 1); -} // namespace ripple +} // namespace xrpl // Seed that produces an account with the low-32 bits == 0xFFFFFFFF in // case it is needed for future testing: diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 5ff0ac17ae..75bf59e70d 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenBaseUtil_test : public beast::unit_test::suite { @@ -7639,10 +7639,10 @@ class NFTokenAllFeatures_test : public NFTokenBaseUtil_test } }; -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDisallowIncoming, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOMintOffer, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOModify, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(NFTokenAllFeatures, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDisallowIncoming, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOMintOffer, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOModify, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(NFTokenAllFeatures, app, xrpl, 2); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/NetworkID_test.cpp b/src/test/app/NetworkID_test.cpp index 49ca453ebb..d924710cb3 100644 --- a/src/test/app/NetworkID_test.cpp +++ b/src/test/app/NetworkID_test.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class NetworkID_test : public beast::unit_test::suite @@ -142,7 +142,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NetworkID, app, ripple); +BEAST_DEFINE_TESTSUITE(NetworkID, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/NetworkOPs_test.cpp b/src/test/app/NetworkOPs_test.cpp index 3965778221..d5616009fa 100644 --- a/src/test/app/NetworkOPs_test.cpp +++ b/src/test/app/NetworkOPs_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class NetworkOPs_test : public beast::unit_test::suite @@ -55,7 +55,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NetworkOPs, app, ripple); +BEAST_DEFINE_TESTSUITE(NetworkOPs, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/OfferStream_test.cpp b/src/test/app/OfferStream_test.cpp index fac5ab18ab..218653a5d4 100644 --- a/src/test/app/OfferStream_test.cpp +++ b/src/test/app/OfferStream_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class OfferStream_test : public beast::unit_test::suite { @@ -20,6 +20,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(OfferStream, app, ripple); +BEAST_DEFINE_TESTSUITE(OfferStream, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 9cf8a7b1f2..1117510a45 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class OfferBaseUtil_test : public beast::unit_test::suite @@ -5300,10 +5300,10 @@ class Offer_manual_test : public OfferBaseUtil_test } }; -BEAST_DEFINE_TESTSUITE_PRIO(OfferBaseUtil, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(OfferWOSmallQOffers, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_PRIO(OfferAllFeatures, app, ripple, 2); -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Offer_manual, app, ripple, 20); +BEAST_DEFINE_TESTSUITE_PRIO(OfferBaseUtil, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(OfferWOSmallQOffers, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_PRIO(OfferAllFeatures, app, xrpl, 2); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Offer_manual, app, xrpl, 20); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Oracle_test.cpp b/src/test/app/Oracle_test.cpp index 470bcd7950..6708f56275 100644 --- a/src/test/app/Oracle_test.cpp +++ b/src/test/app/Oracle_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace oracle { @@ -865,7 +865,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Oracle, app, ripple); +BEAST_DEFINE_TESTSUITE(Oracle, app, xrpl); } // namespace oracle @@ -873,4 +873,4 @@ BEAST_DEFINE_TESTSUITE(Oracle, app, ripple); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/OversizeMeta_test.cpp b/src/test/app/OversizeMeta_test.cpp index dbb5310e01..2eb300b095 100644 --- a/src/test/app/OversizeMeta_test.cpp +++ b/src/test/app/OversizeMeta_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { // Make sure "plump" order books don't have problems @@ -42,7 +42,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(PlumpBook, app, ripple, 5); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(PlumpBook, app, xrpl, 5); //------------------------------------------------------------------------------ @@ -57,7 +57,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ThinBook, app, ripple); +BEAST_DEFINE_TESTSUITE(ThinBook, app, xrpl); //------------------------------------------------------------------------------ @@ -100,7 +100,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(OversizeMeta, app, ripple, 3); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(OversizeMeta, app, xrpl, 3); //------------------------------------------------------------------------------ @@ -166,7 +166,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(FindOversizeCross, app, ripple, 50); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(FindOversizeCross, app, xrpl, 50); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Path_test.cpp b/src/test/app/Path_test.cpp index e481bd673b..8a80ecd6d8 100644 --- a/src/test/app/Path_test.cpp +++ b/src/test/app/Path_test.cpp @@ -23,7 +23,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { //------------------------------------------------------------------------------ @@ -2114,7 +2114,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Path, app, ripple); +BEAST_DEFINE_TESTSUITE(Path, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/PayChan_test.cpp b/src/test/app/PayChan_test.cpp index 3f350626ea..20a433b5dd 100644 --- a/src/test/app/PayChan_test.cpp +++ b/src/test/app/PayChan_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { using namespace jtx::paychan; @@ -1772,14 +1772,14 @@ struct PayChan_test : public beast::unit_test::suite auto inOwnerDir = [](ReadView const& view, Account const& acc, std::shared_ptr const& chan) -> bool { - ripple::Dir const ownerDir(view, keylet::ownerDir(acc.id())); + xrpl::Dir const ownerDir(view, keylet::ownerDir(acc.id())); return std::find(ownerDir.begin(), ownerDir.end(), chan) != ownerDir.end(); }; auto ownerDirCount = [](ReadView const& view, Account const& acc) -> std::size_t { - ripple::Dir const ownerDir(view, keylet::ownerDir(acc.id())); + xrpl::Dir const ownerDir(view, keylet::ownerDir(acc.id())); return std::distance(ownerDir.begin(), ownerDir.end()); }; @@ -2119,6 +2119,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PayChan, app, ripple); +BEAST_DEFINE_TESTSUITE(PayChan, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index 7f8f49ec07..8e0ff337b4 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct DirectStepInfo @@ -86,7 +86,7 @@ equal(std::unique_ptr const& s1, XRPEndpointStepInfo const& xrpsi) } bool -equal(std::unique_ptr const& s1, ripple::Book const& bsi) +equal(std::unique_ptr const& s1, xrpl::Book const& bsi) { if (!s1) return false; @@ -300,7 +300,7 @@ public: struct ExistingElementPool { std::vector accounts; - std::vector currencies; + std::vector currencies; std::vector currencyNames; jtx::Account @@ -310,7 +310,7 @@ struct ExistingElementPool return accounts[id]; } - ripple::Currency + xrpl::Currency getCurrency(size_t id) { assert(id < currencies.size()); @@ -484,13 +484,13 @@ struct ExistingElementPool { std::vector> diffs; - auto xrpBalance = [](ReadView const& v, ripple::Keylet const& k) { + auto xrpBalance = [](ReadView const& v, xrpl::Keylet const& k) { auto const sle = v.read(k); if (!sle) return STAmount{}; return (*sle)[sfBalance]; }; - auto lineBalance = [](ReadView const& v, ripple::Keylet const& k) { + auto lineBalance = [](ReadView const& v, xrpl::Keylet const& k) { auto const sle = v.read(k); if (!sle) return STAmount{}; @@ -534,7 +534,7 @@ struct ExistingElementPool return getAccount(nextAvailAccount++); } - ripple::Currency + xrpl::Currency getAvailCurrency() { return getCurrency(nextAvailCurrency++); @@ -619,7 +619,7 @@ struct PayStrand_test : public beast::unit_test::suite auto const usdC = USD.currency; using D = DirectStepInfo; - using B = ripple::Book; + using B = xrpl::Book; using XRPS = XRPEndpointStepInfo; AMMContext ammContext(alice, false); @@ -1182,13 +1182,13 @@ struct PayStrand_test : public beast::unit_test::suite AccountID const srcAcc = alice.id(); AccountID dstAcc = bob.id(); STPathSet pathSet; - ::ripple::path::RippleCalc::Input inputs; + ::xrpl::path::RippleCalc::Input inputs; inputs.defaultPathsAllowed = true; try { PaymentSandbox sb{env.current().get(), tapNONE}; { - auto const r = ::ripple::path::RippleCalc::rippleCalculate( + auto const r = ::xrpl::path::RippleCalc::rippleCalculate( sb, sendMax, deliver, @@ -1201,7 +1201,7 @@ struct PayStrand_test : public beast::unit_test::suite BEAST_EXPECT(r.result() == temBAD_PATH); } { - auto const r = ::ripple::path::RippleCalc::rippleCalculate( + auto const r = ::xrpl::path::RippleCalc::rippleCalculate( sb, sendMax, deliver, @@ -1214,7 +1214,7 @@ struct PayStrand_test : public beast::unit_test::suite BEAST_EXPECT(r.result() == temBAD_PATH); } { - auto const r = ::ripple::path::RippleCalc::rippleCalculate( + auto const r = ::xrpl::path::RippleCalc::rippleCalculate( sb, noAccountAmount, deliver, @@ -1227,7 +1227,7 @@ struct PayStrand_test : public beast::unit_test::suite BEAST_EXPECT(r.result() == temBAD_PATH); } { - auto const r = ::ripple::path::RippleCalc::rippleCalculate( + auto const r = ::xrpl::path::RippleCalc::rippleCalculate( sb, sendMax, noAccountAmount, @@ -1264,7 +1264,7 @@ struct PayStrand_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(PayStrand, app, ripple); +BEAST_DEFINE_TESTSUITE(PayStrand, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/PermissionedDEX_test.cpp b/src/test/app/PermissionedDEX_test.cpp index 4b7a1db1be..b5db131db6 100644 --- a/src/test/app/PermissionedDEX_test.cpp +++ b/src/test/app/PermissionedDEX_test.cpp @@ -28,7 +28,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { using namespace jtx; @@ -1552,7 +1552,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PermissionedDEX, app, ripple); +BEAST_DEFINE_TESTSUITE(PermissionedDEX, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/PermissionedDomains_test.cpp b/src/test/app/PermissionedDomains_test.cpp index ba1946ee66..a7dff84cff 100644 --- a/src/test/app/PermissionedDomains_test.cpp +++ b/src/test/app/PermissionedDomains_test.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { using namespace jtx; @@ -560,7 +560,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PermissionedDomains, app, ripple); +BEAST_DEFINE_TESTSUITE(PermissionedDomains, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/PseudoTx_test.cpp b/src/test/app/PseudoTx_test.cpp index ea53b0bee5..f01ba616c8 100644 --- a/src/test/app/PseudoTx_test.cpp +++ b/src/test/app/PseudoTx_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct PseudoTx_test : public beast::unit_test::suite @@ -76,7 +76,7 @@ struct PseudoTx_test : public beast::unit_test::suite env.app().openLedger().modify( [&](OpenView& view, beast::Journal j) { auto const result = - ripple::apply(env.app(), view, stx, tapNONE, j); + xrpl::apply(env.app(), view, stx, tapNONE, j); BEAST_EXPECT(!result.applied && result.ter == temINVALID); return result.applied; }); @@ -107,7 +107,7 @@ struct PseudoTx_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(PseudoTx, app, ripple); +BEAST_DEFINE_TESTSUITE(PseudoTx, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/RCLValidations_test.cpp b/src/test/app/RCLValidations_test.cpp index 2d3c4f2af5..a4f0d6a7cb 100644 --- a/src/test/app/RCLValidations_test.cpp +++ b/src/test/app/RCLValidations_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class RCLValidations_test : public beast::unit_test::suite @@ -17,7 +17,7 @@ class RCLValidations_test : public beast::unit_test::suite testcase("Change validation trusted status"); auto keys = randomKeyPair(KeyType::secp256k1); auto v = std::make_shared( - ripple::NetClock::time_point{}, + xrpl::NetClock::time_point{}, keys.first, keys.second, calcNodeID(keys.first), @@ -308,7 +308,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RCLValidations, app, ripple); +BEAST_DEFINE_TESTSUITE(RCLValidations, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/ReducedOffer_test.cpp b/src/test/app/ReducedOffer_test.cpp index f511721dda..8a395913b2 100644 --- a/src/test/app/ReducedOffer_test.cpp +++ b/src/test/app/ReducedOffer_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ReducedOffer_test : public beast::unit_test::suite @@ -719,7 +719,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(ReducedOffer, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(ReducedOffer, app, xrpl, 2); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Regression_test.cpp b/src/test/app/Regression_test.cpp index be51d9c96e..56f0de9e07 100644 --- a/src/test/app/Regression_test.cpp +++ b/src/test/app/Regression_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct Regression_test : public beast::unit_test::suite @@ -63,7 +63,7 @@ struct Regression_test : public beast::unit_test::suite OpenView accum(&*next); auto const result = - ripple::apply(env.app(), accum, *jt.stx, tapNONE, env.journal); + xrpl::apply(env.app(), accum, *jt.stx, tapNONE, env.journal); BEAST_EXPECT(result.ter == tesSUCCESS); BEAST_EXPECT(result.applied); @@ -87,7 +87,7 @@ struct Regression_test : public beast::unit_test::suite OpenView accum(&*next); auto const result = - ripple::apply(env.app(), accum, *jt.stx, tapNONE, env.journal); + xrpl::apply(env.app(), accum, *jt.stx, tapNONE, env.journal); BEAST_EXPECT(result.ter == tecINSUFF_FEE); BEAST_EXPECT(result.applied); @@ -323,7 +323,7 @@ struct Regression_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Regression, app, ripple); +BEAST_DEFINE_TESTSUITE(Regression, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 8ec5a6fd23..d9689dc977 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class SHAMapStore_test : public beast::unit_test::suite @@ -637,7 +637,7 @@ public: }; // VFALCO This test fails because of thread asynchronous issues -BEAST_DEFINE_TESTSUITE(SHAMapStore, app, ripple); +BEAST_DEFINE_TESTSUITE(SHAMapStore, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/SetAuth_test.cpp b/src/test/app/SetAuth_test.cpp index 42766c87ff..29f1e46ca4 100644 --- a/src/test/app/SetAuth_test.cpp +++ b/src/test/app/SetAuth_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct SetAuth_test : public beast::unit_test::suite @@ -61,7 +61,7 @@ struct SetAuth_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(SetAuth, app, ripple); +BEAST_DEFINE_TESTSUITE(SetAuth, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/SetRegularKey_test.cpp b/src/test/app/SetRegularKey_test.cpp index 2065066ec3..308e5527f7 100644 --- a/src/test/app/SetRegularKey_test.cpp +++ b/src/test/app/SetRegularKey_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class SetRegularKey_test : public beast::unit_test::suite { @@ -169,6 +169,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(SetRegularKey, app, ripple); +BEAST_DEFINE_TESTSUITE(SetRegularKey, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/SetTrust_test.cpp b/src/test/app/SetTrust_test.cpp index 07573cf13f..f8309c4271 100644 --- a/src/test/app/SetTrust_test.cpp +++ b/src/test/app/SetTrust_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -618,6 +618,6 @@ public: testWithFeats(sa); } }; -BEAST_DEFINE_TESTSUITE(SetTrust, app, ripple); +BEAST_DEFINE_TESTSUITE(SetTrust, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/TheoreticalQuality_test.cpp b/src/test/app/TheoreticalQuality_test.cpp index fe59ac6b1a..5cc03247ae 100644 --- a/src/test/app/TheoreticalQuality_test.cpp +++ b/src/test/app/TheoreticalQuality_test.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct RippleCalcTestParams @@ -533,7 +533,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(TheoreticalQuality, app, ripple, 3); +BEAST_DEFINE_TESTSUITE_PRIO(TheoreticalQuality, app, xrpl, 3); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Ticket_test.cpp b/src/test/app/Ticket_test.cpp index 4c3208af02..3136699103 100644 --- a/src/test/app/Ticket_test.cpp +++ b/src/test/app/Ticket_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class Ticket_test : public beast::unit_test::suite { @@ -908,6 +908,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Ticket, app, ripple); +BEAST_DEFINE_TESTSUITE(Ticket, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Transaction_ordering_test.cpp b/src/test/app/Transaction_ordering_test.cpp index 2f67d8b414..81c9ae196c 100644 --- a/src/test/app/Transaction_ordering_test.cpp +++ b/src/test/app/Transaction_ordering_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct Transaction_ordering_test : public beast::unit_test::suite @@ -143,7 +143,7 @@ struct Transaction_ordering_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Transaction_ordering, app, ripple); +BEAST_DEFINE_TESTSUITE(Transaction_ordering, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/TrustAndBalance_test.cpp b/src/test/app/TrustAndBalance_test.cpp index 6cad68d584..25c22b823b 100644 --- a/src/test/app/TrustAndBalance_test.cpp +++ b/src/test/app/TrustAndBalance_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class TrustAndBalance_test : public beast::unit_test::suite { @@ -467,6 +467,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(TrustAndBalance, app, ripple); +BEAST_DEFINE_TESTSUITE(TrustAndBalance, app, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/TxQ_test.cpp b/src/test/app/TxQ_test.cpp index 0af91f25a6..3e19fc2842 100644 --- a/src/test/app/TxQ_test.cpp +++ b/src/test/app/TxQ_test.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -99,7 +99,7 @@ class TxQPosNegFlows_test : public beast::unit_test::suite // fee (1) and amendment (numUpVotedAmendments()) // pseudotransactions. The queue treats the fees on these // transactions as though they are ordinary transactions. - auto const flagPerLedger = 1 + ripple::detail::numUpVotedAmendments(); + auto const flagPerLedger = 1 + xrpl::detail::numUpVotedAmendments(); auto const flagMaxQueue = ledgersInQueue * flagPerLedger; checkMetrics(*this, env, 0, flagMaxQueue, 0, flagPerLedger); @@ -977,13 +977,13 @@ public: Env::ParsedResult parsed; - env.app().openLedger().modify( - [&](OpenView& view, beast::Journal j) { - auto const result = ripple::apply( - env.app(), view, *jt.stx, tapNONE, env.journal); - parsed.ter = result.ter; - return result.applied; - }); + env.app().openLedger().modify([&](OpenView& view, + beast::Journal j) { + auto const result = + xrpl::apply(env.app(), view, *jt.stx, tapNONE, env.journal); + parsed.ter = result.ter; + return result.applied; + }); env.postconditions(jt, parsed); } checkMetrics(*this, env, 1, std::nullopt, 4, 2); @@ -4191,7 +4191,7 @@ public: auto const tx = env.jt(noop(alice), seq(aliceSeq), fee(openLedgerCost(env))); auto const result = - ripple::apply(env.app(), view, *tx.stx, tapUNLIMITED, j); + xrpl::apply(env.app(), view, *tx.stx, tapUNLIMITED, j); BEAST_EXPECT(result.ter == tesSUCCESS && result.applied); return result.applied; }); @@ -4263,7 +4263,7 @@ public: ticket::use(tktSeq0 + 1), fee(openLedgerCost(env))); auto const result = - ripple::apply(env.app(), view, *tx.stx, tapUNLIMITED, j); + xrpl::apply(env.app(), view, *tx.stx, tapUNLIMITED, j); BEAST_EXPECT(result.ter == tesSUCCESS && result.applied); return result.applied; }); @@ -4371,7 +4371,7 @@ public: if (!getMajorityAmendments(*env.closed()).empty()) break; } - auto expectedPerLedger = ripple::detail::numUpVotedAmendments() + 1; + auto expectedPerLedger = xrpl::detail::numUpVotedAmendments() + 1; checkMetrics( *this, env, @@ -5052,8 +5052,8 @@ class TxQMetaInfo_test : public TxQPosNegFlows_test } }; -BEAST_DEFINE_TESTSUITE_PRIO(TxQPosNegFlows, app, ripple, 1); -BEAST_DEFINE_TESTSUITE_PRIO(TxQMetaInfo, app, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(TxQPosNegFlows, app, xrpl, 1); +BEAST_DEFINE_TESTSUITE_PRIO(TxQMetaInfo, app, xrpl, 1); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/ValidatorKeys_test.cpp b/src/test/app/ValidatorKeys_test.cpp index 9770d6a0ff..943bf5231f 100644 --- a/src/test/app/ValidatorKeys_test.cpp +++ b/src/test/app/ValidatorKeys_test.cpp @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ValidatorKeys_test : public beast::unit_test::suite @@ -171,7 +171,7 @@ public: } }; // namespace test -BEAST_DEFINE_TESTSUITE(ValidatorKeys, app, ripple); +BEAST_DEFINE_TESTSUITE(ValidatorKeys, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/ValidatorList_test.cpp b/src/test/app/ValidatorList_test.cpp index 2f88f0ea1e..163e4f632c 100644 --- a/src/test/app/ValidatorList_test.cpp +++ b/src/test/app/ValidatorList_test.cpp @@ -16,7 +16,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ValidatorList_test : public beast::unit_test::suite @@ -2294,7 +2294,7 @@ private: { testcase("Sha512 hashing"); // Tests that ValidatorList hash_append helpers with a single blob - // returns the same result as ripple::Sha512Half used by the + // returns the same result as xrpl::Sha512Half used by the // TMValidatorList protocol message handler std::string const manifest = "This is not really a manifest"; std::string const blob = "This is not really a blob"; @@ -4145,7 +4145,7 @@ public: } }; // namespace test -BEAST_DEFINE_TESTSUITE(ValidatorList, app, ripple); +BEAST_DEFINE_TESTSUITE(ValidatorList, app, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/ValidatorSite_test.cpp b/src/test/app/ValidatorSite_test.cpp index be8ae8013f..71a5b7fa73 100644 --- a/src/test/app/ValidatorSite_test.cpp +++ b/src/test/app/ValidatorSite_test.cpp @@ -17,7 +17,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { constexpr char const* realValidatorContents() @@ -688,7 +688,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(ValidatorSite, app, ripple, 2); +BEAST_DEFINE_TESTSUITE_PRIO(ValidatorSite, app, xrpl, 2); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index a07045743e..fbe87ccb5d 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -29,12 +29,12 @@ #include -namespace ripple { +namespace xrpl { class Vault_test : public beast::unit_test::suite { - using PrettyAsset = ripple::test::jtx::PrettyAsset; - using PrettyAmount = ripple::test::jtx::PrettyAmount; + using PrettyAsset = xrpl::test::jtx::PrettyAsset; + using PrettyAmount = xrpl::test::jtx::PrettyAmount; static auto constexpr negativeAmount = [](PrettyAsset const& asset) -> PrettyAmount { @@ -2223,7 +2223,7 @@ class Vault_test : public beast::unit_test::suite env(tx); env.close(); - auto const issuanceId = [&env](ripple::Keylet keylet) -> MPTID { + auto const issuanceId = [&env](xrpl::Keylet keylet) -> MPTID { auto const vault = env.le(keylet); return vault->at(sfShareMPTID); }(keylet); @@ -2555,10 +2555,10 @@ class Vault_test : public beast::unit_test::suite Account const& owner, Account const& issuer, Account const& charlie, - std::function vaultAccount, + std::function vaultAccount, Vault& vault, PrettyAsset const& asset, - std::function issuanceId)> test, + std::function issuanceId)> test, CaseArgs args = {}) { Env env{*this, testable_amendments() | featureSingleAssetVault}; Account const owner{"owner"}; @@ -2590,10 +2590,10 @@ class Vault_test : public beast::unit_test::suite env.close(); auto const vaultAccount = - [&env](ripple::Keylet keylet) -> Account { + [&env](xrpl::Keylet keylet) -> Account { return Account("vault", env.le(keylet)->at(sfAccount)); }; - auto const issuanceId = [&env](ripple::Keylet keylet) -> MPTID { + auto const issuanceId = [&env](xrpl::Keylet keylet) -> MPTID { return env.le(keylet)->at(sfShareMPTID); }; @@ -2843,7 +2843,7 @@ class Vault_test : public beast::unit_test::suite env.close(); // Withdraw to 3rd party works - auto const withdrawToCharlie = [&](ripple::Keylet keylet) { + auto const withdrawToCharlie = [&](xrpl::Keylet keylet) { auto tx = vault.withdraw( {.depositor = owner, .id = keylet.key, @@ -2914,7 +2914,7 @@ class Vault_test : public beast::unit_test::suite env.close(); // Withdraw to 3rd party without trust line - auto const tx1 = [&](ripple::Keylet keylet) { + auto const tx1 = [&](xrpl::Keylet keylet) { auto tx = vault.withdraw( {.depositor = owner, .id = keylet.key, @@ -2953,7 +2953,7 @@ class Vault_test : public beast::unit_test::suite BEAST_EXPECT(trustline == nullptr); // Withdraw without trust line, will succeed - auto const tx1 = [&](ripple::Keylet keylet) { + auto const tx1 = [&](xrpl::Keylet keylet) { auto tx = vault.withdraw( {.depositor = owner, .id = keylet.key, @@ -2972,7 +2972,7 @@ class Vault_test : public beast::unit_test::suite auto vaultAccount, Vault& vault, PrettyAsset const& asset, - std::function issuanceId) { + std::function issuanceId) { testcase("IOU non-transferable"); auto [tx, keylet] = @@ -3250,7 +3250,7 @@ class Vault_test : public beast::unit_test::suite env.close(); // Withdraw to 3rd party works - auto const withdrawToCharlie = [&](ripple::Keylet keylet) { + auto const withdrawToCharlie = [&](xrpl::Keylet keylet) { auto tx = vault.withdraw( {.depositor = owner, .id = keylet.key, @@ -3755,7 +3755,7 @@ class Vault_test : public beast::unit_test::suite for (int i = 0; i < 256; ++i) { AccountID const accountId = - ripple::pseudoAccountAddress(*env.current(), keylet.key); + xrpl::pseudoAccountAddress(*env.current(), keylet.key); env(pay(env.master.id(), accountId, XRP(1000)), seq(autofill), @@ -3783,7 +3783,7 @@ class Vault_test : public beast::unit_test::suite MPTIssue shares; PrettyAsset const& share; Vault& vault; - ripple::Keylet keylet; + xrpl::Keylet keylet; Issue assets; PrettyAsset const& asset; std::function)> peek; @@ -3813,7 +3813,7 @@ class Vault_test : public beast::unit_test::suite env(tx); auto const [vaultAccount, issuanceId] = - [&env](ripple::Keylet keylet) -> std::tuple { + [&env](xrpl::Keylet keylet) -> std::tuple { auto const vault = env.le(keylet); return { Account("vault", vault->at(sfAccount)), @@ -5264,6 +5264,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(Vault, app, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(Vault, app, xrpl, 1); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/XChain_test.cpp b/src/test/app/XChain_test.cpp index 158d913f46..619054b078 100644 --- a/src/test/app/XChain_test.cpp +++ b/src/test/app/XChain_test.cpp @@ -23,7 +23,7 @@ #include #include -namespace ripple::test { +namespace xrpl::test { // SEnv class - encapsulate jtx::Env to make it more user-friendly, // for example having APIs that return a *this reference so that calls can be @@ -5171,7 +5171,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(XChain, app, ripple); -BEAST_DEFINE_TESTSUITE(XChainSim, app, ripple); +BEAST_DEFINE_TESTSUITE(XChain, app, xrpl); +BEAST_DEFINE_TESTSUITE(XChainSim, app, xrpl); -} // namespace ripple::test +} // namespace xrpl::test diff --git a/src/test/app/tx/apply_test.cpp b/src/test/app/tx/apply_test.cpp index 308ad3d3b8..0b198dcd22 100644 --- a/src/test/app/tx/apply_test.cpp +++ b/src/test/app/tx/apply_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class Apply_test : public beast::unit_test::suite { @@ -53,6 +53,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Apply, tx, ripple); +BEAST_DEFINE_TESTSUITE(Apply, tx, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/Buffer_test.cpp b/src/test/basics/Buffer_test.cpp index f734741e0f..cb3c48484b 100644 --- a/src/test/basics/Buffer_test.cpp +++ b/src/test/basics/Buffer_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct Buffer_test : beast::unit_test::suite @@ -261,7 +261,7 @@ struct Buffer_test : beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Buffer, basics, ripple); +BEAST_DEFINE_TESTSUITE(Buffer, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/DetectCrash_test.cpp b/src/test/basics/DetectCrash_test.cpp index e2f7d39921..0dd2787dff 100644 --- a/src/test/basics/DetectCrash_test.cpp +++ b/src/test/basics/DetectCrash_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct DetectCrash_test : public beast::unit_test::suite @@ -25,4 +25,4 @@ struct DetectCrash_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL(DetectCrash, basics, beast); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/Expected_test.cpp b/src/test/basics/Expected_test.cpp index 173e8302aa..010a6fbb8e 100644 --- a/src/test/basics/Expected_test.cpp +++ b/src/test/basics/Expected_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct Expected_test : beast::unit_test::suite @@ -224,7 +224,7 @@ struct Expected_test : beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Expected, basics, ripple); +BEAST_DEFINE_TESTSUITE(Expected, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/FileUtilities_test.cpp b/src/test/basics/FileUtilities_test.cpp index d3e70911b8..c655e4d1bc 100644 --- a/src/test/basics/FileUtilities_test.cpp +++ b/src/test/basics/FileUtilities_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class FileUtilities_test : public beast::unit_test::suite { @@ -12,7 +12,7 @@ public: void testGetFileContents() { - using namespace ripple::detail; + using namespace xrpl::detail; using namespace boost::system; constexpr char const* expectedContents = @@ -60,6 +60,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(FileUtilities, basics, ripple); +BEAST_DEFINE_TESTSUITE(FileUtilities, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/IOUAmount_test.cpp b/src/test/basics/IOUAmount_test.cpp index dd6389ed81..305f2c83a1 100644 --- a/src/test/basics/IOUAmount_test.cpp +++ b/src/test/basics/IOUAmount_test.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { class IOUAmount_test : public beast::unit_test::suite { @@ -239,7 +239,7 @@ public: IOUAmount big(maxMantissa, maxExponent); except([&] { mulRatio(big, 2, 0, true); }); } - } // namespace ripple + } // namespace xrpl //-------------------------------------------------------------------------- @@ -255,6 +255,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(IOUAmount, basics, ripple); +BEAST_DEFINE_TESTSUITE(IOUAmount, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/IntrusiveShared_test.cpp b/src/test/basics/IntrusiveShared_test.cpp index a3acc54d45..d5d5d75048 100644 --- a/src/test/basics/IntrusiveShared_test.cpp +++ b/src/test/basics/IntrusiveShared_test.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { /** @@ -887,6 +887,6 @@ public: } }; // namespace tests -BEAST_DEFINE_TESTSUITE(IntrusiveShared, basics, ripple); +BEAST_DEFINE_TESTSUITE(IntrusiveShared, basics, xrpl); } // namespace tests -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/KeyCache_test.cpp b/src/test/basics/KeyCache_test.cpp index 3ba642682a..55b275ae09 100644 --- a/src/test/basics/KeyCache_test.cpp +++ b/src/test/basics/KeyCache_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class KeyCache_test : public beast::unit_test::suite { @@ -74,6 +74,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(KeyCache, basics, ripple); +BEAST_DEFINE_TESTSUITE(KeyCache, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index bb5262d028..b7c5ee45b7 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Number_test : public beast::unit_test::suite { @@ -859,6 +859,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Number, basics, ripple); +BEAST_DEFINE_TESTSUITE(Number, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/PerfLog_test.cpp b/src/test/basics/PerfLog_test.cpp index dcb91d0fd3..06944bb5ce 100644 --- a/src/test/basics/PerfLog_test.cpp +++ b/src/test/basics/PerfLog_test.cpp @@ -18,7 +18,7 @@ //------------------------------------------------------------------------------ -namespace ripple { +namespace xrpl { class PerfLog_test : public beast::unit_test::suite { @@ -293,7 +293,7 @@ public: // Get the all the labels we can use for RPC interfaces without // causing an assert. std::vector labels = - test::jtx::make_vector(ripple::RPC::getHandlerNames()); + test::jtx::make_vector(xrpl::RPC::getHandlerNames()); std::shuffle(labels.begin(), labels.end(), default_prng()); // Get two IDs to associate with each label. Errors tend to happen at @@ -1042,6 +1042,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PerfLog, basics, ripple); +BEAST_DEFINE_TESTSUITE(PerfLog, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/StringUtilities_test.cpp b/src/test/basics/StringUtilities_test.cpp index 319eafe920..ec993b20c3 100644 --- a/src/test/basics/StringUtilities_test.cpp +++ b/src/test/basics/StringUtilities_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class StringUtilities_test : public beast::unit_test::suite { @@ -303,6 +303,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(StringUtilities, basics, ripple); +BEAST_DEFINE_TESTSUITE(StringUtilities, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/TaggedCache_test.cpp b/src/test/basics/TaggedCache_test.cpp index be0eb5d77b..78dc25380b 100644 --- a/src/test/basics/TaggedCache_test.cpp +++ b/src/test/basics/TaggedCache_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /* I guess you can put some items in, make sure they're still there. Let some @@ -132,6 +132,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(TaggedCache, basics, ripple); +BEAST_DEFINE_TESTSUITE(TaggedCache, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/Units_test.cpp b/src/test/basics/Units_test.cpp index 7838926c87..d0193320bf 100644 --- a/src/test/basics/Units_test.cpp +++ b/src/test/basics/Units_test.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class units_test : public beast::unit_test::suite @@ -353,7 +353,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(units, basics, ripple); +BEAST_DEFINE_TESTSUITE(units, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/XRPAmount_test.cpp b/src/test/basics/XRPAmount_test.cpp index a63f3bfd43..da03a3533f 100644 --- a/src/test/basics/XRPAmount_test.cpp +++ b/src/test/basics/XRPAmount_test.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { class XRPAmount_test : public beast::unit_test::suite { @@ -308,7 +308,7 @@ public: XRPAmount bigNegative(minXRP + 10); BEAST_EXPECT(mulRatio(bigNegative, 2, 1, true) == minXRP); } - } // namespace ripple + } // namespace xrpl //-------------------------------------------------------------------------- @@ -325,6 +325,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(XRPAmount, basics, ripple); +BEAST_DEFINE_TESTSUITE(XRPAmount, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/base58_test.cpp b/src/test/basics/base58_test.cpp index 1700255df6..16307bdb0f 100644 --- a/src/test/basics/base58_test.cpp +++ b/src/test/basics/base58_test.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace { @@ -30,13 +30,13 @@ randEngine() -> std::mt19937& constexpr int numTokenTypeIndexes = 9; [[nodiscard]] inline auto -tokenTypeAndSize(int i) -> std::tuple +tokenTypeAndSize(int i) -> std::tuple { assert(i < numTokenTypeIndexes); switch (i) { - using enum ripple::TokenType; + using enum xrpl::TokenType; case 0: return {None, 20}; case 1: @@ -63,9 +63,9 @@ tokenTypeAndSize(int i) -> std::tuple } [[nodiscard]] inline auto -randomTokenTypeAndSize() -> std::tuple +randomTokenTypeAndSize() -> std::tuple { - using namespace ripple; + using namespace xrpl; auto& rng = randEngine(); std::uniform_int_distribution<> d(0, 8); return tokenTypeAndSize(d(rng)); @@ -74,7 +74,7 @@ randomTokenTypeAndSize() -> std::tuple // Return the token type and subspan of `d` to use as test data. [[nodiscard]] inline auto randomB256TestData(std::span d) - -> std::tuple> + -> std::tuple> { auto& rng = randEngine(); std::uniform_int_distribution dist(0, 255); @@ -267,7 +267,7 @@ class base58_test : public beast::unit_test::suite std::span const outBuf{b58ResultBuf[i]}; if (i == 0) { - auto const r = ripple::b58_fast::detail::b256_to_b58_be( + auto const r = xrpl::b58_fast::detail::b256_to_b58_be( b256Data, outBuf); BEAST_EXPECT(r); b58Result[i] = r.value(); @@ -275,7 +275,7 @@ class base58_test : public beast::unit_test::suite else { std::array tmpBuf; - std::string const s = ripple::b58_ref::detail::encodeBase58( + std::string const s = xrpl::b58_ref::detail::encodeBase58( b256Data.data(), b256Data.size(), tmpBuf.data(), @@ -307,7 +307,7 @@ class base58_test : public beast::unit_test::suite b58Result[i].data(), b58Result[i].data() + b58Result[i].size()); auto const r = - ripple::b58_fast::detail::b58_to_b256_be(in, outBuf); + xrpl::b58_fast::detail::b58_to_b256_be(in, outBuf); BEAST_EXPECT(r); b256Result[i] = r.value(); } @@ -316,7 +316,7 @@ class base58_test : public beast::unit_test::suite std::string const st( b58Result[i].begin(), b58Result[i].end()); std::string const s = - ripple::b58_ref::detail::decodeBase58(st); + xrpl::b58_ref::detail::decodeBase58(st); BEAST_EXPECT(s.size()); b256Result[i] = outBuf.subspan(0, s.size()); std::copy(s.begin(), s.end(), b256Result[i].begin()); @@ -336,7 +336,7 @@ class base58_test : public beast::unit_test::suite } }; - auto testTokenEncode = [&](ripple::TokenType const tokType, + auto testTokenEncode = [&](xrpl::TokenType const tokType, std::span const& b256Data) { std::array b58ResultBuf[2]; std::array, 2> b58Result; @@ -349,14 +349,14 @@ class base58_test : public beast::unit_test::suite b58ResultBuf[i].data(), b58ResultBuf[i].size()}; if (i == 0) { - auto const r = ripple::b58_fast::encodeBase58Token( + auto const r = xrpl::b58_fast::encodeBase58Token( tokType, b256Data, outBuf); BEAST_EXPECT(r); b58Result[i] = r.value(); } else { - std::string const s = ripple::b58_ref::encodeBase58Token( + std::string const s = xrpl::b58_ref::encodeBase58Token( tokType, b256Data.data(), b256Data.size()); BEAST_EXPECT(s.size()); b58Result[i] = outBuf.subspan(0, s.size()); @@ -384,8 +384,8 @@ class base58_test : public beast::unit_test::suite std::string const in( b58Result[i].data(), b58Result[i].data() + b58Result[i].size()); - auto const r = ripple::b58_fast::decodeBase58Token( - tokType, in, outBuf); + auto const r = + xrpl::b58_fast::decodeBase58Token(tokType, in, outBuf); BEAST_EXPECT(r); b256Result[i] = r.value(); } @@ -394,7 +394,7 @@ class base58_test : public beast::unit_test::suite std::string const st( b58Result[i].begin(), b58Result[i].end()); std::string const s = - ripple::b58_ref::decodeBase58Token(st, tokType); + xrpl::b58_ref::decodeBase58Token(st, tokType); BEAST_EXPECT(s.size()); b256Result[i] = outBuf.subspan(0, s.size()); std::copy(s.begin(), s.end(), b256Result[i].begin()); @@ -414,7 +414,7 @@ class base58_test : public beast::unit_test::suite } }; - auto testIt = [&](ripple::TokenType const tokType, + auto testIt = [&](xrpl::TokenType const tokType, std::span const& b256Data) { testRawEncode(b256Data); testTokenEncode(tokType, b256Data); @@ -451,8 +451,8 @@ class base58_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(base58, basics, ripple); +BEAST_DEFINE_TESTSUITE(base58, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl #endif // _MSC_VER diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index 0308fb4466..8f764fd58b 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { // a non-hashing Hasher that just copies the bytes. @@ -59,7 +59,7 @@ struct base_uint_test : beast::unit_test::suite for (auto const& arg : test_args) { - ripple::base_uint<64> const u{arg.first}, v{arg.second}; + xrpl::base_uint<64> const u{arg.first}, v{arg.second}; BEAST_EXPECT(u < v); BEAST_EXPECT(u <= v); BEAST_EXPECT(u != v); @@ -92,7 +92,7 @@ struct base_uint_test : beast::unit_test::suite for (auto const& arg : test_args) { - ripple::base_uint<96> const u{arg.first}, v{arg.second}; + xrpl::base_uint<96> const u{arg.first}, v{arg.second}; BEAST_EXPECT(u < v); BEAST_EXPECT(u <= v); BEAST_EXPECT(u != v); @@ -352,7 +352,7 @@ struct base_uint_test : beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(base_uint, basics, ripple); +BEAST_DEFINE_TESTSUITE(base_uint, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/hardened_hash_test.cpp b/src/test/basics/hardened_hash_test.cpp index 9cd40d6a60..f7eb78ce31 100644 --- a/src/test/basics/hardened_hash_test.cpp +++ b/src/test/basics/hardened_hash_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { template @@ -51,11 +51,11 @@ public: }; } // namespace detail -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ -namespace ripple { +namespace xrpl { namespace detail { @@ -148,11 +148,11 @@ using sha256_t = unsigned_integer<256, std::size_t>; static_assert(sha256_t::bits == 256, "sha256_t must have 256 bits"); #endif -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ -namespace ripple { +namespace xrpl { class hardened_hash_test : public beast::unit_test::suite { @@ -234,6 +234,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(hardened_hash, basics, ripple); +BEAST_DEFINE_TESTSUITE(hardened_hash, basics, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/basics/join_test.cpp b/src/test/basics/join_test.cpp index 751f0290f8..5354f2ab60 100644 --- a/src/test/basics/join_test.cpp +++ b/src/test/basics/join_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct join_test : beast::unit_test::suite @@ -80,7 +80,7 @@ struct join_test : beast::unit_test::suite } }; // namespace test -BEAST_DEFINE_TESTSUITE(join, basics, ripple); +BEAST_DEFINE_TESTSUITE(join, basics, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/beast/IPEndpointCommon.h b/src/test/beast/IPEndpointCommon.h index 83175834af..73cbe7d95b 100644 --- a/src/test/beast/IPEndpointCommon.h +++ b/src/test/beast/IPEndpointCommon.h @@ -7,7 +7,7 @@ namespace IP { inline Endpoint randomEP(bool v4 = true) { - using namespace ripple; + using namespace xrpl; auto dv4 = []() -> AddressV4::bytes_type { return { {static_cast(rand_int(1, UINT8_MAX)), diff --git a/src/test/beast/IPEndpoint_test.cpp b/src/test/beast/IPEndpoint_test.cpp index 3d4f2e7f02..1d451e94a2 100644 --- a/src/test/beast/IPEndpoint_test.cpp +++ b/src/test/beast/IPEndpoint_test.cpp @@ -380,7 +380,7 @@ public: float max_lf{0}; for (auto i = 0; i < items; ++i) { - eps.insert(randomEP(ripple::rand_int(0, 1) == 1)); + eps.insert(randomEP(xrpl::rand_int(0, 1) == 1)); max_lf = std::max(max_lf, eps.load_factor()); } BEAST_EXPECT(eps.bucket_count() >= items); diff --git a/src/test/beast/beast_CurrentThreadName_test.cpp b/src/test/beast/beast_CurrentThreadName_test.cpp index 9863c1bb3c..3d33ecb602 100644 --- a/src/test/beast/beast_CurrentThreadName_test.cpp +++ b/src/test/beast/beast_CurrentThreadName_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class CurrentThreadName_test : public beast::unit_test::suite @@ -70,4 +70,4 @@ public: BEAST_DEFINE_TESTSUITE(CurrentThreadName, beast, beast); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/conditions/PreimageSha256_test.cpp b/src/test/conditions/PreimageSha256_test.cpp index 08f9e5fb5b..71ba526be3 100644 --- a/src/test/conditions/PreimageSha256_test.cpp +++ b/src/test/conditions/PreimageSha256_test.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { class PreimageSha256_test : public beast::unit_test::suite @@ -167,8 +167,8 @@ class PreimageSha256_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(PreimageSha256, conditions, ripple); +BEAST_DEFINE_TESTSUITE(PreimageSha256, conditions, xrpl); } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/ByzantineFailureSim_test.cpp b/src/test/consensus/ByzantineFailureSim_test.cpp index f2a9a7d5c6..0a988f0473 100644 --- a/src/test/consensus/ByzantineFailureSim_test.cpp +++ b/src/test/consensus/ByzantineFailureSim_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ByzantineFailureSim_test : public beast::unit_test::suite @@ -79,7 +79,7 @@ class ByzantineFailureSim_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE_MANUAL(ByzantineFailureSim, consensus, ripple); +BEAST_DEFINE_TESTSUITE_MANUAL(ByzantineFailureSim, consensus, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/Consensus_test.cpp b/src/test/consensus/Consensus_test.cpp index 6318c86a12..85dd5e3957 100644 --- a/src/test/consensus/Consensus_test.cpp +++ b/src/test/consensus/Consensus_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Consensus_test : public beast::unit_test::suite @@ -1518,6 +1518,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Consensus, consensus, ripple); +BEAST_DEFINE_TESTSUITE(Consensus, consensus, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/DistributedValidatorsSim_test.cpp b/src/test/consensus/DistributedValidatorsSim_test.cpp index 6e093a91c5..006c1aab4e 100644 --- a/src/test/consensus/DistributedValidatorsSim_test.cpp +++ b/src/test/consensus/DistributedValidatorsSim_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { /** In progress simulations for diversifying and distributing validators @@ -254,7 +254,7 @@ class DistributedValidators_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DistributedValidators, consensus, ripple, 2); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DistributedValidators, consensus, xrpl, 2); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/LedgerTiming_test.cpp b/src/test/consensus/LedgerTiming_test.cpp index c3ce86b4b3..0ec3563c79 100644 --- a/src/test/consensus/LedgerTiming_test.cpp +++ b/src/test/consensus/LedgerTiming_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class LedgerTiming_test : public beast::unit_test::suite @@ -105,6 +105,6 @@ class LedgerTiming_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(LedgerTiming, consensus, ripple); +BEAST_DEFINE_TESTSUITE(LedgerTiming, consensus, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/LedgerTrie_test.cpp b/src/test/consensus/LedgerTrie_test.cpp index 5ad725fa73..586b9231f6 100644 --- a/src/test/consensus/LedgerTrie_test.cpp +++ b/src/test/consensus/LedgerTrie_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class LedgerTrie_test : public beast::unit_test::suite @@ -659,6 +659,6 @@ class LedgerTrie_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(LedgerTrie, consensus, ripple); +BEAST_DEFINE_TESTSUITE(LedgerTrie, consensus, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/NegativeUNL_test.cpp b/src/test/consensus/NegativeUNL_test.cpp index a1000c0d49..e10d6cbdd0 100644 --- a/src/test/consensus/NegativeUNL_test.cpp +++ b/src/test/consensus/NegativeUNL_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { /* @@ -1826,20 +1826,20 @@ class NegativeUNLVoteFilterValidations_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(NegativeUNL, consensus, ripple); +BEAST_DEFINE_TESTSUITE(NegativeUNL, consensus, xrpl); -BEAST_DEFINE_TESTSUITE(NegativeUNLVoteInternal, consensus, ripple); -BEAST_DEFINE_TESTSUITE_MANUAL(NegativeUNLVoteScoreTable, consensus, ripple); -BEAST_DEFINE_TESTSUITE_PRIO(NegativeUNLVoteGoodScore, consensus, ripple, 1); -BEAST_DEFINE_TESTSUITE(NegativeUNLVoteOffline, consensus, ripple); -BEAST_DEFINE_TESTSUITE(NegativeUNLVoteMaxListed, consensus, ripple); +BEAST_DEFINE_TESTSUITE(NegativeUNLVoteInternal, consensus, xrpl); +BEAST_DEFINE_TESTSUITE_MANUAL(NegativeUNLVoteScoreTable, consensus, xrpl); +BEAST_DEFINE_TESTSUITE_PRIO(NegativeUNLVoteGoodScore, consensus, xrpl, 1); +BEAST_DEFINE_TESTSUITE(NegativeUNLVoteOffline, consensus, xrpl); +BEAST_DEFINE_TESTSUITE(NegativeUNLVoteMaxListed, consensus, xrpl); BEAST_DEFINE_TESTSUITE_PRIO( NegativeUNLVoteRetiredValidator, consensus, ripple, 1); -BEAST_DEFINE_TESTSUITE(NegativeUNLVoteNewValidator, consensus, ripple); -BEAST_DEFINE_TESTSUITE(NegativeUNLVoteFilterValidations, consensus, ripple); +BEAST_DEFINE_TESTSUITE(NegativeUNLVoteNewValidator, consensus, xrpl); +BEAST_DEFINE_TESTSUITE(NegativeUNLVoteFilterValidations, consensus, xrpl); /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// @@ -1947,4 +1947,4 @@ createTx(bool disabling, LedgerIndex seq, PublicKey const& txKey) } } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/RCLCensorshipDetector_test.cpp b/src/test/consensus/RCLCensorshipDetector_test.cpp index 9be73735f9..4093ffe900 100644 --- a/src/test/consensus/RCLCensorshipDetector_test.cpp +++ b/src/test/consensus/RCLCensorshipDetector_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class RCLCensorshipDetector_test : public beast::unit_test::suite @@ -79,6 +79,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RCLCensorshipDetector, consensus, ripple); +BEAST_DEFINE_TESTSUITE(RCLCensorshipDetector, consensus, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/ScaleFreeSim_test.cpp b/src/test/consensus/ScaleFreeSim_test.cpp index 51b9ee542a..53c5030f29 100644 --- a/src/test/consensus/ScaleFreeSim_test.cpp +++ b/src/test/consensus/ScaleFreeSim_test.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ScaleFreeSim_test : public beast::unit_test::suite @@ -100,7 +100,7 @@ class ScaleFreeSim_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(ScaleFreeSim, consensus, ripple, 80); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(ScaleFreeSim, consensus, xrpl, 80); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/consensus/Validations_test.cpp b/src/test/consensus/Validations_test.cpp index b1b5a46f38..906817add0 100644 --- a/src/test/consensus/Validations_test.cpp +++ b/src/test/consensus/Validations_test.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { class Validations_test : public beast::unit_test::suite @@ -1125,7 +1125,7 @@ class Validations_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Validations, consensus, ripple); +BEAST_DEFINE_TESTSUITE(Validations, consensus, xrpl); } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/ClosureCounter_test.cpp b/src/test/core/ClosureCounter_test.cpp index 23359596fd..47f9d9a5d1 100644 --- a/src/test/core/ClosureCounter_test.cpp +++ b/src/test/core/ClosureCounter_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { //------------------------------------------------------------------------------ @@ -318,7 +318,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ClosureCounter, core, ripple); +BEAST_DEFINE_TESTSUITE(ClosureCounter, core, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/Config_test.cpp b/src/test/core/Config_test.cpp index 6f11877202..86f09e6c02 100644 --- a/src/test/core/Config_test.cpp +++ b/src/test/core/Config_test.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { std::string configContents(std::string const& dbPath, std::string const& validatorsFile) @@ -109,7 +109,7 @@ backend=sqlite /** Write a rippled config file and remove when done. */ -class RippledCfgGuard : public ripple::detail::FileDirGuard +class RippledCfgGuard : public xrpl::detail::FileDirGuard { private: path dataDir_; @@ -326,7 +326,7 @@ port_wss_admin { // read from file absolute path auto const cwd = current_path(); - ripple::detail::DirGuard const g0(*this, "test_db"); + xrpl::detail::DirGuard const g0(*this, "test_db"); path const dataDirRel("test_data_dir"); path const dataDirAbs(cwd / g0.subdir() / dataDirRel); detail::RippledCfgGuard const g( @@ -1497,6 +1497,6 @@ r.ripple.com:51235 } }; -BEAST_DEFINE_TESTSUITE(Config, core, ripple); +BEAST_DEFINE_TESTSUITE(Config, core, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/Coroutine_test.cpp b/src/test/core/Coroutine_test.cpp index 47bd74a4a6..72a4c02434 100644 --- a/src/test/core/Coroutine_test.cpp +++ b/src/test/core/Coroutine_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Coroutine_test : public beast::unit_test::suite @@ -165,7 +165,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Coroutine, core, ripple); +BEAST_DEFINE_TESTSUITE(Coroutine, core, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/JobQueue_test.cpp b/src/test/core/JobQueue_test.cpp index 2451827bda..641a5fa317 100644 --- a/src/test/core/JobQueue_test.cpp +++ b/src/test/core/JobQueue_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { //------------------------------------------------------------------------------ @@ -140,7 +140,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(JobQueue, core, ripple); +BEAST_DEFINE_TESTSUITE(JobQueue, core, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/SociDB_test.cpp b/src/test/core/SociDB_test.cpp index 2d38ac4697..fc3c86a994 100644 --- a/src/test/core/SociDB_test.cpp +++ b/src/test/core/SociDB_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class SociDB_test final : public TestSuite { private: @@ -351,6 +351,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(SociDB, core, ripple); +BEAST_DEFINE_TESTSUITE(SociDB, core, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/core/Workers_test.cpp b/src/test/core/Workers_test.cpp index 2ba8c2a0e0..0a552e9d61 100644 --- a/src/test/core/Workers_test.cpp +++ b/src/test/core/Workers_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * Dummy class for unit tests. @@ -154,6 +154,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Workers, core, ripple); +BEAST_DEFINE_TESTSUITE(Workers, core, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/BasicNetwork.h b/src/test/csf/BasicNetwork.h index 7fce2e5f0e..cb4e691317 100644 --- a/src/test/csf/BasicNetwork.h +++ b/src/test/csf/BasicNetwork.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { /** Peer to peer network simulator. @@ -234,6 +234,6 @@ BasicNetwork::send(Peer const& from, Peer const& to, Function&& f) } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/BasicNetwork_test.cpp b/src/test/csf/BasicNetwork_test.cpp index e5a8c545e5..0b29f90ad3 100644 --- a/src/test/csf/BasicNetwork_test.cpp +++ b/src/test/csf/BasicNetwork_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class BasicNetwork_test : public beast::unit_test::suite @@ -127,7 +127,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(BasicNetwork, csf, ripple); +BEAST_DEFINE_TESTSUITE(BasicNetwork, csf, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/CollectorRef.h b/src/test/csf/CollectorRef.h index 81aa048249..3aa2c6495f 100644 --- a/src/test/csf/CollectorRef.h +++ b/src/test/csf/CollectorRef.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -327,6 +327,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Digraph.h b/src/test/csf/Digraph.h index 24ff820e1d..688d0528d3 100644 --- a/src/test/csf/Digraph.h +++ b/src/test/csf/Digraph.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { // Dummy class when no edge data needed for graph struct NoEdgeData @@ -231,5 +231,5 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Digraph_test.cpp b/src/test/csf/Digraph_test.cpp index bd37fef80c..a0cb35323d 100644 --- a/src/test/csf/Digraph_test.cpp +++ b/src/test/csf/Digraph_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Digraph_test : public beast::unit_test::suite @@ -73,7 +73,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Digraph, csf, ripple); +BEAST_DEFINE_TESTSUITE(Digraph, csf, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/Histogram.h b/src/test/csf/Histogram.h index 3a504557f2..b55af34846 100644 --- a/src/test/csf/Histogram.h +++ b/src/test/csf/Histogram.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -111,6 +111,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Histogram_test.cpp b/src/test/csf/Histogram_test.cpp index 964c065bfc..b0a8d8490d 100644 --- a/src/test/csf/Histogram_test.cpp +++ b/src/test/csf/Histogram_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class Histogram_test : public beast::unit_test::suite @@ -62,7 +62,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Histogram, csf, ripple); +BEAST_DEFINE_TESTSUITE(Histogram, csf, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/Peer.h b/src/test/csf/Peer.h index 5f6f006b0f..b2a0c3b3ed 100644 --- a/src/test/csf/Peer.h +++ b/src/test/csf/Peer.h @@ -20,7 +20,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -983,5 +983,5 @@ struct Peer } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/PeerGroup.h b/src/test/csf/PeerGroup.h index 8186b877c8..e674581546 100644 --- a/src/test/csf/PeerGroup.h +++ b/src/test/csf/PeerGroup.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -351,5 +351,5 @@ randomRankedConnect( } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Proposal.h b/src/test/csf/Proposal.h index bb09bbdde1..0bcf838080 100644 --- a/src/test/csf/Proposal.h +++ b/src/test/csf/Proposal.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { /** Proposal is a position taken in the consensus process and is represented @@ -17,6 +17,6 @@ using Proposal = ConsensusProposal; } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Scheduler.h b/src/test/csf/Scheduler.h index 7a44dda5da..2c250e6def 100644 --- a/src/test/csf/Scheduler.h +++ b/src/test/csf/Scheduler.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -434,6 +434,6 @@ Scheduler::step_for(std::chrono::duration const& amount) } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Scheduler_test.cpp b/src/test/csf/Scheduler_test.cpp index 0975cc09d0..a0b57dd87f 100644 --- a/src/test/csf/Scheduler_test.cpp +++ b/src/test/csf/Scheduler_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class Scheduler_test : public beast::unit_test::suite @@ -64,7 +64,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Scheduler, csf, ripple); +BEAST_DEFINE_TESTSUITE(Scheduler, csf, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/Sim.h b/src/test/csf/Sim.h index 53c3875624..ad0927e87e 100644 --- a/src/test/csf/Sim.h +++ b/src/test/csf/Sim.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -157,6 +157,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/SimTime.h b/src/test/csf/SimTime.h index d4ab34fe55..5d8c67b8f8 100644 --- a/src/test/csf/SimTime.h +++ b/src/test/csf/SimTime.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -19,6 +19,6 @@ using SimTime = typename SimClock::time_point; } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/TrustGraph.h b/src/test/csf/TrustGraph.h index 936e13b963..f5b8a9e755 100644 --- a/src/test/csf/TrustGraph.h +++ b/src/test/csf/TrustGraph.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -154,6 +154,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Tx.h b/src/test/csf/Tx.h index e24c09be2f..cf3ee85940 100644 --- a/src/test/csf/Tx.h +++ b/src/test/csf/Tx.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -210,6 +210,6 @@ hash_append(Hasher& h, Tx const& tx) } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/Validation.h b/src/test/csf/Validation.h index 77ba81681d..907eca79d0 100644 --- a/src/test/csf/Validation.h +++ b/src/test/csf/Validation.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -183,6 +183,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/collectors.h b/src/test/csf/collectors.h index 53494dad44..3b6bc0e0f3 100644 --- a/src/test/csf/collectors.h +++ b/src/test/csf/collectors.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -699,6 +699,6 @@ struct JumpCollector } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/events.h b/src/test/csf/events.h index b25dc4b339..29f434f4ad 100644 --- a/src/test/csf/events.h +++ b/src/test/csf/events.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -129,6 +129,6 @@ struct FullyValidateLedger } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/impl/Sim.cpp b/src/test/csf/impl/Sim.cpp index c17ea26939..4fbee56f0f 100644 --- a/src/test/csf/impl/Sim.cpp +++ b/src/test/csf/impl/Sim.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -63,4 +63,4 @@ Sim::branches(PeerGroup const& g) const } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/impl/ledgers.cpp b/src/test/csf/impl/ledgers.cpp index 681020c12e..09a098f2d6 100644 --- a/src/test/csf/impl/ledgers.cpp +++ b/src/test/csf/impl/ledgers.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -152,4 +152,4 @@ LedgerOracle::branches(std::set const& ledgers) const } } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/csf/ledgers.h b/src/test/csf/ledgers.h index 80e431c1e2..7614482635 100644 --- a/src/test/csf/ledgers.h +++ b/src/test/csf/ledgers.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -230,8 +230,8 @@ private: class LedgerOracle { using InstanceMap = boost::bimaps::bimap< - boost::bimaps::set_of>, - boost::bimaps::set_of>>; + boost::bimaps::set_of>, + boost::bimaps::set_of>>; using InstanceEntry = InstanceMap::value_type; // Set of all known ledgers; note this is never pruned @@ -341,6 +341,6 @@ struct LedgerHistoryHelper } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/random.h b/src/test/csf/random.h index c3ad9564ba..8b3ac7e971 100644 --- a/src/test/csf/random.h +++ b/src/test/csf/random.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -156,6 +156,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/submitters.h b/src/test/csf/submitters.h index 3cca62c10d..8a3632eb97 100644 --- a/src/test/csf/submitters.h +++ b/src/test/csf/submitters.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -109,6 +109,6 @@ makeSubmitter( } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/csf/timers.h b/src/test/csf/timers.h index c16beec885..b5902393c7 100644 --- a/src/test/csf/timers.h +++ b/src/test/csf/timers.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace csf { @@ -65,6 +65,6 @@ public: } // namespace csf } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/json/Object_test.cpp b/src/test/json/Object_test.cpp index 9d4f65492a..b74754db33 100644 --- a/src/test/json/Object_test.cpp +++ b/src/test/json/Object_test.cpp @@ -5,7 +5,7 @@ namespace Json { -class JsonObject_test : public ripple::test::TestOutputSuite +class JsonObject_test : public xrpl::test::TestOutputSuite { void setup(std::string const& testName) @@ -234,6 +234,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(JsonObject, json, ripple); +BEAST_DEFINE_TESTSUITE(JsonObject, json, xrpl); } // namespace Json diff --git a/src/test/json/TestOutputSuite.h b/src/test/json/TestOutputSuite.h index 0c1810bd39..934fe1de81 100644 --- a/src/test/json/TestOutputSuite.h +++ b/src/test/json/TestOutputSuite.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class TestOutputSuite : public TestSuite @@ -34,6 +34,6 @@ protected: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/AMM.h b/src/test/jtx/AMM.h index 646d663f99..65c16ec627 100644 --- a/src/test/jtx/AMM.h +++ b/src/test/jtx/AMM.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -442,6 +442,6 @@ ammClawback( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_TEST_JTX_AMM_H_INCLUDED diff --git a/src/test/jtx/AMMTest.h b/src/test/jtx/AMMTest.h index 91a18bec2c..83366d61e2 100644 --- a/src/test/jtx/AMMTest.h +++ b/src/test/jtx/AMMTest.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -148,6 +148,6 @@ protected: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_TEST_JTX_AMMTEST_H_INCLUDED diff --git a/src/test/jtx/AbstractClient.h b/src/test/jtx/AbstractClient.h index 383586ce02..0bdfbd67de 100644 --- a/src/test/jtx/AbstractClient.h +++ b/src/test/jtx/AbstractClient.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { /* Abstract Ripple Client interface. @@ -40,6 +40,6 @@ public: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/Account.h b/src/test/jtx/Account.h index 7545b620ee..af8870f22a 100644 --- a/src/test/jtx/Account.h +++ b/src/test/jtx/Account.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -152,6 +152,6 @@ operator<=>(Account const& lhs, Account const& rhs) noexcept } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/CaptureLogs.h b/src/test/jtx/CaptureLogs.h index 86f160c318..0ac855e402 100644 --- a/src/test/jtx/CaptureLogs.h +++ b/src/test/jtx/CaptureLogs.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { /** @@ -75,6 +75,6 @@ public: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/CheckMessageLogs.h b/src/test/jtx/CheckMessageLogs.h index d71b09673e..b0e5f4c82e 100644 --- a/src/test/jtx/CheckMessageLogs.h +++ b/src/test/jtx/CheckMessageLogs.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { /** Log manager that searches for a specific message substring @@ -63,6 +63,6 @@ public: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index 9858e17078..26a664efbd 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -39,7 +39,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -819,6 +819,6 @@ Env::rpc(std::string const& cmd, Args&&... args) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/Env_ss.h b/src/test/jtx/Env_ss.h index 726fbb4fe0..734eca5819 100644 --- a/src/test/jtx/Env_ss.h +++ b/src/test/jtx/Env_ss.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -59,6 +59,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index fbc4bd37a2..ba5a2ee8c5 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Env_test : public beast::unit_test::suite @@ -928,7 +928,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Env, jtx, ripple); +BEAST_DEFINE_TESTSUITE(Env, jtx, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/JSONRPCClient.h b/src/test/jtx/JSONRPCClient.h index a351694c3b..0513b43a93 100644 --- a/src/test/jtx/JSONRPCClient.h +++ b/src/test/jtx/JSONRPCClient.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { /** Returns a client using JSON-RPC over HTTP/S. */ @@ -15,6 +15,6 @@ std::unique_ptr makeJSONRPCClient(Config const& cfg, unsigned rpc_version = 2); } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/JTx.h b/src/test/jtx/JTx.h index 2baaf8cd10..aa87ce333d 100644 --- a/src/test/jtx/JTx.h +++ b/src/test/jtx/JTx.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -159,6 +159,6 @@ private: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/ManualTimeKeeper.h b/src/test/jtx/ManualTimeKeeper.h index 251877986f..df3c7ff89a 100644 --- a/src/test/jtx/ManualTimeKeeper.h +++ b/src/test/jtx/ManualTimeKeeper.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ManualTimeKeeper : public TimeKeeper @@ -30,6 +30,6 @@ public: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/Oracle.h b/src/test/jtx/Oracle.h index cbf3975771..fc7dc89cd1 100644 --- a/src/test/jtx/Oracle.h +++ b/src/test/jtx/Oracle.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace oracle { @@ -185,6 +185,6 @@ public: } // namespace oracle } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_TEST_JTX_ORACLE_H_INCLUDED diff --git a/src/test/jtx/PathSet.h b/src/test/jtx/PathSet.h index 25f58150bb..0c54b6fb77 100644 --- a/src/test/jtx/PathSet.h +++ b/src/test/jtx/PathSet.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { /** Count offer @@ -182,6 +182,6 @@ private: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/SignerUtils.h b/src/test/jtx/SignerUtils.h index 07d12d8cea..272909c887 100644 --- a/src/test/jtx/SignerUtils.h +++ b/src/test/jtx/SignerUtils.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -51,6 +51,6 @@ sortSigners(std::vector& signers) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 5ae44acaac..f00b929967 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -25,7 +25,7 @@ using source_location = std::experimental::source_location; using std::source_location; #endif -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -828,6 +828,6 @@ pay(AccountID const& account, } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_TEST_JTX_TESTHELPERS_H_INCLUDED diff --git a/src/test/jtx/TestSuite.h b/src/test/jtx/TestSuite.h index 69ac910c54..69cbd2a210 100644 --- a/src/test/jtx/TestSuite.h +++ b/src/test/jtx/TestSuite.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class TestSuite : public beast::unit_test::suite { @@ -119,6 +119,6 @@ private: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index 0f88e42f3d..e7ddef7ac9 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -23,7 +23,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class TrustedPublisherServer @@ -164,8 +164,7 @@ public: bool immediateStart = true, int sequence = 1) : sock_{ioc} - , ep_{boost::asio::ip::make_address( - ripple::test::getEnvLocalhostAddr()), + , ep_{boost::asio::ip::make_address(xrpl::test::getEnvLocalhostAddr()), // 0 means let OS pick the port based on what's available 0} , acceptor_{ioc} @@ -715,5 +714,5 @@ make_TrustedPublisherServer( } } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/WSClient.h b/src/test/jtx/WSClient.h index 9e7370a0fd..2365e8ce40 100644 --- a/src/test/jtx/WSClient.h +++ b/src/test/jtx/WSClient.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class WSClient : public AbstractClient @@ -37,6 +37,6 @@ makeWSClient( std::unordered_map const& headers = {}); } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/WSClient_test.cpp b/src/test/jtx/WSClient_test.cpp index 27285b2021..206b550b87 100644 --- a/src/test/jtx/WSClient_test.cpp +++ b/src/test/jtx/WSClient_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class WSClient_test : public beast::unit_test::suite @@ -27,7 +27,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(WSClient, jtx, ripple); +BEAST_DEFINE_TESTSUITE(WSClient, jtx, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/account_txn_id.h b/src/test/jtx/account_txn_id.h index bec9a195d3..fb48941925 100644 --- a/src/test/jtx/account_txn_id.h +++ b/src/test/jtx/account_txn_id.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -22,5 +22,5 @@ public: }; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/acctdelete.h b/src/test/jtx/acctdelete.h index 73e7cb6e8d..71b8597db9 100644 --- a/src/test/jtx/acctdelete.h +++ b/src/test/jtx/acctdelete.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -26,6 +26,6 @@ incLgrSeqForAccDel( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index ed0fa57cbf..faf70921be 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { struct epsilon_multiple @@ -239,9 +239,9 @@ public: struct BookSpec { AccountID account; - ripple::Currency currency; + xrpl::Currency currency; - BookSpec(AccountID const& account_, ripple::Currency const& currency_) + BookSpec(AccountID const& account_, xrpl::Currency const& currency_) : account(account_), currency(currency_) { } @@ -383,9 +383,9 @@ class IOU { public: Account account; - ripple::Currency currency; + xrpl::Currency currency; - IOU(Account const& account_, ripple::Currency const& currency_) + IOU(Account const& account_, xrpl::Currency const& currency_) : account(account_), currency(currency_) { } @@ -465,14 +465,14 @@ class MPT { public: std::string name; - ripple::MPTID issuanceID; + xrpl::MPTID issuanceID; - MPT(std::string const& n, ripple::MPTID const& issuanceID_) + MPT(std::string const& n, xrpl::MPTID const& issuanceID_) : name(n), issuanceID(issuanceID_) { } - ripple::MPTID const& + xrpl::MPTID const& mpt() const { return issuanceID; @@ -480,7 +480,7 @@ public: /** Explicit conversion to MPTIssue or asset. */ - ripple::MPTIssue + xrpl::MPTIssue mptIssue() const { return MPTIssue{issuanceID}; @@ -496,7 +496,7 @@ public: This allows passing an MPT value where an MPTIssue is expected. */ - operator ripple::MPTIssue() const + operator xrpl::MPTIssue() const { return mptIssue(); } @@ -589,6 +589,6 @@ extern any_t const any; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/attester.h b/src/test/jtx/attester.h index 6aa69e23b5..345002f90a 100644 --- a/src/test/jtx/attester.h +++ b/src/test/jtx/attester.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class PublicKey; class SecretKey; @@ -43,6 +43,6 @@ sign_create_account_attestation( AccountID const& dst); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/balance.h b/src/test/jtx/balance.h index 8ca0f2fd47..999f6b7b0c 100644 --- a/src/test/jtx/balance.h +++ b/src/test/jtx/balance.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -45,6 +45,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/basic_prop.h b/src/test/jtx/basic_prop.h index 1ee7c04e08..32655e9f52 100644 --- a/src/test/jtx/basic_prop.h +++ b/src/test/jtx/basic_prop.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -41,6 +41,6 @@ struct prop_type : basic_prop } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index 14122e3c01..dc9d30a420 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -144,6 +144,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/check.h b/src/test/jtx/check.h index 863fce6f75..6152195f1f 100644 --- a/src/test/jtx/check.h +++ b/src/test/jtx/check.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -44,6 +44,6 @@ using checks = owner_count; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/credentials.h b/src/test/jtx/credentials.h index 2ae0d1737e..2b41b5e7ef 100644 --- a/src/test/jtx/credentials.h +++ b/src/test/jtx/credentials.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -91,6 +91,6 @@ ledgerEntry(jtx::Env& env, std::string const& credIdx); } // namespace credentials } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/delegate.h b/src/test/jtx/delegate.h index 11b13cb9be..19707584ad 100644 --- a/src/test/jtx/delegate.h +++ b/src/test/jtx/delegate.h @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -40,4 +40,4 @@ public: } // namespace delegate } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/delivermin.h b/src/test/jtx/delivermin.h index 9d7ca4eaa2..70f092c9dc 100644 --- a/src/test/jtx/delivermin.h +++ b/src/test/jtx/delivermin.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -26,6 +26,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/deposit.h b/src/test/jtx/deposit.h index 91897038b6..5ea1e5bf06 100644 --- a/src/test/jtx/deposit.h +++ b/src/test/jtx/deposit.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -62,6 +62,6 @@ unauthCredentials( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/did.h b/src/test/jtx/did.h index 883f1abe35..65407028eb 100644 --- a/src/test/jtx/did.h +++ b/src/test/jtx/did.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -80,6 +80,6 @@ del(jtx::Account const& account); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/directory.h b/src/test/jtx/directory.h index 3abcc0562d..6129b79d1c 100644 --- a/src/test/jtx/directory.h +++ b/src/test/jtx/directory.h @@ -10,7 +10,7 @@ #include #include -namespace ripple::test::jtx { +namespace xrpl::test::jtx { /** Directory operations. */ namespace directory { @@ -57,6 +57,6 @@ maximumPageIndex(Env const& env) -> std::uint64_t } // namespace directory -} // namespace ripple::test::jtx +} // namespace xrpl::test::jtx #endif diff --git a/src/test/jtx/domain.h b/src/test/jtx/domain.h index b7199a843c..cb67ce3622 100644 --- a/src/test/jtx/domain.h +++ b/src/test/jtx/domain.h @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -23,4 +23,4 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/envconfig.h b/src/test/jtx/envconfig.h index 4c8476d95f..d6276f2fba 100644 --- a/src/test/jtx/envconfig.h +++ b/src/test/jtx/envconfig.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { // frequently used macros defined here for convenience. @@ -44,7 +44,7 @@ envconfig() /// /// @param modfunc callable function or lambda to modify the default config. /// The first argument to the function must be std::unique_ptr to -/// ripple::Config. The function takes ownership of the unique_ptr and +/// xrpl::Config. The function takes ownership of the unique_ptr and /// relinquishes ownership by returning a unique_ptr. /// /// @param args additional arguments that will be passed to @@ -115,6 +115,6 @@ makeConfig( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/escrow.h b/src/test/jtx/escrow.h index d0d066c2d4..b8490d9534 100644 --- a/src/test/jtx/escrow.h +++ b/src/test/jtx/escrow.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -90,6 +90,6 @@ auto const fulfillment = JTxFieldWrapper(sfFulfillment); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/fee.h b/src/test/jtx/fee.h index 17269b1a38..1b3a6ac49c 100644 --- a/src/test/jtx/fee.h +++ b/src/test/jtx/fee.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -51,6 +51,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/flags.h b/src/test/jtx/flags.h index 7b6be9fe22..6b8c230a79 100644 --- a/src/test/jtx/flags.h +++ b/src/test/jtx/flags.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { class flags_helper @@ -140,6 +140,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index 0fe9bd25df..b620126b0f 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -59,7 +59,7 @@ AMM::AMM( , msig_(ms) , fee_(fee) , ammAccount_(create(tfee, flags, seq, ter)) - , lptIssue_(ripple::ammLPTIssue( + , lptIssue_(xrpl::ammLPTIssue( asset1_.issue().currency, asset2_.issue().currency, ammAccount_)) @@ -832,4 +832,4 @@ ammClawback( } // namespace amm } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/AMMTest.cpp b/src/test/jtx/impl/AMMTest.cpp index 3bdc8e041a..790762d3df 100644 --- a/src/test/jtx/impl/AMMTest.cpp +++ b/src/test/jtx/impl/AMMTest.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -280,4 +280,4 @@ AMMTest::find_paths( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/Account.cpp b/src/test/jtx/impl/Account.cpp index 6cab28245d..232c9d4e6c 100644 --- a/src/test/jtx/impl/Account.cpp +++ b/src/test/jtx/impl/Account.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -85,4 +85,4 @@ Account::operator[](std::string const& s) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index 311a5dde3a..ccef0f0398 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -28,7 +28,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -673,4 +673,4 @@ Env::disableFeature(uint256 const feature) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/JSONRPCClient.cpp b/src/test/jtx/impl/JSONRPCClient.cpp index 7374128e02..df41ed39be 100644 --- a/src/test/jtx/impl/JSONRPCClient.cpp +++ b/src/test/jtx/impl/JSONRPCClient.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class JSONRPCClient : public AbstractClient @@ -147,4 +147,4 @@ makeJSONRPCClient(Config const& cfg, unsigned rpc_version) } } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/Oracle.cpp b/src/test/jtx/impl/Oracle.cpp index e3396f3ebc..03271cc9ad 100644 --- a/src/test/jtx/impl/Oracle.cpp +++ b/src/test/jtx/impl/Oracle.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace oracle { @@ -358,4 +358,4 @@ validDocumentID(AnyValue const& v) } // namespace oracle } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/TestHelpers.cpp b/src/test/jtx/impl/TestHelpers.cpp index 4dfc5fb7b1..4a9d425f01 100644 --- a/src/test/jtx/impl/TestHelpers.cpp +++ b/src/test/jtx/impl/TestHelpers.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -486,4 +486,4 @@ pay(AccountID const& account, } // namespace loan } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/WSClient.cpp b/src/test/jtx/impl/WSClient.cpp index 5f9f123f81..878846b41d 100644 --- a/src/test/jtx/impl/WSClient.cpp +++ b/src/test/jtx/impl/WSClient.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class WSClientImpl : public WSClient @@ -311,4 +311,4 @@ makeWSClient( } } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/account_txn_id.cpp b/src/test/jtx/impl/account_txn_id.cpp index e2c05b4bc7..ceda6e7b50 100644 --- a/src/test/jtx/impl/account_txn_id.cpp +++ b/src/test/jtx/impl/account_txn_id.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -13,4 +13,4 @@ account_txn_id::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/acctdelete.cpp b/src/test/jtx/impl/acctdelete.cpp index ab613671da..47ee1c39a6 100644 --- a/src/test/jtx/impl/acctdelete.cpp +++ b/src/test/jtx/impl/acctdelete.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -42,4 +42,4 @@ incLgrSeqForAccDel(jtx::Env& env, jtx::Account const& acc, std::uint32_t margin) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/amount.cpp b/src/test/jtx/impl/amount.cpp index 08836e4aa3..2548a4423b 100644 --- a/src/test/jtx/impl/amount.cpp +++ b/src/test/jtx/impl/amount.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -115,4 +115,4 @@ any_t const any{}; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/attester.cpp b/src/test/jtx/impl/attester.cpp index 2937aca785..1d00767f0c 100644 --- a/src/test/jtx/impl/attester.cpp +++ b/src/test/jtx/impl/attester.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -59,4 +59,4 @@ sign_create_account_attestation( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/balance.cpp b/src/test/jtx/impl/balance.cpp index e3ab97950b..4449be223c 100644 --- a/src/test/jtx/impl/balance.cpp +++ b/src/test/jtx/impl/balance.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -74,4 +74,4 @@ balance::operator()(Env& env) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/batch.cpp b/src/test/jtx/impl/batch.cpp index b728ff391b..e0a52d0218 100644 --- a/src/test/jtx/impl/batch.cpp +++ b/src/test/jtx/impl/batch.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -81,7 +81,7 @@ sig::operator()(Env& env, JTx& jt) const Serializer msg; serializeBatch(msg, stx.getFlags(), stx.getBatchTransactionIDs()); - auto const sig = ripple::sign( + auto const sig = xrpl::sign( *publicKeyType(e.sig.pk().slice()), e.sig.sk(), msg.slice()); jo[sfTxnSignature.getJsonName()] = strHex(Slice{sig.data(), sig.size()}); @@ -121,7 +121,7 @@ msig::operator()(Env& env, JTx& jt) const Serializer msg; serializeBatch(msg, stx.getFlags(), stx.getBatchTransactionIDs()); finishMultiSigningData(e.acct.id(), msg); - auto const sig = ripple::sign( + auto const sig = xrpl::sign( *publicKeyType(e.sig.pk().slice()), e.sig.sk(), msg.slice()); iso[sfTxnSignature.getJsonName()] = strHex(Slice{sig.data(), sig.size()}); @@ -132,4 +132,4 @@ msig::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/check.cpp b/src/test/jtx/impl/check.cpp index f9de30a8ed..769771861d 100644 --- a/src/test/jtx/impl/check.cpp +++ b/src/test/jtx/impl/check.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -51,4 +51,4 @@ cancel(jtx::Account const& dest, uint256 const& checkId) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/creds.cpp b/src/test/jtx/impl/creds.cpp index b5b65c4445..f93d951e48 100644 --- a/src/test/jtx/impl/creds.cpp +++ b/src/test/jtx/impl/creds.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -84,4 +84,4 @@ ledgerEntry(jtx::Env& env, std::string const& credIdx) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/delegate.cpp b/src/test/jtx/impl/delegate.cpp index 62407776c4..7cca9aa738 100644 --- a/src/test/jtx/impl/delegate.cpp +++ b/src/test/jtx/impl/delegate.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -45,4 +45,4 @@ entry(jtx::Env& env, jtx::Account const& account, jtx::Account const& authorize) } // namespace delegate } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/delivermin.cpp b/src/test/jtx/impl/delivermin.cpp index 7ddccc9c91..5ad98edd09 100644 --- a/src/test/jtx/impl/delivermin.cpp +++ b/src/test/jtx/impl/delivermin.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -14,4 +14,4 @@ delivermin::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/deposit.cpp b/src/test/jtx/impl/deposit.cpp index ba947f48fb..7a49bee06a 100644 --- a/src/test/jtx/impl/deposit.cpp +++ b/src/test/jtx/impl/deposit.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -74,4 +74,4 @@ unauthCredentials( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/dids.cpp b/src/test/jtx/impl/dids.cpp index 6257a0cddb..bb782bcd43 100644 --- a/src/test/jtx/impl/dids.cpp +++ b/src/test/jtx/impl/dids.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -43,4 +43,4 @@ del(jtx::Account const& account) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/directory.cpp b/src/test/jtx/impl/directory.cpp index 275ce2c7b3..bb44b8d782 100644 --- a/src/test/jtx/impl/directory.cpp +++ b/src/test/jtx/impl/directory.cpp @@ -2,7 +2,7 @@ #include -namespace ripple::test::jtx { +namespace xrpl::test::jtx { /** Directory operations. */ namespace directory { @@ -123,4 +123,4 @@ adjustOwnerNode(ApplyView& view, uint256 key, std::uint64_t page) } // namespace directory -} // namespace ripple::test::jtx +} // namespace xrpl::test::jtx diff --git a/src/test/jtx/impl/domain.cpp b/src/test/jtx/impl/domain.cpp index d186fb950c..91568783d2 100644 --- a/src/test/jtx/impl/domain.cpp +++ b/src/test/jtx/impl/domain.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -14,4 +14,4 @@ domain::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/envconfig.cpp b/src/test/jtx/impl/envconfig.cpp index 8cf416a4c5..67bbe3b457 100644 --- a/src/test/jtx/impl/envconfig.cpp +++ b/src/test/jtx/impl/envconfig.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { std::atomic envUseIPv4{false}; @@ -156,4 +156,4 @@ makeConfig( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/escrow.cpp b/src/test/jtx/impl/escrow.cpp index 742bea6afa..067c304178 100644 --- a/src/test/jtx/impl/escrow.cpp +++ b/src/test/jtx/impl/escrow.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -51,7 +51,7 @@ rate(Env& env, Account const& account, std::uint32_t const& seq) { auto const sle = env.le(keylet::escrow(account.id(), seq)); if (sle->isFieldPresent(sfTransferRate)) - return ripple::Rate((*sle)[sfTransferRate]); + return xrpl::Rate((*sle)[sfTransferRate]); return Rate{0}; } @@ -60,4 +60,4 @@ rate(Env& env, Account const& account, std::uint32_t const& seq) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/fee.cpp b/src/test/jtx/impl/fee.cpp index 8ce1dda6af..2b1ac6c398 100644 --- a/src/test/jtx/impl/fee.cpp +++ b/src/test/jtx/impl/fee.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -21,4 +21,4 @@ fee::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/flags.cpp b/src/test/jtx/impl/flags.cpp index 8ee7e4cffa..11e7831f55 100644 --- a/src/test/jtx/impl/flags.cpp +++ b/src/test/jtx/impl/flags.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -45,4 +45,4 @@ nflags::operator()(Env& env) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/invoice_id.cpp b/src/test/jtx/impl/invoice_id.cpp index 47eff96cb2..6d6dae0fbf 100644 --- a/src/test/jtx/impl/invoice_id.cpp +++ b/src/test/jtx/impl/invoice_id.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -13,4 +13,4 @@ invoice_id::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/jtx_json.cpp b/src/test/jtx/impl/jtx_json.cpp index 1e39ec2dda..c39503d038 100644 --- a/src/test/jtx/impl/jtx_json.cpp +++ b/src/test/jtx/impl/jtx_json.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -32,4 +32,4 @@ json::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/last_ledger_sequence.cpp b/src/test/jtx/impl/last_ledger_sequence.cpp index 1a00f7d4d9..5f29282ad6 100644 --- a/src/test/jtx/impl/last_ledger_sequence.cpp +++ b/src/test/jtx/impl/last_ledger_sequence.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -12,4 +12,4 @@ last_ledger_seq::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/ledgerStateFixes.cpp b/src/test/jtx/impl/ledgerStateFixes.cpp index 704da218e8..f1e6b6eda1 100644 --- a/src/test/jtx/impl/ledgerStateFixes.cpp +++ b/src/test/jtx/impl/ledgerStateFixes.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -27,4 +27,4 @@ nftPageLinks(jtx::Account const& acct, jtx::Account const& owner) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/memo.cpp b/src/test/jtx/impl/memo.cpp index 10bcede507..c815b916d7 100644 --- a/src/test/jtx/impl/memo.cpp +++ b/src/test/jtx/impl/memo.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -81,4 +81,4 @@ memontype::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/mpt.cpp b/src/test/jtx/impl/mpt.cpp index fc831790f1..adffa8548a 100644 --- a/src/test/jtx/impl/mpt.cpp +++ b/src/test/jtx/impl/mpt.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -595,7 +595,7 @@ MPTTester::mpt(std::int64_t amount) const { if (!id_) Throw("MPT has not been created"); - return ripple::test::jtx::MPT(issuer_.name(), *id_)(amount); + return xrpl::test::jtx::MPT(issuer_.name(), *id_)(amount); } MPTTester::operator Asset() const @@ -651,4 +651,4 @@ MPTTester::operator()(std::uint64_t amount) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/multisign.cpp b/src/test/jtx/impl/multisign.cpp index 68662b114b..61af11fb3a 100644 --- a/src/test/jtx/impl/multisign.cpp +++ b/src/test/jtx/impl/multisign.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -78,7 +78,7 @@ msig::operator()(Env& env, JTx& jt) const jo[jss::SigningPubKey] = strHex(e.sig.pk().slice()); Serializer ss{buildMultiSigningData(*st, e.acct.id())}; - auto const sig = ripple::sign( + auto const sig = xrpl::sign( *publicKeyType(e.sig.pk().slice()), e.sig.sk(), ss.slice()); jo[sfTxnSignature.getJsonName()] = strHex(Slice{sig.data(), sig.size()}); @@ -92,4 +92,4 @@ msig::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/offer.cpp b/src/test/jtx/impl/offer.cpp index 69ee933049..251b659f3b 100644 --- a/src/test/jtx/impl/offer.cpp +++ b/src/test/jtx/impl/offer.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -35,4 +35,4 @@ offer_cancel(Account const& account, std::uint32_t offerSeq) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/owners.cpp b/src/test/jtx/impl/owners.cpp index b3690563d2..ad449dab93 100644 --- a/src/test/jtx/impl/owners.cpp +++ b/src/test/jtx/impl/owners.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace detail { std::uint32_t @@ -38,4 +38,4 @@ owners::operator()(Env& env) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/paths.cpp b/src/test/jtx/impl/paths.cpp index 37b59773c0..fd93ebd841 100644 --- a/src/test/jtx/impl/paths.cpp +++ b/src/test/jtx/impl/paths.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -98,4 +98,4 @@ path::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/pay.cpp b/src/test/jtx/impl/pay.cpp index 750a3f2abf..9e927c6270 100644 --- a/src/test/jtx/impl/pay.cpp +++ b/src/test/jtx/impl/pay.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -27,4 +27,4 @@ pay(Account const& account, Account const& to, AnyAmount amount) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/permissioned_dex.cpp b/src/test/jtx/impl/permissioned_dex.cpp index 46c7a58689..87b7896663 100644 --- a/src/test/jtx/impl/permissioned_dex.cpp +++ b/src/test/jtx/impl/permissioned_dex.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -63,4 +63,4 @@ PermissionedDEX::PermissionedDEX(Env& env) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/permissioned_domains.cpp b/src/test/jtx/impl/permissioned_domains.cpp index c57bde620e..aac9dcc05f 100644 --- a/src/test/jtx/impl/permissioned_domains.cpp +++ b/src/test/jtx/impl/permissioned_domains.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace pdomain { @@ -158,4 +158,4 @@ getNewDomain(std::shared_ptr const& meta) } // namespace pdomain } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/quality2.cpp b/src/test/jtx/impl/quality2.cpp index dd2c900389..c202592b9d 100644 --- a/src/test/jtx/impl/quality2.cpp +++ b/src/test/jtx/impl/quality2.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -51,4 +51,4 @@ qualityOutPercent::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/rate.cpp b/src/test/jtx/impl/rate.cpp index 14901e37e4..b4e9b2cb60 100644 --- a/src/test/jtx/impl/rate.cpp +++ b/src/test/jtx/impl/rate.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -23,4 +23,4 @@ rate(Account const& account, double multiplier) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/regkey.cpp b/src/test/jtx/impl/regkey.cpp index 72d7331ce6..a2e2198eee 100644 --- a/src/test/jtx/impl/regkey.cpp +++ b/src/test/jtx/impl/regkey.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -27,4 +27,4 @@ regkey(Account const& account, Account const& signer) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/sendmax.cpp b/src/test/jtx/impl/sendmax.cpp index 4a920f5be0..f117458cfa 100644 --- a/src/test/jtx/impl/sendmax.cpp +++ b/src/test/jtx/impl/sendmax.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -14,4 +14,4 @@ sendmax::operator()(Env& env, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/seq.cpp b/src/test/jtx/impl/seq.cpp index c127029def..99c6ddbf0d 100644 --- a/src/test/jtx/impl/seq.cpp +++ b/src/test/jtx/impl/seq.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -18,4 +18,4 @@ seq::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/sig.cpp b/src/test/jtx/impl/sig.cpp index 6d8a0b42c7..3ea7f669a7 100644 --- a/src/test/jtx/impl/sig.cpp +++ b/src/test/jtx/impl/sig.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -31,4 +31,4 @@ sig::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/tag.cpp b/src/test/jtx/impl/tag.cpp index f9a6128c54..8321322f75 100644 --- a/src/test/jtx/impl/tag.cpp +++ b/src/test/jtx/impl/tag.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -18,4 +18,4 @@ stag::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/testline.cpp b/src/test/jtx/impl/testline.cpp index 722dc33bff..fbcb1d2de7 100644 --- a/src/test/jtx/impl/testline.cpp +++ b/src/test/jtx/impl/testline.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -12,4 +12,4 @@ testline::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/ticket.cpp b/src/test/jtx/impl/ticket.cpp index 60318469fb..2cb1826bbb 100644 --- a/src/test/jtx/impl/ticket.cpp +++ b/src/test/jtx/impl/ticket.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -30,4 +30,4 @@ use::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/token.cpp b/src/test/jtx/impl/token.cpp index 281d8543b9..f74b66f9ae 100644 --- a/src/test/jtx/impl/token.cpp +++ b/src/test/jtx/impl/token.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace token { @@ -72,7 +72,7 @@ getID( // sequence number. nftSeq += env.le(issuer)->at(~sfFirstNFTokenSequence).value_or(env.seq(issuer)); - return ripple::NFTokenMint::createNFTokenID( + return xrpl::NFTokenMint::createNFTokenID( flags, xferFee, issuer, nft::toTaxon(nfTokenTaxon), nftSeq); } @@ -223,4 +223,4 @@ modify(jtx::Account const& account, uint256 const& nftokenID) } // namespace token } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/trust.cpp b/src/test/jtx/impl/trust.cpp index d53f87773c..a553efa7f2 100644 --- a/src/test/jtx/impl/trust.cpp +++ b/src/test/jtx/impl/trust.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -65,4 +65,4 @@ claw( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/txflags.cpp b/src/test/jtx/impl/txflags.cpp index a7f69116d5..7b49f9380b 100644 --- a/src/test/jtx/impl/txflags.cpp +++ b/src/test/jtx/impl/txflags.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -14,4 +14,4 @@ txflags::operator()(Env&, JTx& jt) const } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/utility.cpp b/src/test/jtx/impl/utility.cpp index 92f7b16c8d..81bce576ce 100644 --- a/src/test/jtx/impl/utility.cpp +++ b/src/test/jtx/impl/utility.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -31,7 +31,7 @@ sign(Json::Value& jv, Account const& account, Json::Value& sigObject) Serializer ss; ss.add32(HashPrefix::txSign); parse(jv).addWithoutSigningFields(ss); - auto const sig = ripple::sign(account.pk(), account.sk(), ss.slice()); + auto const sig = xrpl::sign(account.pk(), account.sk(), ss.slice()); sigObject[jss::TxnSignature] = strHex(Slice{sig.data(), sig.size()}); } @@ -97,4 +97,4 @@ cmdToJSONRPC( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/vault.cpp b/src/test/jtx/impl/vault.cpp index a1295ba887..90250aece0 100644 --- a/src/test/jtx/impl/vault.cpp +++ b/src/test/jtx/impl/vault.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -81,4 +81,4 @@ Vault::clawback(ClawbackArgs const& args) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/impl/xchain_bridge.cpp b/src/test/jtx/impl/xchain_bridge.cpp index 5cfb6e4a11..cc6be6c737 100644 --- a/src/test/jtx/impl/xchain_bridge.cpp +++ b/src/test/jtx/impl/xchain_bridge.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -486,4 +486,4 @@ XChainBridgeObjects::createBridgeObjects(Env& mcEnv, Env& scEnv) } } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/invoice_id.h b/src/test/jtx/invoice_id.h index 492bb4a500..bdf1aa4250 100644 --- a/src/test/jtx/invoice_id.h +++ b/src/test/jtx/invoice_id.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -22,5 +22,5 @@ public: }; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/jtx_json.h b/src/test/jtx/jtx_json.h index 4334db58f8..32fd3c8d30 100644 --- a/src/test/jtx/jtx_json.h +++ b/src/test/jtx/jtx_json.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -40,6 +40,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/last_ledger_sequence.h b/src/test/jtx/last_ledger_sequence.h index 59e4b9f401..6544294bd6 100644 --- a/src/test/jtx/last_ledger_sequence.h +++ b/src/test/jtx/last_ledger_sequence.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -23,6 +23,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/ledgerStateFix.h b/src/test/jtx/ledgerStateFix.h index c1ab04f249..f93c1bc3d8 100644 --- a/src/test/jtx/ledgerStateFix.h +++ b/src/test/jtx/ledgerStateFix.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -20,6 +20,6 @@ nftPageLinks(jtx::Account const& acct, jtx::Account const& owner); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/memo.h b/src/test/jtx/memo.h index 4a1990e079..377dcbec4e 100644 --- a/src/test/jtx/memo.h +++ b/src/test/jtx/memo.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -124,6 +124,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/mpt.h b/src/test/jtx/mpt.h index f9c58ebc9e..2f6bbb9ea8 100644 --- a/src/test/jtx/mpt.h +++ b/src/test/jtx/mpt.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -313,6 +313,6 @@ private: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/multisign.h b/src/test/jtx/multisign.h index 68dc35442b..8582b27a77 100644 --- a/src/test/jtx/multisign.h +++ b/src/test/jtx/multisign.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -118,6 +118,6 @@ using siglists = owner_count; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/noop.h b/src/test/jtx/noop.h index 70be63052a..3ef3a57c4b 100644 --- a/src/test/jtx/noop.h +++ b/src/test/jtx/noop.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -16,6 +16,6 @@ noop(Account const& account) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/offer.h b/src/test/jtx/offer.h index 45dd358375..8b01a9381b 100644 --- a/src/test/jtx/offer.h +++ b/src/test/jtx/offer.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -24,6 +24,6 @@ offer_cancel(Account const& account, std::uint32_t offerSeq); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/owners.h b/src/test/jtx/owners.h index 326835d507..fabaa148e4 100644 --- a/src/test/jtx/owners.h +++ b/src/test/jtx/owners.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -74,6 +74,6 @@ using offers = owner_count; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/paths.h b/src/test/jtx/paths.h index 2ea4b623fc..b603db3f7b 100644 --- a/src/test/jtx/paths.h +++ b/src/test/jtx/paths.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -94,6 +94,6 @@ path::append(T const& t, Args const&... args) } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/pay.h b/src/test/jtx/pay.h index 6ebcd25b0c..4ef13d72a3 100644 --- a/src/test/jtx/pay.h +++ b/src/test/jtx/pay.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -18,6 +18,6 @@ pay(Account const& account, Account const& to, AnyAmount amount); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/permissioned_dex.h b/src/test/jtx/permissioned_dex.h index b5c81a83ea..2023342ded 100644 --- a/src/test/jtx/permissioned_dex.h +++ b/src/test/jtx/permissioned_dex.h @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -31,4 +31,4 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/jtx/permissioned_domains.h b/src/test/jtx/permissioned_domains.h index 1cb81005c1..c0adacd0c5 100644 --- a/src/test/jtx/permissioned_domains.h +++ b/src/test/jtx/permissioned_domains.h @@ -5,13 +5,13 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace pdomain { // Helpers for PermissionedDomains testing -using Credential = ripple::test::jtx::deposit::AuthorizeCredentials; +using Credential = xrpl::test::jtx::deposit::AuthorizeCredentials; using Credentials = std::vector; // helpers @@ -51,6 +51,6 @@ getNewDomain(std::shared_ptr const& meta); } // namespace pdomain } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/prop.h b/src/test/jtx/prop.h index 67a8e3f45c..3478e23d9b 100644 --- a/src/test/jtx/prop.h +++ b/src/test/jtx/prop.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -30,6 +30,6 @@ struct prop } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/quality.h b/src/test/jtx/quality.h index c05ccb0404..c112ad9934 100644 --- a/src/test/jtx/quality.h +++ b/src/test/jtx/quality.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -65,6 +65,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/rate.h b/src/test/jtx/rate.h index 1f0abd3e46..2ed8cec6f2 100644 --- a/src/test/jtx/rate.h +++ b/src/test/jtx/rate.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -15,6 +15,6 @@ rate(Account const& account, double multiplier); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/regkey.h b/src/test/jtx/regkey.h index 3f9d10596c..b3ab9a0ed9 100644 --- a/src/test/jtx/regkey.h +++ b/src/test/jtx/regkey.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -20,6 +20,6 @@ regkey(Account const& account, Account const& signer); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/require.h b/src/test/jtx/require.h index 3538df2cbc..21ff8a29ec 100644 --- a/src/test/jtx/require.h +++ b/src/test/jtx/require.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -63,6 +63,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/requires.h b/src/test/jtx/requires.h index 4e330c63cc..379c5ad67d 100644 --- a/src/test/jtx/requires.h +++ b/src/test/jtx/requires.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -15,6 +15,6 @@ using requires_t = std::vector; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/rpc.h b/src/test/jtx/rpc.h index a525b04e6b..5a7c205aac 100644 --- a/src/test/jtx/rpc.h +++ b/src/test/jtx/rpc.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -63,6 +63,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/sendmax.h b/src/test/jtx/sendmax.h index f1cc0b2d8c..9082ef9ddd 100644 --- a/src/test/jtx/sendmax.h +++ b/src/test/jtx/sendmax.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -26,6 +26,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/seq.h b/src/test/jtx/seq.h index 6e174b5f97..102961db0e 100644 --- a/src/test/jtx/seq.h +++ b/src/test/jtx/seq.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -36,6 +36,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/sig.h b/src/test/jtx/sig.h index 1b21607d4d..27d18b322e 100644 --- a/src/test/jtx/sig.h +++ b/src/test/jtx/sig.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -60,6 +60,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/tag.h b/src/test/jtx/tag.h index 586eae1f27..688d2e92c1 100644 --- a/src/test/jtx/tag.h +++ b/src/test/jtx/tag.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -41,6 +41,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/tags.h b/src/test/jtx/tags.h index 631d40bb89..445bdebcb4 100644 --- a/src/test/jtx/tags.h +++ b/src/test/jtx/tags.h @@ -1,7 +1,7 @@ #ifndef XRPL_TEST_JTX_TAGS_H_INCLUDED #define XRPL_TEST_JTX_TAGS_H_INCLUDED -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -43,6 +43,6 @@ static increment_t const increment; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/ter.h b/src/test/jtx/ter.h index 9200b2a265..f13c2a90e6 100644 --- a/src/test/jtx/ter.h +++ b/src/test/jtx/ter.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -35,6 +35,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/testline.h b/src/test/jtx/testline.h index 65dd3b7d92..beda870345 100644 --- a/src/test/jtx/testline.h +++ b/src/test/jtx/testline.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -29,6 +29,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/ticket.h b/src/test/jtx/ticket.h index 881757df5c..10cb772bbd 100644 --- a/src/test/jtx/ticket.h +++ b/src/test/jtx/ticket.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -47,6 +47,6 @@ using tickets = owner_count; } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/token.h b/src/test/jtx/token.h index 0f5921d080..5280799582 100644 --- a/src/test/jtx/token.h +++ b/src/test/jtx/token.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -227,6 +227,6 @@ modify(jtx::Account const& account, uint256 const& nftokenID); } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_TEST_JTX_NFT_H_INCLUDED diff --git a/src/test/jtx/trust.h b/src/test/jtx/trust.h index 667ecc9c2e..69a3e7ba53 100644 --- a/src/test/jtx/trust.h +++ b/src/test/jtx/trust.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -30,6 +30,6 @@ claw( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/txflags.h b/src/test/jtx/txflags.h index 26a89c0f76..75a0d2740b 100644 --- a/src/test/jtx/txflags.h +++ b/src/test/jtx/txflags.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -24,6 +24,6 @@ public: } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index 25708d8bb3..a824f86c1a 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -60,6 +60,6 @@ cmdToJSONRPC( } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/vault.h b/src/test/jtx/vault.h index 5ffcd620c1..485940f9f4 100644 --- a/src/test/jtx/vault.h +++ b/src/test/jtx/vault.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -85,6 +85,6 @@ struct Vault } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/jtx/xchain_bridge.h b/src/test/jtx/xchain_bridge.h index be5e4b4a5f..dfd6073ca4 100644 --- a/src/test/jtx/xchain_bridge.h +++ b/src/test/jtx/xchain_bridge.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { @@ -237,6 +237,6 @@ struct XChainBridgeObjects } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/ledger/BookDirs_test.cpp b/src/test/ledger/BookDirs_test.cpp index 7157d17301..4f5cf5cca2 100644 --- a/src/test/ledger/BookDirs_test.cpp +++ b/src/test/ledger/BookDirs_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct BookDirs_test : public beast::unit_test::suite @@ -91,7 +91,7 @@ struct BookDirs_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(BookDirs, ledger, ripple); +BEAST_DEFINE_TESTSUITE(BookDirs, ledger, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/ledger/Directory_test.cpp b/src/test/ledger/Directory_test.cpp index 68c3286660..721b919238 100644 --- a/src/test/ledger/Directory_test.cpp +++ b/src/test/ledger/Directory_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct Directory_test : public beast::unit_test::suite @@ -571,7 +571,7 @@ struct Directory_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE_PRIO(Directory, ledger, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(Directory, ledger, xrpl, 1); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/ledger/PaymentSandbox_test.cpp b/src/test/ledger/PaymentSandbox_test.cpp index 200aac76e2..b5acb38156 100644 --- a/src/test/ledger/PaymentSandbox_test.cpp +++ b/src/test/ledger/PaymentSandbox_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class PaymentSandbox_test : public beast::unit_test::suite @@ -406,7 +406,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PaymentSandbox, ledger, ripple); +BEAST_DEFINE_TESTSUITE(PaymentSandbox, ledger, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/ledger/PendingSaves_test.cpp b/src/test/ledger/PendingSaves_test.cpp index 95b1cc8ab7..ddf371e913 100644 --- a/src/test/ledger/PendingSaves_test.cpp +++ b/src/test/ledger/PendingSaves_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct PendingSaves_test : public beast::unit_test::suite @@ -40,7 +40,7 @@ struct PendingSaves_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(PendingSaves, ledger, ripple); +BEAST_DEFINE_TESTSUITE(PendingSaves, ledger, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/ledger/SkipList_test.cpp b/src/test/ledger/SkipList_test.cpp index 4869036014..12fedea5c1 100644 --- a/src/test/ledger/SkipList_test.cpp +++ b/src/test/ledger/SkipList_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class SkipList_test : public beast::unit_test::suite @@ -87,7 +87,7 @@ class SkipList_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(SkipList, ledger, ripple); +BEAST_DEFINE_TESTSUITE(SkipList, ledger, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/ledger/View_test.cpp b/src/test/ledger/View_test.cpp index a8f3f7fc3b..a486792209 100644 --- a/src/test/ledger/View_test.cpp +++ b/src/test/ledger/View_test.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class View_test : public beast::unit_test::suite @@ -1145,8 +1145,8 @@ class GetAmendments_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(View, ledger, ripple); -BEAST_DEFINE_TESTSUITE(GetAmendments, ledger, ripple); +BEAST_DEFINE_TESTSUITE(View, ledger, xrpl); +BEAST_DEFINE_TESTSUITE(GetAmendments, ledger, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/Backend_test.cpp b/src/test/nodestore/Backend_test.cpp index b65c138305..07b35ed9fc 100644 --- a/src/test/nodestore/Backend_test.cpp +++ b/src/test/nodestore/Backend_test.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -101,7 +101,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Backend, nodestore, ripple); +BEAST_DEFINE_TESTSUITE(Backend, nodestore, xrpl); } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/Basics_test.cpp b/src/test/nodestore/Basics_test.cpp index 350c44ec5d..3a7c6a1fdd 100644 --- a/src/test/nodestore/Basics_test.cpp +++ b/src/test/nodestore/Basics_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { // Tests predictable batches, and NodeObject blob encoding @@ -66,7 +66,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NodeStoreBasic, nodestore, ripple); +BEAST_DEFINE_TESTSUITE(NodeStoreBasic, nodestore, xrpl); } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/Database_test.cpp b/src/test/nodestore/Database_test.cpp index 0efb1e7ba1..e5446374ec 100644 --- a/src/test/nodestore/Database_test.cpp +++ b/src/test/nodestore/Database_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { @@ -28,8 +28,8 @@ public: { testcase("Config"); - using namespace ripple::test; - using namespace ripple::test::jtx; + using namespace xrpl::test; + using namespace xrpl::test::jtx; auto const integrityWarning = "reducing the data integrity guarantees from the " @@ -746,7 +746,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Database, nodestore, ripple); +BEAST_DEFINE_TESTSUITE(Database, nodestore, xrpl); } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/NuDBFactory_test.cpp b/src/test/nodestore/NuDBFactory_test.cpp index 951af7dd5b..b91425259c 100644 --- a/src/test/nodestore/NuDBFactory_test.cpp +++ b/src/test/nodestore/NuDBFactory_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { class NuDBFactory_test : public TestBase @@ -452,7 +452,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NuDBFactory, ripple_core, ripple); +BEAST_DEFINE_TESTSUITE(NuDBFactory, xrpl_core, xrpl); } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/TestBase.h b/src/test/nodestore/TestBase.h index 0675ad85d4..83db83b1df 100644 --- a/src/test/nodestore/TestBase.h +++ b/src/test/nodestore/TestBase.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace NodeStore { /** Binary function that satisfies the strict-weak-ordering requirement. @@ -209,6 +209,6 @@ public: }; } // namespace NodeStore -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/nodestore/Timing_test.cpp b/src/test/nodestore/Timing_test.cpp index e6238925bb..9c91311416 100644 --- a/src/test/nodestore/Timing_test.cpp +++ b/src/test/nodestore/Timing_test.cpp @@ -27,7 +27,7 @@ #define NODESTORE_TIMING_DO_VERIFY 0 #endif -namespace ripple { +namespace xrpl { namespace NodeStore { std::unique_ptr @@ -759,7 +759,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Timing, nodestore, ripple, 1); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Timing, nodestore, xrpl, 1); } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/import_test.cpp b/src/test/nodestore/import_test.cpp index 30aaaa2ea9..9a786801cb 100644 --- a/src/test/nodestore/import_test.cpp +++ b/src/test/nodestore/import_test.cpp @@ -40,7 +40,7 @@ multi(32gb): */ -namespace ripple { +namespace xrpl { namespace detail { @@ -530,11 +530,11 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL(import, nodestore, ripple); +BEAST_DEFINE_TESTSUITE_MANUAL(import, nodestore, xrpl); #endif //------------------------------------------------------------------------------ } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/nodestore/varint_test.cpp b/src/test/nodestore/varint_test.cpp index 148d593aae..7ef624e777 100644 --- a/src/test/nodestore/varint_test.cpp +++ b/src/test/nodestore/varint_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace NodeStore { namespace tests { @@ -52,8 +52,8 @@ public: } }; -BEAST_DEFINE_TESTSUITE(varint, nodestore, ripple); +BEAST_DEFINE_TESTSUITE(varint, nodestore, xrpl); } // namespace tests } // namespace NodeStore -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/ProtocolVersion_test.cpp b/src/test/overlay/ProtocolVersion_test.cpp index d6bbe6282a..507a42eca0 100644 --- a/src/test/overlay/ProtocolVersion_test.cpp +++ b/src/test/overlay/ProtocolVersion_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class ProtocolVersion_test : public beast::unit_test::suite { @@ -79,6 +79,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ProtocolVersion, overlay, ripple); +BEAST_DEFINE_TESTSUITE(ProtocolVersion, overlay, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/cluster_test.cpp b/src/test/overlay/cluster_test.cpp index d29e143cff..4638434233 100644 --- a/src/test/overlay/cluster_test.cpp +++ b/src/test/overlay/cluster_test.cpp @@ -6,10 +6,10 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { -class cluster_test : public ripple::TestSuite +class cluster_test : public xrpl::TestSuite { test::SuiteJournal journal_; @@ -248,7 +248,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(cluster, overlay, ripple); +BEAST_DEFINE_TESTSUITE(cluster, overlay, xrpl); } // namespace tests -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/compression_test.cpp b/src/test/overlay/compression_test.cpp index 4e001115d1..2be69a74c9 100644 --- a/src/test/overlay/compression_test.cpp +++ b/src/test/overlay/compression_test.cpp @@ -30,17 +30,17 @@ #include -namespace ripple { +namespace xrpl { namespace test { -using namespace ripple::test; -using namespace ripple::test::jtx; +using namespace xrpl::test; +using namespace xrpl::test::jtx; static uint256 ledgerHash(LedgerHeader const& info) { - return ripple::sha512Half( + return xrpl::sha512Half( HashPrefix::ledgerMaster, std::uint32_t(info.seq), std::uint64_t(info.drops.drops()), @@ -92,8 +92,8 @@ public: } boost::system::error_code ec; - auto header = ripple::detail::parseMessageHeader( - ec, buffers.data(), buffer.size()); + auto header = + xrpl::detail::parseMessageHeader(ec, buffers.data(), buffer.size()); BEAST_EXPECT(header); @@ -109,7 +109,7 @@ public: ZeroCopyInputStream stream(buffers.data()); stream.Skip(header->header_size); - auto decompressedSize = ripple::compression::decompress( + auto decompressedSize = xrpl::compression::decompress( stream, header->payload_wire_size, decompressed.data(), @@ -121,7 +121,7 @@ public: proto1->ParseFromArray(decompressed.data(), decompressedSize)); auto uncompressed = m.getBuffer(Compressed::Off); BEAST_EXPECT(std::equal( - uncompressed.begin() + ripple::compression::headerBytes, + uncompressed.begin() + xrpl::compression::headerBytes, uncompressed.end(), decompressed.begin())); } @@ -223,10 +223,10 @@ public: auto getLedger = std::make_shared(); getLedger->set_itype(protocol::liTS_CANDIDATE); getLedger->set_ltype(protocol::TMLedgerType::ltACCEPTED); - uint256 const hash(ripple::sha512Half(123456789)); + uint256 const hash(xrpl::sha512Half(123456789)); getLedger->set_ledgerhash(hash.begin(), hash.size()); getLedger->set_ledgerseq(123456789); - ripple::SHAMapNodeID sha(64, hash); + xrpl::SHAMapNodeID sha(64, hash); getLedger->add_nodeids(sha.getRawString()); getLedger->set_requestcookie(123456789); getLedger->set_querytype(protocol::qtINDIRECT); @@ -238,7 +238,7 @@ public: buildLedgerData(uint32_t n, Logs& logs) { auto ledgerData = std::make_shared(); - uint256 const hash(ripple::sha512Half(12356789)); + uint256 const hash(xrpl::sha512Half(12356789)); ledgerData->set_ledgerhash(hash.data(), hash.size()); ledgerData->set_ledgerseq(123456789); ledgerData->set_type(protocol::TMLedgerInfoType::liAS_NODE); @@ -255,9 +255,9 @@ public: LedgerHeader info; info.seq = i; info.parentCloseTime = ct; - info.hash = ripple::sha512Half(i); - info.txHash = ripple::sha512Half(i + 1); - info.accountHash = ripple::sha512Half(i + 2); + info.hash = xrpl::sha512Half(i); + info.txHash = xrpl::sha512Half(i + 1); + info.accountHash = xrpl::sha512Half(i + 2); info.parentHash = parentHash; info.drops = XRPAmount(10); info.closeTimeResolution = resolution; @@ -265,7 +265,7 @@ public: ct += resolution; parentHash = ledgerHash(info); Serializer nData; - ripple::addRaw(info, nData); + xrpl::addRaw(info, nData); ledgerData->add_nodes()->set_nodedata( nData.getDataPtr(), nData.getLength()); } @@ -282,15 +282,15 @@ public: TMGetObjectByHash_ObjectType_otTRANSACTION); getObject->set_query(true); getObject->set_seq(123456789); - uint256 hash(ripple::sha512Half(123456789)); + uint256 hash(xrpl::sha512Half(123456789)); getObject->set_ledgerhash(hash.data(), hash.size()); getObject->set_fat(true); for (int i = 0; i < 100; i++) { - uint256 hash(ripple::sha512Half(i)); + uint256 hash(xrpl::sha512Half(i)); auto object = getObject->add_objects(); object->set_hash(hash.data(), hash.size()); - ripple::SHAMapNodeID sha(64, hash); + xrpl::SHAMapNodeID sha(64, hash); object->set_nodeid(sha.getRawString()); object->set_index(""); object->set_data(""); @@ -323,7 +323,7 @@ public: list->set_manifest(s.data(), s.size()); list->set_version(3); STObject signature(sfSignature); - ripple::sign( + xrpl::sign( st, HashPrefix::manifest, KeyType::ed25519, std::get<1>(signing)); Serializer s1; st.add(s1); @@ -356,7 +356,7 @@ public: list->set_manifest(s.data(), s.size()); list->set_version(4); STObject signature(sfSignature); - ripple::sign( + xrpl::sign( st, HashPrefix::manifest, KeyType::ed25519, std::get<1>(signing)); Serializer s1; st.add(s1); @@ -469,7 +469,7 @@ public: boost::asio::ip::make_address("172.1.1.100"); auto env = getEnv(outboundEnable); - auto request = ripple::makeRequest( + auto request = xrpl::makeRequest( true, env->app().config().COMPRESSION, false, @@ -489,7 +489,7 @@ public: env.reset(); env = getEnv(inboundEnable); - auto http_resp = ripple::makeResponse( + auto http_resp = xrpl::makeResponse( true, http_request, addr, @@ -518,7 +518,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL(compression, overlay, ripple); +BEAST_DEFINE_TESTSUITE_MANUAL(compression, overlay, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/handshake_test.cpp b/src/test/overlay/handshake_test.cpp index b3b7c261a7..8e2d5d5ec1 100644 --- a/src/test/overlay/handshake_test.cpp +++ b/src/test/overlay/handshake_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { @@ -40,7 +40,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(handshake, overlay, ripple); +BEAST_DEFINE_TESTSUITE(handshake, overlay, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/reduce_relay_test.cpp b/src/test/overlay/reduce_relay_test.cpp index 8447a9fc9f..6af27ea8f1 100644 --- a/src/test/overlay/reduce_relay_test.cpp +++ b/src/test/overlay/reduce_relay_test.cpp @@ -19,7 +19,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -1646,7 +1646,7 @@ vp_base_squelch_max_selected_peers=2 boost::asio::ip::make_address("172.1.1.100"); setEnv(outboundEnable); - auto request = ripple::makeRequest( + auto request = xrpl::makeRequest( true, env_.app().config().COMPRESSION, false, @@ -1665,7 +1665,7 @@ vp_base_squelch_max_selected_peers=2 BEAST_EXPECT(!(peerEnabled ^ inboundEnabled)); setEnv(inboundEnable); - auto http_resp = ripple::makeResponse( + auto http_resp = xrpl::makeResponse( true, http_request, addr, @@ -1736,9 +1736,9 @@ class reduce_relay_simulate_test : public reduce_relay_test } }; -BEAST_DEFINE_TESTSUITE(reduce_relay, overlay, ripple); -BEAST_DEFINE_TESTSUITE_MANUAL(reduce_relay_simulate, overlay, ripple); +BEAST_DEFINE_TESTSUITE(reduce_relay, overlay, xrpl); +BEAST_DEFINE_TESTSUITE_MANUAL(reduce_relay_simulate, overlay, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/short_read_test.cpp b/src/test/overlay/short_read_test.cpp index 05193e525c..2db35dd93e 100644 --- a/src/test/overlay/short_read_test.cpp +++ b/src/test/overlay/short_read_test.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { /* Findings from the test: @@ -638,6 +638,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(short_read, overlay, ripple); +BEAST_DEFINE_TESTSUITE(short_read, overlay, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/traffic_count_test.cpp b/src/test/overlay/traffic_count_test.cpp index d8c5636b59..a8948879d9 100644 --- a/src/test/overlay/traffic_count_test.cpp +++ b/src/test/overlay/traffic_count_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -132,7 +132,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(traffic_count, overlay, ripple); +BEAST_DEFINE_TESTSUITE(traffic_count, overlay, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/overlay/tx_reduce_relay_test.cpp b/src/test/overlay/tx_reduce_relay_test.cpp index 1ca9e7aac6..7286b3fd90 100644 --- a/src/test/overlay/tx_reduce_relay_test.cpp +++ b/src/test/overlay/tx_reduce_relay_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -265,6 +265,6 @@ private: } }; -BEAST_DEFINE_TESTSUITE(tx_reduce_relay, overlay, ripple); +BEAST_DEFINE_TESTSUITE(tx_reduce_relay, overlay, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/peerfinder/Livecache_test.cpp b/src/test/peerfinder/Livecache_test.cpp index 2218191b56..b9487d8ce7 100644 --- a/src/test/peerfinder/Livecache_test.cpp +++ b/src/test/peerfinder/Livecache_test.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { bool @@ -120,9 +120,7 @@ public: constexpr auto num_eps = 40; Livecache<> c(clock_, journal_); for (auto i = 0; i < num_eps; ++i) - add(beast::IP::randomEP(true), - c, - ripple::rand_int()); + add(beast::IP::randomEP(true), c, xrpl::rand_int()); auto h = c.hops.histogram(); if (!BEAST_EXPECT(!h.empty())) return; @@ -146,9 +144,9 @@ public: for (auto i = 0; i < 100; ++i) add(beast::IP::randomEP(true), c, - ripple::rand_int(Tuning::maxHops + 1)); + xrpl::rand_int(Tuning::maxHops + 1)); - using at_hop = std::vector; + using at_hop = std::vector; using all_hops = std::array; auto cmp_EP = [](Endpoint const& a, Endpoint const& b) { @@ -220,7 +218,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Livecache, peerfinder, ripple); +BEAST_DEFINE_TESTSUITE(Livecache, peerfinder, xrpl); } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/test/peerfinder/PeerFinder_test.cpp b/src/test/peerfinder/PeerFinder_test.cpp index 96052bdb1a..7ff1b9de01 100644 --- a/src/test/peerfinder/PeerFinder_test.cpp +++ b/src/test/peerfinder/PeerFinder_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { class PeerFinder_test : public beast::unit_test::suite @@ -395,7 +395,7 @@ public: std::uint16_t expectOut, std::uint16_t expectIn, std::uint16_t expectIpLimit) { - ripple::Config c; + xrpl::Config c; testcase(test); @@ -468,7 +468,7 @@ public: testcase("invalid config"); auto run = [&](std::string const& toLoad) { - ripple::Config c; + xrpl::Config c; try { c.loadFromString(toLoad); @@ -524,7 +524,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PeerFinder, peerfinder, ripple); +BEAST_DEFINE_TESTSUITE(PeerFinder, peerfinder, xrpl); } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/ApiVersion_test.cpp b/src/test/protocol/ApiVersion_test.cpp index f9e897ad74..1dc8ef93f7 100644 --- a/src/test/protocol/ApiVersion_test.cpp +++ b/src/test/protocol/ApiVersion_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct ApiVersion_test : beast::unit_test::suite { @@ -49,7 +49,7 @@ struct ApiVersion_test : beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(ApiVersion, protocol, ripple); +BEAST_DEFINE_TESTSUITE(ApiVersion, protocol, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/BuildInfo_test.cpp b/src/test/protocol/BuildInfo_test.cpp index b153e03608..ae06511e85 100644 --- a/src/test/protocol/BuildInfo_test.cpp +++ b/src/test/protocol/BuildInfo_test.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { class BuildInfo_test : public beast::unit_test::suite { @@ -95,5 +95,5 @@ public: } }; -BEAST_DEFINE_TESTSUITE(BuildInfo, protocol, ripple); -} // namespace ripple +BEAST_DEFINE_TESTSUITE(BuildInfo, protocol, xrpl); +} // namespace xrpl diff --git a/src/test/protocol/Hooks_test.cpp b/src/test/protocol/Hooks_test.cpp index 9bbfc4850c..27f455f202 100644 --- a/src/test/protocol/Hooks_test.cpp +++ b/src/test/protocol/Hooks_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class Hooks_test : public beast::unit_test::suite { @@ -174,6 +174,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Hooks, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Hooks, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/InnerObjectFormats_test.cpp b/src/test/protocol/InnerObjectFormats_test.cpp index 5593d4644d..c06524b90e 100644 --- a/src/test/protocol/InnerObjectFormats_test.cpp +++ b/src/test/protocol/InnerObjectFormats_test.cpp @@ -6,7 +6,7 @@ #include // RPC::containsError #include // STParsedJSONObject -namespace ripple { +namespace xrpl { namespace InnerObjectFormatsUnitTestDetail { @@ -182,6 +182,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(InnerObjectFormatsParsedJSON, protocol, ripple); +BEAST_DEFINE_TESTSUITE(InnerObjectFormatsParsedJSON, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/Issue_test.cpp b/src/test/protocol/Issue_test.cpp index cf0b6ff861..eec164f5b6 100644 --- a/src/test/protocol/Issue_test.cpp +++ b/src/test/protocol/Issue_test.cpp @@ -25,7 +25,7 @@ #endif #endif -namespace ripple { +namespace xrpl { class Issue_test : public beast::unit_test::suite { @@ -959,6 +959,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Issue, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Issue, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/Memo_test.cpp b/src/test/protocol/Memo_test.cpp index 415d23190a..706ef79fe2 100644 --- a/src/test/protocol/Memo_test.cpp +++ b/src/test/protocol/Memo_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class Memo_test : public beast::unit_test::suite { @@ -116,6 +116,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Memo, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Memo, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/MultiApiJson_test.cpp b/src/test/protocol/MultiApiJson_test.cpp index fb1549f5fd..52daa0e0a6 100644 --- a/src/test/protocol/MultiApiJson_test.cpp +++ b/src/test/protocol/MultiApiJson_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { namespace { @@ -36,7 +36,7 @@ struct MultiApiJson_test : beast::unit_test::suite void run() override { - using ripple::detail::MultiApiJson; + using xrpl::detail::MultiApiJson; Json::Value const obj1 = makeJson("value", 1); Json::Value const obj2 = makeJson("value", 2); @@ -1049,7 +1049,7 @@ struct MultiApiJson_test : beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(MultiApiJson, protocol, ripple); +BEAST_DEFINE_TESTSUITE(MultiApiJson, protocol, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/PublicKey_test.cpp b/src/test/protocol/PublicKey_test.cpp index 3bc50f2d95..4af21cd037 100644 --- a/src/test/protocol/PublicKey_test.cpp +++ b/src/test/protocol/PublicKey_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { class PublicKey_test : public beast::unit_test::suite { @@ -450,6 +450,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(PublicKey, protocol, ripple); +BEAST_DEFINE_TESTSUITE(PublicKey, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/Quality_test.cpp b/src/test/protocol/Quality_test.cpp index 5c6af14312..840e903ed5 100644 --- a/src/test/protocol/Quality_test.cpp +++ b/src/test/protocol/Quality_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Quality_test : public beast::unit_test::suite { @@ -396,6 +396,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Quality, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Quality, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STAccount_test.cpp b/src/test/protocol/STAccount_test.cpp index 397b150a6c..d469627d51 100644 --- a/src/test/protocol/STAccount_test.cpp +++ b/src/test/protocol/STAccount_test.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { struct STAccount_test : public beast::unit_test::suite { @@ -127,6 +127,6 @@ struct STAccount_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(STAccount, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STAccount, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STAmount_test.cpp b/src/test/protocol/STAmount_test.cpp index 694e351303..796ac91de1 100644 --- a/src/test/protocol/STAmount_test.cpp +++ b/src/test/protocol/STAmount_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class STAmount_test : public beast::unit_test::suite { @@ -1245,6 +1245,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(STAmount, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STAmount, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STInteger_test.cpp b/src/test/protocol/STInteger_test.cpp index 5852fc873c..73b4ca39ef 100644 --- a/src/test/protocol/STInteger_test.cpp +++ b/src/test/protocol/STInteger_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { struct STInteger_test : public beast::unit_test::suite { @@ -139,6 +139,6 @@ struct STInteger_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(STInteger, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STInteger, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STIssue_test.cpp b/src/test/protocol/STIssue_test.cpp index 110c544ec4..d64722712b 100644 --- a/src/test/protocol/STIssue_test.cpp +++ b/src/test/protocol/STIssue_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class STIssue_test : public beast::unit_test::suite @@ -140,7 +140,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(STIssue, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STIssue, protocol, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STNumber_test.cpp b/src/test/protocol/STNumber_test.cpp index af455c6592..1275c756cf 100644 --- a/src/test/protocol/STNumber_test.cpp +++ b/src/test/protocol/STNumber_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { struct STNumber_test : public beast::unit_test::suite { @@ -281,7 +281,7 @@ struct STNumber_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(STNumber, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STNumber, protocol, xrpl); void testCompile(std::ostream& out) @@ -290,4 +290,4 @@ testCompile(std::ostream& out) out << number; } -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STObject_test.cpp b/src/test/protocol/STObject_test.cpp index c0d0297e37..c01297b4e1 100644 --- a/src/test/protocol/STObject_test.cpp +++ b/src/test/protocol/STObject_test.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { class STObject_test : public beast::unit_test::suite { @@ -458,7 +458,7 @@ public: st[sf3] = std::vector{}; BEAST_EXPECT(cst[sf3].size() == 0); } - } // namespace ripple + } // namespace xrpl void testMalformed() @@ -503,6 +503,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(STObject, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STObject, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STParsedJSON_test.cpp b/src/test/protocol/STParsedJSON_test.cpp index 13983444da..9c3a08243b 100644 --- a/src/test/protocol/STParsedJSON_test.cpp +++ b/src/test/protocol/STParsedJSON_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class STParsedJSON_test : public beast::unit_test::suite { @@ -2332,6 +2332,6 @@ class STParsedJSON_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(STParsedJSON, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STParsedJSON, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STTx_test.cpp b/src/test/protocol/STTx_test.cpp index 50cd8c511f..1899b786f9 100644 --- a/src/test/protocol/STTx_test.cpp +++ b/src/test/protocol/STTx_test.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { /** * Return true if the string loosely matches the regex. @@ -1398,7 +1398,7 @@ public: SerialIter tenSit{tenDeep.slice()}; try { - auto stx = std::make_shared(tenSit); + auto stx = std::make_shared(tenSit); fail("STTx construction should have thrown."); } catch (std::runtime_error const& ex) @@ -1417,7 +1417,7 @@ public: SerialIter tooDeepSit{tooDeep.slice()}; try { - auto stx = std::make_shared(tooDeepSit); + auto stx = std::make_shared(tooDeepSit); fail("STTx construction should have thrown."); } catch (std::runtime_error const& ex) @@ -1463,7 +1463,7 @@ public: SerialIter nineSit{nineDeep.slice()}; try { - auto stx = std::make_shared(nineSit); + auto stx = std::make_shared(nineSit); fail("STTx construction should have thrown."); } catch (std::runtime_error const& ex) @@ -1483,7 +1483,7 @@ public: SerialIter tooDeepSit{tooDeep.slice()}; try { - auto stx = std::make_shared(tooDeepSit); + auto stx = std::make_shared(tooDeepSit); fail("STTx construction should have thrown."); } catch (std::runtime_error const& ex) @@ -1512,7 +1512,7 @@ public: { // Verify we have a valid transaction. SerialIter sit{serialized.slice()}; - auto stx = std::make_shared(sit); + auto stx = std::make_shared(sit); } // Tweak the serialized data to change the ClearFlag to @@ -1524,7 +1524,7 @@ public: SerialIter sit{serialized.slice()}; try { - auto stx = std::make_shared(sit); + auto stx = std::make_shared(sit); fail("An exception should have been thrown"); } catch (std::exception const& ex) @@ -1551,9 +1551,9 @@ public: // vary. BEAST_EXPECT(!tx2.ParseFromArray(payload1, sizeof(payload1))); - ripple::SerialIter sit(ripple::makeSlice(tx2.rawtransaction())); + xrpl::SerialIter sit(xrpl::makeSlice(tx2.rawtransaction())); - auto stx = std::make_shared(sit); + auto stx = std::make_shared(sit); fail("An exception should have been thrown"); } catch (std::exception const&) @@ -1563,8 +1563,8 @@ public: try { - ripple::SerialIter sit{payload2}; - auto stx = std::make_shared(sit); + xrpl::SerialIter sit{payload2}; + auto stx = std::make_shared(sit); fail("An exception should have been thrown"); } catch (std::exception const& ex) @@ -1574,8 +1574,8 @@ public: try { - ripple::SerialIter sit{payload3}; - auto stx = std::make_shared(sit); + xrpl::SerialIter sit{payload3}; + auto stx = std::make_shared(sit); fail("An exception should have been thrown"); } catch (std::exception const& ex) @@ -1586,8 +1586,8 @@ public: try { - ripple::SerialIter sit{payload4}; - auto stx = std::make_shared(sit); + xrpl::SerialIter sit{payload4}; + auto stx = std::make_shared(sit); fail("An exception should have been thrown"); } catch (std::exception const& ex) @@ -1837,7 +1837,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(STTx, protocol, ripple); -BEAST_DEFINE_TESTSUITE(InnerObjectFormatsSerializer, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STTx, protocol, xrpl); +BEAST_DEFINE_TESTSUITE(InnerObjectFormatsSerializer, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/STValidation_test.cpp b/src/test/protocol/STValidation_test.cpp index 88956ef2f6..3530d2f34a 100644 --- a/src/test/protocol/STValidation_test.cpp +++ b/src/test/protocol/STValidation_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class STValidation_test : public beast::unit_test::suite { @@ -187,7 +187,7 @@ public: try { SerialIter sit{payload1}; - auto val = std::make_shared( + auto val = std::make_shared( sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false); fail("An exception should have been thrown"); } @@ -202,7 +202,7 @@ public: try { SerialIter sit{payload2}; - auto val = std::make_shared( + auto val = std::make_shared( sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false); fail("An exception should have been thrown"); } @@ -215,7 +215,7 @@ public: try { SerialIter sit{payload3}; - auto val = std::make_shared( + auto val = std::make_shared( sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false); fail("An exception should have been thrown"); } @@ -228,7 +228,7 @@ public: try { SerialIter sit{payload4}; - auto val = std::make_shared( + auto val = std::make_shared( sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false); fail("An exception should have been thrown"); } @@ -330,6 +330,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(STValidation, protocol, ripple); +BEAST_DEFINE_TESTSUITE(STValidation, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/SecretKey_test.cpp b/src/test/protocol/SecretKey_test.cpp index 803988e9d5..e7bdcc1916 100644 --- a/src/test/protocol/SecretKey_test.cpp +++ b/src/test/protocol/SecretKey_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { class SecretKey_test : public beast::unit_test::suite { @@ -1494,6 +1494,6 @@ inline static TestKeyData const ed25519TestVectors[] = { // clang-format on }; -BEAST_DEFINE_TESTSUITE(SecretKey, protocol, ripple); +BEAST_DEFINE_TESTSUITE(SecretKey, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/Seed_test.cpp b/src/test/protocol/Seed_test.cpp index dfac5416d9..65428295f8 100644 --- a/src/test/protocol/Seed_test.cpp +++ b/src/test/protocol/Seed_test.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class Seed_test : public beast::unit_test::suite { @@ -339,6 +339,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Seed, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Seed, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/SeqProxy_test.cpp b/src/test/protocol/SeqProxy_test.cpp index fefea5a638..d922dd1182 100644 --- a/src/test/protocol/SeqProxy_test.cpp +++ b/src/test/protocol/SeqProxy_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { struct SeqProxy_test : public beast::unit_test::suite { @@ -217,6 +217,6 @@ struct SeqProxy_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(SeqProxy, protocol, ripple); +BEAST_DEFINE_TESTSUITE(SeqProxy, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/Serializer_test.cpp b/src/test/protocol/Serializer_test.cpp index 1b99266dc4..c5b56c3029 100644 --- a/src/test/protocol/Serializer_test.cpp +++ b/src/test/protocol/Serializer_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { struct Serializer_test : public beast::unit_test::suite { @@ -45,6 +45,6 @@ struct Serializer_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Serializer, protocol, ripple); +BEAST_DEFINE_TESTSUITE(Serializer, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/protocol/TER_test.cpp b/src/test/protocol/TER_test.cpp index 8c279a8c95..0d9c6cb96d 100644 --- a/src/test/protocol/TER_test.cpp +++ b/src/test/protocol/TER_test.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { struct TER_test : public beast::unit_test::suite { @@ -274,6 +274,6 @@ struct TER_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(TER, protocol, ripple); +BEAST_DEFINE_TESTSUITE(TER, protocol, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/resource/Logic_test.cpp b/src/test/resource/Logic_test.cpp index 2cb2625708..0e520d4983 100644 --- a/src/test/resource/Logic_test.cpp +++ b/src/test/resource/Logic_test.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace Resource { class ResourceManager_test : public beast::unit_test::suite @@ -272,7 +272,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ResourceManager, resource, ripple); +BEAST_DEFINE_TESTSUITE(ResourceManager, resource, xrpl); } // namespace Resource -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AMMInfo_test.cpp b/src/test/rpc/AMMInfo_test.cpp index 2e519d1fb2..c76fa15eb7 100644 --- a/src/test/rpc/AMMInfo_test.cpp +++ b/src/test/rpc/AMMInfo_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class AMMInfo_test : public jtx::AMMTestBase @@ -350,7 +350,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AMMInfo, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AMMInfo, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountCurrencies_test.cpp b/src/test/rpc/AccountCurrencies_test.cpp index c4833d11d4..b1417735be 100644 --- a/src/test/rpc/AccountCurrencies_test.cpp +++ b/src/test/rpc/AccountCurrencies_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class AccountCurrencies_test : public beast::unit_test::suite { @@ -209,6 +209,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AccountCurrencies, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountCurrencies, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountInfo_test.cpp b/src/test/rpc/AccountInfo_test.cpp index 5e2fc608b3..6370884124 100644 --- a/src/test/rpc/AccountInfo_test.cpp +++ b/src/test/rpc/AccountInfo_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class AccountInfo_test : public beast::unit_test::suite @@ -693,15 +693,14 @@ public: testSignerListsApiVersion2(); testSignerListsV2(); - FeatureBitset const allFeatures{ - ripple::test::jtx::testable_amendments()}; + FeatureBitset const allFeatures{xrpl::test::jtx::testable_amendments()}; testAccountFlags(allFeatures); testAccountFlags(allFeatures - featureClawback); testAccountFlags(allFeatures - featureClawback - featureTokenEscrow); } }; -BEAST_DEFINE_TESTSUITE(AccountInfo, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountInfo, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index 200331b9be..6d9b75a44e 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { class AccountLines_test : public beast::unit_test::suite @@ -1400,7 +1400,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AccountLines, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountLines, rpc, xrpl); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index 74c5a2c915..e438d50633 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { static char const* bobs_account_objects[] = { @@ -1427,7 +1427,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AccountObjects, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountObjects, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountOffers_test.cpp b/src/test/rpc/AccountOffers_test.cpp index 500828d9d7..2c03239bd8 100644 --- a/src/test/rpc/AccountOffers_test.cpp +++ b/src/test/rpc/AccountOffers_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class AccountOffers_test : public beast::unit_test::suite @@ -320,7 +320,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AccountOffers, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountOffers, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountSet_test.cpp b/src/test/rpc/AccountSet_test.cpp index 3df3606a03..40ef4acba7 100644 --- a/src/test/rpc/AccountSet_test.cpp +++ b/src/test/rpc/AccountSet_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class AccountSet_test : public beast::unit_test::suite { @@ -565,8 +565,7 @@ public: stx->at(sfSigningPubKey) = makeSlice(std::string("badkey")); env.app().openLedger().modify([&](OpenView& view, beast::Journal j) { - auto const result = - ripple::apply(env.app(), view, *stx, tapNONE, j); + auto const result = xrpl::apply(env.app(), view, *stx, tapNONE, j); BEAST_EXPECT(result.ter == temBAD_SIGNATURE); BEAST_EXPECT(!result.applied); return result.applied; @@ -593,6 +592,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(AccountSet, rpc, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(AccountSet, rpc, xrpl, 1); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index f9f21c5e87..e387e1bc4c 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { @@ -938,7 +938,7 @@ public: testMPT(); } }; -BEAST_DEFINE_TESTSUITE(AccountTx, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AccountTx, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/AmendmentBlocked_test.cpp b/src/test/rpc/AmendmentBlocked_test.cpp index 05fa4908f3..2c3f631ac8 100644 --- a/src/test/rpc/AmendmentBlocked_test.cpp +++ b/src/test/rpc/AmendmentBlocked_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { class AmendmentBlocked_test : public beast::unit_test::suite { @@ -236,6 +236,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(AmendmentBlocked, rpc, ripple); +BEAST_DEFINE_TESTSUITE(AmendmentBlocked, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/BookChanges_test.cpp b/src/test/rpc/BookChanges_test.cpp index 5f58dfc383..216f4bd895 100644 --- a/src/test/rpc/BookChanges_test.cpp +++ b/src/test/rpc/BookChanges_test.cpp @@ -4,7 +4,7 @@ #include "xrpl/beast/unit_test/suite.h" #include "xrpl/protocol/jss.h" -namespace ripple { +namespace xrpl { namespace test { class BookChanges_test : public beast::unit_test::suite @@ -124,7 +124,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(BookChanges, rpc, ripple); +BEAST_DEFINE_TESTSUITE(BookChanges, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Book_test.cpp b/src/test/rpc/Book_test.cpp index f2798671b0..3c7477745b 100644 --- a/src/test/rpc/Book_test.cpp +++ b/src/test/rpc/Book_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class Book_test : public beast::unit_test::suite @@ -2011,7 +2011,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(Book, rpc, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(Book, rpc, xrpl, 1); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Connect_test.cpp b/src/test/rpc/Connect_test.cpp index a01ee05ff2..8d5a2ca33f 100644 --- a/src/test/rpc/Connect_test.cpp +++ b/src/test/rpc/Connect_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class Connect_test : public beast::unit_test::suite { @@ -36,6 +36,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Connect, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Connect, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/DeliveredAmount_test.cpp b/src/test/rpc/DeliveredAmount_test.cpp index 79447af780..3e256aa03b 100644 --- a/src/test/rpc/DeliveredAmount_test.cpp +++ b/src/test/rpc/DeliveredAmount_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { // Helper class to track the expected number `delivered_amount` results. @@ -403,7 +403,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(DeliveredAmount, rpc, ripple); +BEAST_DEFINE_TESTSUITE(DeliveredAmount, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/DepositAuthorized_test.cpp b/src/test/rpc/DepositAuthorized_test.cpp index 6e46b077b8..968a3fd4dc 100644 --- a/src/test/rpc/DepositAuthorized_test.cpp +++ b/src/test/rpc/DepositAuthorized_test.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class DepositAuthorized_test : public beast::unit_test::suite @@ -622,7 +622,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(DepositAuthorized, rpc, ripple); +BEAST_DEFINE_TESTSUITE(DepositAuthorized, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Feature_test.cpp b/src/test/rpc/Feature_test.cpp index 058b4a9572..6b66da072e 100644 --- a/src/test/rpc/Feature_test.cpp +++ b/src/test/rpc/Feature_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class Feature_test : public beast::unit_test::suite { @@ -14,13 +14,13 @@ class Feature_test : public beast::unit_test::suite { testcase("internals"); - auto const& supportedAmendments = ripple::detail::supportedAmendments(); - auto const& allAmendments = ripple::allAmendments(); + auto const& supportedAmendments = xrpl::detail::supportedAmendments(); + auto const& allAmendments = xrpl::allAmendments(); BEAST_EXPECT( supportedAmendments.size() == - ripple::detail::numDownVotedAmendments() + - ripple::detail::numUpVotedAmendments()); + xrpl::detail::numDownVotedAmendments() + + xrpl::detail::numUpVotedAmendments()); { std::size_t up = 0, down = 0, obsolete = 0; for (auto const& [name, vote] : supportedAmendments) @@ -54,8 +54,8 @@ class Feature_test : public beast::unit_test::suite } } BEAST_EXPECT( - down + obsolete == ripple::detail::numDownVotedAmendments()); - BEAST_EXPECT(up == ripple::detail::numUpVotedAmendments()); + down + obsolete == xrpl::detail::numDownVotedAmendments()); + BEAST_EXPECT(up == xrpl::detail::numUpVotedAmendments()); } { std::size_t supported = 0, unsupported = 0, retired = 0; @@ -93,7 +93,7 @@ class Feature_test : public beast::unit_test::suite // Test all the supported features. In a perfect world, this would test // FeatureCollections::featureNames, but that's private. Leave it that // way. - auto const supported = ripple::detail::supportedAmendments(); + auto const supported = xrpl::detail::supportedAmendments(); for (auto const& [feature, vote] : supported) { @@ -139,7 +139,7 @@ class Feature_test : public beast::unit_test::suite Env env{*this}; std::map const& votes = - ripple::detail::supportedAmendments(); + xrpl::detail::supportedAmendments(); auto jrr = env.rpc("feature")[jss::result]; if (!BEAST_EXPECT(jrr.isMember(jss::features))) @@ -325,7 +325,7 @@ class Feature_test : public beast::unit_test::suite Env env{*this, FeatureBitset{}}; std::map const& votes = - ripple::detail::supportedAmendments(); + xrpl::detail::supportedAmendments(); auto jrr = env.rpc("feature")[jss::result]; if (!BEAST_EXPECT(jrr.isMember(jss::features))) @@ -423,7 +423,7 @@ class Feature_test : public beast::unit_test::suite // to avoid maintenance as more amendments are added in the future. BEAST_EXPECT(majorities.size() >= 2); std::map const& votes = - ripple::detail::supportedAmendments(); + xrpl::detail::supportedAmendments(); jrr = env.rpc("feature")[jss::result]; if (!BEAST_EXPECT(jrr.isMember(jss::features))) @@ -607,6 +607,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Feature, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Feature, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/GRPCTestClientBase.h b/src/test/rpc/GRPCTestClientBase.h index b5e50b1c94..6cb806a562 100644 --- a/src/test/rpc/GRPCTestClientBase.h +++ b/src/test/rpc/GRPCTestClientBase.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { struct GRPCTestClientBase @@ -29,5 +29,5 @@ struct GRPCTestClientBase }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif // XRPL_GRPCTESTCLIENTBASE_H diff --git a/src/test/rpc/GatewayBalances_test.cpp b/src/test/rpc/GatewayBalances_test.cpp index 23ac199b4e..40f56dfc81 100644 --- a/src/test/rpc/GatewayBalances_test.cpp +++ b/src/test/rpc/GatewayBalances_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class GatewayBalances_test : public beast::unit_test::suite @@ -243,7 +243,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(GatewayBalances, rpc, ripple); +BEAST_DEFINE_TESTSUITE(GatewayBalances, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/GetAggregatePrice_test.cpp b/src/test/rpc/GetAggregatePrice_test.cpp index a1a09ab592..52f82ffc6c 100644 --- a/src/test/rpc/GetAggregatePrice_test.cpp +++ b/src/test/rpc/GetAggregatePrice_test.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { namespace jtx { namespace oracle { @@ -327,9 +327,9 @@ public: } }; -BEAST_DEFINE_TESTSUITE(GetAggregatePrice, rpc, ripple); +BEAST_DEFINE_TESTSUITE(GetAggregatePrice, rpc, xrpl); } // namespace oracle } // namespace jtx } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/GetCounts_test.cpp b/src/test/rpc/GetCounts_test.cpp index ea8d7a896a..b9ad5ec254 100644 --- a/src/test/rpc/GetCounts_test.cpp +++ b/src/test/rpc/GetCounts_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class GetCounts_test : public beast::unit_test::suite { @@ -101,6 +101,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(GetCounts, rpc, ripple); +BEAST_DEFINE_TESTSUITE(GetCounts, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Handler_test.cpp b/src/test/rpc/Handler_test.cpp index b0f386b925..9a6f1b3aa1 100644 --- a/src/test/rpc/Handler_test.cpp +++ b/src/test/rpc/Handler_test.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple::test { +namespace xrpl::test { // NOTE: there should be no need for this function; // `std::cout << some_duration` should just work if built with a compliant @@ -82,7 +82,7 @@ class Handler_test : public beast::unit_test::suite std::ranlux48 prng(dev()); std::vector names = - test::jtx::make_vector(ripple::RPC::getHandlerNames()); + test::jtx::make_vector(xrpl::RPC::getHandlerNames()); std::uniform_int_distribution distr{0, names.size() - 1}; @@ -109,6 +109,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_MANUAL(Handler, rpc, ripple); +BEAST_DEFINE_TESTSUITE_MANUAL(Handler, rpc, xrpl); -} // namespace ripple::test +} // namespace xrpl::test diff --git a/src/test/rpc/JSONRPC_test.cpp b/src/test/rpc/JSONRPC_test.cpp index 7bcc26e3d3..4d3f0a5098 100644 --- a/src/test/rpc/JSONRPC_test.cpp +++ b/src/test/rpc/JSONRPC_test.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -2917,7 +2917,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(JSONRPC, rpc, ripple); +BEAST_DEFINE_TESTSUITE(JSONRPC, rpc, xrpl); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/KeyGeneration_test.cpp b/src/test/rpc/KeyGeneration_test.cpp index b1bbac7340..23f2723d6a 100644 --- a/src/test/rpc/KeyGeneration_test.cpp +++ b/src/test/rpc/KeyGeneration_test.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -75,7 +75,7 @@ static key_strings const strong_brain_strings = { "attacks.", }; -class WalletPropose_test : public ripple::TestSuite +class WalletPropose_test : public xrpl::TestSuite { public: void @@ -875,7 +875,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(WalletPropose, rpc, ripple); +BEAST_DEFINE_TESTSUITE(WalletPropose, rpc, xrpl); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerClosed_test.cpp b/src/test/rpc/LedgerClosed_test.cpp index ba25a115c3..2bc5c2b0c9 100644 --- a/src/test/rpc/LedgerClosed_test.cpp +++ b/src/test/rpc/LedgerClosed_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class LedgerClosed_test : public beast::unit_test::suite { @@ -49,6 +49,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerClosed, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerClosed, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerData_test.cpp b/src/test/rpc/LedgerData_test.cpp index 9ac61c277a..66be8486b4 100644 --- a/src/test/rpc/LedgerData_test.cpp +++ b/src/test/rpc/LedgerData_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class LedgerData_test : public beast::unit_test::suite { @@ -473,6 +473,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE_PRIO(LedgerData, rpc, ripple, 1); +BEAST_DEFINE_TESTSUITE_PRIO(LedgerData, rpc, xrpl, 1); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index 8e9be02dda..ef5abdd800 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -19,7 +19,7 @@ using source_location = std::experimental::source_location; #include using std::source_location; #endif -namespace ripple { +namespace xrpl { namespace test { @@ -1775,8 +1775,8 @@ class LedgerEntry_test : public beast::unit_test::suite testInvalidOracleLedgerEntry() { testcase("Invalid Oracle Ledger Entry"); - using namespace ripple::test::jtx; - using namespace ripple::test::jtx::oracle; + using namespace xrpl::test::jtx; + using namespace xrpl::test::jtx::oracle; Env env(*this); Account const owner("owner"); @@ -1802,8 +1802,8 @@ class LedgerEntry_test : public beast::unit_test::suite testOracleLedgerEntry() { testcase("Oracle Ledger Entry"); - using namespace ripple::test::jtx; - using namespace ripple::test::jtx::oracle; + using namespace xrpl::test::jtx; + using namespace xrpl::test::jtx::oracle; Env env(*this); auto const baseFee = @@ -2368,8 +2368,8 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerEntry, rpc, ripple); -BEAST_DEFINE_TESTSUITE(LedgerEntry_XChain, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerEntry, rpc, xrpl); +BEAST_DEFINE_TESTSUITE(LedgerEntry_XChain, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerHeader_test.cpp b/src/test/rpc/LedgerHeader_test.cpp index 7ebf7a8a94..3af82d683e 100644 --- a/src/test/rpc/LedgerHeader_test.cpp +++ b/src/test/rpc/LedgerHeader_test.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LedgerHeader_test : public beast::unit_test::suite { @@ -68,6 +68,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerHeader, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerHeader, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 7728973045..583ff0a531 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -738,7 +738,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerRPC, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerRPC, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/LedgerRequest_test.cpp b/src/test/rpc/LedgerRequest_test.cpp index 013d4cbe0f..153c6ad508 100644 --- a/src/test/rpc/LedgerRequest_test.cpp +++ b/src/test/rpc/LedgerRequest_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -377,7 +377,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(LedgerRequest, rpc, ripple); +BEAST_DEFINE_TESTSUITE(LedgerRequest, rpc, xrpl); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/ManifestRPC_test.cpp b/src/test/rpc/ManifestRPC_test.cpp index a875ecb479..5d4f4900eb 100644 --- a/src/test/rpc/ManifestRPC_test.cpp +++ b/src/test/rpc/ManifestRPC_test.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class ManifestRPC_test : public beast::unit_test::suite @@ -73,6 +73,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ManifestRPC, rpc, ripple); +BEAST_DEFINE_TESTSUITE(ManifestRPC, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/NoRippleCheck_test.cpp b/src/test/rpc/NoRippleCheck_test.cpp index 4d9af8524f..7ed2cd8fd1 100644 --- a/src/test/rpc/NoRippleCheck_test.cpp +++ b/src/test/rpc/NoRippleCheck_test.cpp @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { class NoRippleCheck_test : public beast::unit_test::suite { @@ -289,7 +289,7 @@ class NoRippleCheckLimits_test : public beast::unit_test::suite // be better if we could add this functionality to Env somehow // or otherwise disable endpoint charging for certain test // cases. - using namespace ripple::Resource; + using namespace xrpl::Resource; using namespace std::chrono; using namespace beast::IP; auto c = env.app().getResourceManager().newInboundEndpoint( @@ -304,7 +304,7 @@ class NoRippleCheckLimits_test : public beast::unit_test::suite } }; - for (auto i = 0; i < ripple::RPC::Tuning::noRippleCheck.rmax + 5; ++i) + for (auto i = 0; i < xrpl::RPC::Tuning::noRippleCheck.rmax + 5; ++i) { if (!admin) checkBalance(); @@ -379,12 +379,12 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NoRippleCheck, rpc, ripple); +BEAST_DEFINE_TESTSUITE(NoRippleCheck, rpc, xrpl); // These tests that deal with limit amounts are slow because of the // offer/account setup, so making them manual -- the additional coverage // provided by them is minimal -BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(NoRippleCheckLimits, rpc, ripple, 1); +BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(NoRippleCheckLimits, rpc, xrpl, 1); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/NoRipple_test.cpp b/src/test/rpc/NoRipple_test.cpp index 8e68df0e8b..040ceaaa29 100644 --- a/src/test/rpc/NoRipple_test.cpp +++ b/src/test/rpc/NoRipple_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -269,7 +269,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(NoRipple, rpc, ripple); +BEAST_DEFINE_TESTSUITE(NoRipple, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/OwnerInfo_test.cpp b/src/test/rpc/OwnerInfo_test.cpp index b3a4f6a0a4..b47b529680 100644 --- a/src/test/rpc/OwnerInfo_test.cpp +++ b/src/test/rpc/OwnerInfo_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class OwnerInfo_test : public beast::unit_test::suite { @@ -200,6 +200,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(OwnerInfo, rpc, ripple); +BEAST_DEFINE_TESTSUITE(OwnerInfo, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Peers_test.cpp b/src/test/rpc/Peers_test.cpp index a066a0a709..639f5e98cb 100644 --- a/src/test/rpc/Peers_test.cpp +++ b/src/test/rpc/Peers_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class Peers_test : public beast::unit_test::suite { @@ -73,6 +73,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Peers, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Peers, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/RPCCall_test.cpp b/src/test/rpc/RPCCall_test.cpp index 7647dc5f65..682584f40b 100644 --- a/src/test/rpc/RPCCall_test.cpp +++ b/src/test/rpc/RPCCall_test.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { struct RPCCallTestData @@ -5990,7 +5990,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RPCCall, rpc, ripple); +BEAST_DEFINE_TESTSUITE(RPCCall, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/RPCHelpers_test.cpp b/src/test/rpc/RPCHelpers_test.cpp index e2e5f5fcf9..f180bd5c1a 100644 --- a/src/test/rpc/RPCHelpers_test.cpp +++ b/src/test/rpc/RPCHelpers_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class RPCHelpers_test : public beast::unit_test::suite @@ -70,7 +70,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RPCHelpers, rpc, ripple); +BEAST_DEFINE_TESTSUITE(RPCHelpers, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/RPCOverload_test.cpp b/src/test/rpc/RPCOverload_test.cpp index 3eef88ff2a..d05dba4606 100644 --- a/src/test/rpc/RPCOverload_test.cpp +++ b/src/test/rpc/RPCOverload_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class RPCOverload_test : public beast::unit_test::suite @@ -70,7 +70,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RPCOverload, rpc, ripple); +BEAST_DEFINE_TESTSUITE(RPCOverload, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/RobustTransaction_test.cpp b/src/test/rpc/RobustTransaction_test.cpp index d52e08f7ac..b0d0cdafd5 100644 --- a/src/test/rpc/RobustTransaction_test.cpp +++ b/src/test/rpc/RobustTransaction_test.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class RobustTransaction_test : public beast::unit_test::suite @@ -490,7 +490,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(RobustTransaction, rpc, ripple); +BEAST_DEFINE_TESTSUITE(RobustTransaction, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Roles_test.cpp b/src/test/rpc/Roles_test.cpp index 777cf1e2a2..4fa99b432b 100644 --- a/src/test/rpc/Roles_test.cpp +++ b/src/test/rpc/Roles_test.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -370,8 +370,8 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Roles, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Roles, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/ServerDefinitions_test.cpp b/src/test/rpc/ServerDefinitions_test.cpp index 051e9e00eb..ae2cccd908 100644 --- a/src/test/rpc/ServerDefinitions_test.cpp +++ b/src/test/rpc/ServerDefinitions_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -143,7 +143,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ServerDefinitions, rpc, ripple); +BEAST_DEFINE_TESTSUITE(ServerDefinitions, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/ServerInfo_test.cpp b/src/test/rpc/ServerInfo_test.cpp index d149a0899c..27b554e38b 100644 --- a/src/test/rpc/ServerInfo_test.cpp +++ b/src/test/rpc/ServerInfo_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { @@ -162,7 +162,7 @@ admin = 127.0.0.1 } }; -BEAST_DEFINE_TESTSUITE(ServerInfo, rpc, ripple); +BEAST_DEFINE_TESTSUITE(ServerInfo, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Simulate_test.cpp b/src/test/rpc/Simulate_test.cpp index 61d3f1ce6e..2a85e2a928 100644 --- a/src/test/rpc/Simulate_test.cpp +++ b/src/test/rpc/Simulate_test.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -1316,8 +1316,8 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Simulate, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Simulate, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Status_test.cpp b/src/test/rpc/Status_test.cpp index 5e6ac1bca4..c2e9c836df 100644 --- a/src/test/rpc/Status_test.cpp +++ b/src/test/rpc/Status_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { class codeString_test : public beast::unit_test::suite @@ -202,4 +202,4 @@ public: BEAST_DEFINE_TESTSUITE(fillJson, rpc, RPC); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index a4eea3f12c..1637554f5c 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { class Subscribe_test : public beast::unit_test::suite @@ -1591,7 +1591,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Subscribe, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Subscribe, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/TransactionEntry_test.cpp b/src/test/rpc/TransactionEntry_test.cpp index 052d45e43b..f81a04df6a 100644 --- a/src/test/rpc/TransactionEntry_test.cpp +++ b/src/test/rpc/TransactionEntry_test.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class TransactionEntry_test : public beast::unit_test::suite { @@ -375,6 +375,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(TransactionEntry, rpc, ripple); +BEAST_DEFINE_TESTSUITE(TransactionEntry, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/TransactionHistory_test.cpp b/src/test/rpc/TransactionHistory_test.cpp index ca8d128962..1dec83584d 100644 --- a/src/test/rpc/TransactionHistory_test.cpp +++ b/src/test/rpc/TransactionHistory_test.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class TransactionHistory_test : public beast::unit_test::suite { @@ -151,6 +151,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(TransactionHistory, rpc, ripple); +BEAST_DEFINE_TESTSUITE(TransactionHistory, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index b1bea237f5..6947fc91c2 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { class Transaction_test : public beast::unit_test::suite { @@ -938,6 +938,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Transaction, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Transaction, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/ValidatorInfo_test.cpp b/src/test/rpc/ValidatorInfo_test.cpp index a115044194..a8fccc724b 100644 --- a/src/test/rpc/ValidatorInfo_test.cpp +++ b/src/test/rpc/ValidatorInfo_test.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class ValidatorInfo_test : public beast::unit_test::suite @@ -104,6 +104,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ValidatorInfo, rpc, ripple); +BEAST_DEFINE_TESTSUITE(ValidatorInfo, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/ValidatorRPC_test.cpp b/src/test/rpc/ValidatorRPC_test.cpp index df7180ed10..cf8741e507 100644 --- a/src/test/rpc/ValidatorRPC_test.cpp +++ b/src/test/rpc/ValidatorRPC_test.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { @@ -575,7 +575,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ValidatorRPC, rpc, ripple); +BEAST_DEFINE_TESTSUITE(ValidatorRPC, rpc, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/rpc/Version_test.cpp b/src/test/rpc/Version_test.cpp index 50004c2c54..fd4bfdd565 100644 --- a/src/test/rpc/Version_test.cpp +++ b/src/test/rpc/Version_test.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class Version_test : public beast::unit_test::suite { @@ -277,6 +277,6 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Version, rpc, ripple); +BEAST_DEFINE_TESTSUITE(Version, rpc, xrpl); -} // namespace ripple +} // namespace xrpl diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index b93c3a30e7..9f35a9162d 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class ServerStatus_test : public beast::unit_test::suite, @@ -1226,7 +1226,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(ServerStatus, server, ripple); +BEAST_DEFINE_TESTSUITE(ServerStatus, server, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/server/Server_test.cpp b/src/test/server/Server_test.cpp index 55a9b17ea0..2a4bb49d34 100644 --- a/src/test/server/Server_test.cpp +++ b/src/test/server/Server_test.cpp @@ -22,7 +22,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { using socket_type = boost::beast::tcp_stream; @@ -517,7 +517,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(Server, server, ripple); +BEAST_DEFINE_TESTSUITE(Server, server, xrpl); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/shamap/FetchPack_test.cpp b/src/test/shamap/FetchPack_test.cpp index 13ea267da9..dc51616015 100644 --- a/src/test/shamap/FetchPack_test.cpp +++ b/src/test/shamap/FetchPack_test.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { class FetchPack_test : public beast::unit_test::suite @@ -72,7 +72,7 @@ public: { Serializer s; for (int d = 0; d < 3; ++d) - s.add32(ripple::rand_int(r)); + s.add32(xrpl::rand_int(r)); return make_shamapitem(s.getSHA512Half(), s.slice()); } @@ -151,7 +151,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(FetchPack, shamap, ripple); +BEAST_DEFINE_TESTSUITE(FetchPack, shamap, xrpl); } // namespace tests -} // namespace ripple +} // namespace xrpl diff --git a/src/test/shamap/SHAMapSync_test.cpp b/src/test/shamap/SHAMapSync_test.cpp index c71ad53ce8..912768e618 100644 --- a/src/test/shamap/SHAMapSync_test.cpp +++ b/src/test/shamap/SHAMapSync_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { class SHAMapSync_test : public beast::unit_test::suite @@ -168,7 +168,7 @@ public: } }; -BEAST_DEFINE_TESTSUITE(SHAMapSync, shamap, ripple); +BEAST_DEFINE_TESTSUITE(SHAMapSync, shamap, xrpl); } // namespace tests -} // namespace ripple +} // namespace xrpl diff --git a/src/test/shamap/SHAMap_test.cpp b/src/test/shamap/SHAMap_test.cpp index e3e541019b..ade7a692f8 100644 --- a/src/test/shamap/SHAMap_test.cpp +++ b/src/test/shamap/SHAMap_test.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { #ifndef __INTELLISENSE__ @@ -382,7 +382,7 @@ class SHAMapPathProof_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(SHAMap, shamap, ripple); -BEAST_DEFINE_TESTSUITE(SHAMapPathProof, shamap, ripple); +BEAST_DEFINE_TESTSUITE(SHAMap, shamap, xrpl); +BEAST_DEFINE_TESTSUITE(SHAMapPathProof, shamap, xrpl); } // namespace tests -} // namespace ripple +} // namespace xrpl diff --git a/src/test/shamap/common.h b/src/test/shamap/common.h index ac9a716912..add2c79243 100644 --- a/src/test/shamap/common.h +++ b/src/test/shamap/common.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace tests { class TestNodeFamily : public Family @@ -109,6 +109,6 @@ public: }; } // namespace tests -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index c5272015cc..94ca5948bd 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { /** @@ -158,6 +158,6 @@ public: }; } // namespace detail -} // namespace ripple +} // namespace xrpl #endif // TEST_UNIT_TEST_DIRGUARD_H diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index d4883f4721..d64be9ea9b 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { // A Journal::Sink intended for use with the beast unit test framework. @@ -140,6 +140,6 @@ public: }; } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/test/unit_test/multi_runner.cpp b/src/test/unit_test/multi_runner.cpp index f6f599977e..4b1a82cd3f 100644 --- a/src/test/unit_test/multi_runner.cpp +++ b/src/test/unit_test/multi_runner.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -636,4 +636,4 @@ template class multi_runner_base; template class multi_runner_base; } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/test/unit_test/multi_runner.h b/src/test/unit_test/multi_runner.h index 8c302a8007..813af61572 100644 --- a/src/test/unit_test/multi_runner.h +++ b/src/test/unit_test/multi_runner.h @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -335,6 +335,6 @@ multi_runner_child::run_multi(Pred pred) } } // namespace test -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/tests/libxrpl/basics/RangeSet.cpp b/src/tests/libxrpl/basics/RangeSet.cpp index d6f3691d4b..8c43b26758 100644 --- a/src/tests/libxrpl/basics/RangeSet.cpp +++ b/src/tests/libxrpl/basics/RangeSet.cpp @@ -5,7 +5,7 @@ #include #include -using namespace ripple; +using namespace xrpl; TEST_SUITE_BEGIN("RangeSet"); diff --git a/src/tests/libxrpl/basics/Slice.cpp b/src/tests/libxrpl/basics/Slice.cpp index d85d7c03d7..03d89ff174 100644 --- a/src/tests/libxrpl/basics/Slice.cpp +++ b/src/tests/libxrpl/basics/Slice.cpp @@ -5,7 +5,7 @@ #include #include -using namespace ripple; +using namespace xrpl; static std::uint8_t const data[] = { 0xa8, 0xa1, 0x38, 0x45, 0x23, 0xec, 0xe4, 0x23, 0x71, 0x6d, 0x2a, diff --git a/src/tests/libxrpl/basics/base64.cpp b/src/tests/libxrpl/basics/base64.cpp index 1191319145..e4581126b4 100644 --- a/src/tests/libxrpl/basics/base64.cpp +++ b/src/tests/libxrpl/basics/base64.cpp @@ -4,7 +4,7 @@ #include -using namespace ripple; +using namespace xrpl; static void check(std::string const& in, std::string const& out) diff --git a/src/tests/libxrpl/basics/contract.cpp b/src/tests/libxrpl/basics/contract.cpp index c7be5f8ede..a1f6f0b777 100644 --- a/src/tests/libxrpl/basics/contract.cpp +++ b/src/tests/libxrpl/basics/contract.cpp @@ -5,7 +5,7 @@ #include #include -using namespace ripple; +using namespace xrpl; TEST_CASE("contract") { diff --git a/src/tests/libxrpl/basics/mulDiv.cpp b/src/tests/libxrpl/basics/mulDiv.cpp index 2a59ff81c6..d3c58ea2f4 100644 --- a/src/tests/libxrpl/basics/mulDiv.cpp +++ b/src/tests/libxrpl/basics/mulDiv.cpp @@ -5,7 +5,7 @@ #include #include -using namespace ripple; +using namespace xrpl; TEST_CASE("mulDiv") { diff --git a/src/tests/libxrpl/basics/scope.cpp b/src/tests/libxrpl/basics/scope.cpp index 2f8248ef9a..b3774d54bd 100644 --- a/src/tests/libxrpl/basics/scope.cpp +++ b/src/tests/libxrpl/basics/scope.cpp @@ -2,7 +2,7 @@ #include -using namespace ripple; +using namespace xrpl; TEST_CASE("scope_exit") { diff --git a/src/tests/libxrpl/basics/tagged_integer.cpp b/src/tests/libxrpl/basics/tagged_integer.cpp index 945eaf9156..45efc579ab 100644 --- a/src/tests/libxrpl/basics/tagged_integer.cpp +++ b/src/tests/libxrpl/basics/tagged_integer.cpp @@ -4,7 +4,7 @@ #include -using namespace ripple; +using namespace xrpl; struct Tag1 { diff --git a/src/tests/libxrpl/crypto/csprng.cpp b/src/tests/libxrpl/crypto/csprng.cpp index 88c55dc4d0..e59c8a555a 100644 --- a/src/tests/libxrpl/crypto/csprng.cpp +++ b/src/tests/libxrpl/crypto/csprng.cpp @@ -2,7 +2,7 @@ #include -using namespace ripple; +using namespace xrpl; TEST_CASE("get values") { diff --git a/src/tests/libxrpl/json/Output.cpp b/src/tests/libxrpl/json/Output.cpp index 4960171e56..6e6c20a0e5 100644 --- a/src/tests/libxrpl/json/Output.cpp +++ b/src/tests/libxrpl/json/Output.cpp @@ -6,7 +6,7 @@ #include -using namespace ripple; +using namespace xrpl; using namespace Json; TEST_SUITE_BEGIN("JsonOutput"); diff --git a/src/tests/libxrpl/json/Value.cpp b/src/tests/libxrpl/json/Value.cpp index df777c98fc..25bd2f548d 100644 --- a/src/tests/libxrpl/json/Value.cpp +++ b/src/tests/libxrpl/json/Value.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { TEST_SUITE_BEGIN("json_value"); @@ -1363,4 +1363,4 @@ TEST_CASE("memory leak") TEST_SUITE_END(); -} // namespace ripple +} // namespace xrpl diff --git a/src/tests/libxrpl/json/Writer.cpp b/src/tests/libxrpl/json/Writer.cpp index 46bfd61ae2..9637184c95 100644 --- a/src/tests/libxrpl/json/Writer.cpp +++ b/src/tests/libxrpl/json/Writer.cpp @@ -6,7 +6,7 @@ #include #include -using namespace ripple; +using namespace xrpl; using namespace Json; TEST_SUITE_BEGIN("JsonWriter"); diff --git a/src/tests/libxrpl/net/HTTPClient.cpp b/src/tests/libxrpl/net/HTTPClient.cpp index 5d46f68f0c..5a484c1f56 100644 --- a/src/tests/libxrpl/net/HTTPClient.cpp +++ b/src/tests/libxrpl/net/HTTPClient.cpp @@ -13,7 +13,7 @@ #include #include -using namespace ripple; +using namespace xrpl; namespace { diff --git a/src/xrpld/app/consensus/RCLCensorshipDetector.h b/src/xrpld/app/consensus/RCLCensorshipDetector.h index d53d1197db..97d2743dc1 100644 --- a/src/xrpld/app/consensus/RCLCensorshipDetector.h +++ b/src/xrpld/app/consensus/RCLCensorshipDetector.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { template class RCLCensorshipDetector @@ -122,6 +122,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 4c2ecbac10..99cc140056 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -30,7 +30,7 @@ #include #include -namespace ripple { +namespace xrpl { RCLConsensus::RCLConsensus( Application& app, @@ -77,7 +77,7 @@ RCLConsensus::Adaptor::Adaptor( , nUnlVote_(validatorKeys_.nodeID, j_) { XRPL_ASSERT( - valCookie_, "ripple::RCLConsensus::Adaptor::Adaptor : nonzero cookie"); + valCookie_, "xrpl::RCLConsensus::Adaptor::Adaptor : nonzero cookie"); JLOG(j_.info()) << "Consensus engine started (cookie: " + std::to_string(valCookie_) + ")"; @@ -133,10 +133,10 @@ RCLConsensus::Adaptor::acquireLedger(LedgerHash const& hash) XRPL_ASSERT( !built->open() && built->isImmutable(), - "ripple::RCLConsensus::Adaptor::acquireLedger : valid ledger state"); + "xrpl::RCLConsensus::Adaptor::acquireLedger : valid ledger state"); XRPL_ASSERT( built->header().hash == hash, - "ripple::RCLConsensus::Adaptor::acquireLedger : ledger hash match"); + "xrpl::RCLConsensus::Adaptor::acquireLedger : ledger hash match"); // Notify inbound transactions of the new ledger sequence number inboundTransactions_.newRound(built->header().seq); @@ -193,8 +193,8 @@ void RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal) { JLOG(j_.trace()) << (proposal.isBowOut() ? "We bow out: " : "We propose: ") - << ripple::to_string(proposal.prevLedger()) << " -> " - << ripple::to_string(proposal.position()); + << xrpl::to_string(proposal.prevLedger()) << " -> " + << xrpl::to_string(proposal.position()); protocol::TMProposeSet prop; @@ -664,10 +664,10 @@ RCLConsensus::Adaptor::doAccept( // Do these need to exist? XRPL_ASSERT( ledgerMaster_.getClosedLedger()->header().hash == built.id(), - "ripple::RCLConsensus::Adaptor::doAccept : ledger hash match"); + "xrpl::RCLConsensus::Adaptor::doAccept : ledger hash match"); XRPL_ASSERT( app_.openLedger().current()->header().parentHash == built.id(), - "ripple::RCLConsensus::Adaptor::doAccept : parent hash match"); + "xrpl::RCLConsensus::Adaptor::doAccept : parent hash match"); } //------------------------------------------------------------------------- @@ -765,7 +765,7 @@ RCLConsensus::Adaptor::buildLCL( { XRPL_ASSERT( replayData->parent()->header().hash == previousLedger.id(), - "ripple::RCLConsensus::Adaptor::buildLCL : parent hash match"); + "xrpl::RCLConsensus::Adaptor::buildLCL : parent hash match"); return buildLedger(*replayData, tapNONE, app_, j_); } return buildLedger( @@ -1106,4 +1106,4 @@ RclConsensusLogger::~RclConsensusLogger() j_.sink().writeAlways(beast::severities::kInfo, outSs.str()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/consensus/RCLConsensus.h b/src/xrpld/app/consensus/RCLConsensus.h index a6a15395a3..e26cde9801 100644 --- a/src/xrpld/app/consensus/RCLConsensus.h +++ b/src/xrpld/app/consensus/RCLConsensus.h @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { class InboundTransactions; class LocalTxs; @@ -548,6 +548,6 @@ public: return ss_; } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/consensus/RCLCxLedger.h b/src/xrpld/app/consensus/RCLCxLedger.h index 5671fa988d..4413fee7fc 100644 --- a/src/xrpld/app/consensus/RCLCxLedger.h +++ b/src/xrpld/app/consensus/RCLCxLedger.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents a ledger in RCLConsensus. @@ -69,7 +69,7 @@ public: bool closeAgree() const { - return ripple::getCloseAgree(ledger_->header()); + return xrpl::getCloseAgree(ledger_->header()); } //! The close time of this ledger @@ -90,7 +90,7 @@ public: Json::Value getJson() const { - return ripple::getJson({*ledger_, {}}); + return xrpl::getJson({*ledger_, {}}); } /** The ledger instance. @@ -100,5 +100,5 @@ public: */ std::shared_ptr ledger_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.cpp b/src/xrpld/app/consensus/RCLCxPeerPos.cpp index c1ebfc20e2..5f227b00a9 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.cpp +++ b/src/xrpld/app/consensus/RCLCxPeerPos.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { // Used to construct received proposals RCLCxPeerPos::RCLCxPeerPos( @@ -19,7 +19,7 @@ RCLCxPeerPos::RCLCxPeerPos( // this elsewhere, but we want to be extra careful here: XRPL_ASSERT( signature.size() != 0 && signature.size() <= signature_.capacity(), - "ripple::RCLCxPeerPos::RCLCxPeerPos : valid signature size"); + "xrpl::RCLCxPeerPos::RCLCxPeerPos : valid signature size"); if (signature.size() != 0 && signature.size() <= signature_.capacity()) signature_.assign(signature.begin(), signature.end()); @@ -63,4 +63,4 @@ proposalUniqueId( return s.getSHA512Half(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.h b/src/xrpld/app/consensus/RCLCxPeerPos.h index 7202503e76..08b93d4ba9 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.h +++ b/src/xrpld/app/consensus/RCLCxPeerPos.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A peer's signed, proposed position for use in RCLConsensus. @@ -128,6 +128,6 @@ proposalUniqueId( Slice const& publicKey, Slice const& signature); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/consensus/RCLCxTx.h b/src/xrpld/app/consensus/RCLCxTx.h index 0a2f25dbd2..5e92aea8a6 100644 --- a/src/xrpld/app/consensus/RCLCxTx.h +++ b/src/xrpld/app/consensus/RCLCxTx.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Represents a transaction in RCLConsensus. @@ -90,7 +90,7 @@ public: RCLTxSet(std::shared_ptr m) : map_{std::move(m)} { XRPL_ASSERT( - map_, "ripple::RCLTxSet::MutableTxSet::RCLTxSet : non-null input"); + map_, "xrpl::RCLTxSet::MutableTxSet::RCLTxSet : non-null input"); } /** Constructor from a previously created MutableTxSet @@ -158,7 +158,7 @@ public: { XRPL_ASSERT( (v.first && !v.second) || (v.second && !v.first), - "ripple::RCLTxSet::compare : either side is set"); + "xrpl::RCLTxSet::compare : either side is set"); ret[k] = static_cast(v.first); } @@ -168,5 +168,5 @@ public: //! The SHAMap representing the transactions. std::shared_ptr map_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/consensus/RCLValidations.cpp b/src/xrpld/app/consensus/RCLValidations.cpp index 827c417ba8..eb10765ba3 100644 --- a/src/xrpld/app/consensus/RCLValidations.cpp +++ b/src/xrpld/app/consensus/RCLValidations.cpp @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { RCLValidatedLedger::RCLValidatedLedger(MakeGenesis) : ledgerID_{0}, ledgerSeq_{0}, j_{beast::Journal::getNullSink()} @@ -30,7 +30,7 @@ RCLValidatedLedger::RCLValidatedLedger( { XRPL_ASSERT( hashIndex->getFieldU32(sfLastLedgerSequence) == (seq() - 1), - "ripple::RCLValidatedLedger::RCLValidatedLedger(Ledger) : valid " + "xrpl::RCLValidatedLedger::RCLValidatedLedger(Ledger) : valid " "last ledger sequence"); ancestors_ = hashIndex->getFieldV256(sfHashes).value(); } @@ -134,10 +134,10 @@ RCLValidationsAdaptor::acquire(LedgerHash const& hash) XRPL_ASSERT( !ledger->open() && ledger->isImmutable(), - "ripple::RCLValidationsAdaptor::acquire : valid ledger state"); + "xrpl::RCLValidationsAdaptor::acquire : valid ledger state"); XRPL_ASSERT( ledger->header().hash == hash, - "ripple::RCLValidationsAdaptor::acquire : ledger hash match"); + "xrpl::RCLValidationsAdaptor::acquire : ledger hash match"); return RCLValidatedLedger(std::move(ledger), j_); } @@ -177,7 +177,7 @@ handleNewValidation( if (bypassAccept == BypassAccept::yes) { XRPL_ASSERT( - j, "ripple::handleNewValidation : journal is available"); + j, "xrpl::handleNewValidation : journal is available"); if (j.has_value()) { JLOG(j->trace()) << "Bypassing checkAccept for validation " @@ -228,4 +228,4 @@ handleNewValidation( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/consensus/RCLValidations.h b/src/xrpld/app/consensus/RCLValidations.h index ef6d8e9423..62dd52b1dd 100644 --- a/src/xrpld/app/consensus/RCLValidations.h +++ b/src/xrpld/app/consensus/RCLValidations.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; @@ -26,8 +26,8 @@ class RCLValidation std::shared_ptr val_; public: - using NodeKey = ripple::PublicKey; - using NodeID = ripple::NodeID; + using NodeKey = xrpl::PublicKey; + using NodeID = xrpl::NodeID; /** Constructor @@ -238,6 +238,6 @@ handleNewValidation( BypassAccept const bypassAccept = BypassAccept::no, std::optional j = std::nullopt); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/AbstractFetchPackContainer.h b/src/xrpld/app/ledger/AbstractFetchPackContainer.h index d8826a14e3..85efe09e29 100644 --- a/src/xrpld/app/ledger/AbstractFetchPackContainer.h +++ b/src/xrpld/app/ledger/AbstractFetchPackContainer.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { /** An interface facilitating retrieval of fetch packs without an application or ledgermaster object. @@ -26,6 +26,6 @@ public: getFetchPack(uint256 const& nodeHash) = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/AcceptedLedger.cpp b/src/xrpld/app/ledger/AcceptedLedger.cpp index 85fc1dcb37..76099ff864 100644 --- a/src/xrpld/app/ledger/AcceptedLedger.cpp +++ b/src/xrpld/app/ledger/AcceptedLedger.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { AcceptedLedger::AcceptedLedger( std::shared_ptr const& ledger, @@ -28,4 +28,4 @@ AcceptedLedger::AcceptedLedger( }); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/AcceptedLedger.h b/src/xrpld/app/ledger/AcceptedLedger.h index 0d0fe19f10..41177e7078 100644 --- a/src/xrpld/app/ledger/AcceptedLedger.h +++ b/src/xrpld/app/ledger/AcceptedLedger.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** A ledger that has become irrevocable. @@ -57,6 +57,6 @@ private: std::vector> transactions_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/AcceptedLedgerTx.cpp b/src/xrpld/app/ledger/AcceptedLedgerTx.cpp index 18de7b5d06..d57246444f 100644 --- a/src/xrpld/app/ledger/AcceptedLedgerTx.cpp +++ b/src/xrpld/app/ledger/AcceptedLedgerTx.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { AcceptedLedgerTx::AcceptedLedgerTx( std::shared_ptr const& ledger, @@ -17,7 +17,7 @@ AcceptedLedgerTx::AcceptedLedgerTx( { XRPL_ASSERT( !ledger->open(), - "ripple::AcceptedLedgerTx::AcceptedLedgerTx : valid ledger state"); + "xrpl::AcceptedLedgerTx::AcceptedLedgerTx : valid ledger state"); Serializer s; met->add(s); @@ -62,8 +62,8 @@ AcceptedLedgerTx::getEscMeta() const { XRPL_ASSERT( !mRawMeta.empty(), - "ripple::AcceptedLedgerTx::getEscMeta : metadata is set"); + "xrpl::AcceptedLedgerTx::getEscMeta : metadata is set"); return sqlBlobLiteral(mRawMeta); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/AcceptedLedgerTx.h b/src/xrpld/app/ledger/AcceptedLedgerTx.h index aeac800c5c..efea5b9162 100644 --- a/src/xrpld/app/ledger/AcceptedLedgerTx.h +++ b/src/xrpld/app/ledger/AcceptedLedgerTx.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class Logs; @@ -85,6 +85,6 @@ private: Json::Value mJson; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/AccountStateSF.cpp b/src/xrpld/app/ledger/AccountStateSF.cpp index 052f9f9a69..44f18b5cd3 100644 --- a/src/xrpld/app/ledger/AccountStateSF.cpp +++ b/src/xrpld/app/ledger/AccountStateSF.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { void AccountStateSF::gotNode( @@ -20,4 +20,4 @@ AccountStateSF::getNode(SHAMapHash const& nodeHash) const return fp_.getFetchPack(nodeHash.as_uint256()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/AccountStateSF.h b/src/xrpld/app/ledger/AccountStateSF.h index 13844e2417..84738f6e1f 100644 --- a/src/xrpld/app/ledger/AccountStateSF.h +++ b/src/xrpld/app/ledger/AccountStateSF.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // This class is only needed on add functions // sync filter for account state nodes during ledger sync @@ -34,6 +34,6 @@ private: AbstractFetchPackContainer& fp_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/BookListeners.cpp b/src/xrpld/app/ledger/BookListeners.cpp index 31b5d102ca..69d03058a9 100644 --- a/src/xrpld/app/ledger/BookListeners.cpp +++ b/src/xrpld/app/ledger/BookListeners.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { void BookListeners::addSubscriber(InfoSub::ref sub) @@ -44,4 +44,4 @@ BookListeners::publish( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/BookListeners.h b/src/xrpld/app/ledger/BookListeners.h index ad9e0fe0c7..784172974e 100644 --- a/src/xrpld/app/ledger/BookListeners.h +++ b/src/xrpld/app/ledger/BookListeners.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Listen to public/subscribe messages from a book. */ class BookListeners @@ -50,6 +50,6 @@ private: hash_map mListeners; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/BuildLedger.h b/src/xrpld/app/ledger/BuildLedger.h index 8c127fb365..ad6aba3288 100644 --- a/src/xrpld/app/ledger/BuildLedger.h +++ b/src/xrpld/app/ledger/BuildLedger.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class CanonicalTXSet; @@ -57,5 +57,5 @@ buildLedger( Application& app, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index d248a36987..b52cee2927 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { ConsensusTransSetSF::ConsensusTransSetSF(Application& app, NodeCache& nodeCache) : app_(app), m_nodeCache(nodeCache), j_(app.journal("TransactionAcquire")) @@ -43,7 +43,7 @@ ConsensusTransSetSF::gotNode( auto stx = std::make_shared(std::ref(sit)); XRPL_ASSERT( stx->getTransactionID() == nodeHash.as_uint256(), - "ripple::ConsensusTransSetSF::gotNode : transaction hash " + "xrpl::ConsensusTransSetSF::gotNode : transaction hash " "match"); auto const pap = &app_; app_.getJobQueue().addJob(jtTRANSACTION, "TXS->TXN", [pap, stx]() { @@ -78,7 +78,7 @@ ConsensusTransSetSF::getNode(SHAMapHash const& nodeHash) const txn->getSTransaction()->add(s); XRPL_ASSERT( sha512Half(s.slice()) == nodeHash.as_uint256(), - "ripple::ConsensusTransSetSF::getNode : transaction hash match"); + "xrpl::ConsensusTransSetSF::getNode : transaction hash match"); nodeData = s.peekData(); return nodeData; } @@ -86,4 +86,4 @@ ConsensusTransSetSF::getNode(SHAMapHash const& nodeHash) const return std::nullopt; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.h b/src/xrpld/app/ledger/ConsensusTransSetSF.h index 23ee6b9fac..cdb1c47183 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.h +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // Sync filters allow low-level SHAMapSync code to interact correctly with // higher-level structures such as caches and transaction stores @@ -38,6 +38,6 @@ private: beast::Journal const j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/InboundLedger.h b/src/xrpld/app/ledger/InboundLedger.h index 0d5639909b..1b4353b260 100644 --- a/src/xrpld/app/ledger/InboundLedger.h +++ b/src/xrpld/app/ledger/InboundLedger.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { // A ledger we are trying to acquire class InboundLedger final : public TimeoutCounter, @@ -179,6 +179,6 @@ private: std::unique_ptr mPeerSet; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/InboundLedgers.h b/src/xrpld/app/ledger/InboundLedgers.h index 6eba2eec87..0e4d9996bb 100644 --- a/src/xrpld/app/ledger/InboundLedgers.h +++ b/src/xrpld/app/ledger/InboundLedgers.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Manages the lifetime of inbound ledgers. @@ -84,6 +84,6 @@ make_InboundLedgers( InboundLedgers::clock_type& clock, beast::insight::Collector::ptr const& collector); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/InboundTransactions.h b/src/xrpld/app/ledger/InboundTransactions.h index 41dab5307e..6c0281e26f 100644 --- a/src/xrpld/app/ledger/InboundTransactions.h +++ b/src/xrpld/app/ledger/InboundTransactions.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class Application; @@ -78,6 +78,6 @@ make_InboundTransactions( beast::insight::Collector::ptr const& collector, std::function const&, bool)> gotSet); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/Ledger.cpp b/src/xrpld/app/ledger/Ledger.cpp index bf5f442eee..e21cbb6d54 100644 --- a/src/xrpld/app/ledger/Ledger.cpp +++ b/src/xrpld/app/ledger/Ledger.cpp @@ -27,7 +27,7 @@ #include #include -namespace ripple { +namespace xrpl { create_genesis_t const create_genesis{}; @@ -344,7 +344,7 @@ Ledger::setAccepted( bool correctCloseTime) { // Used when we witnessed the consensus. - XRPL_ASSERT(!open(), "ripple::Ledger::setAccepted : valid ledger state"); + XRPL_ASSERT(!open(), "xrpl::Ledger::setAccepted : valid ledger state"); header_.closeTime = closeTime; header_.closeTimeResolution = closeResolution; @@ -418,7 +418,7 @@ Ledger::read(Keylet const& k) const if (k.key == beast::zero) { // LCOV_EXCL_START - UNREACHABLE("ripple::Ledger::read : zero key"); + UNREACHABLE("xrpl::Ledger::read : zero key"); return nullptr; // LCOV_EXCL_STOP } @@ -540,7 +540,7 @@ Ledger::rawTxInsert( std::shared_ptr const& metaData) { XRPL_ASSERT( - metaData, "ripple::Ledger::rawTxInsert : non-null metadata input"); + metaData, "xrpl::Ledger::rawTxInsert : non-null metadata input"); // low-level - just add to table Serializer s(txn->getDataLength() + metaData->getDataLength() + 16); @@ -559,7 +559,7 @@ Ledger::rawTxInsertWithHash( { XRPL_ASSERT( metaData, - "ripple::Ledger::rawTxInsertWithHash : non-null metadata input"); + "xrpl::Ledger::rawTxInsertWithHash : non-null metadata input"); // low-level - just add to table Serializer s(txn->getDataLength() + metaData->getDataLength() + 16); @@ -657,7 +657,7 @@ Ledger::defaultFees(Config const& config) { XRPL_ASSERT( fees_.base == 0 && fees_.reserve == 0 && fees_.increment == 0, - "ripple::Ledger::defaultFees : zero fees"); + "xrpl::Ledger::defaultFees : zero fees"); if (fees_.base == 0) fees_.base = config.FEES.reference_fee; if (fees_.reserve == 0) @@ -854,7 +854,7 @@ Ledger::assertSensible(beast::Journal ledgerJ) const JLOG(ledgerJ.fatal()) << "ledger is not sensible" << j; - UNREACHABLE("ripple::Ledger::assertSensible : ledger is not sensible"); + UNREACHABLE("xrpl::Ledger::assertSensible : ledger is not sensible"); return false; // LCOV_EXCL_STOP @@ -891,7 +891,7 @@ Ledger::updateSkipList() XRPL_ASSERT( hashes.size() <= 256, - "ripple::Ledger::updateSkipList : first maximum hashes size"); + "xrpl::Ledger::updateSkipList : first maximum hashes size"); hashes.push_back(header_.parentHash); sle->setFieldV256(sfHashes, STVector256(hashes)); sle->setFieldU32(sfLastLedgerSequence, prevIndex); @@ -918,7 +918,7 @@ Ledger::updateSkipList() } XRPL_ASSERT( hashes.size() <= 256, - "ripple::Ledger::updateSkipList : second maximum hashes size"); + "xrpl::Ledger::updateSkipList : second maximum hashes size"); if (hashes.size() == 256) hashes.erase(hashes.begin()); hashes.push_back(header_.parentHash); @@ -1000,7 +1000,7 @@ pendSaveValidated( } XRPL_ASSERT( - ledger->isImmutable(), "ripple::pendSaveValidated : immutable ledger"); + ledger->isImmutable(), "xrpl::pendSaveValidated : immutable ledger"); if (!app.pendingSaves().shouldWork(ledger->header().seq, isSynchronous)) { @@ -1080,7 +1080,7 @@ finishLoadByIndexOrHash( XRPL_ASSERT( ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()), - "ripple::finishLoadByIndexOrHash : valid ledger fees"); + "xrpl::finishLoadByIndexOrHash : valid ledger fees"); ledger->setImmutable(); JLOG(j.trace()) << "Loaded ledger: " << to_string(ledger->header().hash); @@ -1121,10 +1121,10 @@ loadByHash(uint256 const& ledgerHash, Application& app, bool acquire) finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger")); XRPL_ASSERT( !ledger || ledger->header().hash == ledgerHash, - "ripple::loadByHash : ledger hash match if loaded"); + "xrpl::loadByHash : ledger hash match if loaded"); return ledger; } return {}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/Ledger.h b/src/xrpld/app/ledger/Ledger.h index 0e849389fd..a17281f2c7 100644 --- a/src/xrpld/app/ledger/Ledger.h +++ b/src/xrpld/app/ledger/Ledger.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class Job; @@ -459,6 +459,6 @@ deserializeTxPlusMeta(SHAMapItem const& item); uint256 calculateLedgerHash(LedgerHeader const& info); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerCleaner.h b/src/xrpld/app/ledger/LedgerCleaner.h index 66c8c070c9..2377485f22 100644 --- a/src/xrpld/app/ledger/LedgerCleaner.h +++ b/src/xrpld/app/ledger/LedgerCleaner.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Check the ledger/transaction databases to make sure they have continuity */ class LedgerCleaner : public beast::PropertyStream::Source @@ -43,6 +43,6 @@ public: std::unique_ptr make_LedgerCleaner(Application& app, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index c084297641..2654e25d7b 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // FIXME: Need to clean up ledgers by index at some point @@ -42,7 +42,7 @@ LedgerHistory::insert( XRPL_ASSERT( ledger->stateMap().getHash().isNonZero(), - "ripple::LedgerHistory::insert : nonzero hash"); + "xrpl::LedgerHistory::insert : nonzero hash"); std::unique_lock sl(m_ledgers_by_hash.peekMutex()); @@ -85,7 +85,7 @@ LedgerHistory::getLedgerBySeq(LedgerIndex index) XRPL_ASSERT( ret->header().seq == index, - "ripple::LedgerHistory::getLedgerBySeq : result sequence match"); + "xrpl::LedgerHistory::getLedgerBySeq : result sequence match"); { // Add this ledger to the local tracking by index @@ -93,7 +93,7 @@ LedgerHistory::getLedgerBySeq(LedgerIndex index) XRPL_ASSERT( ret->isImmutable(), - "ripple::LedgerHistory::getLedgerBySeq : immutable result ledger"); + "xrpl::LedgerHistory::getLedgerBySeq : immutable result ledger"); m_ledgers_by_hash.canonicalize_replace_client(ret->header().hash, ret); mLedgersByIndex[ret->header().seq] = ret->header().hash; return (ret->header().seq == index) ? ret : nullptr; @@ -109,11 +109,11 @@ LedgerHistory::getLedgerByHash(LedgerHash const& hash) { XRPL_ASSERT( ret->isImmutable(), - "ripple::LedgerHistory::getLedgerByHash : immutable fetched " + "xrpl::LedgerHistory::getLedgerByHash : immutable fetched " "ledger"); XRPL_ASSERT( ret->header().hash == hash, - "ripple::LedgerHistory::getLedgerByHash : fetched ledger hash " + "xrpl::LedgerHistory::getLedgerByHash : fetched ledger hash " "match"); return ret; } @@ -125,14 +125,14 @@ LedgerHistory::getLedgerByHash(LedgerHash const& hash) XRPL_ASSERT( ret->isImmutable(), - "ripple::LedgerHistory::getLedgerByHash : immutable loaded ledger"); + "xrpl::LedgerHistory::getLedgerByHash : immutable loaded ledger"); XRPL_ASSERT( ret->header().hash == hash, - "ripple::LedgerHistory::getLedgerByHash : loaded ledger hash match"); + "xrpl::LedgerHistory::getLedgerByHash : loaded ledger hash match"); m_ledgers_by_hash.canonicalize_replace_client(ret->header().hash, ret); XRPL_ASSERT( ret->header().hash == hash, - "ripple::LedgerHistory::getLedgerByHash : result hash match"); + "xrpl::LedgerHistory::getLedgerByHash : result hash match"); return ret; } @@ -178,7 +178,7 @@ log_metadata_difference( XRPL_ASSERT( validMetaData || builtMetaData, - "ripple::log_metadata_difference : some metadata present"); + "xrpl::log_metadata_difference : some metadata present"); if (validMetaData && builtMetaData) { @@ -325,8 +325,7 @@ LedgerHistory::handleMismatch( Json::Value const& consensus) { XRPL_ASSERT( - built != valid, - "ripple::LedgerHistory::handleMismatch : unequal hashes"); + built != valid, "xrpl::LedgerHistory::handleMismatch : unequal hashes"); ++mismatch_counter_; auto builtLedger = getLedgerByHash(built); @@ -343,7 +342,7 @@ LedgerHistory::handleMismatch( XRPL_ASSERT( builtLedger->header().seq == validLedger->header().seq, - "ripple::LedgerHistory::handleMismatch : sequence match"); + "xrpl::LedgerHistory::handleMismatch : sequence match"); if (auto stream = j_.debug()) { @@ -437,7 +436,7 @@ LedgerHistory::builtLedger( LedgerIndex index = ledger->header().seq; LedgerHash hash = ledger->header().hash; XRPL_ASSERT( - !hash.isZero(), "ripple::LedgerHistory::builtLedger : nonzero hash"); + !hash.isZero(), "xrpl::LedgerHistory::builtLedger : nonzero hash"); std::unique_lock sl(m_consensus_validated.peekMutex()); @@ -478,8 +477,7 @@ LedgerHistory::validatedLedger( LedgerIndex index = ledger->header().seq; LedgerHash hash = ledger->header().hash; XRPL_ASSERT( - !hash.isZero(), - "ripple::LedgerHistory::validatedLedger : nonzero hash"); + !hash.isZero(), "xrpl::LedgerHistory::validatedLedger : nonzero hash"); std::unique_lock sl(m_consensus_validated.peekMutex()); @@ -538,4 +536,4 @@ LedgerHistory::clearLedgerCachePrior(LedgerIndex seq) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/LedgerHistory.h b/src/xrpld/app/ledger/LedgerHistory.h index 02346265bd..279d009429 100644 --- a/src/xrpld/app/ledger/LedgerHistory.h +++ b/src/xrpld/app/ledger/LedgerHistory.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { // VFALCO TODO Rename to OldLedgers ? @@ -135,6 +135,6 @@ private: beast::Journal j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerHolder.h b/src/xrpld/app/ledger/LedgerHolder.h index 8925d688ac..c0a81778ae 100644 --- a/src/xrpld/app/ledger/LedgerHolder.h +++ b/src/xrpld/app/ledger/LedgerHolder.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { // Can std::atomic> make this lock free? @@ -53,6 +53,6 @@ private: std::shared_ptr m_heldLedger; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerMaster.h b/src/xrpld/app/ledger/LedgerMaster.h index eba57894be..38dff835b7 100644 --- a/src/xrpld/app/ledger/LedgerMaster.h +++ b/src/xrpld/app/ledger/LedgerMaster.h @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { class Peer; class Transaction; @@ -401,6 +401,6 @@ private: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerReplay.h b/src/xrpld/app/ledger/LedgerReplay.h index 5d26d36e99..29e8a835fe 100644 --- a/src/xrpld/app/ledger/LedgerReplay.h +++ b/src/xrpld/app/ledger/LedgerReplay.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Ledger; class STTx; @@ -52,6 +52,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerReplayTask.h b/src/xrpld/app/ledger/LedgerReplayTask.h index d7d24f86f2..623a193d93 100644 --- a/src/xrpld/app/ledger/LedgerReplayTask.h +++ b/src/xrpld/app/ledger/LedgerReplayTask.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class InboundLedgers; class Ledger; class LedgerDeltaAcquire; @@ -161,6 +161,6 @@ private: friend class test::LedgerReplayClient; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerReplayer.h b/src/xrpld/app/ledger/LedgerReplayer.h index 68a1c0da1d..b0e0692019 100644 --- a/src/xrpld/app/ledger/LedgerReplayer.h +++ b/src/xrpld/app/ledger/LedgerReplayer.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { class LedgerReplayClient; @@ -141,6 +141,6 @@ private: friend class test::LedgerReplayClient; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index cd3dcc9255..7ebbfc655e 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { struct LedgerFill { @@ -53,6 +53,6 @@ addJson(Json::Value&, LedgerFill const&); Json::Value getJson(LedgerFill const&); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/LocalTxs.h b/src/xrpld/app/ledger/LocalTxs.h index c60d3bce1a..d02e1027a0 100644 --- a/src/xrpld/app/ledger/LocalTxs.h +++ b/src/xrpld/app/ledger/LocalTxs.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { // Track transactions issued by local clients // Ensure we always apply them to our open ledger @@ -42,6 +42,6 @@ public: std::unique_ptr make_LocalTxs(); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/OpenLedger.h b/src/xrpld/app/ledger/OpenLedger.h index c21e858f44..45a3517168 100644 --- a/src/xrpld/app/ledger/OpenLedger.h +++ b/src/xrpld/app/ledger/OpenLedger.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { // How many total extra passes we make // We must ensure we make at least one non-retriable pass @@ -247,7 +247,7 @@ OpenLedger::apply( // If there are any transactions left, we must have // tried them in at least one final pass XRPL_ASSERT( - retries.empty() || !retry, "ripple::OpenLedger::apply : valid retries"); + retries.empty() || !retry, "xrpl::OpenLedger::apply : valid retries"); } //------------------------------------------------------------------------------ @@ -266,6 +266,6 @@ debugTostr(SHAMap const& set); std::string debugTostr(std::shared_ptr const& view); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/OrderBookDB.cpp b/src/xrpld/app/ledger/OrderBookDB.cpp index 00907ee2ce..47b04f3d2c 100644 --- a/src/xrpld/app/ledger/OrderBookDB.cpp +++ b/src/xrpld/app/ledger/OrderBookDB.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { OrderBookDB::OrderBookDB(Application& app) : app_(app), seq_(0), j_(app.journal("OrderBookDB")) @@ -249,7 +249,7 @@ OrderBookDB::makeBookListeners(Book const& book) mListeners[book] = ret; XRPL_ASSERT( getBookListeners(book) == ret, - "ripple::OrderBookDB::makeBookListeners : result roundtrip " + "xrpl::OrderBookDB::makeBookListeners : result roundtrip " "lookup"); } @@ -325,4 +325,4 @@ OrderBookDB::processTxn( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/OrderBookDB.h b/src/xrpld/app/ledger/OrderBookDB.h index 9a1528c794..68bdf294a9 100644 --- a/src/xrpld/app/ledger/OrderBookDB.h +++ b/src/xrpld/app/ledger/OrderBookDB.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { class OrderBookDB { @@ -81,6 +81,6 @@ private: beast::Journal const j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/PendingSaves.h b/src/xrpld/app/ledger/PendingSaves.h index 5082936ec8..24eb50e568 100644 --- a/src/xrpld/app/ledger/PendingSaves.h +++ b/src/xrpld/app/ledger/PendingSaves.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Keeps track of which ledgers haven't been fully saved. @@ -124,6 +124,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/TransactionMaster.h b/src/xrpld/app/ledger/TransactionMaster.h index 5fbf00a0d5..a9bf05065d 100644 --- a/src/xrpld/app/ledger/TransactionMaster.h +++ b/src/xrpld/app/ledger/TransactionMaster.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class STTx; @@ -77,6 +77,6 @@ private: TaggedCache mCache; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/TransactionStateSF.cpp b/src/xrpld/app/ledger/TransactionStateSF.cpp index e861cbd2cc..af7dd8640a 100644 --- a/src/xrpld/app/ledger/TransactionStateSF.cpp +++ b/src/xrpld/app/ledger/TransactionStateSF.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { void TransactionStateSF::gotNode( @@ -13,7 +13,7 @@ TransactionStateSF::gotNode( { XRPL_ASSERT( type != SHAMapNodeType::tnTRANSACTION_NM, - "ripple::TransactionStateSF::gotNode : valid input"); + "xrpl::TransactionStateSF::gotNode : valid input"); db_.store( hotTRANSACTION_NODE, std::move(nodeData), @@ -27,4 +27,4 @@ TransactionStateSF::getNode(SHAMapHash const& nodeHash) const return fp_.getFetchPack(nodeHash.as_uint256()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/TransactionStateSF.h b/src/xrpld/app/ledger/TransactionStateSF.h index 50a77edc56..9950134e4b 100644 --- a/src/xrpld/app/ledger/TransactionStateSF.h +++ b/src/xrpld/app/ledger/TransactionStateSF.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // This class is only needed on add functions // sync filter for transactions tree during ledger sync @@ -34,6 +34,6 @@ private: AbstractFetchPackContainer& fp_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index d7153c0fe9..a716375f6b 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /* Generic buildLedgerImpl that dispatches to ApplyTxs invocable with signature void(OpenView&, std::shared_ptr const&) @@ -39,7 +39,7 @@ buildLedgerImpl( { OpenView accum(&*built); XRPL_ASSERT( - !accum.open(), "ripple::buildLedgerImpl : valid ledger state"); + !accum.open(), "xrpl::buildLedgerImpl : valid ledger state"); applyTxs(accum, built); accum.apply(*built); } @@ -60,7 +60,7 @@ buildLedgerImpl( XRPL_ASSERT( built->header().seq < XRP_LEDGER_EARLIEST_FEES || built->read(keylet::fees()), - "ripple::buildLedgerImpl : valid ledger fees"); + "xrpl::buildLedgerImpl : valid ledger fees"); built->setAccepted(closeTime, closeResolution, closeTimeCorrect); return built; @@ -154,7 +154,7 @@ applyTransactions( // tried them in at least one final pass XRPL_ASSERT( txns.empty() || !certainRetry, - "ripple::applyTransactions : retry transactions"); + "xrpl::applyTransactions : retry transactions"); return count; } @@ -228,4 +228,4 @@ buildLedger( }); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index cd42b4fe82..1f5e5cc7b6 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { using namespace std::chrono_literals; @@ -104,7 +104,7 @@ InboundLedger::init(ScopedLockType& collectionLock) XRPL_ASSERT( mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), - "ripple::InboundLedger::init : valid ledger fees"); + "xrpl::InboundLedger::init : valid ledger fees"); mLedger->setImmutable(); if (mReason == Reason::HISTORY) @@ -337,7 +337,7 @@ InboundLedger::tryDB(NodeStore::Database& srcDB) XRPL_ASSERT( mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), - "ripple::InboundLedger::tryDB : valid ledger fees"); + "xrpl::InboundLedger::tryDB : valid ledger fees"); mLedger->setImmutable(); } } @@ -432,15 +432,14 @@ InboundLedger::done() << mStats.get(); XRPL_ASSERT( - complete_ || failed_, - "ripple::InboundLedger::done : complete or failed"); + complete_ || failed_, "xrpl::InboundLedger::done : complete or failed"); if (complete_ && !failed_ && mLedger) { XRPL_ASSERT( mLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || mLedger->read(keylet::fees()), - "ripple::InboundLedger::done : valid ledger fees"); + "xrpl::InboundLedger::done : valid ledger fees"); mLedger->setImmutable(); switch (mReason) { @@ -604,7 +603,7 @@ InboundLedger::trigger(std::shared_ptr const& peer, TriggerReason reason) { XRPL_ASSERT( mLedger, - "ripple::InboundLedger::trigger : non-null ledger to read state " + "xrpl::InboundLedger::trigger : non-null ledger to read state " "from"); if (!mLedger->stateMap().isValid()) @@ -679,7 +678,7 @@ InboundLedger::trigger(std::shared_ptr const& peer, TriggerReason reason) { XRPL_ASSERT( mLedger, - "ripple::InboundLedger::trigger : non-null ledger to read " + "xrpl::InboundLedger::trigger : non-null ledger to read " "transactions from"); if (!mLedger->txMap().isValid()) @@ -946,7 +945,7 @@ InboundLedger::takeAsRootNode(Slice const& data, SHAMapAddNode& san) if (!mHaveHeader) { // LCOV_EXCL_START - UNREACHABLE("ripple::InboundLedger::takeAsRootNode : no ledger header"); + UNREACHABLE("xrpl::InboundLedger::takeAsRootNode : no ledger header"); return false; // LCOV_EXCL_STOP } @@ -973,7 +972,7 @@ InboundLedger::takeTxRootNode(Slice const& data, SHAMapAddNode& san) if (!mHaveHeader) { // LCOV_EXCL_START - UNREACHABLE("ripple::InboundLedger::takeTxRootNode : no ledger header"); + UNREACHABLE("xrpl::InboundLedger::takeTxRootNode : no ledger header"); return false; // LCOV_EXCL_STOP } @@ -1335,4 +1334,4 @@ InboundLedger::getJson(int) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/InboundLedgers.cpp b/src/xrpld/app/ledger/detail/InboundLedgers.cpp index fafcdb9161..445786eb63 100644 --- a/src/xrpld/app/ledger/detail/InboundLedgers.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedgers.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { class InboundLedgersImp : public InboundLedgers { @@ -56,7 +56,7 @@ public: auto doAcquire = [&, seq, reason]() -> std::shared_ptr { XRPL_ASSERT( hash.isNonZero(), - "ripple::InboundLedgersImp::acquire::doAcquire : nonzero hash"); + "xrpl::InboundLedgersImp::acquire::doAcquire : nonzero hash"); // probably not the right rule if (app_.getOPs().isNeedNetworkLedger() && @@ -146,8 +146,7 @@ public: find(uint256 const& hash) override { XRPL_ASSERT( - hash.isNonZero(), - "ripple::InboundLedgersImp::find : nonzero input"); + hash.isNonZero(), "xrpl::InboundLedgersImp::find : nonzero input"); std::shared_ptr ret; @@ -311,7 +310,7 @@ public: { XRPL_ASSERT( it.second, - "ripple::InboundLedgersImp::getInfo : non-null ledger"); + "xrpl::InboundLedgersImp::getInfo : non-null ledger"); acqs.push_back(it); } for (auto const& it : mRecentFailures) @@ -348,7 +347,7 @@ public: { XRPL_ASSERT( it.second, - "ripple::InboundLedgersImp::gotFetchPack : non-null " + "xrpl::InboundLedgersImp::gotFetchPack : non-null " "ledger"); acquires.push_back(it.second); } @@ -458,4 +457,4 @@ make_InboundLedgers( app, clock, collector, make_PeerSetBuilder(app)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index b84a03e7bb..80906c45e7 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { enum { // Ideal number of peers to start with @@ -258,4 +258,4 @@ make_InboundTransactions( app, collector, std::move(gotSet), make_PeerSetBuilder(app)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp index 639d8250ac..1eec2efc80 100644 --- a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp +++ b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /* @@ -215,7 +215,7 @@ private: break; XRPL_ASSERT( state_ == State::cleaning, - "ripple::LedgerCleanerImp::run : is cleaning"); + "xrpl::LedgerCleanerImp::run : is cleaning"); } doLedgerCleaner(); } @@ -338,8 +338,7 @@ private: bool const nonzero(refHash.isNonZero()); XRPL_ASSERT( - nonzero, - "ripple::LedgerCleanerImp::getHash : nonzero hash"); + nonzero, "xrpl::LedgerCleanerImp::getHash : nonzero hash"); if (nonzero) { // We found the hash and sequence of a better reference @@ -443,4 +442,4 @@ make_LedgerCleaner(Application& app, beast::Journal journal) return std::make_unique(app, journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index 9c190ee376..5b642ba3db 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { LedgerDeltaAcquire::LedgerDeltaAcquire( Application& app, @@ -183,10 +183,10 @@ LedgerDeltaAcquire::tryBuild(std::shared_ptr const& parent) XRPL_ASSERT( parent->seq() + 1 == replayTemp_->seq(), - "ripple::LedgerDeltaAcquire::tryBuild : parent sequence match"); + "xrpl::LedgerDeltaAcquire::tryBuild : parent sequence match"); XRPL_ASSERT( parent->header().hash == replayTemp_->header().parentHash, - "ripple::LedgerDeltaAcquire::tryBuild : parent hash match"); + "xrpl::LedgerDeltaAcquire::tryBuild : parent hash match"); // build ledger LedgerReplay replayData(parent, replayTemp_, std::move(orderedTxns_)); fullLedger_ = buildLedger(replayData, tapNONE, app_, journal_); @@ -248,7 +248,7 @@ LedgerDeltaAcquire::onLedgerBuilt( void LedgerDeltaAcquire::notify(ScopedLockType& sl) { - XRPL_ASSERT(isDone(), "ripple::LedgerDeltaAcquire::notify : is done"); + XRPL_ASSERT(isDone(), "xrpl::LedgerDeltaAcquire::notify : is done"); std::vector toCall; std::swap(toCall, dataReadyCallbacks_); auto const good = !failed_; @@ -262,4 +262,4 @@ LedgerDeltaAcquire::notify(ScopedLockType& sl) sl.lock(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h index a2c300c546..779bbfa85e 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { class InboundLedgers; class PeerSet; namespace test { @@ -142,6 +142,6 @@ private: friend class test::LedgerReplayClient; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 3e75a28abd..2a2424995e 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -37,7 +37,7 @@ #include #include -namespace ripple { +namespace xrpl { // Don't catch up more than 100 ledgers (cannot exceed 256) static constexpr int MAX_LEDGER_GAP{100}; @@ -257,7 +257,7 @@ LedgerMaster::setValidLedger(std::shared_ptr const& l) mValidLedgerSeq || !app_.getMaxDisallowedLedger() || l->header().seq + max_ledger_difference_ > app_.getMaxDisallowedLedger(), - "ripple::LedgerMaster::setValidLedger : valid ledger sequence"); + "xrpl::LedgerMaster::setValidLedger : valid ledger sequence"); (void)max_ledger_difference_; mValidLedgerSeq = l->header().seq; @@ -322,7 +322,7 @@ LedgerMaster::addHeldTransaction( bool LedgerMaster::canBeCurrent(std::shared_ptr const& ledger) { - XRPL_ASSERT(ledger, "ripple::LedgerMaster::canBeCurrent : non-null input"); + XRPL_ASSERT(ledger, "xrpl::LedgerMaster::canBeCurrent : non-null input"); // Never jump to a candidate ledger that precedes our // last validated ledger @@ -390,7 +390,7 @@ LedgerMaster::canBeCurrent(std::shared_ptr const& ledger) void LedgerMaster::switchLCL(std::shared_ptr const& lastClosed) { - XRPL_ASSERT(lastClosed, "ripple::LedgerMaster::switchLCL : non-null input"); + XRPL_ASSERT(lastClosed, "xrpl::LedgerMaster::switchLCL : non-null input"); if (!lastClosed->isImmutable()) LogicError("mutable ledger in switchLCL"); @@ -500,7 +500,7 @@ LedgerMaster::isValidated(ReadView const& ledger) { XRPL_ASSERT( hash->isNonZero(), - "ripple::LedgerMaster::isValidated : nonzero hash"); + "xrpl::LedgerMaster::isValidated : nonzero hash"); uint256 valHash = app_.getRelationalDatabase().getHashByIndex(seq); if (valHash == ledger.header().hash) @@ -792,7 +792,7 @@ LedgerMaster::setFullLedger( << " accepted :" << ledger->header().hash; XRPL_ASSERT( ledger->stateMap().getHash().isNonZero(), - "ripple::LedgerMaster::setFullLedger : nonzero ledger state hash"); + "xrpl::LedgerMaster::setFullLedger : nonzero ledger state hash"); ledger->setValidated(); ledger->setFull(); @@ -1258,7 +1258,7 @@ LedgerMaster::findNewLedgersToPublish( JLOG(m_journal.fatal()) << "Ledger: " << valSeq << " does not have hash for " << seq; UNREACHABLE( - "ripple::LedgerMaster::findNewLedgersToPublish : ledger " + "xrpl::LedgerMaster::findNewLedgersToPublish : ledger " "not found"); // LCOV_EXCL_STOP } @@ -1349,7 +1349,7 @@ LedgerMaster::tryAdvance() XRPL_ASSERT( !mValidLedger.empty() && mAdvanceThread, - "ripple::LedgerMaster::tryAdvance : has valid ledger"); + "xrpl::LedgerMaster::tryAdvance : has valid ledger"); JLOG(m_journal.trace()) << "advanceThread<"; @@ -1651,7 +1651,7 @@ LedgerMaster::walkHashBySeq( // be located easily and should contain the hash. LedgerIndex refIndex = getCandidateLedger(index); auto const refHash = hashOfSeq(*referenceLedger, refIndex, m_journal); - XRPL_ASSERT(refHash, "ripple::LedgerMaster::walkHashBySeq : found ledger"); + XRPL_ASSERT(refHash, "xrpl::LedgerMaster::walkHashBySeq : found ledger"); if (refHash) { // Try the hash and sequence of a better reference ledger just found @@ -1678,7 +1678,7 @@ LedgerMaster::walkHashBySeq( ledgerHash = hashOfSeq(*l, index, m_journal); XRPL_ASSERT( ledgerHash, - "ripple::LedgerMaster::walkHashBySeq : has complete " + "xrpl::LedgerMaster::walkHashBySeq : has complete " "ledger"); } } @@ -1793,7 +1793,7 @@ LedgerMaster::fetchForHistory( { XRPL_ASSERT( hash->isNonZero(), - "ripple::LedgerMaster::fetchForHistory : found ledger"); + "xrpl::LedgerMaster::fetchForHistory : found ledger"); auto ledger = getLedgerByHash(*hash); if (!ledger) { @@ -1822,7 +1822,7 @@ LedgerMaster::fetchForHistory( auto seq = ledger->header().seq; XRPL_ASSERT( seq == missing, - "ripple::LedgerMaster::fetchForHistory : sequence match"); + "xrpl::LedgerMaster::fetchForHistory : sequence match"); JLOG(m_journal.trace()) << "fetchForHistory acquired " << seq; setFullLedger(ledger, false, false); int fillInProgress; @@ -1865,7 +1865,7 @@ LedgerMaster::fetchForHistory( { XRPL_ASSERT( h->isNonZero(), - "ripple::LedgerMaster::fetchForHistory : " + "xrpl::LedgerMaster::fetchForHistory : " "prefetched ledger"); app_.getInboundLedgers().acquire(*h, seq, reason); } @@ -2052,7 +2052,7 @@ populateFetchPack( std::uint32_t seq, bool withLeaves = true) { - XRPL_ASSERT(cnt, "ripple::populateFetchPack : nonzero count input"); + XRPL_ASSERT(cnt, "xrpl::populateFetchPack : nonzero count input"); Serializer s(1024); @@ -2242,4 +2242,4 @@ LedgerMaster::txnIdFromIndex(uint32_t ledgerSeq, uint32_t txnIndex) return {}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerReplay.cpp b/src/xrpld/app/ledger/detail/LedgerReplay.cpp index 85ec420bbf..5d7ce0e69f 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplay.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplay.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { LedgerReplay::LedgerReplay( std::shared_ptr parent, @@ -26,4 +26,4 @@ LedgerReplay::LedgerReplay( { } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp index 0a070fdeb0..e1eb51fda7 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { LedgerReplayMsgHandler::LedgerReplayMsgHandler( Application& app, LedgerReplayer& replayer) @@ -273,4 +273,4 @@ LedgerReplayMsgHandler::processReplayDeltaResponse( return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h index 276bf316e1..fff3e75460 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class LedgerReplayer; @@ -54,6 +54,6 @@ private: beast::Journal journal_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp index 4e73b54d53..cd174b098f 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { LedgerReplayTask::TaskParameter::TaskParameter( InboundLedger::Reason r, @@ -14,7 +14,7 @@ LedgerReplayTask::TaskParameter::TaskParameter( { XRPL_ASSERT( finishLedgerHash.isNonZero() && totalNumLedgers > 0, - "ripple::LedgerReplayTask::TaskParameter::TaskParameter : valid " + "xrpl::LedgerReplayTask::TaskParameter::TaskParameter : valid " "inputs"); } @@ -33,7 +33,7 @@ LedgerReplayTask::TaskParameter::update( startHash_ = skipList_[skipList_.size() - totalLedgers_]; XRPL_ASSERT( startHash_.isNonZero(), - "ripple::LedgerReplayTask::TaskParameter::update : nonzero start hash"); + "xrpl::LedgerReplayTask::TaskParameter::update : nonzero start hash"); startSeq_ = finishSeq_ - totalLedgers_ + 1; full_ = true; return true; @@ -187,7 +187,7 @@ LedgerReplayTask::tryAdvance(ScopedLockType& sl) auto& delta = deltas_[deltaToBuild_]; XRPL_ASSERT( parent_->seq() + 1 == delta->ledgerSeq_, - "ripple::LedgerReplayTask::tryAdvance : consecutive sequence"); + "xrpl::LedgerReplayTask::tryAdvance : consecutive sequence"); if (auto l = delta->tryBuild(parent_); l) { JLOG(journal_.debug()) @@ -279,7 +279,7 @@ LedgerReplayTask::addDelta(std::shared_ptr const& delta) XRPL_ASSERT( deltas_.empty() || deltas_.back()->ledgerSeq_ + 1 == delta->ledgerSeq_, - "ripple::LedgerReplayTask::addDelta : no deltas or consecutive " + "xrpl::LedgerReplayTask::addDelta : no deltas or consecutive " "sequence"); deltas_.push_back(delta); } @@ -292,4 +292,4 @@ LedgerReplayTask::finished() const return isDone(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp index 1f89b6c044..1d1cdf3ec2 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { LedgerReplayer::LedgerReplayer( Application& app, @@ -30,7 +30,7 @@ LedgerReplayer::replay( XRPL_ASSERT( finishLedgerHash.isNonZero() && totalNumLedgers > 0 && totalNumLedgers <= LedgerReplayParameters::MAX_TASK_SIZE, - "ripple::LedgerReplayer::replay : valid inputs"); + "xrpl::LedgerReplayer::replay : valid inputs"); LedgerReplayTask::TaskParameter parameter( r, finishLedgerHash, totalNumLedgers); @@ -266,4 +266,4 @@ LedgerReplayer::stop() JLOG(j_.info()) << "Stopped"; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index f571669e5c..8c9e21acde 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace { @@ -342,4 +342,4 @@ getJson(LedgerFill const& fill) return json; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/LocalTxs.cpp b/src/xrpld/app/ledger/detail/LocalTxs.cpp index 4d26b60a6f..1e9cfe0b9b 100644 --- a/src/xrpld/app/ledger/detail/LocalTxs.cpp +++ b/src/xrpld/app/ledger/detail/LocalTxs.cpp @@ -27,7 +27,7 @@ test-applied to all new open ledgers until seen in a fully- validated ledger */ -namespace ripple { +namespace xrpl { // This class wraps a pointer to a transaction along with // its expiration ledger. It also caches the issuing account. @@ -175,4 +175,4 @@ make_LocalTxs() return std::make_unique(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/OpenLedger.cpp b/src/xrpld/app/ledger/detail/OpenLedger.cpp index 14db13aad4..35f4b75157 100644 --- a/src/xrpld/app/ledger/detail/OpenLedger.cpp +++ b/src/xrpld/app/ledger/detail/OpenLedger.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { OpenLedger::OpenLedger( std::shared_ptr const& ledger, @@ -163,7 +163,7 @@ OpenLedger::apply_one( if (retry) flags = flags | tapRETRY; // If it's in anybody's proposed set, try to keep it in the ledger - auto const result = ripple::apply(app, view, *tx, flags, j); + auto const result = xrpl::apply(app, view, *tx, flags, j); if (result.applied || result.ter == terQUEUED) return Result::success; if (isTefFailure(result.ter) || isTemMalformed(result.ter) || @@ -220,4 +220,4 @@ debugTostr(std::shared_ptr const& view) return ss.str(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp index a6dbf40d4d..5f4b0dc339 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { SkipListAcquire::SkipListAcquire( Application& app, @@ -121,7 +121,7 @@ SkipListAcquire::processData( { XRPL_ASSERT( ledgerSeq != 0 && item, - "ripple::SkipListAcquire::processData : valid inputs"); + "xrpl::SkipListAcquire::processData : valid inputs"); ScopedLockType sl(mtx_); if (isDone()) return; @@ -206,7 +206,7 @@ SkipListAcquire::onSkipListAcquired( void SkipListAcquire::notify(ScopedLockType& sl) { - XRPL_ASSERT(isDone(), "ripple::SkipListAcquire::notify : is done"); + XRPL_ASSERT(isDone(), "xrpl::SkipListAcquire::notify : is done"); std::vector toCall; std::swap(toCall, dataReadyCallbacks_); auto const good = !failed_; @@ -220,4 +220,4 @@ SkipListAcquire::notify(ScopedLockType& sl) sl.lock(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.h b/src/xrpld/app/ledger/detail/SkipListAcquire.h index 816bacc4cb..15c420a5cd 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.h +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class InboundLedgers; class PeerSet; namespace test { @@ -36,11 +36,11 @@ public: struct SkipListData { std::uint32_t const ledgerSeq; - std::vector const skipList; + std::vector const skipList; SkipListData( std::uint32_t const ledgerSeq, - std::vector const& skipList) + std::vector const& skipList) : ledgerSeq(ledgerSeq), skipList(skipList) { } @@ -144,6 +144,6 @@ private: friend class test::LedgerReplayClient; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp index d4e7e9a73c..3482725148 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { using namespace std::chrono_literals; @@ -25,7 +25,7 @@ TimeoutCounter::TimeoutCounter( { XRPL_ASSERT( (timerInterval_ > 10ms) && (timerInterval_ < 30s), - "ripple::TimeoutCounter::TimeoutCounter : interval input inside range"); + "xrpl::TimeoutCounter::TimeoutCounter : interval input inside range"); } void @@ -107,4 +107,4 @@ TimeoutCounter::cancel() } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.h b/src/xrpld/app/ledger/detail/TimeoutCounter.h index 1ce4c48415..c228d50aac 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.h +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { /** This class is an "active" object. It maintains its own timer @@ -102,7 +102,7 @@ protected: } // Used in this class for access to boost::asio::io_context and - // ripple::Overlay. Used in subtypes for the kitchen sink. + // xrpl::Overlay. Used in subtypes for the kitchen sink. Application& app_; beast::Journal journal_; mutable std::recursive_mutex mtx_; @@ -130,6 +130,6 @@ private: boost::asio::basic_waitable_timer timer_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp index 4c50c5087c..3cd0e84ef0 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { using namespace std::chrono_literals; @@ -244,4 +244,4 @@ TransactionAcquire::stillNeed() failed_ = false; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.h b/src/xrpld/app/ledger/detail/TransactionAcquire.h index 60afab7928..83f9b62f83 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.h +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { // VFALCO TODO rename to PeerTxRequest // A transaction set we are trying to acquire @@ -54,6 +54,6 @@ private: pmDowncast() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/TransactionMaster.cpp b/src/xrpld/app/ledger/detail/TransactionMaster.cpp index 266a067f66..e8580bcfc6 100644 --- a/src/xrpld/app/ledger/detail/TransactionMaster.cpp +++ b/src/xrpld/app/ledger/detail/TransactionMaster.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { TransactionMaster::TransactionMaster(Application& app) : mApp(app) @@ -151,4 +151,4 @@ TransactionMaster::getCache() return mCache; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index e28cd559e9..15abff9b14 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -66,7 +66,7 @@ #include #include -namespace ripple { +namespace xrpl { static void fixConfigPorts(Config& config, Endpoints const& endpoints); @@ -569,7 +569,7 @@ public: { XRPL_ASSERT( serverHandler_, - "ripple::ApplicationImp::getServerHandler : non-null server " + "xrpl::ApplicationImp::getServerHandler : non-null server " "handle"); return *serverHandler_; } @@ -777,7 +777,7 @@ public: overlay() override { XRPL_ASSERT( - overlay_, "ripple::ApplicationImp::overlay : non-null overlay"); + overlay_, "xrpl::ApplicationImp::overlay : non-null overlay"); return *overlay_; } @@ -785,8 +785,7 @@ public: getTxQ() override { XRPL_ASSERT( - txQ_, - "ripple::ApplicationImp::getTxQ : non-null transaction queue"); + txQ_, "xrpl::ApplicationImp::getTxQ : non-null transaction queue"); return *txQ_; } @@ -795,7 +794,7 @@ public: { XRPL_ASSERT( mRelationalDatabase, - "ripple::ApplicationImp::getRelationalDatabase : non-null " + "xrpl::ApplicationImp::getRelationalDatabase : non-null " "relational database"); return *mRelationalDatabase; } @@ -805,7 +804,7 @@ public: { XRPL_ASSERT( mWalletDB, - "ripple::ApplicationImp::getWalletDB : non-null wallet database"); + "xrpl::ApplicationImp::getWalletDB : non-null wallet database"); return *mWalletDB; } @@ -822,7 +821,7 @@ public: { XRPL_ASSERT( mWalletDB.get() == nullptr, - "ripple::ApplicationImp::initRelationalDatabase : null wallet " + "xrpl::ApplicationImp::initRelationalDatabase : null wallet " "database"); try @@ -1223,9 +1222,9 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) supported.reserve(amendments.size()); for (auto const& [a, vote] : amendments) { - auto const f = ripple::getRegisteredFeature(a); + auto const f = xrpl::getRegisteredFeature(a); XRPL_ASSERT( - f, "ripple::ApplicationImp::setup : registered feature"); + f, "xrpl::ApplicationImp::setup : registered feature"); if (f) supported.emplace_back(a, *f, vote); } @@ -1701,7 +1700,7 @@ ApplicationImp::startGenesisLedger() XRPL_ASSERT( next->header().seq < XRP_LEDGER_EARLIEST_FEES || next->read(keylet::fees()), - "ripple::ApplicationImp::startGenesisLedger : valid ledger fees"); + "xrpl::ApplicationImp::startGenesisLedger : valid ledger fees"); next->setImmutable(); openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger")); m_ledgerMaster->storeLedger(next); @@ -1723,7 +1722,7 @@ ApplicationImp::getLastFullLedger() XRPL_ASSERT( ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()), - "ripple::ApplicationImp::getLastFullLedger : valid ledger fees"); + "xrpl::ApplicationImp::getLastFullLedger : valid ledger fees"); ledger->setImmutable(); if (getLedgerMaster().haveLedger(seq)) @@ -1878,7 +1877,7 @@ ApplicationImp::loadLedgerFromFile(std::string const& name) XRPL_ASSERT( loadLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || loadLedger->read(keylet::fees()), - "ripple::ApplicationImp::loadLedgerFromFile : valid ledger fees"); + "xrpl::ApplicationImp::loadLedgerFromFile : valid ledger fees"); loadLedger->setAccepted( closeTime, closeTimeResolution, !closeTimeEstimated); @@ -1978,7 +1977,7 @@ ApplicationImp::loadOldLedger( // LCOV_EXCL_START JLOG(m_journal.fatal()) << "Replay ledger missing/damaged"; UNREACHABLE( - "ripple::ApplicationImp::loadOldLedger : replay ledger " + "xrpl::ApplicationImp::loadOldLedger : replay ledger " "missing/damaged"); return false; // LCOV_EXCL_STOP @@ -2011,7 +2010,7 @@ ApplicationImp::loadOldLedger( // LCOV_EXCL_START JLOG(m_journal.fatal()) << "Ledger is empty."; UNREACHABLE( - "ripple::ApplicationImp::loadOldLedger : ledger is empty"); + "xrpl::ApplicationImp::loadOldLedger : ledger is empty"); return false; // LCOV_EXCL_STOP } @@ -2021,7 +2020,7 @@ ApplicationImp::loadOldLedger( // LCOV_EXCL_START JLOG(m_journal.fatal()) << "Ledger is missing nodes."; UNREACHABLE( - "ripple::ApplicationImp::loadOldLedger : ledger is missing " + "xrpl::ApplicationImp::loadOldLedger : ledger is missing " "nodes"); return false; // LCOV_EXCL_STOP @@ -2032,7 +2031,7 @@ ApplicationImp::loadOldLedger( // LCOV_EXCL_START JLOG(m_journal.fatal()) << "Ledger is not sensible."; UNREACHABLE( - "ripple::ApplicationImp::loadOldLedger : ledger is not " + "xrpl::ApplicationImp::loadOldLedger : ledger is not " "sensible"); return false; // LCOV_EXCL_STOP @@ -2206,4 +2205,4 @@ fixConfigPorts(Config& config, Endpoints const& endpoints) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index d8cceb687b..ffb3cd9983 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace unl { class Manager; @@ -264,6 +264,6 @@ make_Application( std::unique_ptr logs, std::unique_ptr timeKeeper); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/CollectorManager.cpp b/src/xrpld/app/main/CollectorManager.cpp index d66b08db8c..110ea564d8 100644 --- a/src/xrpld/app/main/CollectorManager.cpp +++ b/src/xrpld/app/main/CollectorManager.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { class CollectorManagerImp : public CollectorManager { @@ -56,4 +56,4 @@ make_CollectorManager(Section const& params, beast::Journal journal) return std::make_unique(params, journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/CollectorManager.h b/src/xrpld/app/main/CollectorManager.h index d0cc35f94f..d0d202625c 100644 --- a/src/xrpld/app/main/CollectorManager.h +++ b/src/xrpld/app/main/CollectorManager.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Provides the beast::insight::Collector service. */ class CollectorManager @@ -22,6 +22,6 @@ public: std::unique_ptr make_CollectorManager(Section const& params, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/DBInit.h b/src/xrpld/app/main/DBInit.h index 9219db715a..60ff4b498b 100644 --- a/src/xrpld/app/main/DBInit.h +++ b/src/xrpld/app/main/DBInit.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { //////////////////////////////////////////////////////////////////////////////// @@ -116,6 +116,6 @@ inline constexpr std::array WalletDBInit{ "END TRANSACTION;"}}; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 03aa0f6612..e415ee14cf 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace { @@ -249,7 +249,7 @@ template std::optional GRPCServerImpl::CallData::getClientEndpoint() { - return ripple::getEndpoint(ctx_.peer()); + return xrpl::getEndpoint(ctx_.peer()); } template @@ -601,7 +601,7 @@ GRPCServer::stop() GRPCServer::~GRPCServer() { - XRPL_ASSERT(!running_, "ripple::GRPCServer::~GRPCServer : is not running"); + XRPL_ASSERT(!running_, "xrpl::GRPCServer::~GRPCServer : is not running"); } boost::asio::ip::tcp::endpoint @@ -610,4 +610,4 @@ GRPCServer::getEndpoint() const return impl_.getEndpoint(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index eba666cc35..dab71303c4 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { // Interface that CallData implements class Processor @@ -305,5 +305,5 @@ private: std::thread thread_; bool running_ = false; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/LoadManager.cpp b/src/xrpld/app/main/LoadManager.cpp index 92a4c49bf2..91afb67eb7 100644 --- a/src/xrpld/app/main/LoadManager.cpp +++ b/src/xrpld/app/main/LoadManager.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { LoadManager::LoadManager(Application& app, beast::Journal journal) : app_(app), journal_(journal), lastHeartbeat_(), armed_(false) @@ -56,8 +56,7 @@ LoadManager::start() { JLOG(journal_.debug()) << "Starting"; XRPL_ASSERT( - !thread_.joinable(), - "ripple::LoadManager::start : thread not joinable"); + !thread_.joinable(), "xrpl::LoadManager::start : thread not joinable"); thread_ = std::thread{&LoadManager::run, this}; } @@ -182,4 +181,4 @@ make_LoadManager(Application& app, beast::Journal journal) return std::unique_ptr{new LoadManager{app, journal}}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/LoadManager.h b/src/xrpld/app/main/LoadManager.h index bd3a72b80b..15caa9b0f0 100644 --- a/src/xrpld/app/main/LoadManager.h +++ b/src/xrpld/app/main/LoadManager.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; @@ -94,6 +94,6 @@ private: std::unique_ptr make_LoadManager(Application& app, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/Main.cpp b/src/xrpld/app/main/Main.cpp index 2491149160..7c138168e4 100644 --- a/src/xrpld/app/main/Main.cpp +++ b/src/xrpld/app/main/Main.cpp @@ -53,7 +53,7 @@ namespace po = boost::program_options; -namespace ripple { +namespace xrpl { bool adjustDescriptorLimit(int needed, beast::Journal j) @@ -248,9 +248,9 @@ runUnitTests( char** argv) { using namespace beast::unit_test; - using namespace ripple::test; + using namespace xrpl::test; - ripple::test::envUseIPv4 = (!ipv6); + xrpl::test::envUseIPv4 = (!ipv6); if (!child && num_jobs == 1) { @@ -829,7 +829,7 @@ run(int argc, char** argv) // LCOV_EXCL_STOP } -} // namespace ripple +} // namespace xrpl int main(int argc, char** argv) @@ -854,5 +854,5 @@ main(int argc, char** argv) atexit(&google::protobuf::ShutdownProtobufLibrary); - return ripple::run(argc, argv); + return xrpl::run(argc, argv); } diff --git a/src/xrpld/app/main/NodeIdentity.cpp b/src/xrpld/app/main/NodeIdentity.cpp index 4c7148642c..73ef3f0152 100644 --- a/src/xrpld/app/main/NodeIdentity.cpp +++ b/src/xrpld/app/main/NodeIdentity.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { std::pair getNodeIdentity( @@ -46,4 +46,4 @@ getNodeIdentity( return getNodeIdentity(*db); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/NodeIdentity.h b/src/xrpld/app/main/NodeIdentity.h index fcef1d1d03..7fdb748033 100644 --- a/src/xrpld/app/main/NodeIdentity.h +++ b/src/xrpld/app/main/NodeIdentity.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { /** The cryptographic credentials identifying this server instance. @@ -20,6 +20,6 @@ getNodeIdentity( Application& app, boost::program_options::variables_map const& cmdline); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/NodeStoreScheduler.cpp b/src/xrpld/app/main/NodeStoreScheduler.cpp index ba9c2ff281..221c1f098e 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.cpp +++ b/src/xrpld/app/main/NodeStoreScheduler.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { NodeStoreScheduler::NodeStoreScheduler(JobQueue& jobQueue) : jobQueue_(jobQueue) { @@ -44,4 +44,4 @@ NodeStoreScheduler::onBatchWrite(NodeStore::BatchWriteReport const& report) jobQueue_.addLoadEvents(jtNS_WRITE, report.writeCount, report.elapsed); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/main/NodeStoreScheduler.h b/src/xrpld/app/main/NodeStoreScheduler.h index 6a5cb8e8ee..0214b76660 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.h +++ b/src/xrpld/app/main/NodeStoreScheduler.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { /** A NodeStore::Scheduler which uses the JobQueue. */ class NodeStoreScheduler : public NodeStore::Scheduler @@ -23,6 +23,6 @@ private: JobQueue& jobQueue_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/main/Tuning.h b/src/xrpld/app/main/Tuning.h index 6c7db8ea72..25cc2ef75d 100644 --- a/src/xrpld/app/main/Tuning.h +++ b/src/xrpld/app/main/Tuning.h @@ -3,13 +3,13 @@ #include -namespace ripple { +namespace xrpl { constexpr std::size_t fullBelowTargetSize = 524288; constexpr std::chrono::seconds fullBelowExpiration = std::chrono::minutes{10}; constexpr std::size_t maxPoppedTransactions = 10; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/AMMHelpers.h b/src/xrpld/app/misc/AMMHelpers.h index c300774553..3a33f49ee4 100644 --- a/src/xrpld/app/misc/AMMHelpers.h +++ b/src/xrpld/app/misc/AMMHelpers.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -761,6 +761,6 @@ adjustFracByTokens( STAmount const& tokens, Number const& frac); -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_MISC_AMMHELPERS_H_INCLUDED diff --git a/src/xrpld/app/misc/AMMUtils.h b/src/xrpld/app/misc/AMMUtils.h index 7369ee4998..266f50bb87 100644 --- a/src/xrpld/app/misc/AMMUtils.h +++ b/src/xrpld/app/misc/AMMUtils.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { class ReadView; class ApplyView; @@ -116,6 +116,6 @@ verifyAndAdjustLPTokenBalance( std::shared_ptr& ammSle, AccountID const& account); -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_MISC_AMMUTILS_H_INCLUDED diff --git a/src/xrpld/app/misc/AmendmentTable.h b/src/xrpld/app/misc/AmendmentTable.h index af436205fb..0265e0127f 100644 --- a/src/xrpld/app/misc/AmendmentTable.h +++ b/src/xrpld/app/misc/AmendmentTable.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { /** The amendment table stores the list of enabled and potential amendments. Individuals amendments are voted on by validators during the consensus @@ -177,6 +177,6 @@ make_AmendmentTable( Section const& vetoed, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/CanonicalTXSet.cpp b/src/xrpld/app/misc/CanonicalTXSet.cpp index 311d120d4e..ac1b86e62f 100644 --- a/src/xrpld/app/misc/CanonicalTXSet.cpp +++ b/src/xrpld/app/misc/CanonicalTXSet.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { bool operator<(CanonicalTXSet::Key const& lhs, CanonicalTXSet::Key const& rhs) @@ -71,4 +71,4 @@ CanonicalTXSet::popAcctTransaction(std::shared_ptr const& tx) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/CanonicalTXSet.h b/src/xrpld/app/misc/CanonicalTXSet.h index 9a7d7fe171..8d0461a845 100644 --- a/src/xrpld/app/misc/CanonicalTXSet.h +++ b/src/xrpld/app/misc/CanonicalTXSet.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Holds transactions which were deferred to the next pass of consensus. @@ -156,6 +156,6 @@ private: uint256 salt_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/DelegateUtils.h b/src/xrpld/app/misc/DelegateUtils.h index 21b78ca71c..37d9195a82 100644 --- a/src/xrpld/app/misc/DelegateUtils.h +++ b/src/xrpld/app/misc/DelegateUtils.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * Check if the delegate account has permission to execute the transaction. @@ -33,6 +33,6 @@ loadGranularPermission( TxType const& type, std::unordered_set& granularPermissions); -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_MISC_DELEGATEUTILS_H_INCLUDED diff --git a/src/xrpld/app/misc/DeliverMax.h b/src/xrpld/app/misc/DeliverMax.h index 0847bf185d..e9455354f8 100644 --- a/src/xrpld/app/misc/DeliverMax.h +++ b/src/xrpld/app/misc/DeliverMax.h @@ -7,7 +7,7 @@ namespace Json { class Value; } -namespace ripple { +namespace xrpl { namespace RPC { @@ -26,6 +26,6 @@ insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion); /** @} */ } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/FeeVote.h b/src/xrpld/app/misc/FeeVote.h index 15fd8e39fe..aed64be2c2 100644 --- a/src/xrpld/app/misc/FeeVote.h +++ b/src/xrpld/app/misc/FeeVote.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Manager to process fee votes. */ class FeeVote @@ -44,6 +44,6 @@ struct FeeSetup; std::unique_ptr make_FeeVote(FeeSetup const& setup, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/FeeVoteImpl.cpp b/src/xrpld/app/misc/FeeVoteImpl.cpp index 88c33bd66b..a6b140f691 100644 --- a/src/xrpld/app/misc/FeeVoteImpl.cpp +++ b/src/xrpld/app/misc/FeeVoteImpl.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -182,7 +182,7 @@ FeeVoteImpl::doVoting( // LCL must be flag ledger XRPL_ASSERT( lastClosedLedger && isFlagLedger(lastClosedLedger->seq()), - "ripple::FeeVoteImpl::doVoting : has a flag ledger"); + "xrpl::FeeVoteImpl::doVoting : has a flag ledger"); detail::VotableValue baseFeeVote( lastClosedLedger->fees().base, target_.reference_fee); @@ -323,4 +323,4 @@ make_FeeVote(FeeSetup const& setup, beast::Journal journal) return std::make_unique(setup, journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/HashRouter.cpp b/src/xrpld/app/misc/HashRouter.cpp index da27158969..0cad01c27e 100644 --- a/src/xrpld/app/misc/HashRouter.cpp +++ b/src/xrpld/app/misc/HashRouter.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { auto HashRouter::emplace(uint256 const& key) -> std::pair @@ -87,7 +87,7 @@ bool HashRouter::setFlags(uint256 const& key, HashRouterFlags flags) { XRPL_ASSERT( - static_cast(flags), "ripple::HashRouter::setFlags : valid input"); + static_cast(flags), "xrpl::HashRouter::setFlags : valid input"); std::lock_guard lock(mutex_); @@ -149,4 +149,4 @@ setup_HashRouter(Config const& config) return setup; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/HashRouter.h b/src/xrpld/app/misc/HashRouter.h index f7ecb153fe..1b59797b28 100644 --- a/src/xrpld/app/misc/HashRouter.h +++ b/src/xrpld/app/misc/HashRouter.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { enum class HashRouterFlags : std::uint16_t { // Public flags @@ -270,6 +270,6 @@ private: HashRouter::Setup setup_HashRouter(Config const&); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/LendingHelpers.h b/src/xrpld/app/misc/LendingHelpers.h index 559af28a47..071466f05c 100644 --- a/src/xrpld/app/misc/LendingHelpers.h +++ b/src/xrpld/app/misc/LendingHelpers.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { struct PreflightContext; @@ -155,7 +155,7 @@ struct LoanState XRPL_ASSERT_PARTS( interestDue + managementFeeDue == valueOutstanding - principalOutstanding, - "ripple::LoanState::interestOutstanding", + "xrpl::LoanState::interestOutstanding", "other values add up correctly"); return interestDue + managementFeeDue; } @@ -439,6 +439,6 @@ loanMakePayment( LoanPaymentType const paymentType, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_MISC_LENDINGHELPERS_H_INCLUDED diff --git a/src/xrpld/app/misc/LoadFeeTrack.h b/src/xrpld/app/misc/LoadFeeTrack.h index dfae110fb4..181fb0536e 100644 --- a/src/xrpld/app/misc/LoadFeeTrack.h +++ b/src/xrpld/app/misc/LoadFeeTrack.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { struct Fees; @@ -147,6 +147,6 @@ scaleFeeLoad( Fees const& fees, bool bUnlimited); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/Manifest.h b/src/xrpld/app/misc/Manifest.h index 49b345d095..24e4f5f71f 100644 --- a/src/xrpld/app/misc/Manifest.h +++ b/src/xrpld/app/misc/Manifest.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /* Validator key manifests @@ -443,6 +443,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/NegativeUNLVote.cpp b/src/xrpld/app/misc/NegativeUNLVote.cpp index 23d3248ba6..12467697fa 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.cpp +++ b/src/xrpld/app/misc/NegativeUNLVote.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { NegativeUNLVote::NegativeUNLVote(NodeID const& myId, beast::Journal j) : myId_(myId), j_(j) @@ -73,7 +73,7 @@ NegativeUNLVote::doVoting( prevLedger->header().hash, candidates.toDisableCandidates); XRPL_ASSERT( nidToKeyMap.contains(n), - "ripple::NegativeUNLVote::doVoting : found node to disable"); + "xrpl::NegativeUNLVote::doVoting : found node to disable"); addTx(seq, nidToKeyMap.at(n), ToDisable, initialSet); } @@ -83,7 +83,7 @@ NegativeUNLVote::doVoting( prevLedger->header().hash, candidates.toReEnableCandidates); XRPL_ASSERT( nidToKeyMap.contains(n), - "ripple::NegativeUNLVote::doVoting : found node to enable"); + "xrpl::NegativeUNLVote::doVoting : found node to enable"); addTx(seq, nidToKeyMap.at(n), ToReEnable, initialSet); } } @@ -127,8 +127,7 @@ NegativeUNLVote::choose( std::vector const& candidates) { XRPL_ASSERT( - !candidates.empty(), - "ripple::NegativeUNLVote::choose : non-empty input"); + !candidates.empty(), "xrpl::NegativeUNLVote::choose : non-empty input"); static_assert(NodeID::bytes <= uint256::bytes); NodeID randomPad = NodeID::fromVoid(randomPadData.data()); NodeID txNodeID = candidates[0]; @@ -336,4 +335,4 @@ NegativeUNLVote::purgeNewValidators(LedgerIndex seq) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/NegativeUNLVote.h b/src/xrpld/app/misc/NegativeUNLVote.h index 77b4035a0d..3146294923 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.h +++ b/src/xrpld/app/misc/NegativeUNLVote.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { template class Validations; @@ -194,6 +194,6 @@ private: friend class test::NegativeUNLVoteScoreTable_test; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 39ec0b78c9..084a584377 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -64,7 +64,7 @@ #include #include -namespace ripple { +namespace xrpl { class NetworkOPsImp final : public NetworkOPs { @@ -91,7 +91,7 @@ class NetworkOPsImp final : public NetworkOPs { XRPL_ASSERT( local || failType == FailHard::no, - "ripple::NetworkOPsImp::TransactionStatus::TransactionStatus : " + "xrpl::NetworkOPsImp::TransactionStatus::TransactionStatus : " "valid inputs"); } }; @@ -1267,7 +1267,7 @@ NetworkOPsImp::preProcessTransaction(std::shared_ptr& transaction) checkValidity(app_.getHashRouter(), sttx, view->rules(), app_.config()); XRPL_ASSERT( validity == Validity::Valid, - "ripple::NetworkOPsImp::processTransaction : valid validity"); + "xrpl::NetworkOPsImp::processTransaction : valid validity"); // Not concerned with local checks at this point. if (validity == Validity::SigBad) @@ -1442,7 +1442,7 @@ NetworkOPsImp::processTransactionSet(CanonicalTXSet const& set) doTransactionSyncBatch(lock, [&](std::unique_lock const&) { XRPL_ASSERT( lock.owns_lock(), - "ripple::NetworkOPsImp::processTransactionSet has lock"); + "xrpl::NetworkOPsImp::processTransactionSet has lock"); return std::any_of( mTransactions.begin(), mTransactions.end(), [](auto const& t) { return t.transaction->getApplying(); @@ -1472,10 +1472,10 @@ NetworkOPsImp::apply(std::unique_lock& batchLock) mTransactions.swap(transactions); XRPL_ASSERT( !transactions.empty(), - "ripple::NetworkOPsImp::apply : non-empty transactions"); + "xrpl::NetworkOPsImp::apply : non-empty transactions"); XRPL_ASSERT( mDispatchState != DispatchState::running, - "ripple::NetworkOPsImp::apply : is not running"); + "xrpl::NetworkOPsImp::apply : is not running"); mDispatchState = DispatchState::running; @@ -1754,7 +1754,7 @@ NetworkOPsImp::getOwnerInfo( auto sleCur = lpLedger->read(keylet::child(uDirEntry)); XRPL_ASSERT( sleCur, - "ripple::NetworkOPsImp::getOwnerInfo : non-null child SLE"); + "xrpl::NetworkOPsImp::getOwnerInfo : non-null child SLE"); switch (sleCur->getType()) { @@ -1783,7 +1783,7 @@ NetworkOPsImp::getOwnerInfo( // LCOV_EXCL_START default: UNREACHABLE( - "ripple::NetworkOPsImp::getOwnerInfo : invalid " + "xrpl::NetworkOPsImp::getOwnerInfo : invalid " "type"); break; // LCOV_EXCL_STOP @@ -1797,7 +1797,7 @@ NetworkOPsImp::getOwnerInfo( sleNode = lpLedger->read(keylet::page(root, uNodeDir)); XRPL_ASSERT( sleNode, - "ripple::NetworkOPsImp::getOwnerInfo : read next page"); + "xrpl::NetworkOPsImp::getOwnerInfo : read next page"); } } while (uNodeDir); } @@ -2034,7 +2034,7 @@ NetworkOPsImp::beginConsensus( { XRPL_ASSERT( networkClosed.isNonZero(), - "ripple::NetworkOPsImp::beginConsensus : nonzero input"); + "xrpl::NetworkOPsImp::beginConsensus : nonzero input"); auto closingInfo = m_ledgerMaster.getCurrentLedger()->header(); @@ -2059,12 +2059,12 @@ NetworkOPsImp::beginConsensus( XRPL_ASSERT( prevLedger->header().hash == closingInfo.parentHash, - "ripple::NetworkOPsImp::beginConsensus : prevLedger hash matches " + "xrpl::NetworkOPsImp::beginConsensus : prevLedger hash matches " "parent"); XRPL_ASSERT( closingInfo.parentHash == m_ledgerMaster.getClosedLedger()->header().hash, - "ripple::NetworkOPsImp::beginConsensus : closedLedger parent matches " + "xrpl::NetworkOPsImp::beginConsensus : closedLedger parent matches " "hash"); app_.validators().setNegativeUNL(prevLedger->negativeUNL()); @@ -2327,7 +2327,7 @@ NetworkOPsImp::pubServer() f.em->openLedgerFeeLevel, f.loadBaseServer, f.em->referenceFeeLevel) - .value_or(ripple::muldiv_max)); + .value_or(xrpl::muldiv_max)); jvObj[jss::load_factor] = trunc32(loadFactor); jvObj[jss::load_factor_fee_escalation] = @@ -2843,7 +2843,7 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) escalationMetrics.openLedgerFeeLevel, loadBaseServer, escalationMetrics.referenceFeeLevel) - .value_or(ripple::muldiv_max); + .value_or(xrpl::muldiv_max); auto const loadFactor = std::max( safe_cast(loadFactorServer), loadFactorFeeEscalation); @@ -3097,7 +3097,7 @@ NetworkOPsImp::pubLedger(std::shared_ptr const& lpAccepted) XRPL_ASSERT( alpAccepted->getLedger().get() == lpAccepted.get(), - "ripple::NetworkOPsImp::pubLedger : accepted input"); + "xrpl::NetworkOPsImp::pubLedger : accepted input"); { JLOG(m_journal.debug()) @@ -3149,7 +3149,7 @@ NetworkOPsImp::pubLedger(std::shared_ptr const& lpAccepted) if (!mStreamMaps[sBookChanges].empty()) { - Json::Value jvObj = ripple::RPC::computeBookChanges(lpAccepted); + Json::Value jvObj = xrpl::RPC::computeBookChanges(lpAccepted); auto it = mStreamMaps[sBookChanges].begin(); while (it != mStreamMaps[sBookChanges].end()) @@ -3519,7 +3519,7 @@ NetworkOPsImp::pubAccountTransaction( XRPL_ASSERT( jvObj.isMember(jss::account_history_tx_stream) == MultiApiJson::none, - "ripple::NetworkOPsImp::pubAccountTransaction : " + "xrpl::NetworkOPsImp::pubAccountTransaction : " "account_history_tx_stream not set"); for (auto& info : accountHistoryNotify) { @@ -3596,7 +3596,7 @@ NetworkOPsImp::pubProposedAccountTransaction( XRPL_ASSERT( jvObj.isMember(jss::account_history_tx_stream) == MultiApiJson::none, - "ripple::NetworkOPs::pubProposedAccountTransaction : " + "xrpl::NetworkOPs::pubProposedAccountTransaction : " "account_history_tx_stream not set"); for (auto& info : accountHistoryNotify) { @@ -3713,8 +3713,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo) if (databaseType == DatabaseType::None) { // LCOV_EXCL_START - UNREACHABLE( - "ripple::NetworkOPsImp::addAccountHistoryJob : no database"); + UNREACHABLE("xrpl::NetworkOPsImp::addAccountHistoryJob : no database"); JLOG(m_journal.error()) << "AccountHistory job for account " << toBase58(subInfo.index_->accountId_) << " no database"; @@ -3824,7 +3823,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo) // LCOV_EXCL_START default: { UNREACHABLE( - "ripple::NetworkOPsImp::addAccountHistoryJob : " + "xrpl::NetworkOPsImp::addAccountHistoryJob : " "getMoreTxns : invalid database type"); return {}; } @@ -3891,7 +3890,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo) { // LCOV_EXCL_START UNREACHABLE( - "ripple::NetworkOPsImp::addAccountHistoryJob : " + "xrpl::NetworkOPsImp::addAccountHistoryJob : " "getMoreTxns failed"); JLOG(m_journal.debug()) << "AccountHistory job for account " @@ -3923,7 +3922,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo) { // LCOV_EXCL_START UNREACHABLE( - "ripple::NetworkOPsImp::addAccountHistoryJob : " + "xrpl::NetworkOPsImp::addAccountHistoryJob : " "getLedgerBySeq failed"); JLOG(m_journal.debug()) << "AccountHistory job for account " @@ -4039,7 +4038,7 @@ NetworkOPsImp::subAccountHistoryStart( { // LCOV_EXCL_START UNREACHABLE( - "ripple::NetworkOPsImp::subAccountHistoryStart : failed to " + "xrpl::NetworkOPsImp::subAccountHistoryStart : failed to " "access genesis account"); return; // LCOV_EXCL_STOP @@ -4151,7 +4150,7 @@ NetworkOPsImp::subBook(InfoSub::ref isrListener, Book const& book) else { // LCOV_EXCL_START - UNREACHABLE("ripple::NetworkOPsImp::subBook : null book listeners"); + UNREACHABLE("xrpl::NetworkOPsImp::subBook : null book listeners"); // LCOV_EXCL_STOP } return true; @@ -4173,7 +4172,7 @@ NetworkOPsImp::acceptLedger( // This code-path is exclusively used when the server is in standalone // mode via `ledger_accept` XRPL_ASSERT( - m_standalone, "ripple::NetworkOPsImp::acceptLedger : is standalone"); + m_standalone, "xrpl::NetworkOPsImp::acceptLedger : is standalone"); if (!m_standalone) Throw( @@ -4894,4 +4893,4 @@ make_NetworkOPs( collector); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 15545153c7..800f473959 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { // Operations that clients may wish to perform against the network // Master operational handler, server sequencer, network tracker @@ -275,6 +275,6 @@ make_NetworkOPs( beast::Journal journal, beast::insight::Collector::ptr const& collector); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/PermissionedDEXHelpers.cpp b/src/xrpld/app/misc/PermissionedDEXHelpers.cpp index bc90848428..0cf41ac6f0 100644 --- a/src/xrpld/app/misc/PermissionedDEXHelpers.cpp +++ b/src/xrpld/app/misc/PermissionedDEXHelpers.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace permissioned_dex { bool @@ -67,4 +67,4 @@ offerInDomain( } // namespace permissioned_dex -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/PermissionedDEXHelpers.h b/src/xrpld/app/misc/PermissionedDEXHelpers.h index 87c8e64bcd..9b6d23d09d 100644 --- a/src/xrpld/app/misc/PermissionedDEXHelpers.h +++ b/src/xrpld/app/misc/PermissionedDEXHelpers.h @@ -1,7 +1,7 @@ #pragma once #include -namespace ripple { +namespace xrpl { namespace permissioned_dex { // Check if an account is in a permissioned domain @@ -21,4 +21,4 @@ offerInDomain( } // namespace permissioned_dex -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/SHAMapStore.h b/src/xrpld/app/misc/SHAMapStore.h index a906966b37..26d6120f32 100644 --- a/src/xrpld/app/misc/SHAMapStore.h +++ b/src/xrpld/app/misc/SHAMapStore.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { class TransactionMaster; @@ -88,6 +88,6 @@ make_SHAMapStore( Application& app, NodeStore::Scheduler& scheduler, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index 79c75ca0cf..0e33a0bc10 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { void SHAMapStoreImp::SavedStateDB::init( BasicConfig const& config, @@ -27,7 +27,7 @@ SHAMapStoreImp::SavedStateDB::getCanDelete() { std::lock_guard lock(mutex_); - return ripple::getCanDelete(sqlDb_); + return xrpl::getCanDelete(sqlDb_); } LedgerIndex @@ -35,7 +35,7 @@ SHAMapStoreImp::SavedStateDB::setCanDelete(LedgerIndex canDelete) { std::lock_guard lock(mutex_); - return ripple::setCanDelete(sqlDb_, canDelete); + return xrpl::setCanDelete(sqlDb_, canDelete); } SavedState @@ -43,21 +43,21 @@ SHAMapStoreImp::SavedStateDB::getState() { std::lock_guard lock(mutex_); - return ripple::getSavedState(sqlDb_); + return xrpl::getSavedState(sqlDb_); } void SHAMapStoreImp::SavedStateDB::setState(SavedState const& state) { std::lock_guard lock(mutex_); - ripple::setSavedState(sqlDb_, state); + xrpl::setSavedState(sqlDb_, state); } void SHAMapStoreImp::SavedStateDB::setLastRotated(LedgerIndex seq) { std::lock_guard lock(mutex_); - ripple::setLastRotated(sqlDb_, seq); + xrpl::setLastRotated(sqlDb_, seq); } //------------------------------------------------------------------------------ @@ -496,7 +496,7 @@ SHAMapStoreImp::clearSql( { XRPL_ASSERT( deleteInterval_, - "ripple::SHAMapStoreImp::clearSql : nonzero delete interval"); + "xrpl::SHAMapStoreImp::clearSql : nonzero delete interval"); LedgerIndex min = std::numeric_limits::max(); { @@ -669,4 +669,4 @@ make_SHAMapStore( return std::make_unique(app, scheduler, journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index 12079b9fec..e5a7435b0a 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { class NetworkOPs; @@ -225,6 +225,6 @@ public: stop() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/Transaction.h b/src/xrpld/app/misc/Transaction.h index 4f59377fe0..ac801a2cd0 100644 --- a/src/xrpld/app/misc/Transaction.h +++ b/src/xrpld/app/misc/Transaction.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { // // Transactions should be constructed in JSON with. Use STObject::parseJson to @@ -413,6 +413,6 @@ private: beast::Journal j_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/TxQ.h b/src/xrpld/app/misc/TxQ.h index 4c4bb3c923..aff7fc89db 100644 --- a/src/xrpld/app/misc/TxQ.h +++ b/src/xrpld/app/misc/TxQ.h @@ -15,7 +15,7 @@ #include -namespace ripple { +namespace xrpl { class Application; class Config; @@ -854,6 +854,6 @@ toFeeLevel(XRPAmount const& drops, XRPAmount const& baseFee) .value_or(FeeLevel64(std::numeric_limits::max())); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/ValidatorKeys.h b/src/xrpld/app/misc/ValidatorKeys.h index 8c5060b488..a1511c134a 100644 --- a/src/xrpld/app/misc/ValidatorKeys.h +++ b/src/xrpld/app/misc/ValidatorKeys.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class Config; @@ -59,6 +59,6 @@ private: bool configInvalid_ = false; //< Set to true if config was invalid }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/ValidatorList.h b/src/xrpld/app/misc/ValidatorList.h index 77793619ac..d6758f8877 100644 --- a/src/xrpld/app/misc/ValidatorList.h +++ b/src/xrpld/app/misc/ValidatorList.h @@ -21,7 +21,7 @@ class TMValidatorList; class TMValidatorListCollection; } // namespace protocol -namespace ripple { +namespace xrpl { class Overlay; class HashRouter; @@ -927,7 +927,7 @@ hash_append(Hasher& h, std::map const& blobs) } } -} // namespace ripple +} // namespace xrpl namespace protocol { @@ -945,10 +945,7 @@ hash_append(Hasher& h, TMValidatorListCollection const& msg) { using beast::hash_append; hash_append( - h, - msg.manifest(), - ripple::ValidatorList::parseBlobs(msg), - msg.version()); + h, msg.manifest(), xrpl::ValidatorList::parseBlobs(msg), msg.version()); } } // namespace protocol diff --git a/src/xrpld/app/misc/ValidatorSite.h b/src/xrpld/app/misc/ValidatorSite.h index 9f20bef07a..64b22f065d 100644 --- a/src/xrpld/app/misc/ValidatorSite.h +++ b/src/xrpld/app/misc/ValidatorSite.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Validator Sites @@ -242,6 +242,6 @@ private: missingSite(std::lock_guard const&); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/AMMHelpers.cpp b/src/xrpld/app/misc/detail/AMMHelpers.cpp index 2d5adc8f44..0b741c8d36 100644 --- a/src/xrpld/app/misc/detail/AMMHelpers.cpp +++ b/src/xrpld/app/misc/detail/AMMHelpers.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { STAmount ammLPTokens( @@ -236,7 +236,7 @@ adjustAmountsByLPTokens( XRPL_ASSERT( lpTokensActual == lpTokens, - "ripple::adjustAmountsByLPTokens : LP tokens match actual"); + "xrpl::adjustAmountsByLPTokens : LP tokens match actual"); return {amount, amount2, lpTokensActual}; } @@ -390,4 +390,4 @@ adjustFracByTokens( return tokens / lptAMMBalance; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/AMMUtils.cpp b/src/xrpld/app/misc/detail/AMMUtils.cpp index ab0aec41b1..c0cda2bd73 100644 --- a/src/xrpld/app/misc/detail/AMMUtils.cpp +++ b/src/xrpld/app/misc/detail/AMMUtils.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { std::pair ammPoolHolds( @@ -163,7 +163,7 @@ getTradingFee(ReadView const& view, SLE const& ammSle, AccountID const& account) XRPL_ASSERT( !view.rules().enabled(fixInnerObjTemplate) || ammSle.isFieldPresent(sfAuctionSlot), - "ripple::getTradingFee : auction present"); + "xrpl::getTradingFee : auction present"); if (ammSle.isFieldPresent(sfAuctionSlot)) { auto const& auctionSlot = @@ -475,4 +475,4 @@ verifyAndAdjustLPTokenBalance( return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.cpp b/src/xrpld/app/misc/detail/AccountTxPaging.cpp index d58dace34c..e3fc2de4f8 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.cpp +++ b/src/xrpld/app/misc/detail/AccountTxPaging.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { void convertBlobsToTxResult( @@ -44,4 +44,4 @@ saveLedgerAsync(Application& app, std::uint32_t seq) pendSaveValidated(app, l, false, false); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.h b/src/xrpld/app/misc/detail/AccountTxPaging.h index b822d7186c..cbfe8c89bb 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.h +++ b/src/xrpld/app/misc/detail/AccountTxPaging.h @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -namespace ripple { +namespace xrpl { void convertBlobsToTxResult( @@ -21,6 +21,6 @@ convertBlobsToTxResult( void saveLedgerAsync(Application& app, std::uint32_t seq); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/AmendmentTable.cpp b/src/xrpld/app/misc/detail/AmendmentTable.cpp index b857f82213..8ed9bc12c5 100644 --- a/src/xrpld/app/misc/detail/AmendmentTable.cpp +++ b/src/xrpld/app/misc/detail/AmendmentTable.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { static std::vector> parseSection(Section const& section) @@ -211,7 +211,7 @@ public: { XRPL_ASSERT( votes.second.upVotes.empty(), - "ripple::TrustedVotes::recordVotes : received no " + "xrpl::TrustedVotes::recordVotes : received no " "upvotes"); JLOG(j.debug()) << "recordVotes: Have not received any " @@ -230,7 +230,7 @@ public: { XRPL_ASSERT( votes.second.timeout < newTimeout, - "ripple::TrustedVotes::recordVotes : votes not " + "xrpl::TrustedVotes::recordVotes : votes not " "expired"); using namespace std::chrono; auto const age = duration_cast( @@ -254,7 +254,7 @@ public: XRPL_ASSERT( validatorVotes.second.timeout || validatorVotes.second.upVotes.empty(), - "ripple::TrustedVotes::getVotes : valid votes"); + "xrpl::TrustedVotes::getVotes : valid votes"); if (validatorVotes.second.timeout) ++available; for (uint256 const& amendment : validatorVotes.second.upVotes) @@ -688,7 +688,7 @@ AmendmentTableImpl::persistVote( { XRPL_ASSERT( vote != AmendmentVote::obsolete, - "ripple::AmendmentTableImpl::persistVote : valid vote input"); + "xrpl::AmendmentTableImpl::persistVote : valid vote input"); auto db = db_.checkoutDb(); voteAmendment(*db, amendment, name, vote); } @@ -1042,4 +1042,4 @@ make_AmendmentTable( app, majorityTime, supported, enabled, vetoed, journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/DelegateUtils.cpp b/src/xrpld/app/misc/detail/DelegateUtils.cpp index 04728005af..027f2f1cc6 100644 --- a/src/xrpld/app/misc/detail/DelegateUtils.cpp +++ b/src/xrpld/app/misc/detail/DelegateUtils.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { NotTEC checkTxPermission(std::shared_ptr const& delegate, STTx const& tx) { @@ -44,4 +44,4 @@ loadGranularPermission( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/DeliverMax.cpp b/src/xrpld/app/misc/detail/DeliverMax.cpp index 3d0ef901ec..44500eec7e 100644 --- a/src/xrpld/app/misc/detail/DeliverMax.cpp +++ b/src/xrpld/app/misc/detail/DeliverMax.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { void @@ -20,4 +20,4 @@ insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion) } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/LendingHelpers.cpp b/src/xrpld/app/misc/detail/LendingHelpers.cpp index 8020b47ba9..51e0988bc4 100644 --- a/src/xrpld/app/misc/detail/LendingHelpers.cpp +++ b/src/xrpld/app/misc/detail/LendingHelpers.cpp @@ -2,7 +2,7 @@ // DO NOT REMOVE forces header file include to sort first #include -namespace ripple { +namespace xrpl { bool checkLendingProtocolDependencies(PreflightContext const& ctx) @@ -17,15 +17,15 @@ LoanPaymentParts::operator+=(LoanPaymentParts const& other) XRPL_ASSERT( other.principalPaid >= beast::zero, - "ripple::LoanPaymentParts::operator+= : other principal " + "xrpl::LoanPaymentParts::operator+= : other principal " "non-negative"); XRPL_ASSERT( other.interestPaid >= beast::zero, - "ripple::LoanPaymentParts::operator+= : other interest paid " + "xrpl::LoanPaymentParts::operator+= : other interest paid " "non-negative"); XRPL_ASSERT( other.feePaid >= beast::zero, - "ripple::LoanPaymentParts::operator+= : other fee paid " + "xrpl::LoanPaymentParts::operator+= : other fee paid " "non-negative"); principalPaid += other.principalPaid; @@ -288,23 +288,21 @@ doPayment( std::uint32_t paymentInterval) { XRPL_ASSERT_PARTS( - nextDueDateProxy, - "ripple::detail::doPayment", - "Next due date proxy set"); + nextDueDateProxy, "xrpl::detail::doPayment", "Next due date proxy set"); if (payment.specialCase == PaymentSpecialCase::final) { XRPL_ASSERT_PARTS( principalOutstandingProxy == payment.trackedPrincipalDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Full principal payment"); XRPL_ASSERT_PARTS( totalValueOutstandingProxy == payment.trackedValueDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Full value payment"); XRPL_ASSERT_PARTS( managementFeeOutstandingProxy == payment.trackedManagementFeeDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Full management fee payment"); // Mark the loan as complete @@ -336,17 +334,17 @@ doPayment( } XRPL_ASSERT_PARTS( principalOutstandingProxy > payment.trackedPrincipalDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Partial principal payment"); XRPL_ASSERT_PARTS( totalValueOutstandingProxy > payment.trackedValueDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Partial value payment"); // Management fees are expected to be relatively small, and could get to // zero before the loan is paid off XRPL_ASSERT_PARTS( managementFeeOutstandingProxy >= payment.trackedManagementFeeDelta, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "Valid management fee"); // Apply the payment deltas to reduce the outstanding balances @@ -361,14 +359,14 @@ doPayment( // ValueProxy or Number static_cast(principalOutstandingProxy) <= static_cast(totalValueOutstandingProxy), - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "principal does not exceed total"); XRPL_ASSERT_PARTS( // Use an explicit cast because the template parameter can be // ValueProxy or Number static_cast(managementFeeOutstandingProxy) >= beast::zero, - "ripple::detail::doPayment", + "xrpl::detail::doPayment", "fee outstanding stays valid"); return LoanPaymentParts{ @@ -673,13 +671,13 @@ doOverpayment( XRPL_ASSERT_PARTS( overpaymentComponents.trackedPrincipalDelta == principalOutstandingProxy - principalOutstanding, - "ripple::detail::doOverpayment", + "xrpl::detail::doOverpayment", "principal change agrees"); XRPL_ASSERT_PARTS( overpaymentComponents.trackedManagementFeeDelta == managementFeeOutstandingProxy - managementFeeOutstanding, - "ripple::detail::doOverpayment", + "xrpl::detail::doOverpayment", "no fee change"); // I'm not 100% sure the following asserts are correct. If in doubt, and @@ -703,20 +701,20 @@ doOverpayment( (totalValueOutstandingProxy - overpaymentComponents.trackedPrincipalDelta) + overpaymentComponents.trackedInterestPart(), - "ripple::detail::doOverpayment", + "xrpl::detail::doOverpayment", "interest paid agrees"); XRPL_ASSERT_PARTS( overpaymentComponents.trackedPrincipalDelta == loanPaymentParts.principalPaid, - "ripple::detail::doOverpayment", + "xrpl::detail::doOverpayment", "principal payment matches"); XRPL_ASSERT_PARTS( loanPaymentParts.feePaid == overpaymentComponents.untrackedManagementFee + overpaymentComponents.trackedManagementFeeDelta, - "ripple::detail::doOverpayment", + "xrpl::detail::doOverpayment", "fee payment matches"); // All validations passed, so update the proxy objects (which will @@ -780,10 +778,10 @@ computeLatePayment( XRPL_ASSERT( roundedLateInterest >= 0, - "ripple::detail::computeLatePayment : valid late interest"); + "xrpl::detail::computeLatePayment : valid late interest"); XRPL_ASSERT_PARTS( periodic.specialCase != PaymentSpecialCase::extra, - "ripple::detail::computeLatePayment", + "xrpl::detail::computeLatePayment", "no extra parts to this payment"); // Create the late payment components by copying the regular periodic @@ -813,7 +811,7 @@ computeLatePayment( XRPL_ASSERT_PARTS( isRounded(asset, late.totalDue, loanScale), - "ripple::detail::computeLatePayment", + "xrpl::detail::computeLatePayment", "total due is rounded"); // Check that the borrower provided enough funds to cover the late payment. @@ -939,7 +937,7 @@ computeFullPayment( XRPL_ASSERT_PARTS( isRounded(asset, full.totalDue, loanScale), - "ripple::detail::computeFullPayment", + "xrpl::detail::computeFullPayment", "total due is rounded"); JLOG(j.trace()) << "computeFullPayment result: periodicPayment: " @@ -999,11 +997,11 @@ computePaymentComponents( isRounded(asset, totalValueOutstanding, scale) && isRounded(asset, principalOutstanding, scale) && isRounded(asset, managementFeeOutstanding, scale), - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "Outstanding values are rounded"); XRPL_ASSERT_PARTS( paymentRemaining > 0, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "some payments remaining"); auto const roundedPeriodicPayment = @@ -1054,7 +1052,7 @@ computePaymentComponents( XRPL_ASSERT_PARTS( deltas.principal <= currentLedgerState.principalOutstanding, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "principal delta not greater than outstanding"); // Cap each component to never exceed what's actually outstanding @@ -1063,7 +1061,7 @@ computePaymentComponents( XRPL_ASSERT_PARTS( deltas.interest <= currentLedgerState.interestDue, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "interest due delta not greater than outstanding"); // Cap interest to both the outstanding amount AND what's left of the @@ -1075,7 +1073,7 @@ computePaymentComponents( XRPL_ASSERT_PARTS( deltas.managementFee <= currentLedgerState.managementFeeDue, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "management fee due delta not greater than outstanding"); // Cap management fee to both the outstanding amount AND what's left of the @@ -1098,7 +1096,7 @@ computePaymentComponents( } XRPL_ASSERT_PARTS( excess >= beast::zero, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "excess non-negative"); }; // Helper to reduce deltas when they collectively exceed a limit. @@ -1120,7 +1118,7 @@ computePaymentComponents( { // LCOV_EXCL_START UNREACHABLE( - "ripple::detail::computePaymentComponents : payment exceeded loan " + "xrpl::detail::computePaymentComponents : payment exceeded loan " "state"); addressExcess(deltas, totalOverpayment); // LCOV_EXCL_STOP @@ -1131,7 +1129,7 @@ computePaymentComponents( XRPL_ASSERT_PARTS( isRounded(asset, shortage, scale), - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "shortage is rounded"); if (shortage < beast::zero) @@ -1147,35 +1145,35 @@ computePaymentComponents( // shortage < 0 would mean we're trying to pay more than allowed (bug). XRPL_ASSERT_PARTS( shortage >= beast::zero, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "no shortage or excess"); // Final validation that all components are valid XRPL_ASSERT_PARTS( deltas.total() == deltas.principal + deltas.interest + deltas.managementFee, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "total value adds up"); XRPL_ASSERT_PARTS( deltas.principal >= beast::zero && deltas.principal <= currentLedgerState.principalOutstanding, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "valid principal result"); XRPL_ASSERT_PARTS( deltas.interest >= beast::zero && deltas.interest <= currentLedgerState.interestDue, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "valid interest result"); XRPL_ASSERT_PARTS( deltas.managementFee >= beast::zero && deltas.managementFee <= currentLedgerState.managementFeeDue, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "valid fee result"); XRPL_ASSERT_PARTS( deltas.principal + deltas.interest + deltas.managementFee > beast::zero, - "ripple::detail::computePaymentComponents", + "xrpl::detail::computePaymentComponents", "payment parts add to payment"); // Final safety clamp to ensure no value exceeds its outstanding balance @@ -1218,7 +1216,7 @@ computeOverpaymentComponents( { XRPL_ASSERT( overpayment > 0 && isRounded(asset, overpayment, loanScale), - "ripple::detail::computeOverpaymentComponents : valid overpayment " + "xrpl::detail::computeOverpaymentComponents : valid overpayment " "amount"); // First, deduct the fixed overpayment fee from the total amount. @@ -1267,7 +1265,7 @@ computeOverpaymentComponents( roundedOverpaymentInterest}; XRPL_ASSERT_PARTS( result.trackedInterestPart() == roundedOverpaymentInterest, - "ripple::detail::computeOverpaymentComponents", + "xrpl::detail::computeOverpaymentComponents", "valid interest computation"); return result; } @@ -1418,7 +1416,7 @@ computeFullPaymentInterest( paymentInterval); XRPL_ASSERT( accruedInterest >= 0, - "ripple::detail::computeFullPaymentInterest : valid accrued " + "xrpl::detail::computeFullPaymentInterest : valid accrued " "interest"); // Equation (28) from XLS-66 spec, Section A-2 Equation Glossary @@ -1428,7 +1426,7 @@ computeFullPaymentInterest( XRPL_ASSERT( prepaymentPenalty >= 0, - "ripple::detail::computeFullPaymentInterest : valid prepayment " + "xrpl::detail::computeFullPaymentInterest : valid prepayment " "interest"); // Part of equation (27) from XLS-66 spec, Section A-2 Equation Glossary @@ -1616,7 +1614,7 @@ computeLoanProperties( auto const periodicRate = loanPeriodicRate(interestRate, paymentInterval); XRPL_ASSERT( interestRate == 0 || periodicRate > 0, - "ripple::computeLoanProperties : valid rate"); + "xrpl::computeLoanProperties : valid rate"); auto const periodicPayment = detail::loanPeriodicPayment( principalOutstanding, periodicRate, paymentsRemaining); @@ -1638,7 +1636,7 @@ computeLoanProperties( (amount.integral() && loanScale == 0) || (!amount.integral() && loanScale >= static_cast(amount).exponent()), - "ripple::computeLoanProperties", + "xrpl::computeLoanProperties", "loanScale value fits expectations"); // We may need to truncate the total value because of the minimum @@ -1752,11 +1750,11 @@ loanMakePayment( Number const periodicRate = loanPeriodicRate(interestRate, paymentInterval); XRPL_ASSERT( interestRate == 0 || periodicRate > 0, - "ripple::loanMakePayment : valid rate"); + "xrpl::loanMakePayment : valid rate"); XRPL_ASSERT( *totalValueOutstandingProxy > 0, - "ripple::loanMakePayment : valid total value"); + "xrpl::loanMakePayment : valid total value"); view.update(loan); @@ -1826,7 +1824,7 @@ loanMakePayment( return Unexpected(fullPaymentComponents.error()); // LCOV_EXCL_START - UNREACHABLE("ripple::loanMakePayment : invalid full payment result"); + UNREACHABLE("xrpl::loanMakePayment : invalid full payment result"); JLOG(j.error()) << "Full payment computation failed unexpectedly."; return Unexpected(tecINTERNAL); // LCOV_EXCL_STOP @@ -1849,7 +1847,7 @@ loanMakePayment( serviceFee}; XRPL_ASSERT_PARTS( periodic.trackedPrincipalDelta >= 0, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "regular payment valid principal"); // ------------------------------------------------------------- @@ -1890,7 +1888,7 @@ loanMakePayment( } // LCOV_EXCL_START - UNREACHABLE("ripple::loanMakePayment : invalid late payment result"); + UNREACHABLE("xrpl::loanMakePayment : invalid late payment result"); JLOG(j.error()) << "Late payment computation failed unexpectedly."; return Unexpected(tecINTERNAL); // LCOV_EXCL_STOP @@ -1902,7 +1900,7 @@ loanMakePayment( XRPL_ASSERT_PARTS( paymentType == LoanPaymentType::regular || paymentType == LoanPaymentType::overpayment, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "regular payment type"); // Keep a running total of the actual parts paid @@ -1917,7 +1915,7 @@ loanMakePayment( // Try to make more payments XRPL_ASSERT_PARTS( periodic.trackedPrincipalDelta >= 0, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "payment pays non-negative principal"); totalPaid += periodic.totalDue; @@ -1935,7 +1933,7 @@ loanMakePayment( XRPL_ASSERT_PARTS( (periodic.specialCase == detail::PaymentSpecialCase::final) == (paymentRemainingProxy == 0), - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "final payment is the final payment"); // Don't compute the next payment if this was the last payment @@ -1967,11 +1965,11 @@ loanMakePayment( totalParts.principalPaid + totalParts.interestPaid + totalParts.feePaid == totalPaid, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "payment parts add up"); XRPL_ASSERT_PARTS( totalParts.valueChange == 0, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "no value change"); // ------------------------------------------------------------- @@ -2005,7 +2003,7 @@ loanMakePayment( { XRPL_ASSERT_PARTS( overpaymentComponents.untrackedInterest >= beast::zero, - "ripple::loanMakePayment", + "xrpl::loanMakePayment", "overpayment penalty did not reduce value of loan"); // Can't just use `periodicPayment` here, because it might // change @@ -2041,18 +2039,18 @@ loanMakePayment( XRPL_ASSERT( isRounded(asset, totalParts.principalPaid, loanScale) && totalParts.principalPaid >= beast::zero, - "ripple::loanMakePayment : total principal paid is valid"); + "xrpl::loanMakePayment : total principal paid is valid"); XRPL_ASSERT( isRounded(asset, totalParts.interestPaid, loanScale) && totalParts.interestPaid >= beast::zero, - "ripple::loanMakePayment : total interest paid is valid"); + "xrpl::loanMakePayment : total interest paid is valid"); XRPL_ASSERT( isRounded(asset, totalParts.valueChange, loanScale), - "ripple::loanMakePayment : loan value change is valid"); + "xrpl::loanMakePayment : loan value change is valid"); XRPL_ASSERT( isRounded(asset, totalParts.feePaid, loanScale) && totalParts.feePaid >= beast::zero, - "ripple::loanMakePayment : fee paid is valid"); + "xrpl::loanMakePayment : fee paid is valid"); return totalParts; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/LoadFeeTrack.cpp b/src/xrpld/app/misc/detail/LoadFeeTrack.cpp index 9434ed5d02..6166656aee 100644 --- a/src/xrpld/app/misc/detail/LoadFeeTrack.cpp +++ b/src/xrpld/app/misc/detail/LoadFeeTrack.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { bool LoadFeeTrack::raiseLocalFee() @@ -90,4 +90,4 @@ scaleFeeLoad( return *result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/Manifest.cpp b/src/xrpld/app/misc/detail/Manifest.cpp index 68d91599db..59a1325e32 100644 --- a/src/xrpld/app/misc/detail/Manifest.cpp +++ b/src/xrpld/app/misc/detail/Manifest.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string to_string(Manifest const& m) @@ -187,11 +187,10 @@ Manifest::verify() const // Signing key and signature are not required for // master key revocations - if (!revoked() && !ripple::verify(st, HashPrefix::manifest, *signingKey)) + if (!revoked() && !xrpl::verify(st, HashPrefix::manifest, *signingKey)) return false; - return ripple::verify( - st, HashPrefix::manifest, masterKey, sfMasterSignature); + return xrpl::verify(st, HashPrefix::manifest, masterKey, sfMasterSignature); } uint256 @@ -374,7 +373,7 @@ ManifestCache::applyManifest(Manifest m) -> std::optional { XRPL_ASSERT( lock.owns_lock(), - "ripple::ManifestCache::applyManifest::prewriteCheck : locked"); + "xrpl::ManifestCache::applyManifest::prewriteCheck : locked"); (void)lock; // not used. parameter is present to ensure the mutex is // locked when the lambda is called. if (iter != map_.end() && m.sequence <= iter->second.sequence) @@ -525,7 +524,7 @@ void ManifestCache::load(DatabaseCon& dbCon, std::string const& dbTable) { auto db = dbCon.checkoutDb(); - ripple::getManifests(*db, dbTable, *this, j_); + xrpl::getManifests(*db, dbTable, *this, j_); } bool @@ -596,4 +595,4 @@ ManifestCache::save( saveManifests(*db, dbTable, isTrusted, map_, j_); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/Transaction.cpp b/src/xrpld/app/misc/detail/Transaction.cpp index 588bbc6fb7..77a8897d9c 100644 --- a/src/xrpld/app/misc/detail/Transaction.cpp +++ b/src/xrpld/app/misc/detail/Transaction.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { Transaction::Transaction( std::shared_ptr const& stx, @@ -71,7 +71,7 @@ Transaction::sqlTransactionStatus(boost::optional const& status) XRPL_ASSERT( c == txnSqlUnknown, - "ripple::Transaction::sqlTransactionStatus : unknown transaction " + "xrpl::Transaction::sqlTransactionStatus : unknown transaction " "status"); return INVALID; } @@ -183,4 +183,4 @@ Transaction::getJson(JsonOptions options, bool binary) const return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index 35ae25c82f..9f260e5f48 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { ////////////////////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ getFeeLevelPaid(ReadView const& view, STTx const& tx) return std::pair{baseFee + mod, feePaid + mod}; }(); - XRPL_ASSERT(baseFee.signum() > 0, "ripple::getFeeLevelPaid : positive fee"); + XRPL_ASSERT(baseFee.signum() > 0, "xrpl::getFeeLevelPaid : positive fee"); if (effectiveFeePaid.signum() <= 0 || baseFee.signum() <= 0) { return FeeLevel64(0); @@ -56,7 +56,7 @@ static FeeLevel64 increase(FeeLevel64 level, std::uint32_t increasePercent) { return mulDiv(level, 100 + increasePercent, 100) - .value_or(static_cast(ripple::muldiv_max)); + .value_or(static_cast(xrpl::muldiv_max)); } ////////////////////////////////////////////////////////////////////////// @@ -79,7 +79,7 @@ TxQ::FeeMetrics::update( std::sort(feeLevels.begin(), feeLevels.end()); XRPL_ASSERT( size == feeLevels.size(), - "ripple::TxQ::FeeMetrics::update : fee levels size"); + "xrpl::TxQ::FeeMetrics::update : fee levels size"); JLOG((timeLeap ? j_.warn() : j_.debug())) << "Ledger " << view.header().seq << " has " << size @@ -96,10 +96,10 @@ TxQ::FeeMetrics::update( // upperLimit must be >= minimumTxnCount_ or std::clamp can give // unexpected results auto const upperLimit = std::max( - mulDiv(txnsExpected_, cutPct, 100).value_or(ripple::muldiv_max), + mulDiv(txnsExpected_, cutPct, 100).value_or(xrpl::muldiv_max), minimumTxnCount_); txnsExpected_ = std::clamp( - mulDiv(size, cutPct, 100).value_or(ripple::muldiv_max), + mulDiv(size, cutPct, 100).value_or(xrpl::muldiv_max), minimumTxnCount_, upperLimit); recentTxnCounts_.clear(); @@ -108,7 +108,7 @@ TxQ::FeeMetrics::update( { recentTxnCounts_.push_back( mulDiv(size, 100 + setup.normalConsensusIncreasePercent, 100) - .value_or(ripple::muldiv_max)); + .value_or(xrpl::muldiv_max)); auto const iter = std::max_element(recentTxnCounts_.begin(), recentTxnCounts_.end()); BOOST_ASSERT(iter != recentTxnCounts_.end()); @@ -167,7 +167,7 @@ TxQ::FeeMetrics::scaleFeeLevel(Snapshot const& snapshot, OpenView const& view) // Compute escalated fee level // Don't care about the overflow flag return mulDiv(multiplier, current * current, target * target) - .value_or(static_cast(ripple::muldiv_max)); + .value_or(static_cast(xrpl::muldiv_max)); } return baseLevel; @@ -234,7 +234,7 @@ TxQ::FeeMetrics::escalatedSeriesFeeLevel( XRPL_ASSERT( current > target, - "ripple::TxQ::FeeMetrics::escalatedSeriesFeeLevel : current over " + "xrpl::TxQ::FeeMetrics::escalatedSeriesFeeLevel : current over " "target"); /* Calculate (apologies for the terrible notation) @@ -281,7 +281,7 @@ TxQ::MaybeTx::apply(Application& app, OpenView& view, beast::Journal j) { // If the rules or flags change, preflight again XRPL_ASSERT( - pfresult, "ripple::TxQ::MaybeTx::apply : preflight result is set"); + pfresult, "xrpl::TxQ::MaybeTx::apply : preflight result is set"); NumberSO stNumberSO{view.rules().enabled(fixUniversalNumber)}; if (pfresult->rules != view.rules() || pfresult->flags != flags) @@ -326,10 +326,10 @@ TxQ::TxQAccount::add(MaybeTx&& txn) auto result = transactions.emplace(seqProx, std::move(txn)); XRPL_ASSERT( - result.second, "ripple::TxQ::TxQAccount::add : emplace succeeded"); + result.second, "xrpl::TxQ::TxQAccount::add : emplace succeeded"); XRPL_ASSERT( &result.first->second != &txn, - "ripple::TxQ::TxQAccount::add : transaction moved"); + "xrpl::TxQ::TxQAccount::add : transaction moved"); return result.first->second; } @@ -438,7 +438,7 @@ TxQ::erase(TxQ::FeeMultiSet::const_iterator_type candidateIter) // intrusive list remove it from the TxQAccount // so the memory can be freed. [[maybe_unused]] auto const found = txQAccount.remove(seqProx); - XRPL_ASSERT(found, "ripple::TxQ::erase : account removed"); + XRPL_ASSERT(found, "xrpl::TxQ::erase : account removed"); return newCandidateIter; } @@ -452,7 +452,7 @@ TxQ::eraseAndAdvance(TxQ::FeeMultiSet::const_iterator_type candidateIter) txQAccount.transactions.find(candidateIter->seqProxy); XRPL_ASSERT( accountIter != txQAccount.transactions.end(), - "ripple::TxQ::eraseAndAdvance : account found"); + "xrpl::TxQ::eraseAndAdvance : account found"); // Note that sequence-based transactions must be applied in sequence order // from smallest to largest. But ticket-based transactions can be @@ -460,10 +460,10 @@ TxQ::eraseAndAdvance(TxQ::FeeMultiSet::const_iterator_type candidateIter) XRPL_ASSERT( candidateIter->seqProxy.isTicket() || accountIter == txQAccount.transactions.begin(), - "ripple::TxQ::eraseAndAdvance : ticket or sequence"); + "xrpl::TxQ::eraseAndAdvance : ticket or sequence"); XRPL_ASSERT( byFee_.iterator_to(accountIter->second) == candidateIter, - "ripple::TxQ::eraseAndAdvance : found in byFee"); + "xrpl::TxQ::eraseAndAdvance : found in byFee"); auto const accountNextIter = std::next(accountIter); // Check if the next transaction for this account is earlier in the queue, @@ -512,7 +512,7 @@ TxQ::tryClearAccountQueueUpThruTx( SeqProxy const tSeqProx{tx.getSeqProxy()}; XRPL_ASSERT( beginTxIter != accountIter->second.transactions.end(), - "ripple::TxQ::tryClearAccountQueueUpThruTx : non-empty accounts input"); + "xrpl::TxQ::tryClearAccountQueueUpThruTx : non-empty accounts input"); // This check is only concerned with the range from // [aSeqProxy, tSeqProxy) @@ -994,8 +994,7 @@ TxQ::apply( // o The current first thing in the queue has a Ticket and // * The tx has a Ticket that precedes it or // * txSeqProx == acctSeqProx. - XRPL_ASSERT( - prevIter != txIter->end, "ripple::TxQ::apply : not end"); + XRPL_ASSERT(prevIter != txIter->end, "xrpl::TxQ::apply : not end"); if (prevIter == txIter->end || txSeqProx < prevIter->first) { // The first Sequence number in the queue must be the @@ -1120,7 +1119,7 @@ TxQ::apply( potentialTotalSpend > XRPAmount{0} || (potentialTotalSpend == XRPAmount{0} && multiTxn->applyView.fees().base == 0), - "ripple::TxQ::apply : total spend check"); + "xrpl::TxQ::apply : total spend check"); sleBump->setFieldAmount(sfBalance, balance - potentialTotalSpend); // The transaction's sequence/ticket will be valid when the other // transactions in the queue have been processed. If the tx has a @@ -1150,7 +1149,7 @@ TxQ::apply( return {pcresult.ter, false}; // Too low of a fee should get caught by preclaim - XRPL_ASSERT(feeLevelPaid >= baseLevel, "ripple::TxQ::apply : minimum fee"); + XRPL_ASSERT(feeLevelPaid >= baseLevel, "xrpl::TxQ::apply : minimum fee"); JLOG(j_.trace()) << "Transaction " << transactionID << " from account " << account << " has fee level of " << feeLevelPaid @@ -1277,7 +1276,7 @@ TxQ::apply( auto dropRIter = endAccount.transactions.rbegin(); XRPL_ASSERT( dropRIter->second.account == lastRIter->account, - "ripple::TxQ::apply : cheapest transaction found"); + "xrpl::TxQ::apply : cheapest transaction found"); JLOG(j_.info()) << "Removing last item of account " << lastRIter->account << " from queue with average fee of " << endEffectiveFeeLevel @@ -1306,7 +1305,7 @@ TxQ::apply( [[maybe_unused]] bool created = false; std::tie(accountIter, created) = byAccount_.emplace(account, TxQAccount(tx)); - XRPL_ASSERT(created, "ripple::TxQ::apply : account created"); + XRPL_ASSERT(created, "xrpl::TxQ::apply : account created"); } // Modify the flags for use when coming out of the queue. // These changes _may_ cause an extra `preflight`, but as long as @@ -1521,7 +1520,7 @@ TxQ::accept(Application& app, OpenView& view) auto dropRIter = account.transactions.rbegin(); XRPL_ASSERT( dropRIter->second.account == candidateIter->account, - "ripple::TxQ::accept : account check"); + "xrpl::TxQ::accept : account check"); JLOG(j_.info()) << "Queue is nearly full, and transaction " @@ -1576,8 +1575,7 @@ TxQ::accept(Application& app, OpenView& view) } } XRPL_ASSERT( - byFee_.size() == startingSize, - "ripple::TxQ::accept : byFee size match"); + byFee_.size() == startingSize, "xrpl::TxQ::accept : byFee size match"); return ledgerChanged; } @@ -1696,7 +1694,7 @@ TxQ::tryDirectApply( << " to open ledger."; auto const [txnResult, didApply, metadata] = - ripple::apply(app, view, *tx, flags, j); + xrpl::apply(app, view, *tx, flags, j); JLOG(j_.trace()) << "New transaction " << transactionID << (didApply ? " applied successfully with " @@ -1738,16 +1736,16 @@ TxQ::removeFromByFee( auto deleteIter = byFee_.iterator_to((*replacedTxIter)->second); XRPL_ASSERT( deleteIter != byFee_.end(), - "ripple::TxQ::removeFromByFee : found in byFee"); + "xrpl::TxQ::removeFromByFee : found in byFee"); XRPL_ASSERT( &(*replacedTxIter)->second == &*deleteIter, - "ripple::TxQ::removeFromByFee : matching transaction"); + "xrpl::TxQ::removeFromByFee : matching transaction"); XRPL_ASSERT( deleteIter->seqProxy == tx->getSeqProxy(), - "ripple::TxQ::removeFromByFee : matching sequence"); + "xrpl::TxQ::removeFromByFee : matching sequence"); XRPL_ASSERT( deleteIter->account == (*tx)[sfAccount], - "ripple::TxQ::removeFromByFee : matching account"); + "xrpl::TxQ::removeFromByFee : matching account"); erase(deleteIter); } @@ -1959,4 +1957,4 @@ setup_TxQ(Config const& config) return setup; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/ValidatorKeys.cpp b/src/xrpld/app/misc/detail/ValidatorKeys.cpp index 4b1e93a444..757a18aa47 100644 --- a/src/xrpld/app/misc/detail/ValidatorKeys.cpp +++ b/src/xrpld/app/misc/detail/ValidatorKeys.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { ValidatorKeys::ValidatorKeys(Config const& config, beast::Journal j) { if (config.exists(SECTION_VALIDATOR_TOKEN) && @@ -70,4 +70,4 @@ ValidatorKeys::ValidatorKeys(Config const& config, beast::Journal j) } } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index 566dfc06a0..db2ee980b8 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { std::string to_string(ListDisposition disposition) @@ -181,7 +181,7 @@ ValidatorList::load( // This should be enforced by Config class XRPL_ASSERT( listThreshold_ > 0 && listThreshold_ <= publisherLists_.size(), - "ripple::ValidatorList::load : list threshold inside range"); + "xrpl::ValidatorList::load : list threshold inside range"); JLOG(j_.debug()) << "Validator list threshold set in configuration to " << listThreshold_; } @@ -293,7 +293,7 @@ ValidatorList::buildFileData( XRPL_ASSERT( pubCollection.rawVersion == 2 || pubCollection.remaining.empty(), - "ripple::ValidatorList::buildFileData : valid publisher list input"); + "xrpl::ValidatorList::buildFileData : valid publisher list input"); auto const effectiveVersion = forceVersion ? *forceVersion : pubCollection.rawVersion; @@ -395,7 +395,7 @@ ValidatorList::parseBlobs(std::uint32_t version, Json::Value const& body) info.signature = body[jss::signature].asString(); XRPL_ASSERT( result.size() == 1, - "ripple::ValidatorList::parseBlobs : single element result"); + "xrpl::ValidatorList::parseBlobs : single element result"); return result; } // Treat unknown versions as if they're the latest version. This @@ -432,7 +432,7 @@ ValidatorList::parseBlobs(std::uint32_t version, Json::Value const& body) } XRPL_ASSERT( result.size() == blobs.size(), - "ripple::ValidatorList::parseBlobs(version, Jason::Value) : " + "xrpl::ValidatorList::parseBlobs(version, Jason::Value) : " "result size matches"); return result; } @@ -466,7 +466,7 @@ ValidatorList::parseBlobs(protocol::TMValidatorListCollection const& body) } XRPL_ASSERT( result.size() == body.blobs_size(), - "ripple::ValidatorList::parseBlobs(TMValidatorList) : result size " + "xrpl::ValidatorList::parseBlobs(TMValidatorList) : result size " "match"); return result; } @@ -489,7 +489,7 @@ splitMessage( { if (begin == 0 && end == 0) end = largeMsg.blobs_size(); - XRPL_ASSERT(begin < end, "ripple::splitMessage : valid inputs"); + XRPL_ASSERT(begin < end, "xrpl::splitMessage : valid inputs"); if (end <= begin) return 0; @@ -525,7 +525,7 @@ splitMessageParts( XRPL_ASSERT( Message::totalSize(smallMsg) <= maximiumMessageSize, - "ripple::splitMessageParts : maximum message size"); + "xrpl::splitMessageParts : maximum message size"); messages.emplace_back( std::make_shared(smallMsg, protocol::mtVALIDATORLIST), @@ -575,7 +575,7 @@ buildValidatorListMessage( { XRPL_ASSERT( messages.empty(), - "ripple::buildValidatorListMessage(ValidatorBlobInfo) : empty messages " + "xrpl::buildValidatorListMessage(ValidatorBlobInfo) : empty messages " "input"); protocol::TMValidatorList msg; auto const manifest = @@ -589,7 +589,7 @@ buildValidatorListMessage( XRPL_ASSERT( Message::totalSize(msg) <= maximiumMessageSize, - "ripple::buildValidatorListMessage(ValidatorBlobInfo) : maximum " + "xrpl::buildValidatorListMessage(ValidatorBlobInfo) : maximum " "message size"); messages.emplace_back( std::make_shared(msg, protocol::mtVALIDATORLIST), @@ -611,7 +611,7 @@ buildValidatorListMessage( { XRPL_ASSERT( messages.empty(), - "ripple::buildValidatorListMessage(std::map) : empty messages input"); protocol::TMValidatorListCollection msg; auto const version = rawVersion < 2 ? 2 : rawVersion; @@ -630,7 +630,7 @@ buildValidatorListMessage( } XRPL_ASSERT( msg.blobs_size() > 0, - "ripple::buildValidatorListMessage(std::map) : minimum message blobs"); if (Message::totalSize(msg) > maxSize) { @@ -662,7 +662,7 @@ ValidatorList::buildValidatorListMessages( { XRPL_ASSERT( !blobInfos.empty(), - "ripple::ValidatorList::buildValidatorListMessages : empty messages " + "xrpl::ValidatorList::buildValidatorListMessages : empty messages " "input"); auto const& [currentSeq, currentBlob] = *blobInfos.begin(); auto numVLs = std::accumulate( @@ -748,7 +748,7 @@ ValidatorList::sendValidatorList( { XRPL_ASSERT( !messages.empty(), - "ripple::ValidatorList::sendValidatorList : non-empty messages " + "xrpl::ValidatorList::sendValidatorList : non-empty messages " "input"); // Don't send it next time. peer.setPublisherListSequence(publisherKey, newPeerSequence); @@ -767,7 +767,7 @@ ValidatorList::sendValidatorList( // thus there will only be one entry without a message XRPL_ASSERT( sent || messages.size() == 1, - "ripple::ValidatorList::sendValidatorList : sent or one message"); + "xrpl::ValidatorList::sendValidatorList : sent or one message"); if (sent) { if (messageVersion > 1) @@ -781,7 +781,7 @@ ValidatorList::sendValidatorList( { XRPL_ASSERT( numVLs == 1, - "ripple::ValidatorList::sendValidatorList : one validator " + "xrpl::ValidatorList::sendValidatorList : one validator " "list"); JLOG(j.debug()) << "Sent validator list for " << strHex(publisherKey) @@ -879,7 +879,7 @@ ValidatorList::broadcastBlobs( XRPL_ASSERT( lists.current.sequence == maxSequence || lists.remaining.count(maxSequence) == 1, - "ripple::ValidatorList::broadcastBlobs : valid sequence"); + "xrpl::ValidatorList::broadcastBlobs : valid sequence"); // Can't use overlay.foreach here because we need to modify // the peer, and foreach provides a const& for (auto& peer : overlay.getActivePeers()) @@ -1025,7 +1025,7 @@ ValidatorList::applyLists( auto next = std::next(iter); XRPL_ASSERT( next == remaining.end() || next->first > iter->first, - "ripple::ValidatorList::applyLists : next is valid"); + "xrpl::ValidatorList::applyLists : next is valid"); if (iter->first <= current.sequence || (next != remaining.end() && next->second.validFrom <= iter->second.validFrom)) @@ -1151,8 +1151,7 @@ ValidatorList::applyList( // we can only arrive here if the key used by the manifest matched one // of the loaded keys // LCOV_EXCL_START - UNREACHABLE( - "ripple::ValidatorList::applyList : invalid public key type"); + UNREACHABLE("xrpl::ValidatorList::applyList : invalid public key type"); return PublisherListStats{result}; // LCOV_EXCL_STOP } @@ -1213,7 +1212,7 @@ ValidatorList::applyList( // Done XRPL_ASSERT( publisher.sequence == sequence, - "ripple::ValidatorList::applyList : publisher sequence match"); + "xrpl::ValidatorList::applyList : publisher sequence match"); } else { @@ -1374,7 +1373,7 @@ ValidatorList::verify( auto const sig = strUnHex(signature); auto const data = base64_decode(blob); - if (!sig || !ripple::verify(*signingKey, makeSlice(data), makeSlice(*sig))) + if (!sig || !xrpl::verify(*signingKey, makeSlice(data), makeSlice(*sig))) return {ListDisposition::invalid, masterPubKey}; Json::Reader r; @@ -1508,7 +1507,7 @@ ValidatorList::removePublisherList( XRPL_ASSERT( reason != PublisherStatus::available && reason != PublisherStatus::unavailable, - "ripple::ValidatorList::removePublisherList : valid reason input"); + "xrpl::ValidatorList::removePublisherList : valid reason input"); auto const iList = publisherLists_.find(publisherKey); if (iList == publisherLists_.end()) return false; @@ -1697,7 +1696,7 @@ ValidatorList::getJson() const // Race conditions can happen, so make this check "fuzzy" XRPL_ASSERT( future.validFrom > timeKeeper_.now() + 600s, - "ripple::ValidatorList::getJson : minimum valid from"); + "xrpl::ValidatorList::getJson : minimum valid from"); } if (remaining.size()) curr[jss::remaining] = std::move(remaining); @@ -1764,7 +1763,7 @@ ValidatorList::for_each_available( continue; XRPL_ASSERT( plCollection.maxSequence != 0, - "ripple::ValidatorList::for_each_available : nonzero maxSequence"); + "xrpl::ValidatorList::for_each_available : nonzero maxSequence"); func( plCollection.rawManifest, plCollection.rawVersion, @@ -1854,7 +1853,7 @@ ValidatorList::calculateQuorum( publisherLists_.size() - listThreshold_ + 1); XRPL_ASSERT( errorThreshold > 0, - "ripple::ValidatorList::calculateQuorum : nonzero error threshold"); + "xrpl::ValidatorList::calculateQuorum : nonzero error threshold"); if (unavailable >= errorThreshold) return std::numeric_limits::max(); } @@ -1931,12 +1930,12 @@ ValidatorList::updateTrusted( { XRPL_ASSERT( std::next(iter) == next, - "ripple::ValidatorList::updateTrusted : sequential " + "xrpl::ValidatorList::updateTrusted : sequential " "remaining"); } XRPL_ASSERT( iter != remaining.end(), - "ripple::ValidatorList::updateTrusted : non-end of " + "xrpl::ValidatorList::updateTrusted : non-end of " "remaining"); // Rotate the pending list in to current @@ -1945,7 +1944,7 @@ ValidatorList::updateTrusted( auto& current = collection.current; XRPL_ASSERT( candidate.validFrom <= closeTime, - "ripple::ValidatorList::updateTrusted : maximum time"); + "xrpl::ValidatorList::updateTrusted : maximum time"); auto const oldList = current.list; current = std::move(candidate); @@ -1953,7 +1952,7 @@ ValidatorList::updateTrusted( collection.status = PublisherStatus::available; XRPL_ASSERT( current.sequence == sequence, - "ripple::ValidatorList::updateTrusted : sequence match"); + "xrpl::ValidatorList::updateTrusted : sequence match"); // If the list is expired, remove the validators so they don't // get processed in. The expiration check below will do the rest // of the work @@ -2012,7 +2011,7 @@ ValidatorList::updateTrusted( { XRPL_ASSERT( kit->second >= listThreshold_, - "ripple::ValidatorList::updateTrusted : count meets threshold"); + "xrpl::ValidatorList::updateTrusted : count meets threshold"); ++it; } } @@ -2039,7 +2038,7 @@ ValidatorList::updateTrusted( validatorManifests_.getSigningKey(k); XRPL_ASSERT( signingKey, - "ripple::ValidatorList::updateTrusted : found signing key"); + "xrpl::ValidatorList::updateTrusted : found signing key"); trustedSigningKeys_.insert(*signingKey); } } @@ -2153,4 +2152,4 @@ ValidatorList::negativeUNLFilter( return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/ValidatorSite.cpp b/src/xrpld/app/misc/detail/ValidatorSite.cpp index 74481e9a6b..a76980ac02 100644 --- a/src/xrpld/app/misc/detail/ValidatorSite.cpp +++ b/src/xrpld/app/misc/detail/ValidatorSite.cpp @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { auto constexpr default_refresh_interval = std::chrono::minutes{5}; auto constexpr error_retry_interval = std::chrono::seconds{30}; @@ -394,7 +394,7 @@ ValidatorSite::parseJsonResponse( auto const manifest = body[jss::manifest].asString(); XRPL_ASSERT( version == body[jss::version].asUInt(), - "ripple::ValidatorSite::parseJsonResponse : version match"); + "xrpl::ValidatorSite::parseJsonResponse : version match"); auto const& uri = sites_[siteIdx].activeResource->uri; auto const hash = sha512Half(manifest, blobs, version); auto const applyResult = app_.validators().applyListsAndBroadcast( @@ -571,7 +571,7 @@ ValidatorSite::onSiteFetch( processRedirect(res, siteIdx, lock_sites); XRPL_ASSERT( newLocation, - "ripple::ValidatorSite::onSiteFetch : non-null " + "xrpl::ValidatorSite::onSiteFetch : non-null " "validator"); // for perm redirects, also update our starting URI if (res.result() == status::moved_permanently || @@ -684,4 +684,4 @@ ValidatorSite::getJson() const } return jrr; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/Work.h b/src/xrpld/app/misc/detail/Work.h index 6855c68827..4d1547c4fb 100644 --- a/src/xrpld/app/misc/detail/Work.h +++ b/src/xrpld/app/misc/detail/Work.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -25,6 +25,6 @@ public: } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/WorkBase.h b/src/xrpld/app/misc/detail/WorkBase.h index 03cd2398f5..6c46749f6d 100644 --- a/src/xrpld/app/misc/detail/WorkBase.h +++ b/src/xrpld/app/misc/detail/WorkBase.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -260,7 +260,7 @@ WorkBase::onResponse(error_code const& ec) return fail(ec); close(); - XRPL_ASSERT(cb_, "ripple::detail::WorkBase::onResponse : callback is set"); + XRPL_ASSERT(cb_, "xrpl::detail::WorkBase::onResponse : callback is set"); cb_(ec, lastEndpoint_, std::move(res_)); cb_ = nullptr; } @@ -281,6 +281,6 @@ WorkBase::close() } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/WorkFile.h b/src/xrpld/app/misc/detail/WorkFile.h index 32dfca2b49..ac926ede1f 100644 --- a/src/xrpld/app/misc/detail/WorkFile.h +++ b/src/xrpld/app/misc/detail/WorkFile.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { @@ -78,7 +78,7 @@ WorkFile::run() error_code ec; auto const fileContents = getFileContents(ec, path_, megabytes(1)); - XRPL_ASSERT(cb_, "ripple::detail::WorkFile::run : callback is set"); + XRPL_ASSERT(cb_, "xrpl::detail::WorkFile::run : callback is set"); cb_(ec, fileContents); cb_ = nullptr; } @@ -91,6 +91,6 @@ WorkFile::cancel() } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/WorkPlain.h b/src/xrpld/app/misc/detail/WorkPlain.h index 13ed9c7f1d..23bae20006 100644 --- a/src/xrpld/app/misc/detail/WorkPlain.h +++ b/src/xrpld/app/misc/detail/WorkPlain.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -60,6 +60,6 @@ WorkPlain::onConnect(error_code const& ec) } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/misc/detail/WorkSSL.cpp b/src/xrpld/app/misc/detail/WorkSSL.cpp index 6bd576cb18..6ccc83f595 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.cpp +++ b/src/xrpld/app/misc/detail/WorkSSL.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace detail { WorkSSL::WorkSSL( @@ -56,4 +56,4 @@ WorkSSL::onHandshake(error_code const& ec) } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkSSL.h b/src/xrpld/app/misc/detail/WorkSSL.h index 5d17e6979f..7dd1a94c9e 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.h +++ b/src/xrpld/app/misc/detail/WorkSSL.h @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -57,6 +57,6 @@ private: } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/AMMContext.h b/src/xrpld/app/paths/AMMContext.h index b84634c6dc..a272ba291e 100644 --- a/src/xrpld/app/paths/AMMContext.h +++ b/src/xrpld/app/paths/AMMContext.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** Maintains AMM info per overall payment engine execution and * individual iteration. @@ -95,6 +95,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_PATHS_AMMCONTEXT_H_INCLUDED diff --git a/src/xrpld/app/paths/AMMLiquidity.h b/src/xrpld/app/paths/AMMLiquidity.h index 48388b378e..b5b865d80e 100644 --- a/src/xrpld/app/paths/AMMLiquidity.h +++ b/src/xrpld/app/paths/AMMLiquidity.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { template class AMMOffer; @@ -131,6 +131,6 @@ private: maxOffer(TAmounts const& balances, Rules const& rules) const; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_TX_AMMLIQUIDITY_H_INCLUDED diff --git a/src/xrpld/app/paths/AMMOffer.h b/src/xrpld/app/paths/AMMOffer.h index d669e60d99..07defc16b1 100644 --- a/src/xrpld/app/paths/AMMOffer.h +++ b/src/xrpld/app/paths/AMMOffer.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { template class AMMLiquidity; @@ -127,6 +127,6 @@ public: checkInvariant(TAmounts const& consumed, beast::Journal j) const; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_APP_AMMOFFER_H_INCLUDED diff --git a/src/xrpld/app/paths/AccountCurrencies.cpp b/src/xrpld/app/paths/AccountCurrencies.cpp index 900ca04904..fbb9c63cd8 100644 --- a/src/xrpld/app/paths/AccountCurrencies.cpp +++ b/src/xrpld/app/paths/AccountCurrencies.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { hash_set accountSourceCurrencies( @@ -66,4 +66,4 @@ accountDestCurrencies( return currencies; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/AccountCurrencies.h b/src/xrpld/app/paths/AccountCurrencies.h index 39e4f8931f..de46a13808 100644 --- a/src/xrpld/app/paths/AccountCurrencies.h +++ b/src/xrpld/app/paths/AccountCurrencies.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { hash_set accountDestCurrencies( @@ -19,6 +19,6 @@ accountSourceCurrencies( std::shared_ptr const& lrLedger, bool includeXRP); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/Credit.cpp b/src/xrpld/app/paths/Credit.cpp index 8895e681dc..09798cef90 100644 --- a/src/xrpld/app/paths/Credit.cpp +++ b/src/xrpld/app/paths/Credit.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { STAmount creditLimit( @@ -25,10 +25,10 @@ creditLimit( XRPL_ASSERT( result.getIssuer() == account, - "ripple::creditLimit : result issuer match"); + "xrpl::creditLimit : result issuer match"); XRPL_ASSERT( result.getCurrency() == currency, - "ripple::creditLimit : result currency match"); + "xrpl::creditLimit : result currency match"); return result; } @@ -63,11 +63,11 @@ creditBalance( XRPL_ASSERT( result.getIssuer() == account, - "ripple::creditBalance : result issuer match"); + "xrpl::creditBalance : result issuer match"); XRPL_ASSERT( result.getCurrency() == currency, - "ripple::creditBalance : result currency match"); + "xrpl::creditBalance : result currency match"); return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/Credit.h b/src/xrpld/app/paths/Credit.h index 69594cf843..5bdcd70e74 100644 --- a/src/xrpld/app/paths/Credit.h +++ b/src/xrpld/app/paths/Credit.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Calculate the maximum amount of IOUs that an account can hold @param ledger the ledger to check against. @@ -45,6 +45,6 @@ creditBalance( Currency const& currency); /** @} */ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/Flow.cpp b/src/xrpld/app/paths/Flow.cpp index c9e16497e3..a102e44854 100644 --- a/src/xrpld/app/paths/Flow.cpp +++ b/src/xrpld/app/paths/Flow.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { template static auto @@ -172,7 +172,7 @@ flow( flowDebugInfo)); } - XRPL_ASSERT(!srcIsXRP && !dstIsXRP, "ripple::flow : neither is XRP"); + XRPL_ASSERT(!srcIsXRP && !dstIsXRP, "xrpl::flow : neither is XRP"); return finishFlow( sb, srcIssue, @@ -190,4 +190,4 @@ flow( flowDebugInfo)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/Flow.h b/src/xrpld/app/paths/Flow.h index ca1e538e3a..5fafe294db 100644 --- a/src/xrpld/app/paths/Flow.h +++ b/src/xrpld/app/paths/Flow.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace path { namespace detail { @@ -51,6 +51,6 @@ flow( beast::Journal j, path::detail::FlowDebugInfo* flowDebugInfo = nullptr); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/PathRequest.cpp b/src/xrpld/app/paths/PathRequest.cpp index 6b7b35e366..41bae4b178 100644 --- a/src/xrpld/app/paths/PathRequest.cpp +++ b/src/xrpld/app/paths/PathRequest.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { PathRequest::PathRequest( Application& app, @@ -139,8 +139,7 @@ PathRequest::updateComplete() { std::lock_guard sl(mIndexLock); - XRPL_ASSERT( - mInProgress, "ripple::PathRequest::updateComplete : in progress"); + XRPL_ASSERT(mInProgress, "xrpl::PathRequest::updateComplete : in progress"); mInProgress = false; if (fCompletion) @@ -762,4 +761,4 @@ PathRequest::getSubscriber() const return wpSubscriber.lock(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/PathRequest.h b/src/xrpld/app/paths/PathRequest.h index b71635cc7f..3d5564c069 100644 --- a/src/xrpld/app/paths/PathRequest.h +++ b/src/xrpld/app/paths/PathRequest.h @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { // A pathfinding request submitted by a client // The request issuer must maintain a strong pointer @@ -158,6 +158,6 @@ private: static unsigned int const max_paths_ = 4; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/PathRequests.cpp b/src/xrpld/app/paths/PathRequests.cpp index 2d5b52d1f9..cfe6080eac 100644 --- a/src/xrpld/app/paths/PathRequests.cpp +++ b/src/xrpld/app/paths/PathRequests.cpp @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { /** Get the current RippleLineCache, updating it if necessary. Get the correct ledger to use. @@ -300,4 +300,4 @@ PathRequests::doLegacyPathRequest( return std::move(jvRes); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/PathRequests.h b/src/xrpld/app/paths/PathRequests.h index 544ff2fec0..5c97bafa8a 100644 --- a/src/xrpld/app/paths/PathRequests.h +++ b/src/xrpld/app/paths/PathRequests.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { class PathRequests { @@ -100,6 +100,6 @@ private: std::recursive_mutex mutable mLock; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/Pathfinder.cpp b/src/xrpld/app/paths/Pathfinder.cpp index d3ed3fc38c..1d3be85d48 100644 --- a/src/xrpld/app/paths/Pathfinder.cpp +++ b/src/xrpld/app/paths/Pathfinder.cpp @@ -45,7 +45,7 @@ same path request (particularly if the search depth may change). */ -namespace ripple { +namespace xrpl { namespace { @@ -174,7 +174,7 @@ Pathfinder::Pathfinder( { XRPL_ASSERT( !uSrcIssuer || isXRP(uSrcCurrency) == isXRP(uSrcIssuer.value()), - "ripple::Pathfinder::Pathfinder : valid inputs"); + "xrpl::Pathfinder::Pathfinder : valid inputs"); } bool @@ -568,7 +568,7 @@ Pathfinder::getBestPaths( XRPL_ASSERT( fullLiquidityPath.empty(), - "ripple::Pathfinder::getBestPaths : first empty path result"); + "xrpl::Pathfinder::getBestPaths : first empty path result"); bool const issuerIsSender = isXRP(mSrcCurrency) || (srcIssuer == mSrcAccount); @@ -630,7 +630,7 @@ Pathfinder::getBestPaths( if (path.empty()) { // LCOV_EXCL_START - UNREACHABLE("ripple::Pathfinder::getBestPaths : path not found"); + UNREACHABLE("xrpl::Pathfinder::getBestPaths : path not found"); continue; // LCOV_EXCL_STOP } @@ -676,7 +676,7 @@ Pathfinder::getBestPaths( { XRPL_ASSERT( fullLiquidityPath.empty(), - "ripple::Pathfinder::getBestPaths : second empty path result"); + "xrpl::Pathfinder::getBestPaths : second empty path result"); JLOG(j_.info()) << "Paths could not send " << remaining << " of " << mDstAmount; } @@ -827,7 +827,7 @@ Pathfinder::addPathsForType( // Source must always be at the start, so pathsOut has to be empty. XRPL_ASSERT( pathsOut.empty(), - "ripple::Pathfinder::addPathsForType : empty paths"); + "xrpl::Pathfinder::addPathsForType : empty paths"); pathsOut.push_back(STPath()); break; @@ -1280,7 +1280,7 @@ void fillPaths(Pathfinder::PaymentType type, PathCostList const& costs) { auto& list = mPathTable[type]; - XRPL_ASSERT(list.empty(), "ripple::fillPaths : empty paths"); + XRPL_ASSERT(list.empty(), "xrpl::fillPaths : empty paths"); for (auto& cost : costs) list.push_back({cost.cost, makePath(cost.path)}); } @@ -1359,4 +1359,4 @@ Pathfinder::initPathTable() }); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/Pathfinder.h b/src/xrpld/app/paths/Pathfinder.h index 91c0a033f1..b269cc868b 100644 --- a/src/xrpld/app/paths/Pathfinder.h +++ b/src/xrpld/app/paths/Pathfinder.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Calculates payment paths. @@ -219,6 +219,6 @@ private: static std::uint32_t const afAC_LAST = 0x080; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/RippleCalc.cpp b/src/xrpld/app/paths/RippleCalc.cpp index a6751169d7..2b48a6ba5c 100644 --- a/src/xrpld/app/paths/RippleCalc.cpp +++ b/src/xrpld/app/paths/RippleCalc.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace path { RippleCalc::Output @@ -108,4 +108,4 @@ RippleCalc::rippleCalculate( } } // namespace path -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/RippleCalc.h b/src/xrpld/app/paths/RippleCalc.h index 1480a02bb7..0ef2641e36 100644 --- a/src/xrpld/app/paths/RippleCalc.h +++ b/src/xrpld/app/paths/RippleCalc.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class Config; namespace path { @@ -107,6 +107,6 @@ public: }; } // namespace path -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/RippleLineCache.cpp b/src/xrpld/app/paths/RippleLineCache.cpp index 498b060cb3..ece4c4149a 100644 --- a/src/xrpld/app/paths/RippleLineCache.cpp +++ b/src/xrpld/app/paths/RippleLineCache.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { RippleLineCache::RippleLineCache( std::shared_ptr const& ledger, @@ -61,7 +61,7 @@ RippleLineCache::getRippleLines( // for either value of outgoing. XRPL_ASSERT( size <= totalLineCount_, - "ripple::RippleLineCache::getRippleLines : maximum lines"); + "xrpl::RippleLineCache::getRippleLines : maximum lines"); totalLineCount_ -= size; lines_.erase(otheriter); } @@ -83,7 +83,7 @@ RippleLineCache::getRippleLines( { XRPL_ASSERT( it->second == nullptr, - "ripple::RippleLineCache::getRippleLines : null lines"); + "xrpl::RippleLineCache::getRippleLines : null lines"); auto lines = PathFindTrustLine::getItems(accountID, *ledger_, direction); if (lines.size()) @@ -96,7 +96,7 @@ RippleLineCache::getRippleLines( XRPL_ASSERT( !it->second || (it->second->size() > 0), - "ripple::RippleLineCache::getRippleLines : null or nonempty lines"); + "xrpl::RippleLineCache::getRippleLines : null or nonempty lines"); auto const size = it->second ? it->second->size() : 0; JLOG(journal_.trace()) << "getRippleLines for ledger " << ledger_->header().seq << " found " << size @@ -111,4 +111,4 @@ RippleLineCache::getRippleLines( return it->second; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/RippleLineCache.h b/src/xrpld/app/paths/RippleLineCache.h index 00614f08c2..c2763ca2b4 100644 --- a/src/xrpld/app/paths/RippleLineCache.h +++ b/src/xrpld/app/paths/RippleLineCache.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { // Used by Pathfinder class RippleLineCache final : public CountedObject @@ -46,7 +46,7 @@ public: private: std::mutex mLock; - ripple::hardened_hash<> hasher_; + xrpl::hardened_hash<> hasher_; std::shared_ptr ledger_; beast::Journal journal_; @@ -108,6 +108,6 @@ private: std::size_t totalLineCount_ = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/TrustLine.cpp b/src/xrpld/app/paths/TrustLine.cpp index 45c17bb893..b6ce9d74b0 100644 --- a/src/xrpld/app/paths/TrustLine.cpp +++ b/src/xrpld/app/paths/TrustLine.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { TrustLineBase::TrustLineBase( std::shared_ptr const& sle, @@ -103,4 +103,4 @@ RPCTrustLine::getItems(AccountID const& accountID, ReadView const& view) return detail::getTrustLineItems(accountID, view); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/TrustLine.h b/src/xrpld/app/paths/TrustLine.h index 8b944d84b1..a0a58c2bde 100644 --- a/src/xrpld/app/paths/TrustLine.h +++ b/src/xrpld/app/paths/TrustLine.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Describes how an account was found in a path, and how to find the next set of paths. "Outgoing" is defined as the source account, or an account found via a @@ -227,6 +227,6 @@ private: Rate highQualityOut_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/AMMLiquidity.cpp b/src/xrpld/app/paths/detail/AMMLiquidity.cpp index 84a039bfc6..2042467923 100644 --- a/src/xrpld/app/paths/detail/AMMLiquidity.cpp +++ b/src/xrpld/app/paths/detail/AMMLiquidity.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { template AMMLiquidity::AMMLiquidity( @@ -60,7 +60,7 @@ AMMLiquidity::generateFibSeqOffer( XRPL_ASSERT( !ammContext_.maxItersReached(), - "ripple::AMMLiquidity::generateFibSeqOffer : maximum iterations"); + "xrpl::AMMLiquidity::generateFibSeqOffer : maximum iterations"); cur.out = toAmount( getIssue(balances.out), @@ -245,4 +245,4 @@ template class AMMLiquidity; template class AMMLiquidity; template class AMMLiquidity; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/detail/AMMOffer.cpp b/src/xrpld/app/paths/detail/AMMOffer.cpp index 42592ee9c9..a58eafbdbf 100644 --- a/src/xrpld/app/paths/detail/AMMOffer.cpp +++ b/src/xrpld/app/paths/detail/AMMOffer.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { template AMMOffer::AMMOffer( @@ -155,4 +155,4 @@ template class AMMOffer; template class AMMOffer; template class AMMOffer; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/detail/AmountSpec.h b/src/xrpld/app/paths/detail/AmountSpec.h index 09ebea9c8a..5249bd30e0 100644 --- a/src/xrpld/app/paths/detail/AmountSpec.h +++ b/src/xrpld/app/paths/detail/AmountSpec.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { struct AmountSpec { @@ -107,7 +107,7 @@ inline IOUAmount& get(EitherAmount& amt) { XRPL_ASSERT( - !amt.native, "ripple::get(EitherAmount&) : is not XRP"); + !amt.native, "xrpl::get(EitherAmount&) : is not XRP"); return amt.iou; } @@ -115,7 +115,7 @@ template <> inline XRPAmount& get(EitherAmount& amt) { - XRPL_ASSERT(amt.native, "ripple::get(EitherAmount&) : is XRP"); + XRPL_ASSERT(amt.native, "xrpl::get(EitherAmount&) : is XRP"); return amt.xrp; } @@ -132,8 +132,7 @@ inline IOUAmount const& get(EitherAmount const& amt) { XRPL_ASSERT( - !amt.native, - "ripple::get(EitherAmount const&) : is not XRP"); + !amt.native, "xrpl::get(EitherAmount const&) : is not XRP"); return amt.iou; } @@ -142,7 +141,7 @@ inline XRPAmount const& get(EitherAmount const& amt) { XRPL_ASSERT( - amt.native, "ripple::get(EitherAmount const&) : is XRP"); + amt.native, "xrpl::get(EitherAmount const&) : is XRP"); return amt.xrp; } @@ -151,7 +150,7 @@ toAmountSpec(STAmount const& amt) { XRPL_ASSERT( amt.mantissa() < std::numeric_limits::max(), - "ripple::toAmountSpec(STAmount const&) : maximum mantissa"); + "xrpl::toAmountSpec(STAmount const&) : maximum mantissa"); bool const isNeg = amt.negative(); std::int64_t const sMant = isNeg ? -std::int64_t(amt.mantissa()) : amt.mantissa(); @@ -188,7 +187,7 @@ toAmountSpec(EitherAmount const& ea, std::optional const& c) r.currency = c; XRPL_ASSERT( ea.native == r.native, - "ripple::toAmountSpec(EitherAmount const&&, std::optional) : " + "xrpl::toAmountSpec(EitherAmount const&&, std::optional) : " "matching native"); if (r.native) { @@ -201,6 +200,6 @@ toAmountSpec(EitherAmount const& ea, std::optional const& c) return r; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/BookStep.cpp b/src/xrpld/app/paths/detail/BookStep.cpp index 6144f8adfa..baef42a492 100644 --- a/src/xrpld/app/paths/detail/BookStep.cpp +++ b/src/xrpld/app/paths/detail/BookStep.cpp @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { template class BookStep : public StepImp> @@ -356,7 +356,7 @@ private: // It's really a programming error if the quality is missing. XRPL_ASSERT( limitQuality, - "ripple::BookOfferCrossingStep::getQuality : nonzero quality"); + "xrpl::BookOfferCrossingStep::getQuality : nonzero quality"); if (!limitQuality) Throw(tefINTERNAL, "Offer requires quality."); return *limitQuality; @@ -1079,7 +1079,7 @@ BookStep::revImp( // LCOV_EXCL_START JLOG(j_.error()) << "BookStep remainingOut < 0 " << to_string(remainingOut); - UNREACHABLE("ripple::BookStep::revImp : remaining less than zero"); + UNREACHABLE("xrpl::BookStep::revImp : remaining less than zero"); cache_.emplace(beast::zero, beast::zero); return {beast::zero, beast::zero}; // LCOV_EXCL_STOP @@ -1103,7 +1103,7 @@ BookStep::fwdImp( boost::container::flat_set& ofrsToRm, TIn const& in) { - XRPL_ASSERT(cache_, "ripple::BookStep::fwdImp : cache is set"); + XRPL_ASSERT(cache_, "xrpl::BookStep::fwdImp : cache is set"); TAmounts result(beast::zero, beast::zero); @@ -1122,8 +1122,7 @@ BookStep::fwdImp( TOut const& ownerGives, std::uint32_t transferRateIn, std::uint32_t transferRateOut) mutable -> bool { - XRPL_ASSERT( - cache_, "ripple::BookStep::fwdImp::eachOffer : cache is set"); + XRPL_ASSERT(cache_, "xrpl::BookStep::fwdImp::eachOffer : cache is set"); if (remainingIn <= beast::zero) return false; @@ -1243,7 +1242,7 @@ BookStep::fwdImp( // something went very wrong JLOG(j_.error()) << "BookStep remainingIn < 0 " << to_string(remainingIn); - UNREACHABLE("ripple::BookStep::fwdImp : remaining less than zero"); + UNREACHABLE("xrpl::BookStep::fwdImp : remaining less than zero"); cache_.emplace(beast::zero, beast::zero); return {beast::zero, beast::zero}; // LCOV_EXCL_STOP @@ -1365,7 +1364,7 @@ namespace test { template static bool -equalHelper(Step const& step, ripple::Book const& book) +equalHelper(Step const& step, xrpl::Book const& book) { if (auto bs = dynamic_cast const*>(&step)) return book == bs->book(); @@ -1373,14 +1372,14 @@ equalHelper(Step const& step, ripple::Book const& book) } bool -bookStepEqual(Step const& step, ripple::Book const& book) +bookStepEqual(Step const& step, xrpl::Book const& book) { bool const inXRP = isXRP(book.in.currency); bool const outXRP = isXRP(book.out.currency); if (inXRP && outXRP) { // LCOV_EXCL_START - UNREACHABLE("ripple::test::bookStepEqual : no XRP to XRP book step"); + UNREACHABLE("xrpl::test::bookStepEqual : no XRP to XRP book step"); return false; // no such thing as xrp/xrp book step // LCOV_EXCL_STOP } @@ -1449,4 +1448,4 @@ make_BookStepXI(StrandContext const& ctx, Issue const& out) return make_BookStepHelper(ctx, xrpIssue(), out); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/detail/DirectStep.cpp b/src/xrpld/app/paths/detail/DirectStep.cpp index 2af467c820..5f9d0c86e7 100644 --- a/src/xrpld/app/paths/detail/DirectStep.cpp +++ b/src/xrpld/app/paths/detail/DirectStep.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { template class DirectStepI : public StepImp> @@ -499,7 +499,7 @@ DirectStepI::revImp( qualities(sb, srcDebtDir, StrandDirection::reverse); XRPL_ASSERT( static_cast(this)->verifyDstQualityIn(dstQIn), - "ripple::DirectStepI : valid destination quality"); + "xrpl::DirectStepI : valid destination quality"); Issue const srcToDstIss(currency_, redeems(srcDebtDir) ? dst_ : src_); @@ -618,7 +618,7 @@ DirectStepI::fwdImp( boost::container::flat_set& /*ofrsToRm*/, IOUAmount const& in) { - XRPL_ASSERT(cache_, "ripple::DirectStepI::fwdImp : cache is set"); + XRPL_ASSERT(cache_, "xrpl::DirectStepI::fwdImp : cache is set"); auto const [maxSrcToDst, srcDebtDir] = static_cast(this)->maxFlow(sb, cache_->srcToDst); @@ -705,7 +705,7 @@ DirectStepI::validFwd( auto const savCache = *cache_; - XRPL_ASSERT(!in.native, "ripple::DirectStepI::validFwd : input is not XRP"); + XRPL_ASSERT(!in.native, "xrpl::DirectStepI::validFwd : input is not XRP"); auto const [maxSrcToDst, srcDebtDir] = static_cast(this)->maxFlow(sb, cache_->srcToDst); @@ -772,7 +772,7 @@ DirectStepI::qualitiesSrcIssues( XRPL_ASSERT( static_cast(this)->verifyPrevStepDebtDirection( prevStepDebtDirection), - "ripple::DirectStepI::qualitiesSrcIssues : will prevStepDebtDirection " + "xrpl::DirectStepI::qualitiesSrcIssues : will prevStepDebtDirection " "issue"); std::uint32_t const srcQOut = redeems(prevStepDebtDirection) @@ -896,7 +896,7 @@ DirectStepI::check(StrandContext const& ctx) const { // LCOV_EXCL_START UNREACHABLE( - "ripple::DirectStepI::check : prev seen book without a " + "xrpl::DirectStepI::check : prev seen book without a " "prev step"); return temBAD_PATH_LOOP; // LCOV_EXCL_STOP @@ -975,4 +975,4 @@ make_DirectStepI( return {tesSUCCESS, std::move(r)}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/detail/FlatSets.h b/src/xrpld/app/paths/detail/FlatSets.h index 9438f71532..cb02a09d9a 100644 --- a/src/xrpld/app/paths/detail/FlatSets.h +++ b/src/xrpld/app/paths/detail/FlatSets.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Given two flat sets dst and src, compute dst = dst union src @@ -25,6 +25,6 @@ SetUnion( boost::container::ordered_unique_range_t{}, src.begin(), src.end()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/FlowDebugInfo.h b/src/xrpld/app/paths/detail/FlowDebugInfo.h index 1addb5acbd..6c0f0e8e00 100644 --- a/src/xrpld/app/paths/detail/FlowDebugInfo.h +++ b/src/xrpld/app/paths/detail/FlowDebugInfo.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace path { namespace detail { // Track performance information of a single payment @@ -73,7 +73,7 @@ struct FlowDebugInfo { XRPL_ASSERT( !liquiditySrcIn.empty(), - "ripple::path::detail::FlowDebugInfo::pushLiquiditySrc : " + "xrpl::path::detail::FlowDebugInfo::pushLiquiditySrc : " "non-empty liquidity source"); liquiditySrcIn.back().push_back(eIn); liquiditySrcOut.back().push_back(eOut); @@ -109,7 +109,7 @@ struct FlowDebugInfo { // LCOV_EXCL_START UNREACHABLE( - "ripple::path::detail::FlowDebugInfo::duration : timepoint not " + "xrpl::path::detail::FlowDebugInfo::duration : timepoint not " "found"); return std::chrono::duration(0); // LCOV_EXCL_STOP @@ -222,7 +222,7 @@ struct FlowDebugInfo std::vector const& amts, char delim = ';') { auto get_val = [](EitherAmount const& a) -> std::string { - return ripple::to_string(a.xrp); + return xrpl::to_string(a.xrp); }; write_list(amts, get_val, delim); }; @@ -230,7 +230,7 @@ struct FlowDebugInfo std::vector const& amts, char delim = ';') { auto get_val = [](EitherAmount const& a) -> std::string { - return ripple::to_string(a.iou); + return xrpl::to_string(a.iou); }; write_list(amts, get_val, delim); }; @@ -361,5 +361,5 @@ balanceDiffsToString(std::optional const& bd) } // namespace detail } // namespace path -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/PathfinderUtils.h b/src/xrpld/app/paths/detail/PathfinderUtils.h index 42cc6f832f..5571cd4732 100644 --- a/src/xrpld/app/paths/detail/PathfinderUtils.h +++ b/src/xrpld/app/paths/detail/PathfinderUtils.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { inline STAmount largestAmount(STAmount const& amt) @@ -29,6 +29,6 @@ convertAllCheck(STAmount const& a) return a == largestAmount(a); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/PaySteps.cpp b/src/xrpld/app/paths/detail/PaySteps.cpp index 8e189806fb..97d1dad4fa 100644 --- a/src/xrpld/app/paths/detail/PaySteps.cpp +++ b/src/xrpld/app/paths/detail/PaySteps.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { // Check equal with tolerance bool @@ -80,7 +80,7 @@ toStep( // should already be taken care of JLOG(j.error()) << "Found offer/account payment step. Aborting payment strand."; - UNREACHABLE("ripple::toStep : offer/account payment payment strand"); + UNREACHABLE("xrpl::toStep : offer/account payment payment strand"); return {temBAD_PATH, std::unique_ptr{}}; // LCOV_EXCL_STOP } @@ -88,7 +88,7 @@ toStep( XRPL_ASSERT( (e2->getNodeType() & STPathElement::typeCurrency) || (e2->getNodeType() & STPathElement::typeIssuer), - "ripple::toStep : currency or issuer"); + "xrpl::toStep : currency or issuer"); auto const outCurrency = e2->getNodeType() & STPathElement::typeCurrency ? e2->getCurrency() : curIssue.currency; @@ -102,7 +102,7 @@ toStep( return {temBAD_PATH, std::unique_ptr{}}; } - XRPL_ASSERT(e2->isOffer(), "ripple::toStep : is offer"); + XRPL_ASSERT(e2->isOffer(), "xrpl::toStep : is offer"); if (isXRP(outCurrency)) return make_BookStepIX(ctx, curIssue); @@ -376,7 +376,7 @@ toStrand( { // Should never happen // LCOV_EXCL_START - UNREACHABLE("ripple::toStrand : offer currency mismatch"); + UNREACHABLE("xrpl::toStrand : offer currency mismatch"); return {temBAD_PATH, Strand{}}; // LCOV_EXCL_STOP } @@ -444,7 +444,7 @@ toStrand( { // LCOV_EXCL_START JLOG(j.warn()) << "Flow check strand failed"; - UNREACHABLE("ripple::toStrand : invalid strand"); + UNREACHABLE("xrpl::toStrand : invalid strand"); return {temBAD_PATH, Strand{}}; // LCOV_EXCL_STOP } @@ -627,4 +627,4 @@ isDirectXrpToXrp(Strand const& strand); template bool isDirectXrpToXrp(Strand const& strand); -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/paths/detail/StepChecks.h b/src/xrpld/app/paths/detail/StepChecks.h index 7ba1e40d16..969aec2541 100644 --- a/src/xrpld/app/paths/detail/StepChecks.h +++ b/src/xrpld/app/paths/detail/StepChecks.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { inline TER checkFreeze( @@ -17,7 +17,7 @@ checkFreeze( AccountID const& dst, Currency const& currency) { - XRPL_ASSERT(src != dst, "ripple::checkFreeze : unequal input accounts"); + XRPL_ASSERT(src != dst, "xrpl::checkFreeze : unequal input accounts"); // check freeze if (auto sle = view.read(keylet::account(dst))) @@ -93,6 +93,6 @@ checkNoRipple( return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/Steps.h b/src/xrpld/app/paths/detail/Steps.h index 6bdb30dd22..63254c228e 100644 --- a/src/xrpld/app/paths/detail/Steps.h +++ b/src/xrpld/app/paths/detail/Steps.h @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { class PaymentSandbox; class ReadView; class ApplyView; @@ -579,7 +579,7 @@ bool xrpEndpointStepEqual(Step const& step, AccountID const& acc); bool -bookStepEqual(Step const& step, ripple::Book const& book); +bookStepEqual(Step const& step, xrpl::Book const& book); } // namespace test std::pair> @@ -606,6 +606,6 @@ bool isDirectXrpToXrp(Strand const& strand); /// @endcond -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/StrandFlow.h b/src/xrpld/app/paths/detail/StrandFlow.h index fb93f3fdb7..5e0a637858 100644 --- a/src/xrpld/app/paths/detail/StrandFlow.h +++ b/src/xrpld/app/paths/detail/StrandFlow.h @@ -21,7 +21,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Result of flow() execution of a single Strand. */ template @@ -154,7 +154,7 @@ flow( << to_string(get(r.first)) << " maxIn: " << to_string(*maxIn); UNREACHABLE( - "ripple::flow : first step re-executing the " + "xrpl::flow : first step re-executing the " "limiting step failed"); return Result{strand, std::move(ofrsToRm)}; // LCOV_EXCL_STOP @@ -194,7 +194,7 @@ flow( JLOG(j.fatal()) << "Re-executed limiting step failed"; #endif UNREACHABLE( - "ripple::flow : limiting step re-executing the " + "xrpl::flow : limiting step re-executing the " "limiting step failed"); return Result{strand, std::move(ofrsToRm)}; // LCOV_EXCL_STOP @@ -232,7 +232,7 @@ flow( JLOG(j.fatal()) << "Re-executed forward pass failed"; #endif UNREACHABLE( - "ripple::flow : non-limiting step re-executing the " + "xrpl::flow : non-limiting step re-executing the " "forward pass failed"); return Result{strand, std::move(ofrsToRm)}; // LCOV_EXCL_STOP @@ -487,7 +487,7 @@ public: if (i >= cur_.size()) { // LCOV_EXCL_START - UNREACHABLE("ripple::ActiveStrands::get : input out of range"); + UNREACHABLE("xrpl::ActiveStrands::get : input out of range"); return nullptr; // LCOV_EXCL_STOP } @@ -698,7 +698,7 @@ flow( XRPL_ASSERT( f.out <= remainingOut && f.sandbox && (!remainingIn || f.in <= *remainingIn), - "ripple::flow : remaining constraints"); + "xrpl::flow : remaining constraints"); Quality const q(f.out, f.in); @@ -719,7 +719,7 @@ flow( continue; } - XRPL_ASSERT(!best, "ripple::flow : best is unset"); + XRPL_ASSERT(!best, "xrpl::flow : best is unset"); if (!f.inactive) activeStrands.push(strand); best.emplace(f.in, f.out, std::move(*f.sandbox), *strand, q); @@ -805,7 +805,7 @@ flow( // running debug builds of rippled. While this issue still needs to // be resolved, the assert is causing more harm than good at this // point. - // UNREACHABLE("ripple::flow : rounding error"); + // UNREACHABLE("xrpl::flow : rounding error"); return {tefEXCEPTION, std::move(ofrsToRmOnFail)}; } @@ -842,7 +842,7 @@ flow( // Handles both cases 1. and 2. // fixFillOrKill amendment: // Handles 2. 1. is handled above and falls through for tfSell. - XRPL_ASSERT(remainingIn, "ripple::flow : nonzero remainingIn"); + XRPL_ASSERT(remainingIn, "xrpl::flow : nonzero remainingIn"); if (remainingIn && *remainingIn != beast::zero) return { tecPATH_PARTIAL, @@ -854,6 +854,6 @@ flow( return {actualIn, actualOut, std::move(sb), std::move(ofrsToRmOnFail)}; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp index fb51a68fcc..83271321be 100644 --- a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp +++ b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { template class XRPEndpointStep @@ -106,7 +106,7 @@ protected: XRPAmount xrpLiquidImpl(ReadView& sb, std::int32_t reserveReduction) const { - return ripple::xrpLiquid(sb, acc_, reserveReduction, j_); + return xrpl::xrpLiquid(sb, acc_, reserveReduction, j_); } std::string @@ -263,7 +263,7 @@ XRPEndpointStep::fwdImp( boost::container::flat_set& ofrsToRm, XRPAmount const& in) { - XRPL_ASSERT(cache_, "ripple::XRPEndpointStep::fwdImp : cache is set"); + XRPL_ASSERT(cache_, "xrpl::XRPEndpointStep::fwdImp : cache is set"); auto const balance = static_cast(this)->xrpLiquid(sb); auto const result = isLast_ ? in : std::min(balance, in); @@ -291,7 +291,7 @@ XRPEndpointStep::validFwd( return {false, EitherAmount(XRPAmount(beast::zero))}; } - XRPL_ASSERT(in.native, "ripple::XRPEndpointStep::validFwd : input is XRP"); + XRPL_ASSERT(in.native, "xrpl::XRPEndpointStep::validFwd : input is XRP"); auto const& xrpIn = in.xrp; auto const balance = static_cast(this)->xrpLiquid(sb); @@ -396,4 +396,4 @@ make_XRPEndpointStep(StrandContext const& ctx, AccountID const& acc) return {tesSUCCESS, std::move(r)}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/PeerFinder.h b/src/xrpld/app/rdb/PeerFinder.h index e5e3195b2f..6c1b2779a6 100644 --- a/src/xrpld/app/rdb/PeerFinder.h +++ b/src/xrpld/app/rdb/PeerFinder.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * @brief initPeerFinderDB Opens a session with the peer finder database. @@ -52,6 +52,6 @@ savePeerFinderDB( soci::session& session, std::vector const& v); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index 102479544b..50cd420483 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { struct LedgerHashPair { @@ -218,7 +218,7 @@ rangeCheckedCast(C c) { // This should never happen // LCOV_EXCL_START - UNREACHABLE("ripple::rangeCheckedCast : domain error"); + UNREACHABLE("xrpl::rangeCheckedCast : domain error"); JLOG(debugLog().error()) << "rangeCheckedCast domain error:" << " value = " << c << " min = " << std::numeric_limits::lowest() @@ -229,6 +229,6 @@ rangeCheckedCast(C c) return static_cast(c); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/State.h b/src/xrpld/app/rdb/State.h index 54e1f8219a..e8c14fdd29 100644 --- a/src/xrpld/app/rdb/State.h +++ b/src/xrpld/app/rdb/State.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { struct SavedState { @@ -74,6 +74,6 @@ setSavedState(soci::session& session, SavedState const& state); void setLastRotated(soci::session& session, LedgerIndex seq); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/Vacuum.h b/src/xrpld/app/rdb/Vacuum.h index 40c84796d2..d7ca5f8bce 100644 --- a/src/xrpld/app/rdb/Vacuum.h +++ b/src/xrpld/app/rdb/Vacuum.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** * @brief doVacuumDB Creates, initialises, and performs cleanup on a database. @@ -14,6 +14,6 @@ namespace ripple { bool doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/Wallet.h b/src/xrpld/app/rdb/Wallet.h index c1a17b39dd..961b12d7ef 100644 --- a/src/xrpld/app/rdb/Wallet.h +++ b/src/xrpld/app/rdb/Wallet.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * @brief makeWalletDB Opens the wallet database and returns it. @@ -158,6 +158,6 @@ voteAmendment( std::string const& name, AmendmentVote vote); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/backend/SQLiteDatabase.h b/src/xrpld/app/rdb/backend/SQLiteDatabase.h index cf668137ea..22a4ed8b37 100644 --- a/src/xrpld/app/rdb/backend/SQLiteDatabase.h +++ b/src/xrpld/app/rdb/backend/SQLiteDatabase.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class SQLiteDatabase : public RelationalDatabase { @@ -289,6 +289,6 @@ public: closeTransactionDB() = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index c8458d15db..b112f46409 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -16,7 +16,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { /** @@ -41,7 +41,7 @@ to_string(TableType type) return "AccountTransactions"; // LCOV_EXCL_START default: - UNREACHABLE("ripple::detail::to_string : invalid TableType"); + UNREACHABLE("xrpl::detail::to_string : invalid TableType"); return "Unknown"; // LCOV_EXCL_STOP } @@ -187,7 +187,7 @@ saveValidatedLedger( { // LCOV_EXCL_START JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}}); - UNREACHABLE("ripple::detail::saveValidatedLedger : zero account hash"); + UNREACHABLE("xrpl::detail::saveValidatedLedger : zero account hash"); // LCOV_EXCL_STOP } @@ -200,13 +200,13 @@ saveValidatedLedger( JLOG(j.fatal()) << "saveAcceptedLedger: seq=" << seq << ", current=" << current; UNREACHABLE( - "ripple::detail::saveValidatedLedger : mismatched account hash"); + "xrpl::detail::saveValidatedLedger : mismatched account hash"); // LCOV_EXCL_STOP } XRPL_ASSERT( ledger->header().txHash == ledger->txMap().getHash().as_uint256(), - "ripple::detail::saveValidatedLedger : transaction hash match"); + "xrpl::detail::saveValidatedLedger : transaction hash match"); // Save the ledger header in the hashed object store { @@ -1354,4 +1354,4 @@ dbHasSpace(soci::session& session, Config const& config, beast::Journal j) } } // namespace detail -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index fbf06083d6..37d028c035 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace detail { /* Need to change TableTypeCount if TableType is modified. */ @@ -436,6 +436,6 @@ bool dbHasSpace(soci::session& session, Config const& config, beast::Journal j); } // namespace detail -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp index b789685211..796b030a99 100644 --- a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp +++ b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { class SQLiteDatabaseImp final : public SQLiteDatabase { @@ -789,7 +789,7 @@ SQLiteDatabaseImp::getKBUsedAll() { if (existsLedger()) { - return ripple::getKBUsedAll(lgrdb_->getSession()); + return xrpl::getKBUsedAll(lgrdb_->getSession()); } return 0; @@ -800,7 +800,7 @@ SQLiteDatabaseImp::getKBUsedLedger() { if (existsLedger()) { - return ripple::getKBUsedDB(lgrdb_->getSession()); + return xrpl::getKBUsedDB(lgrdb_->getSession()); } return 0; @@ -814,7 +814,7 @@ SQLiteDatabaseImp::getKBUsedTransaction() if (existsTransaction()) { - return ripple::getKBUsedDB(txdb_->getSession()); + return xrpl::getKBUsedDB(txdb_->getSession()); } return 0; @@ -838,4 +838,4 @@ getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue) return std::make_unique(app, config, jobQueue); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/PeerFinder.cpp b/src/xrpld/app/rdb/detail/PeerFinder.cpp index 7ac0a941e2..0c4b5d355c 100644 --- a/src/xrpld/app/rdb/detail/PeerFinder.cpp +++ b/src/xrpld/app/rdb/detail/PeerFinder.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { void initPeerFinderDB( @@ -249,4 +249,4 @@ savePeerFinderDB( tr.commit(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp index a01f0583f6..37ee2a7703 100644 --- a/src/xrpld/app/rdb/detail/RelationalDatabase.cpp +++ b/src/xrpld/app/rdb/detail/RelationalDatabase.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { extern std::unique_ptr getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue); @@ -42,4 +42,4 @@ RelationalDatabase::init( return std::unique_ptr(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/State.cpp b/src/xrpld/app/rdb/detail/State.cpp index d731c98b40..984c8824f2 100644 --- a/src/xrpld/app/rdb/detail/State.cpp +++ b/src/xrpld/app/rdb/detail/State.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { void initStateDB( @@ -108,4 +108,4 @@ setLastRotated(soci::session& session, LedgerIndex seq) soci::use(seq); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/Vacuum.cpp b/src/xrpld/app/rdb/detail/Vacuum.cpp index 49e86ae281..8423f20992 100644 --- a/src/xrpld/app/rdb/detail/Vacuum.cpp +++ b/src/xrpld/app/rdb/detail/Vacuum.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { bool doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j) @@ -49,4 +49,4 @@ doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j) return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/rdb/detail/Wallet.cpp b/src/xrpld/app/rdb/detail/Wallet.cpp index 7dbaab6ef4..fc4f5ea89b 100644 --- a/src/xrpld/app/rdb/detail/Wallet.cpp +++ b/src/xrpld/app/rdb/detail/Wallet.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { std::unique_ptr makeWalletDB(DatabaseCon::Setup const& setup, beast::Journal j) @@ -284,4 +284,4 @@ voteAmendment( tr.commit(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/apply.h b/src/xrpld/app/tx/apply.h index 2e0cd538f2..d578334c31 100644 --- a/src/xrpld/app/tx/apply.h +++ b/src/xrpld/app/tx/apply.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { class Application; class HashRouter; @@ -138,6 +138,6 @@ applyTransaction( ApplyFlags flags, beast::Journal journal); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/applySteps.h b/src/xrpld/app/tx/applySteps.h index 6542a8d6ec..c0c530f3ac 100644 --- a/src/xrpld/app/tx/applySteps.h +++ b/src/xrpld/app/tx/applySteps.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class STTx; @@ -347,6 +347,6 @@ calculateDefaultBaseFee(ReadView const& view, STTx const& tx); ApplyResult doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/AMMBid.cpp b/src/xrpld/app/tx/detail/AMMBid.cpp index 47b89417a3..34b2c811c2 100644 --- a/src/xrpld/app/tx/detail/AMMBid.cpp +++ b/src/xrpld/app/tx/detail/AMMBid.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMBid::checkExtraFeatures(PreflightContext const& ctx) @@ -173,7 +173,7 @@ applyBid( { XRPL_ASSERT( ammSle->isFieldPresent(sfAuctionSlot), - "ripple::applyBid : has auction slot"); + "xrpl::applyBid : has auction slot"); if (!ammSle->isFieldPresent(sfAuctionSlot)) return {tecINTERNAL, false}; } @@ -300,7 +300,7 @@ applyBid( { // Price the slot was purchased at. STAmount const pricePurchased = auctionSlot[sfPrice]; - XRPL_ASSERT(timeSlot, "ripple::applyBid : timeSlot is set"); + XRPL_ASSERT(timeSlot, "xrpl::applyBid : timeSlot is set"); auto const fractionUsed = (Number(*timeSlot) + 1) / AUCTION_SLOT_TIME_INTERVALS; auto const fractionRemaining = Number(1) - fractionUsed; @@ -362,4 +362,4 @@ AMMBid::doApply() return result.first; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMBid.h b/src/xrpld/app/tx/detail/AMMBid.h index 25ad118e05..b402e82f9d 100644 --- a/src/xrpld/app/tx/detail/AMMBid.h +++ b/src/xrpld/app/tx/detail/AMMBid.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** AMMBid implements AMM bid Transactor. * This is a mechanism for an AMM instance to auction-off @@ -65,6 +65,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMBID_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMClawback.cpp b/src/xrpld/app/tx/detail/AMMClawback.cpp index ebde91b43d..5eaed55f23 100644 --- a/src/xrpld/app/tx/detail/AMMClawback.cpp +++ b/src/xrpld/app/tx/detail/AMMClawback.cpp @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { std::uint32_t AMMClawback::getFlagsMask(PreflightContext const& ctx) @@ -321,4 +321,4 @@ AMMClawback::equalWithdrawMatchingOneAmount( ctx_.journal); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMClawback.h b/src/xrpld/app/tx/detail/AMMClawback.h index b1283c9427..0615234ffa 100644 --- a/src/xrpld/app/tx/detail/AMMClawback.h +++ b/src/xrpld/app/tx/detail/AMMClawback.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Sandbox; class AMMClawback : public Transactor { @@ -54,6 +54,6 @@ private: STAmount const& amount); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/AMMCreate.cpp b/src/xrpld/app/tx/detail/AMMCreate.cpp index 65357ad197..3a3ce4b1e1 100644 --- a/src/xrpld/app/tx/detail/AMMCreate.cpp +++ b/src/xrpld/app/tx/detail/AMMCreate.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMCreate::checkExtraFeatures(PreflightContext const& ctx) @@ -330,4 +330,4 @@ AMMCreate::doApply() return result.first; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMCreate.h b/src/xrpld/app/tx/detail/AMMCreate.h index 5be2cc264c..da77f79c5e 100644 --- a/src/xrpld/app/tx/detail/AMMCreate.h +++ b/src/xrpld/app/tx/detail/AMMCreate.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** AMMCreate implements Automatic Market Maker(AMM) creation Transactor. * It creates a new AMM instance with two tokens. Any trader, or Liquidity @@ -61,6 +61,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMCREATE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMDelete.cpp b/src/xrpld/app/tx/detail/AMMDelete.cpp index 476b035bc0..a6cfaac586 100644 --- a/src/xrpld/app/tx/detail/AMMDelete.cpp +++ b/src/xrpld/app/tx/detail/AMMDelete.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMDelete::checkExtraFeatures(PreflightContext const& ctx) @@ -53,4 +53,4 @@ AMMDelete::doApply() return ter; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMDelete.h b/src/xrpld/app/tx/detail/AMMDelete.h index af0b33154b..a09b855c7c 100644 --- a/src/xrpld/app/tx/detail/AMMDelete.h +++ b/src/xrpld/app/tx/detail/AMMDelete.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** AMMDelete implements AMM delete transactor. This is a mechanism to * delete AMM in an empty state when the number of LP tokens is 0. @@ -33,6 +33,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMDELETE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMDeposit.cpp b/src/xrpld/app/tx/detail/AMMDeposit.cpp index 3495ef03f5..36399d4e1c 100644 --- a/src/xrpld/app/tx/detail/AMMDeposit.cpp +++ b/src/xrpld/app/tx/detail/AMMDeposit.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMDeposit::checkExtraFeatures(PreflightContext const& ctx) @@ -448,7 +448,7 @@ AMMDeposit::applyGuts(Sandbox& sb) { XRPL_ASSERT( newLPTokenBalance > beast::zero, - "ripple::AMMDeposit::applyGuts : valid new LP token balance"); + "xrpl::AMMDeposit::applyGuts : valid new LP token balance"); ammSle->setFieldAmount(sfLPTokenBalance, newLPTokenBalance); // LP depositing into AMM empty state gets the auction slot // and the voting @@ -1008,4 +1008,4 @@ AMMDeposit::equalDepositInEmptyState( tfee); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMDeposit.h b/src/xrpld/app/tx/detail/AMMDeposit.h index fa0610fcd5..7fd50c4c4d 100644 --- a/src/xrpld/app/tx/detail/AMMDeposit.h +++ b/src/xrpld/app/tx/detail/AMMDeposit.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Sandbox; @@ -229,6 +229,6 @@ private: std::uint16_t tfee); }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMDEPOSIT_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMVote.cpp b/src/xrpld/app/tx/detail/AMMVote.cpp index ea11f543dd..ca57ce1f8c 100644 --- a/src/xrpld/app/tx/detail/AMMVote.cpp +++ b/src/xrpld/app/tx/detail/AMMVote.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMVote::checkExtraFeatures(PreflightContext const& ctx) @@ -177,7 +177,7 @@ applyVote( XRPL_ASSERT( !ctx_.view().rules().enabled(fixInnerObjTemplate) || ammSle->isFieldPresent(sfAuctionSlot), - "ripple::applyVote : has auction slot"); + "xrpl::applyVote : has auction slot"); // Update the vote entries and the trading/discounted fee. ammSle->setFieldArray(sfVoteSlots, updatedVoteSlots); @@ -224,4 +224,4 @@ AMMVote::doApply() return result.first; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMVote.h b/src/xrpld/app/tx/detail/AMMVote.h index b38beb56bc..1dec046c29 100644 --- a/src/xrpld/app/tx/detail/AMMVote.h +++ b/src/xrpld/app/tx/detail/AMMVote.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** AMMVote implements AMM vote Transactor. * This transactor allows for the TradingFee of the AMM instance be a votable @@ -50,6 +50,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMVOTE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/AMMWithdraw.cpp b/src/xrpld/app/tx/detail/AMMWithdraw.cpp index ac49298920..78da481b95 100644 --- a/src/xrpld/app/tx/detail/AMMWithdraw.cpp +++ b/src/xrpld/app/tx/detail/AMMWithdraw.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { bool AMMWithdraw::checkExtraFeatures(PreflightContext const& ctx) @@ -891,7 +891,7 @@ AMMWithdraw::equalWithdrawLimit( // LCOV_EXCL_START XRPL_ASSERT( amountWithdraw <= amount, - "ripple::AMMWithdraw::equalWithdrawLimit : maximum amountWithdraw"); + "xrpl::AMMWithdraw::equalWithdrawLimit : maximum amountWithdraw"); // LCOV_EXCL_STOP } else if (amountWithdraw > amount) @@ -1084,4 +1084,4 @@ AMMWithdraw::isWithdrawAll(STTx const& tx) return WithdrawAll::Yes; return WithdrawAll::No; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/AMMWithdraw.h b/src/xrpld/app/tx/detail/AMMWithdraw.h index 871f8e3a21..916621a5d0 100644 --- a/src/xrpld/app/tx/detail/AMMWithdraw.h +++ b/src/xrpld/app/tx/detail/AMMWithdraw.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class Sandbox; @@ -293,6 +293,6 @@ private: isWithdrawAll(STTx const& tx); }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_AMMWITHDRAW_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/ApplyContext.cpp b/src/xrpld/app/tx/detail/ApplyContext.cpp index 4a7f72e2e3..d364950b44 100644 --- a/src/xrpld/app/tx/detail/ApplyContext.cpp +++ b/src/xrpld/app/tx/detail/ApplyContext.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { ApplyContext::ApplyContext( Application& app_, @@ -133,7 +133,7 @@ ApplyContext::checkInvariants(TER const result, XRPAmount const fee) { XRPL_ASSERT( isTesSuccess(result) || isTecClaim(result), - "ripple::ApplyContext::checkInvariants : is tesSUCCESS or tecCLAIM"); + "xrpl::ApplyContext::checkInvariants : is tesSUCCESS or tecCLAIM"); return checkInvariantsHelper( result, @@ -141,4 +141,4 @@ ApplyContext::checkInvariants(TER const result, XRPAmount const fee) std::make_index_sequence::value>{}); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/ApplyContext.h b/src/xrpld/app/tx/detail/ApplyContext.h index e045189146..4ae2f11a85 100644 --- a/src/xrpld/app/tx/detail/ApplyContext.h +++ b/src/xrpld/app/tx/detail/ApplyContext.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { /** State information when applying a tx. */ class ApplyContext @@ -140,6 +140,6 @@ private: std::optional parentBatchId_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Batch.cpp b/src/xrpld/app/tx/detail/Batch.cpp index 8bf0c7fe02..277bd4e3b7 100644 --- a/src/xrpld/app/tx/detail/Batch.cpp +++ b/src/xrpld/app/tx/detail/Batch.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** * @brief Calculates the total base fee for a batch transaction. @@ -78,7 +78,7 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx) } // LCOV_EXCL_STOP - auto const fee = ripple::calculateBaseFee(view, stx); + auto const fee = xrpl::calculateBaseFee(view, stx); // LCOV_EXCL_START if (txnFees > maxAmount - fee) { @@ -306,7 +306,7 @@ Batch::preflight(PreflightContext const& ctx) } auto const innerAccount = stx.getAccountID(sfAccount); - if (auto const preflightResult = ripple::preflight( + if (auto const preflightResult = xrpl::preflight( ctx.app, ctx.rules, parentBatchId, stx, tapBATCH, ctx.j); preflightResult.ter != tesSUCCESS) { @@ -521,4 +521,4 @@ Batch::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Batch.h b/src/xrpld/app/tx/detail/Batch.h index 7889e91bdc..a8cfeadc6b 100644 --- a/src/xrpld/app/tx/detail/Batch.h +++ b/src/xrpld/app/tx/detail/Batch.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class Batch : public Transactor { @@ -55,6 +55,6 @@ public: }); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/BookTip.cpp b/src/xrpld/app/tx/detail/BookTip.cpp index 09a0091995..d3c8e69e01 100644 --- a/src/xrpld/app/tx/detail/BookTip.cpp +++ b/src/xrpld/app/tx/detail/BookTip.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { BookTip::BookTip(ApplyView& view, Book const& book) : view_(view) @@ -59,4 +59,4 @@ BookTip::step(beast::Journal j) return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/BookTip.h b/src/xrpld/app/tx/detail/BookTip.h index f6d05f1df5..51dc252835 100644 --- a/src/xrpld/app/tx/detail/BookTip.h +++ b/src/xrpld/app/tx/detail/BookTip.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { class Logs; @@ -61,6 +61,6 @@ public: step(beast::Journal j); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CancelCheck.cpp b/src/xrpld/app/tx/detail/CancelCheck.cpp index daf4955d47..b673784655 100644 --- a/src/xrpld/app/tx/detail/CancelCheck.cpp +++ b/src/xrpld/app/tx/detail/CancelCheck.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC CancelCheck::preflight(PreflightContext const& ctx) @@ -101,4 +101,4 @@ CancelCheck::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CancelCheck.h b/src/xrpld/app/tx/detail/CancelCheck.h index 6f0b5a969b..4be696520d 100644 --- a/src/xrpld/app/tx/detail/CancelCheck.h +++ b/src/xrpld/app/tx/detail/CancelCheck.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class CancelCheck : public Transactor { @@ -26,6 +26,6 @@ public: using CheckCancel = CancelCheck; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CancelOffer.cpp b/src/xrpld/app/tx/detail/CancelOffer.cpp index 149d7e2d9c..1dc9ad0bde 100644 --- a/src/xrpld/app/tx/detail/CancelOffer.cpp +++ b/src/xrpld/app/tx/detail/CancelOffer.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC CancelOffer::preflight(PreflightContext const& ctx) @@ -61,4 +61,4 @@ CancelOffer::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CancelOffer.h b/src/xrpld/app/tx/detail/CancelOffer.h index 3ae6afa935..33af365c4d 100644 --- a/src/xrpld/app/tx/detail/CancelOffer.h +++ b/src/xrpld/app/tx/detail/CancelOffer.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class CancelOffer : public Transactor { @@ -28,6 +28,6 @@ public: using OfferCancel = CancelOffer; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CashCheck.cpp b/src/xrpld/app/tx/detail/CashCheck.cpp index 4010aa0714..c32b7dfe4e 100644 --- a/src/xrpld/app/tx/detail/CashCheck.cpp +++ b/src/xrpld/app/tx/detail/CashCheck.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { NotTEC CashCheck::preflight(PreflightContext const& ctx) @@ -475,4 +475,4 @@ CashCheck::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CashCheck.h b/src/xrpld/app/tx/detail/CashCheck.h index cfa0adbe1f..f27a45a0c4 100644 --- a/src/xrpld/app/tx/detail/CashCheck.h +++ b/src/xrpld/app/tx/detail/CashCheck.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class CashCheck : public Transactor { @@ -26,6 +26,6 @@ public: using CheckCash = CashCheck; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Change.cpp b/src/xrpld/app/tx/detail/Change.cpp index 43c6f7c619..191d91863d 100644 --- a/src/xrpld/app/tx/detail/Change.cpp +++ b/src/xrpld/app/tx/detail/Change.cpp @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { template <> NotTEC @@ -131,7 +131,7 @@ Change::doApply() return applyUNLModify(); // LCOV_EXCL_START default: - UNREACHABLE("ripple::Change::doApply : invalid transaction type"); + UNREACHABLE("xrpl::Change::doApply : invalid transaction type"); return tefFAILURE; // LCOV_EXCL_STOP } @@ -141,7 +141,7 @@ void Change::preCompute() { XRPL_ASSERT( - account_ == beast::zero, "ripple::Change::preCompute : zero account"); + account_ == beast::zero, "xrpl::Change::preCompute : zero account"); } TER @@ -407,4 +407,4 @@ Change::applyUNLModify() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Change.h b/src/xrpld/app/tx/detail/Change.h index 9ff37b1515..4d7b76ed78 100644 --- a/src/xrpld/app/tx/detail/Change.h +++ b/src/xrpld/app/tx/detail/Change.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Change : public Transactor { @@ -43,6 +43,6 @@ using EnableAmendment = Change; using SetFee = Change; using UNLModify = Change; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Clawback.cpp b/src/xrpld/app/tx/detail/Clawback.cpp index 0d153771b5..24b1603aab 100644 --- a/src/xrpld/app/tx/detail/Clawback.cpp +++ b/src/xrpld/app/tx/detail/Clawback.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { template static NotTEC @@ -270,4 +270,4 @@ Clawback::doApply() ctx_.tx[sfAmount].asset().value()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Clawback.h b/src/xrpld/app/tx/detail/Clawback.h index 95ebd0e74c..8db93fcc01 100644 --- a/src/xrpld/app/tx/detail/Clawback.h +++ b/src/xrpld/app/tx/detail/Clawback.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Clawback : public Transactor { @@ -27,6 +27,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CreateCheck.cpp b/src/xrpld/app/tx/detail/CreateCheck.cpp index df859c4364..11613a5855 100644 --- a/src/xrpld/app/tx/detail/CreateCheck.cpp +++ b/src/xrpld/app/tx/detail/CreateCheck.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC CreateCheck::preflight(PreflightContext const& ctx) @@ -214,4 +214,4 @@ CreateCheck::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CreateCheck.h b/src/xrpld/app/tx/detail/CreateCheck.h index b8b0add2f9..ac735eecb0 100644 --- a/src/xrpld/app/tx/detail/CreateCheck.h +++ b/src/xrpld/app/tx/detail/CreateCheck.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class CreateCheck : public Transactor { @@ -26,6 +26,6 @@ public: using CheckCreate = CreateCheck; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CreateOffer.cpp b/src/xrpld/app/tx/detail/CreateOffer.cpp index fe96436f2f..f81afecd55 100644 --- a/src/xrpld/app/tx/detail/CreateOffer.cpp +++ b/src/xrpld/app/tx/detail/CreateOffer.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { TxConsequences CreateOffer::makeTxConsequences(PreflightContext const& ctx) { @@ -216,7 +216,7 @@ CreateOffer::checkAcceptAsset( // Only valid for custom currencies XRPL_ASSERT( !isXRP(issue.currency), - "ripple::CreateOffer::checkAcceptAsset : input is not XRP"); + "xrpl::CreateOffer::checkAcceptAsset : input is not XRP"); auto const issuerAccount = view.read(keylet::account(issue.account)); @@ -460,7 +460,7 @@ CreateOffer::flowCross( afterCross.out -= result.actualAmountOut; XRPL_ASSERT( afterCross.out >= beast::zero, - "ripple::CreateOffer::flowCross : minimum offer"); + "xrpl::CreateOffer::flowCross : minimum offer"); if (afterCross.out < beast::zero) afterCross.out.clear(); afterCross.in = mulRound( @@ -673,7 +673,7 @@ CreateOffer::applyGuts(Sandbox& sb, Sandbox& sbCancel) // or give a tec. XRPL_ASSERT( result == tesSUCCESS || isTecClaim(result), - "ripple::CreateOffer::applyGuts : result is tesSUCCESS or " + "xrpl::CreateOffer::applyGuts : result is tesSUCCESS or " "tecCLAIM"); if (auto stream = j_.trace()) @@ -694,10 +694,10 @@ CreateOffer::applyGuts(Sandbox& sb, Sandbox& sbCancel) XRPL_ASSERT( saTakerGets.issue() == place_offer.in.issue(), - "ripple::CreateOffer::applyGuts : taker gets issue match"); + "xrpl::CreateOffer::applyGuts : taker gets issue match"); XRPL_ASSERT( saTakerPays.issue() == place_offer.out.issue(), - "ripple::CreateOffer::applyGuts : taker pays issue match"); + "xrpl::CreateOffer::applyGuts : taker pays issue match"); if (takerAmount != place_offer) crossed = true; @@ -727,7 +727,7 @@ CreateOffer::applyGuts(Sandbox& sb, Sandbox& sbCancel) XRPL_ASSERT( saTakerPays > zero && saTakerGets > zero, - "ripple::CreateOffer::applyGuts : taker pays and gets positive"); + "xrpl::CreateOffer::applyGuts : taker pays and gets positive"); if (result != tesSUCCESS) { @@ -907,4 +907,4 @@ CreateOffer::doApply() return result.first; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CreateOffer.h b/src/xrpld/app/tx/detail/CreateOffer.h index 9593b9d1ad..5aaa60c20e 100644 --- a/src/xrpld/app/tx/detail/CreateOffer.h +++ b/src/xrpld/app/tx/detail/CreateOffer.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class PaymentSandbox; class Sandbox; @@ -78,6 +78,6 @@ private: using OfferCreate = CreateOffer; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/CreateTicket.cpp b/src/xrpld/app/tx/detail/CreateTicket.cpp index 1a49209faf..6432d1b3d5 100644 --- a/src/xrpld/app/tx/detail/CreateTicket.cpp +++ b/src/xrpld/app/tx/detail/CreateTicket.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { TxConsequences CreateTicket::makeTxConsequences(PreflightContext const& ctx) @@ -125,4 +125,4 @@ CreateTicket::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/CreateTicket.h b/src/xrpld/app/tx/detail/CreateTicket.h index da5083c838..a41c7e2b1f 100644 --- a/src/xrpld/app/tx/detail/CreateTicket.h +++ b/src/xrpld/app/tx/detail/CreateTicket.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class CreateTicket : public Transactor { @@ -65,6 +65,6 @@ public: using TicketCreate = CreateTicket; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Credentials.cpp b/src/xrpld/app/tx/detail/Credentials.cpp index 274a25e0c6..6d106535a2 100644 --- a/src/xrpld/app/tx/detail/Credentials.cpp +++ b/src/xrpld/app/tx/detail/Credentials.cpp @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { /* Credentials @@ -353,4 +353,4 @@ CredentialAccept::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Credentials.h b/src/xrpld/app/tx/detail/Credentials.h index 704730e6ee..6723a2f0e4 100644 --- a/src/xrpld/app/tx/detail/Credentials.h +++ b/src/xrpld/app/tx/detail/Credentials.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class CredentialCreate : public Transactor { @@ -75,6 +75,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/DID.cpp b/src/xrpld/app/tx/detail/DID.cpp index b17d4ef1b7..e9b23a15eb 100644 --- a/src/xrpld/app/tx/detail/DID.cpp +++ b/src/xrpld/app/tx/detail/DID.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /* DID @@ -194,4 +194,4 @@ DIDDelete::doApply() return deleteSLE(ctx_, keylet::did(account_), account_); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/DID.h b/src/xrpld/app/tx/detail/DID.h index 9e9de22f84..934a9c9e6f 100644 --- a/src/xrpld/app/tx/detail/DID.h +++ b/src/xrpld/app/tx/detail/DID.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class DIDSet : public Transactor { @@ -49,6 +49,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/DelegateSet.cpp b/src/xrpld/app/tx/detail/DelegateSet.cpp index f8dd696fad..8c64547ae1 100644 --- a/src/xrpld/app/tx/detail/DelegateSet.cpp +++ b/src/xrpld/app/tx/detail/DelegateSet.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC DelegateSet::preflight(PreflightContext const& ctx) @@ -129,4 +129,4 @@ DelegateSet::deleteDelegate( return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/DelegateSet.h b/src/xrpld/app/tx/detail/DelegateSet.h index 2f340efb3b..1f9bc02944 100644 --- a/src/xrpld/app/tx/detail/DelegateSet.h +++ b/src/xrpld/app/tx/detail/DelegateSet.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class DelegateSet : public Transactor { @@ -32,6 +32,6 @@ public: beast::Journal j); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/DeleteAccount.cpp b/src/xrpld/app/tx/detail/DeleteAccount.cpp index c9fd0cc75e..422ed37e2f 100644 --- a/src/xrpld/app/tx/detail/DeleteAccount.cpp +++ b/src/xrpld/app/tx/detail/DeleteAccount.cpp @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { bool DeleteAccount::checkExtraFeatures(PreflightContext const& ctx) @@ -237,8 +237,7 @@ DeleteAccount::preclaim(PreclaimContext const& ctx) } auto sleAccount = ctx.view.read(keylet::account(account)); - XRPL_ASSERT( - sleAccount, "ripple::DeleteAccount::preclaim : non-null account"); + XRPL_ASSERT(sleAccount, "xrpl::DeleteAccount::preclaim : non-null account"); if (!sleAccount) return terNO_ACCOUNT; @@ -338,13 +337,12 @@ TER DeleteAccount::doApply() { auto src = view().peek(keylet::account(account_)); - XRPL_ASSERT( - src, "ripple::DeleteAccount::doApply : non-null source account"); + XRPL_ASSERT(src, "xrpl::DeleteAccount::doApply : non-null source account"); auto const dstID = ctx_.tx[sfDestination]; auto dst = view().peek(keylet::account(dstID)); XRPL_ASSERT( - dst, "ripple::DeleteAccount::doApply : non-null destination account"); + dst, "xrpl::DeleteAccount::doApply : non-null destination account"); if (!src || !dst) return tefBAD_LEDGER; // LCOV_EXCL_LINE @@ -374,7 +372,7 @@ DeleteAccount::doApply() // LCOV_EXCL_START UNREACHABLE( - "ripple::DeleteAccount::doApply : undeletable item not found " + "xrpl::DeleteAccount::doApply : undeletable item not found " "in preclaim"); JLOG(j_.error()) << "DeleteAccount undeletable item not " "found in preclaim."; @@ -392,7 +390,7 @@ DeleteAccount::doApply() XRPL_ASSERT( (*src)[sfBalance] == XRPAmount(0), - "ripple::DeleteAccount::doApply : source balance is zero"); + "xrpl::DeleteAccount::doApply : source balance is zero"); // If there's still an owner directory associated with the source account // delete it. @@ -413,4 +411,4 @@ DeleteAccount::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/DeleteAccount.h b/src/xrpld/app/tx/detail/DeleteAccount.h index bfab5591a0..357f87d566 100644 --- a/src/xrpld/app/tx/detail/DeleteAccount.h +++ b/src/xrpld/app/tx/detail/DeleteAccount.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class DeleteAccount : public Transactor { @@ -32,6 +32,6 @@ public: using AccountDelete = DeleteAccount; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/DeleteOracle.cpp b/src/xrpld/app/tx/detail/DeleteOracle.cpp index d635721b86..df7b737eed 100644 --- a/src/xrpld/app/tx/detail/DeleteOracle.cpp +++ b/src/xrpld/app/tx/detail/DeleteOracle.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC DeleteOracle::preflight(PreflightContext const& ctx) @@ -80,4 +80,4 @@ DeleteOracle::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/DeleteOracle.h b/src/xrpld/app/tx/detail/DeleteOracle.h index a9fcd73ec2..48950cfad9 100644 --- a/src/xrpld/app/tx/detail/DeleteOracle.h +++ b/src/xrpld/app/tx/detail/DeleteOracle.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Price Oracle is a system that acts as a bridge between @@ -42,6 +42,6 @@ public: using OracleDelete = DeleteOracle; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_DELETEORACLE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/DepositPreauth.cpp b/src/xrpld/app/tx/detail/DepositPreauth.cpp index 069b356e99..057e240fff 100644 --- a/src/xrpld/app/tx/detail/DepositPreauth.cpp +++ b/src/xrpld/app/tx/detail/DepositPreauth.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { bool DepositPreauth::checkExtraFeatures(PreflightContext const& ctx) @@ -299,4 +299,4 @@ DepositPreauth::removeFromLedger( return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/DepositPreauth.h b/src/xrpld/app/tx/detail/DepositPreauth.h index 4e0102952c..003d444bf3 100644 --- a/src/xrpld/app/tx/detail/DepositPreauth.h +++ b/src/xrpld/app/tx/detail/DepositPreauth.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class DepositPreauth : public Transactor { @@ -34,6 +34,6 @@ public: beast::Journal j); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index e9aad6ad37..4e5f41a427 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { // During an EscrowFinish, the transaction must specify both // a condition and a fulfillment. We track whether that @@ -141,7 +141,7 @@ EscrowCreate::preflight(PreflightContext const& ctx) if (auto const cb = ctx.tx[~sfCondition]) { - using namespace ripple::cryptoconditions; + using namespace xrpl::cryptoconditions; std::error_code ec; @@ -546,7 +546,7 @@ EscrowCreate::doApply() static bool checkCondition(Slice f, Slice c) { - using namespace ripple::cryptoconditions; + using namespace xrpl::cryptoconditions; std::error_code ec; @@ -1072,7 +1072,7 @@ EscrowFinish::doApply() return temDISABLED; // LCOV_EXCL_LINE Rate lockedRate = slep->isFieldPresent(sfTransferRate) - ? ripple::Rate(slep->getFieldU32(sfTransferRate)) + ? xrpl::Rate(slep->getFieldU32(sfTransferRate)) : parityRate; auto const issuer = amount.getIssuer(); bool const createAsset = destID == account_; @@ -1321,4 +1321,4 @@ EscrowCancel::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Escrow.h b/src/xrpld/app/tx/detail/Escrow.h index d2821bc45d..935fb27cd0 100644 --- a/src/xrpld/app/tx/detail/Escrow.h +++ b/src/xrpld/app/tx/detail/Escrow.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class EscrowCreate : public Transactor { @@ -78,6 +78,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/InvariantCheck.cpp b/src/xrpld/app/tx/detail/InvariantCheck.cpp index 27c87e074c..dadc5a7d74 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.cpp +++ b/src/xrpld/app/tx/detail/InvariantCheck.cpp @@ -25,7 +25,7 @@ #include #include -namespace ripple { +namespace xrpl { /* assert(enforce) @@ -525,7 +525,7 @@ AccountRootsDeletedClean::finalize( // assert. XRPL_ASSERT( enforce, - "ripple::AccountRootsDeletedClean::finalize::objectExists : " + "xrpl::AccountRootsDeletedClean::finalize::objectExists : " "account deletion left no objects behind"); return true; } @@ -542,7 +542,7 @@ AccountRootsDeletedClean::finalize( "behind a non-zero balance"; XRPL_ASSERT( enforce, - "ripple::AccountRootsDeletedClean::finalize : " + "xrpl::AccountRootsDeletedClean::finalize : " "deleted account has zero balance"); if (enforce) return false; @@ -554,7 +554,7 @@ AccountRootsDeletedClean::finalize( "behind a non-zero owner count"; XRPL_ASSERT( enforce, - "ripple::AccountRootsDeletedClean::finalize : " + "xrpl::AccountRootsDeletedClean::finalize : " "deleted account has zero owner count"); if (enforce) return false; @@ -796,7 +796,7 @@ TransfersNotFrozen::finalize( // assert. XRPL_ASSERT( enforce, - "ripple::TransfersNotFrozen::finalize : enforce " + "xrpl::TransfersNotFrozen::finalize : enforce " "invariant."); if (enforce) { @@ -820,8 +820,7 @@ TransfersNotFrozen::isValidEntry( std::shared_ptr const& after) { // `after` can never be null, even if the trust line is deleted. - XRPL_ASSERT( - after, "ripple::TransfersNotFrozen::isValidEntry : valid after."); + XRPL_ASSERT(after, "xrpl::TransfersNotFrozen::isValidEntry : valid after."); if (!after) { return false; @@ -877,7 +876,7 @@ TransfersNotFrozen::recordBalance(Issue const& issue, BalanceChange change) { XRPL_ASSERT( change.balanceChangeSign, - "ripple::TransfersNotFrozen::recordBalance : valid trustline " + "xrpl::TransfersNotFrozen::recordBalance : valid trustline " "balance sign."); auto& changes = balanceChanges_[issue]; if (change.balanceChangeSign < 0) @@ -996,7 +995,7 @@ TransfersNotFrozen::validateFrozenState( // The comment above starting with "assert(enforce)" explains this assert. XRPL_ASSERT( enforce, - "ripple::TransfersNotFrozen::validateFrozenState : enforce " + "xrpl::TransfersNotFrozen::validateFrozenState : enforce " "invariant."); if (enforce) @@ -1084,7 +1083,7 @@ ValidNewAccountRoot::finalize( JLOG(j.fatal()) << "Invariant failed: account root created illegally"; return false; -} // namespace ripple +} // namespace xrpl //------------------------------------------------------------------------------ @@ -1486,7 +1485,7 @@ ValidMPTIssuance::finalize( // assert. XRPL_ASSERT_PARTS( enforceCreatedByIssuer, - "ripple::ValidMPTIssuance::finalize", + "xrpl::ValidMPTIssuance::finalize", "no issuer MPToken"); if (enforceCreatedByIssuer) return false; @@ -1598,7 +1597,7 @@ ValidMPTIssuance::finalize( // non-amendment-gated side effects. XRPL_ASSERT_PARTS( !enforceEscrowFinish, - "ripple::ValidMPTIssuance::finalize", + "xrpl::ValidMPTIssuance::finalize", "not escrow finish tx"); return true; } @@ -1811,7 +1810,7 @@ ValidPseudoAccounts::finalize( bool const enforce = view.rules().enabled(featureSingleAssetVault); XRPL_ASSERT( errors_.empty() || enforce, - "ripple::ValidPseudoAccounts::finalize : no bad " + "xrpl::ValidPseudoAccounts::finalize : no bad " "changes or enforce invariant"); if (!errors_.empty()) { @@ -2089,8 +2088,8 @@ ValidAMM::finalizeDEX(bool enforce, beast::Journal const& j) const bool ValidAMM::generalInvariant( - ripple::STTx const& tx, - ripple::ReadView const& view, + xrpl::STTx const& tx, + xrpl::ReadView const& view, ZeroAllowed zeroAllowed, beast::Journal const& j) const { @@ -2135,8 +2134,8 @@ ValidAMM::generalInvariant( bool ValidAMM::finalizeDeposit( - ripple::STTx const& tx, - ripple::ReadView const& view, + xrpl::STTx const& tx, + xrpl::ReadView const& view, bool enforce, beast::Journal const& j) const { @@ -2156,8 +2155,8 @@ ValidAMM::finalizeDeposit( bool ValidAMM::finalizeWithdraw( - ripple::STTx const& tx, - ripple::ReadView const& view, + xrpl::STTx const& tx, + xrpl::ReadView const& view, bool enforce, beast::Journal const& j) const { @@ -2317,7 +2316,7 @@ NoModifiedUnmodifiableFields::finalize( } XRPL_ASSERT( !bad || enforce, - "ripple::NoModifiedUnmodifiableFields::finalize : no bad " + "xrpl::NoModifiedUnmodifiableFields::finalize : no bad " "changes or enforce invariant"); if (bad) { @@ -2657,7 +2656,7 @@ ValidVault::visitEntry( // `isDelete` indicates whether an object is being deleted or modified. XRPL_ASSERT( after != nullptr && (before != nullptr || !isDelete), - "ripple::ValidVault::visitEntry : some object is available"); + "xrpl::ValidVault::visitEntry : some object is available"); // Number balanceDelta will capture the difference (delta) between "before" // state (zero if created) and "after" state (zero if destroyed), so the @@ -2755,7 +2754,7 @@ ValidVault::finalize( "Invariant failed: vault operation succeeded without modifying " "a vault"; XRPL_ASSERT( - enforce, "ripple::ValidVault::finalize : vault noop invariant"); + enforce, "xrpl::ValidVault::finalize : vault noop invariant"); return !enforce; } @@ -2768,7 +2767,7 @@ ValidVault::finalize( "Invariant failed: vault updated by a wrong transaction type"; XRPL_ASSERT( enforce, - "ripple::ValidVault::finalize : illegal vault transaction " + "xrpl::ValidVault::finalize : illegal vault transaction " "invariant"); return !enforce; // Also not a vault operation } @@ -2778,7 +2777,7 @@ ValidVault::finalize( JLOG(j.fatal()) << // "Invariant failed: vault operation updated more than single vault"; XRPL_ASSERT( - enforce, "ripple::ValidVault::finalize : single vault invariant"); + enforce, "xrpl::ValidVault::finalize : single vault invariant"); return !enforce; // That's all we can do here } @@ -2794,7 +2793,7 @@ ValidVault::finalize( "Invariant failed: vault deleted by a wrong transaction type"; XRPL_ASSERT( enforce, - "ripple::ValidVault::finalize : illegal vault deletion " + "xrpl::ValidVault::finalize : illegal vault deletion " "invariant"); return !enforce; // That's all we can do here } @@ -2821,7 +2820,7 @@ ValidVault::finalize( "delete shares"; XRPL_ASSERT( enforce, - "ripple::ValidVault::finalize : shares deletion invariant"); + "xrpl::ValidVault::finalize : shares deletion invariant"); return !enforce; // That's all we can do here } @@ -2852,7 +2851,7 @@ ValidVault::finalize( JLOG(j.fatal()) << "Invariant failed: vault deletion succeeded without " "deleting a vault"; XRPL_ASSERT( - enforce, "ripple::ValidVault::finalize : vault deletion invariant"); + enforce, "xrpl::ValidVault::finalize : vault deletion invariant"); return !enforce; // That's all we can do here } @@ -2860,7 +2859,7 @@ ValidVault::finalize( auto const& afterVault = afterVault_[0]; XRPL_ASSERT( beforeVault_.empty() || beforeVault_[0].key == afterVault.key, - "ripple::ValidVault::finalize : single vault operation"); + "xrpl::ValidVault::finalize : single vault operation"); auto const updatedShares = [&]() -> std::optional { // At this moment we only know that a vault is being updated and there @@ -2901,8 +2900,7 @@ ValidVault::finalize( { JLOG(j.fatal()) << "Invariant failed: updated vault must have shares"; XRPL_ASSERT( - enforce, - "ripple::ValidVault::finalize : vault has shares invariant"); + enforce, "xrpl::ValidVault::finalize : vault has shares invariant"); return !enforce; // That's all we can do here } @@ -2972,7 +2970,7 @@ ValidVault::finalize( JLOG(j.fatal()) << // "Invariant failed: vault created by a wrong transaction type"; XRPL_ASSERT( - enforce, "ripple::ValidVault::finalize : vault creation invariant"); + enforce, "xrpl::ValidVault::finalize : vault creation invariant"); return !enforce; // That's all we can do here } @@ -3007,7 +3005,7 @@ ValidVault::finalize( JLOG(j.fatal()) << "Invariant failed: vault operation succeeded " "without updating shares"; XRPL_ASSERT( - enforce, "ripple::ValidVault::finalize : shares noop invariant"); + enforce, "xrpl::ValidVault::finalize : shares noop invariant"); return !enforce; // That's all we can do here } @@ -3137,7 +3135,7 @@ ValidVault::finalize( XRPL_ASSERT( !beforeVault_.empty(), - "ripple::ValidVault::finalize : set updated a vault"); + "xrpl::ValidVault::finalize : set updated a vault"); auto const& beforeVault = beforeVault_[0]; auto const vaultDeltaAssets = deltaAssets(afterVault.pseudoId); @@ -3189,7 +3187,7 @@ ValidVault::finalize( XRPL_ASSERT( !beforeVault_.empty(), - "ripple::ValidVault::finalize : deposit updated a vault"); + "xrpl::ValidVault::finalize : deposit updated a vault"); auto const& beforeVault = beforeVault_[0]; auto const vaultDeltaAssets = deltaAssets(afterVault.pseudoId); @@ -3316,7 +3314,7 @@ ValidVault::finalize( XRPL_ASSERT( !beforeVault_.empty(), - "ripple::ValidVault::finalize : withdrawal updated a " + "xrpl::ValidVault::finalize : withdrawal updated a " "vault"); auto const& beforeVault = beforeVault_[0]; @@ -3444,7 +3442,7 @@ ValidVault::finalize( XRPL_ASSERT( !beforeVault_.empty(), - "ripple::ValidVault::finalize : clawback updated a vault"); + "xrpl::ValidVault::finalize : clawback updated a vault"); auto const& beforeVault = beforeVault_[0]; if (vaultAsset.native() || @@ -3536,7 +3534,7 @@ ValidVault::finalize( default: // LCOV_EXCL_START UNREACHABLE( - "ripple::ValidVault::finalize : unknown transaction type"); + "xrpl::ValidVault::finalize : unknown transaction type"); return false; // LCOV_EXCL_STOP } @@ -3546,11 +3544,11 @@ ValidVault::finalize( { // The comment at the top of this file starting with "assert(enforce)" // explains this assert. - XRPL_ASSERT(enforce, "ripple::ValidVault::finalize : vault invariants"); + XRPL_ASSERT(enforce, "xrpl::ValidVault::finalize : vault invariants"); return !enforce; } return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/InvariantCheck.h b/src/xrpld/app/tx/detail/InvariantCheck.h index 09a84b1ab4..b7f91a1c46 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.h +++ b/src/xrpld/app/tx/detail/InvariantCheck.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { class ReadView; @@ -935,7 +935,7 @@ using InvariantChecks = std::tuple< * @return std::tuple of instances that implement the required invariant check * methods * - * @see ripple::InvariantChecker_PROTOTYPE + * @see xrpl::InvariantChecker_PROTOTYPE */ inline InvariantChecks getInvariantChecks() @@ -943,6 +943,6 @@ getInvariantChecks() return InvariantChecks{}; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LedgerStateFix.cpp b/src/xrpld/app/tx/detail/LedgerStateFix.cpp index ba750152e7..43001e2fbf 100644 --- a/src/xrpld/app/tx/detail/LedgerStateFix.cpp +++ b/src/xrpld/app/tx/detail/LedgerStateFix.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC LedgerStateFix::preflight(PreflightContext const& ctx) @@ -67,4 +67,4 @@ LedgerStateFix::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LedgerStateFix.h b/src/xrpld/app/tx/detail/LedgerStateFix.h index 92f6a22303..e1a7f85ecc 100644 --- a/src/xrpld/app/tx/detail/LedgerStateFix.h +++ b/src/xrpld/app/tx/detail/LedgerStateFix.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LedgerStateFix : public Transactor { @@ -31,6 +31,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.cpp b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.cpp index 26e978697c..32c8fecf20 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.cpp @@ -2,7 +2,7 @@ // #include -namespace ripple { +namespace xrpl { bool LoanBrokerCoverClawback::checkExtraFeatures(PreflightContext const& ctx) @@ -337,4 +337,4 @@ LoanBrokerCoverClawback::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h index 183d3c4479..3c4f997d95 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverClawback.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanBrokerCoverClawback : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.cpp b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.cpp index 4e9e0e9c05..c894df2c2b 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.cpp @@ -2,7 +2,7 @@ // #include -namespace ripple { +namespace xrpl { bool LoanBrokerCoverDeposit::checkExtraFeatures(PreflightContext const& ctx) @@ -120,4 +120,4 @@ LoanBrokerCoverDeposit::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h index 23863b479c..d2f17b1f1c 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanBrokerCoverDeposit : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp index 1fd5a1a471..4c0b3e9af5 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { bool LoanBrokerCoverWithdraw::checkExtraFeatures(PreflightContext const& ctx) @@ -170,4 +170,4 @@ LoanBrokerCoverWithdraw::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h index eab2c9e60f..e0a9a2e51b 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanBrokerCoverWithdraw : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerDelete.cpp b/src/xrpld/app/tx/detail/LoanBrokerDelete.cpp index f3dd781bb5..76773037fa 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerDelete.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerDelete.cpp @@ -2,7 +2,7 @@ // #include -namespace ripple { +namespace xrpl { bool LoanBrokerDelete::checkExtraFeatures(PreflightContext const& ctx) @@ -194,4 +194,4 @@ LoanBrokerDelete::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanBrokerDelete.h b/src/xrpld/app/tx/detail/LoanBrokerDelete.h index 8466fe4f95..aaea2af81a 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerDelete.h +++ b/src/xrpld/app/tx/detail/LoanBrokerDelete.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanBrokerDelete : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanBrokerSet.cpp b/src/xrpld/app/tx/detail/LoanBrokerSet.cpp index c2e6effd7a..7b12a6cf39 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerSet.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerSet.cpp @@ -2,7 +2,7 @@ // #include -namespace ripple { +namespace xrpl { bool LoanBrokerSet::checkExtraFeatures(PreflightContext const& ctx) @@ -212,4 +212,4 @@ LoanBrokerSet::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanBrokerSet.h b/src/xrpld/app/tx/detail/LoanBrokerSet.h index 39ed9bcd61..625c0adeb2 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerSet.h +++ b/src/xrpld/app/tx/detail/LoanBrokerSet.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanBrokerSet : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanDelete.cpp b/src/xrpld/app/tx/detail/LoanDelete.cpp index 87ff4d594b..659f0bba8b 100644 --- a/src/xrpld/app/tx/detail/LoanDelete.cpp +++ b/src/xrpld/app/tx/detail/LoanDelete.cpp @@ -2,7 +2,7 @@ // #include -namespace ripple { +namespace xrpl { bool LoanDelete::checkExtraFeatures(PreflightContext const& ctx) @@ -117,7 +117,7 @@ LoanDelete::doApply() debtTotalProxy, getVaultScale(vaultSle), Number::towards_zero) == beast::zero, - "ripple::LoanDelete::doApply", + "xrpl::LoanDelete::doApply", "last loan, remaining debt rounds to zero"); debtTotalProxy = 0; } @@ -130,4 +130,4 @@ LoanDelete::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanDelete.h b/src/xrpld/app/tx/detail/LoanDelete.h index cbc37dec14..a1ebad340c 100644 --- a/src/xrpld/app/tx/detail/LoanDelete.h +++ b/src/xrpld/app/tx/detail/LoanDelete.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanDelete : public Transactor { @@ -29,6 +29,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanManage.cpp b/src/xrpld/app/tx/detail/LoanManage.cpp index adf08d71bf..2d405f204b 100644 --- a/src/xrpld/app/tx/detail/LoanManage.cpp +++ b/src/xrpld/app/tx/detail/LoanManage.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { bool LoanManage::checkExtraFeatures(PreflightContext const& ctx) @@ -417,4 +417,4 @@ LoanManage::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanManage.h b/src/xrpld/app/tx/detail/LoanManage.h index dde1023cad..7a02c7a16f 100644 --- a/src/xrpld/app/tx/detail/LoanManage.h +++ b/src/xrpld/app/tx/detail/LoanManage.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanManage : public Transactor { @@ -61,6 +61,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanPay.cpp b/src/xrpld/app/tx/detail/LoanPay.cpp index 43f19743a7..d34a766d70 100644 --- a/src/xrpld/app/tx/detail/LoanPay.cpp +++ b/src/xrpld/app/tx/detail/LoanPay.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { bool LoanPay::checkExtraFeatures(PreflightContext const& ctx) @@ -326,7 +326,7 @@ LoanPay::doApply() { XRPL_ASSERT_PARTS( paymentParts.error(), - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "payment error is an error"); return paymentParts.error(); } @@ -338,22 +338,20 @@ LoanPay::doApply() XRPL_ASSERT_PARTS( // It is possible to pay 0 principal paymentParts->principalPaid >= 0, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "valid principal paid"); XRPL_ASSERT_PARTS( // It is possible to pay 0 interest paymentParts->interestPaid >= 0, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "valid interest paid"); XRPL_ASSERT_PARTS( // It should not be possible to pay 0 total paymentParts->principalPaid + paymentParts->interestPaid > 0, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "valid total paid"); XRPL_ASSERT_PARTS( - paymentParts->feePaid >= 0, - "ripple::LoanPay::doApply", - "valid fee paid"); + paymentParts->feePaid >= 0, "xrpl::LoanPay::doApply", "valid fee paid"); if (paymentParts->principalPaid < 0 || paymentParts->interestPaid < 0 || paymentParts->feePaid < 0) @@ -387,7 +385,7 @@ LoanPay::doApply() roundToAsset(asset, totalPaidToVaultRaw, vaultScale, Number::downward); XRPL_ASSERT_PARTS( !asset.integral() || totalPaidToVaultRaw == totalPaidToVaultRounded, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "rounding does nothing for integral asset"); // Account for value changes when reducing the broker's debt: // - Positive value change (from full/late/overpayments): Subtract from the @@ -403,7 +401,7 @@ LoanPay::doApply() (totalPaidToVaultRaw + totalPaidToBroker) == (paymentParts->principalPaid + paymentParts->interestPaid + paymentParts->feePaid), - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "payments add up"); // Decrease LoanBroker Debt by the amount paid, add the Loan value change @@ -411,7 +409,7 @@ LoanPay::doApply() // increasing the debt XRPL_ASSERT_PARTS( isRounded(asset, totalPaidToVaultForDebt, loanScale), - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "totalPaidToVaultForDebt rounding good"); // Despite our best efforts, it's possible for rounding errors to accumulate // in the loan broker's debt total. This is because the broker may have more @@ -435,7 +433,7 @@ LoanPay::doApply() { XRPL_ASSERT_PARTS( assetsAvailableBefore == pseudoAccountBalanceBefore, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "vault pseudo balance agrees before"); assetsAvailableProxy += totalPaidToVaultRounded; @@ -443,7 +441,7 @@ LoanPay::doApply() XRPL_ASSERT_PARTS( *assetsAvailableProxy <= *assetsTotalProxy, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "assets available must not be greater than assets outstanding"); if (*assetsAvailableProxy > *assetsTotalProxy) @@ -463,7 +461,7 @@ LoanPay::doApply() // Move funds XRPL_ASSERT_PARTS( totalPaidToVaultRounded + totalPaidToBroker <= amount, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "amount is sufficient"); if (!sendBrokerFeeToOwner) @@ -541,7 +539,7 @@ LoanPay::doApply() j_); XRPL_ASSERT_PARTS( assetsAvailableAfter == pseudoAccountBalanceAfter, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "vault pseudo balance agrees after"); #if !NDEBUG @@ -564,33 +562,33 @@ LoanPay::doApply() XRPL_ASSERT_PARTS( accountBalanceBefore + vaultBalanceBefore + brokerBalanceBefore == accountBalanceAfter + vaultBalanceAfter + brokerBalanceAfter, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "funds are conserved (with rounding)"); XRPL_ASSERT_PARTS( accountBalanceAfter >= beast::zero, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "positive account balance"); XRPL_ASSERT_PARTS( accountBalanceAfter < accountBalanceBefore || account_ == asset.getIssuer(), - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "account balance decreased"); XRPL_ASSERT_PARTS( vaultBalanceAfter >= beast::zero && brokerBalanceAfter >= beast::zero, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "positive vault and broker balances"); XRPL_ASSERT_PARTS( vaultBalanceAfter >= vaultBalanceBefore, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "vault balance did not decrease"); XRPL_ASSERT_PARTS( brokerBalanceAfter >= brokerBalanceBefore, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "broker balance did not decrease"); XRPL_ASSERT_PARTS( vaultBalanceAfter > vaultBalanceBefore || brokerBalanceAfter > brokerBalanceBefore, - "ripple::LoanPay::doApply", + "xrpl::LoanPay::doApply", "vault and/or broker balance increased"); #endif @@ -599,4 +597,4 @@ LoanPay::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanPay.h b/src/xrpld/app/tx/detail/LoanPay.h index 3f8eb16d04..f951fdad5f 100644 --- a/src/xrpld/app/tx/detail/LoanPay.h +++ b/src/xrpld/app/tx/detail/LoanPay.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class LoanPay : public Transactor { @@ -35,6 +35,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/LoanSet.cpp b/src/xrpld/app/tx/detail/LoanSet.cpp index 756ea53fc1..e8fe76a48f 100644 --- a/src/xrpld/app/tx/detail/LoanSet.cpp +++ b/src/xrpld/app/tx/detail/LoanSet.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { bool LoanSet::checkExtraFeatures(PreflightContext const& ctx) @@ -50,8 +50,8 @@ LoanSet::preflight(PreflightContext const& ctx) if (counterPartySig) { - if (auto const ret = ripple::detail::preflightCheckSigningKey( - *counterPartySig, ctx.j)) + if (auto const ret = + xrpl::detail::preflightCheckSigningKey(*counterPartySig, ctx.j)) return ret; } @@ -97,7 +97,7 @@ LoanSet::preflight(PreflightContext const& ctx) // Copied from preflight2 if (counterPartySig) { - if (auto const ret = ripple::detail::preflightCheckSimulateKeys( + if (auto const ret = xrpl::detail::preflightCheckSimulateKeys( ctx.flags, *counterPartySig, ctx.j)) return *ret; } @@ -496,7 +496,7 @@ LoanSet::doApply() XRPL_ASSERT_PARTS( borrower == account_ || borrower == counterparty, - "ripple::LoanSet::doApply", + "xrpl::LoanSet::doApply", "borrower signed transaction"); if (auto const ter = addEmptyHolding( view, @@ -521,7 +521,7 @@ LoanSet::doApply() // The owner may have deleted their MPT / line at some point. XRPL_ASSERT_PARTS( brokerOwner == account_ || brokerOwner == counterparty, - "ripple::LoanSet::doApply", + "xrpl::LoanSet::doApply", "broker owner signed transaction"); if (auto const ter = addEmptyHolding( @@ -600,7 +600,7 @@ LoanSet::doApply() vaultTotalProxy += state.interestDue; XRPL_ASSERT_PARTS( *vaultAvailableProxy <= *vaultTotalProxy, - "ripple::LoanSet::doApply", + "xrpl::LoanSet::doApply", "assets available must not be greater than assets outstanding"); view.update(vaultSle); @@ -629,4 +629,4 @@ LoanSet::doApply() //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/LoanSet.h b/src/xrpld/app/tx/detail/LoanSet.h index 91f3960891..d3853fbbdd 100644 --- a/src/xrpld/app/tx/detail/LoanSet.h +++ b/src/xrpld/app/tx/detail/LoanSet.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { class LoanSet : public Transactor { @@ -54,6 +54,6 @@ public: //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/MPTokenAuthorize.cpp b/src/xrpld/app/tx/detail/MPTokenAuthorize.cpp index b6eaacb372..a563849a0b 100644 --- a/src/xrpld/app/tx/detail/MPTokenAuthorize.cpp +++ b/src/xrpld/app/tx/detail/MPTokenAuthorize.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { std::uint32_t MPTokenAuthorize::getFlagsMask(PreflightContext const& ctx) @@ -174,4 +174,4 @@ MPTokenAuthorize::doApply() tx[~sfHolder]); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/MPTokenAuthorize.h b/src/xrpld/app/tx/detail/MPTokenAuthorize.h index 0bac2f1843..6c0ade324c 100644 --- a/src/xrpld/app/tx/detail/MPTokenAuthorize.h +++ b/src/xrpld/app/tx/detail/MPTokenAuthorize.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { struct MPTAuthorizeArgs { @@ -43,6 +43,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.cpp b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.cpp index 05b1720d3d..913c7cf53c 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.cpp +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { bool MPTokenIssuanceCreate::checkExtraFeatures(PreflightContext const& ctx) @@ -161,4 +161,4 @@ MPTokenIssuanceCreate::doApply() return result ? tesSUCCESS : result.error(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h index bff41c9180..5b5268265c 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { struct MPTCreateArgs { @@ -47,6 +47,6 @@ public: create(ApplyView& view, beast::Journal journal, MPTCreateArgs const& args); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.cpp b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.cpp index 5b20a5a4b3..58b3cbea4f 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.cpp +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { std::uint32_t MPTokenIssuanceDestroy::getFlagsMask(PreflightContext const& ctx) @@ -60,4 +60,4 @@ MPTokenIssuanceDestroy::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h index a764ecc652..5f59c9b1bd 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceDestroy.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class MPTokenIssuanceDestroy : public Transactor { @@ -27,6 +27,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.cpp b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.cpp index d46a7a2add..578e5f6564 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.cpp +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { bool MPTokenIssuanceSet::checkExtraFeatures(PreflightContext const& ctx) @@ -337,4 +337,4 @@ MPTokenIssuanceSet::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h index bc5d390f97..a687a37b47 100644 --- a/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h +++ b/src/xrpld/app/tx/detail/MPTokenIssuanceSet.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class MPTokenIssuanceSet : public Transactor { @@ -33,6 +33,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp index 2af0abfdac..f3205f6df3 100644 --- a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp +++ b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { std::uint32_t NFTokenAcceptOffer::getFlagsMask(PreflightContext const& ctx) @@ -551,4 +551,4 @@ NFTokenAcceptOffer::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h index 4bc429fcfc..83cd71b734 100644 --- a/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenAcceptOffer.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenAcceptOffer : public Transactor { @@ -45,6 +45,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenBurn.cpp b/src/xrpld/app/tx/detail/NFTokenBurn.cpp index 1e1d19679b..755e9e52c5 100644 --- a/src/xrpld/app/tx/detail/NFTokenBurn.cpp +++ b/src/xrpld/app/tx/detail/NFTokenBurn.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC NFTokenBurn::preflight(PreflightContext const& ctx) @@ -90,4 +90,4 @@ NFTokenBurn::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenBurn.h b/src/xrpld/app/tx/detail/NFTokenBurn.h index 5a3e530c8c..5425f0902d 100644 --- a/src/xrpld/app/tx/detail/NFTokenBurn.h +++ b/src/xrpld/app/tx/detail/NFTokenBurn.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenBurn : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenCancelOffer.cpp b/src/xrpld/app/tx/detail/NFTokenCancelOffer.cpp index 45b93b64d6..94512b5e66 100644 --- a/src/xrpld/app/tx/detail/NFTokenCancelOffer.cpp +++ b/src/xrpld/app/tx/detail/NFTokenCancelOffer.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { std::uint32_t NFTokenCancelOffer::getFlagsMask(PreflightContext const& ctx) @@ -93,4 +93,4 @@ NFTokenCancelOffer::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenCancelOffer.h b/src/xrpld/app/tx/detail/NFTokenCancelOffer.h index 98444e21d8..13a6ecc065 100644 --- a/src/xrpld/app/tx/detail/NFTokenCancelOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenCancelOffer.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenCancelOffer : public Transactor { @@ -27,6 +27,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenCreateOffer.cpp b/src/xrpld/app/tx/detail/NFTokenCreateOffer.cpp index 3b8758f25d..00e69ccc9f 100644 --- a/src/xrpld/app/tx/detail/NFTokenCreateOffer.cpp +++ b/src/xrpld/app/tx/detail/NFTokenCreateOffer.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { std::uint32_t NFTokenCreateOffer::getFlagsMask(PreflightContext const& ctx) @@ -82,4 +82,4 @@ NFTokenCreateOffer::doApply() ctx_.tx.getFlags()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenCreateOffer.h b/src/xrpld/app/tx/detail/NFTokenCreateOffer.h index 4dd1ff93f1..704b253924 100644 --- a/src/xrpld/app/tx/detail/NFTokenCreateOffer.h +++ b/src/xrpld/app/tx/detail/NFTokenCreateOffer.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenCreateOffer : public Transactor { @@ -27,6 +27,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenMint.cpp b/src/xrpld/app/tx/detail/NFTokenMint.cpp index 9a8d828215..fbba92b264 100644 --- a/src/xrpld/app/tx/detail/NFTokenMint.cpp +++ b/src/xrpld/app/tx/detail/NFTokenMint.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { static std::uint16_t extractNFTokenFlagsFromTxFlags(std::uint32_t txFlags) @@ -154,7 +154,7 @@ NFTokenMint::createNFTokenID( ptr += sizeof(tokenSeq); XRPL_ASSERT( std::distance(buf.data(), ptr) == buf.size(), - "ripple::NFTokenMint::createNFTokenID : data size matches the buffer"); + "xrpl::NFTokenMint::createNFTokenID : data size matches the buffer"); return uint256::fromVoid(buf.data()); } @@ -325,4 +325,4 @@ NFTokenMint::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenMint.h b/src/xrpld/app/tx/detail/NFTokenMint.h index a4b8fb6fa3..a3b43b8269 100644 --- a/src/xrpld/app/tx/detail/NFTokenMint.h +++ b/src/xrpld/app/tx/detail/NFTokenMint.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenMint : public Transactor { @@ -42,6 +42,6 @@ public: std::uint32_t tokenSeq); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenModify.cpp b/src/xrpld/app/tx/detail/NFTokenModify.cpp index 392d837c46..8ecf8de676 100644 --- a/src/xrpld/app/tx/detail/NFTokenModify.cpp +++ b/src/xrpld/app/tx/detail/NFTokenModify.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC NFTokenModify::preflight(PreflightContext const& ctx) @@ -59,4 +59,4 @@ NFTokenModify::doApply() return nft::changeTokenURI(view(), owner, nftokenID, ctx_.tx[~sfURI]); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenModify.h b/src/xrpld/app/tx/detail/NFTokenModify.h index 0058b3a8ed..4353c3d58b 100644 --- a/src/xrpld/app/tx/detail/NFTokenModify.h +++ b/src/xrpld/app/tx/detail/NFTokenModify.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class NFTokenModify : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/NFTokenUtils.cpp b/src/xrpld/app/tx/detail/NFTokenUtils.cpp index db2b00cb2c..c737855840 100644 --- a/src/xrpld/app/tx/detail/NFTokenUtils.cpp +++ b/src/xrpld/app/tx/detail/NFTokenUtils.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace nft { @@ -167,7 +167,7 @@ getPageForToken( auto np = std::make_shared(keylet::nftpage(base, tokenIDForNewPage)); XRPL_ASSERT( np->key() > base.key, - "ripple::nft::getPageForToken : valid NFT page index"); + "xrpl::nft::getPageForToken : valid NFT page index"); np->setFieldArray(sfNFTokens, narr); np->setFieldH256(sfNextPageMin, cp->key()); @@ -213,7 +213,7 @@ changeTokenURI( ApplyView& view, AccountID const& owner, uint256 const& nftokenID, - std::optional const& uri) + std::optional const& uri) { std::shared_ptr const page = locatePage(view, owner, nftokenID); @@ -247,7 +247,7 @@ insertToken(ApplyView& view, AccountID owner, STObject&& nft) { XRPL_ASSERT( nft.isFieldPresent(sfNFTokenID), - "ripple::nft::insertToken : has NFT token"); + "xrpl::nft::insertToken : has NFT token"); // First, we need to locate the page the NFT belongs to, creating it // if necessary. This operation may fail if it is impossible to insert @@ -789,7 +789,7 @@ repairNFTokenDirectoryLinks(ApplyView& view, AccountID const& owner) XRPL_ASSERT( nextPage, - "ripple::nft::repairNFTokenDirectoryLinks : next page is available"); + "xrpl::nft::repairNFTokenDirectoryLinks : next page is available"); if (nextPage->isFieldPresent(sfNextPageMin)) { didRepair = true; @@ -887,7 +887,7 @@ tokenOfferCreatePreclaim( { auto const root = view.read(keylet::account(nftIssuer)); XRPL_ASSERT( - root, "ripple::nft::tokenOfferCreatePreclaim : non-null account"); + root, "xrpl::nft::tokenOfferCreatePreclaim : non-null account"); if (auto minter = (*root)[~sfNFTokenMinter]; minter != acctID) return tefNFTOKEN_IS_NOT_TRANSFERABLE; @@ -1035,14 +1035,14 @@ checkTrustlineAuthorized( // Only valid for custom currencies XRPL_ASSERT( !isXRP(issue.currency), - "ripple::nft::checkTrustlineAuthorized : valid to check."); + "xrpl::nft::checkTrustlineAuthorized : valid to check."); if (view.rules().enabled(fixEnforceNFTokenTrustlineV2)) { auto const issuerAccount = view.read(keylet::account(issue.account)); if (!issuerAccount) { - JLOG(j.debug()) << "ripple::nft::checkTrustlineAuthorized: can't " + JLOG(j.debug()) << "xrpl::nft::checkTrustlineAuthorized: can't " "receive IOUs from non-existent issuer: " << to_string(issue.account); @@ -1091,14 +1091,14 @@ checkTrustlineDeepFrozen( // Only valid for custom currencies XRPL_ASSERT( !isXRP(issue.currency), - "ripple::nft::checkTrustlineDeepFrozen : valid to check."); + "xrpl::nft::checkTrustlineDeepFrozen : valid to check."); if (view.rules().enabled(featureDeepFreeze)) { auto const issuerAccount = view.read(keylet::account(issue.account)); if (!issuerAccount) { - JLOG(j.debug()) << "ripple::nft::checkTrustlineDeepFrozen: can't " + JLOG(j.debug()) << "xrpl::nft::checkTrustlineDeepFrozen: can't " "receive IOUs from non-existent issuer: " << to_string(issue.account); @@ -1136,4 +1136,4 @@ checkTrustlineDeepFrozen( } } // namespace nft -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/NFTokenUtils.h b/src/xrpld/app/tx/detail/NFTokenUtils.h index 0294724b51..640f12f9d2 100644 --- a/src/xrpld/app/tx/detail/NFTokenUtils.h +++ b/src/xrpld/app/tx/detail/NFTokenUtils.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace nft { @@ -91,7 +91,7 @@ changeTokenURI( ApplyView& view, AccountID const& owner, uint256 const& nftokenID, - std::optional const& uri); + std::optional const& uri); /** Preflight checks shared by NFTokenCreateOffer and NFTokenMint */ NotTEC @@ -149,6 +149,6 @@ checkTrustlineDeepFrozen( } // namespace nft -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/Offer.h b/src/xrpld/app/tx/detail/Offer.h index 64bc3f4cbf..b04049b657 100644 --- a/src/xrpld/app/tx/detail/Offer.h +++ b/src/xrpld/app/tx/detail/Offer.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { template class TOfferBase @@ -208,7 +208,7 @@ TOffer::setFieldAmounts() { // LCOV_EXCL_START #ifdef _MSC_VER - UNREACHABLE("ripple::TOffer::setFieldAmounts : must be specialized"); + UNREACHABLE("xrpl::TOffer::setFieldAmounts : must be specialized"); #else static_assert(sizeof(TOut) == -1, "Must be specialized"); #endif @@ -319,6 +319,6 @@ operator<<(std::ostream& os, TOffer const& offer) return os << offer.id(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/OfferStream.cpp b/src/xrpld/app/tx/detail/OfferStream.cpp index 93a26f71da..49e45976eb 100644 --- a/src/xrpld/app/tx/detail/OfferStream.cpp +++ b/src/xrpld/app/tx/detail/OfferStream.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace { bool @@ -37,7 +37,7 @@ TOfferStreamBase::TOfferStreamBase( , counter_(counter) { XRPL_ASSERT( - validBook_, "ripple::TOfferStreamBase::TOfferStreamBase : valid book"); + validBook_, "xrpl::TOfferStreamBase::TOfferStreamBase : valid book"); } // Handle the case where a directory item with no corresponding ledger entry @@ -403,4 +403,4 @@ template class TOfferStreamBase; template class TOfferStreamBase; template class TOfferStreamBase; template class TOfferStreamBase; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/OfferStream.h b/src/xrpld/app/tx/detail/OfferStream.h index 3969cfb48f..cab5f1384d 100644 --- a/src/xrpld/app/tx/detail/OfferStream.h +++ b/src/xrpld/app/tx/detail/OfferStream.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { template class TOfferStreamBase @@ -174,6 +174,6 @@ public: return permToRemove_; } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/PayChan.cpp b/src/xrpld/app/tx/detail/PayChan.cpp index 40e760e5f5..163ea802a8 100644 --- a/src/xrpld/app/tx/detail/PayChan.cpp +++ b/src/xrpld/app/tx/detail/PayChan.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { /* PaymentChannel @@ -136,7 +136,7 @@ closeChannel( XRPL_ASSERT( (*slep)[sfAmount] >= (*slep)[sfBalance], - "ripple::closeChannel : minimum channel amount"); + "xrpl::closeChannel : minimum channel amount"); (*sle)[sfBalance] = (*sle)[sfBalance] + (*slep)[sfAmount] - (*slep)[sfBalance]; adjustOwnerCount(view, sle, -1, j); @@ -527,7 +527,7 @@ PayChanClaim::doApply() XRPAmount const reqDelta = reqBalance - chanBalance; XRPL_ASSERT( reqDelta >= beast::zero, - "ripple::PayChanClaim::doApply : minimum balance delta"); + "xrpl::PayChanClaim::doApply : minimum balance delta"); (*sled)[sfBalance] = (*sled)[sfBalance] + reqDelta; ctx_.view().update(sled); ctx_.view().update(slep); @@ -562,4 +562,4 @@ PayChanClaim::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/PayChan.h b/src/xrpld/app/tx/detail/PayChan.h index a68cae49f4..f42e9549b3 100644 --- a/src/xrpld/app/tx/detail/PayChan.h +++ b/src/xrpld/app/tx/detail/PayChan.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class PayChanCreate : public Transactor { @@ -81,6 +81,6 @@ public: using PaymentChannelClaim = PayChanClaim; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/Payment.cpp b/src/xrpld/app/tx/detail/Payment.cpp index 56aeb1b0aa..7a14cecc2d 100644 --- a/src/xrpld/app/tx/detail/Payment.cpp +++ b/src/xrpld/app/tx/detail/Payment.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { TxConsequences Payment::makeTxConsequences(PreflightContext const& ctx) @@ -569,7 +569,7 @@ Payment::doApply() return res; } - XRPL_ASSERT(dstAmount.native(), "ripple::Payment::doApply : amount is XRP"); + XRPL_ASSERT(dstAmount.native(), "xrpl::Payment::doApply : amount is XRP"); // Direct XRP payment. @@ -659,4 +659,4 @@ Payment::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Payment.h b/src/xrpld/app/tx/detail/Payment.h index f41326ecf6..30c9a9e326 100644 --- a/src/xrpld/app/tx/detail/Payment.h +++ b/src/xrpld/app/tx/detail/Payment.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Payment : public Transactor { @@ -42,6 +42,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/PermissionedDomainDelete.cpp b/src/xrpld/app/tx/detail/PermissionedDomainDelete.cpp index 08bf778065..6301d6f892 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainDelete.cpp +++ b/src/xrpld/app/tx/detail/PermissionedDomainDelete.cpp @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC PermissionedDomainDelete::preflight(PreflightContext const& ctx) @@ -26,7 +26,7 @@ PermissionedDomainDelete::preclaim(PreclaimContext const& ctx) XRPL_ASSERT( sleDomain->isFieldPresent(sfOwner) && ctx.tx.isFieldPresent(sfAccount), - "ripple::PermissionedDomainDelete::preclaim : required fields present"); + "xrpl::PermissionedDomainDelete::preclaim : required fields present"); if (sleDomain->getAccountID(sfOwner) != ctx.tx.getAccountID(sfAccount)) return tecNO_PERMISSION; @@ -39,7 +39,7 @@ PermissionedDomainDelete::doApply() { XRPL_ASSERT( ctx_.tx.isFieldPresent(sfDomainID), - "ripple::PermissionedDomainDelete::doApply : required field present"); + "xrpl::PermissionedDomainDelete::doApply : required field present"); auto const slePd = view().peek({ltPERMISSIONED_DOMAIN, ctx_.tx.at(sfDomainID)}); @@ -57,11 +57,11 @@ PermissionedDomainDelete::doApply() auto const ownerSle = view().peek(keylet::account(account_)); XRPL_ASSERT( ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0, - "ripple::PermissionedDomainDelete::doApply : nonzero owner count"); + "xrpl::PermissionedDomainDelete::doApply : nonzero owner count"); adjustOwnerCount(view(), ownerSle, -1, ctx_.journal); view().erase(slePd); return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/PermissionedDomainDelete.h b/src/xrpld/app/tx/detail/PermissionedDomainDelete.h index 7ea0681279..3ae10a739f 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainDelete.h +++ b/src/xrpld/app/tx/detail/PermissionedDomainDelete.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class PermissionedDomainDelete : public Transactor { @@ -25,6 +25,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/PermissionedDomainSet.cpp b/src/xrpld/app/tx/detail/PermissionedDomainSet.cpp index d73d9f7322..3417f1fb0a 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainSet.cpp +++ b/src/xrpld/app/tx/detail/PermissionedDomainSet.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { bool PermissionedDomainSet::checkExtraFeatures(PreflightContext const& ctx) @@ -123,4 +123,4 @@ PermissionedDomainSet::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/PermissionedDomainSet.h b/src/xrpld/app/tx/detail/PermissionedDomainSet.h index 6df3448e10..fde06232a5 100644 --- a/src/xrpld/app/tx/detail/PermissionedDomainSet.h +++ b/src/xrpld/app/tx/detail/PermissionedDomainSet.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class PermissionedDomainSet : public Transactor { @@ -28,6 +28,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/SetAccount.cpp b/src/xrpld/app/tx/detail/SetAccount.cpp index e860eca22d..efdf63042c 100644 --- a/src/xrpld/app/tx/detail/SetAccount.cpp +++ b/src/xrpld/app/tx/detail/SetAccount.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { TxConsequences SetAccount::makeTxConsequences(PreflightContext const& ctx) @@ -640,4 +640,4 @@ SetAccount::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SetAccount.h b/src/xrpld/app/tx/detail/SetAccount.h index 4c310b7fd1..fb8b4a0ccd 100644 --- a/src/xrpld/app/tx/detail/SetAccount.h +++ b/src/xrpld/app/tx/detail/SetAccount.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class SetAccount : public Transactor { @@ -37,6 +37,6 @@ public: using AccountSet = SetAccount; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/SetOracle.cpp b/src/xrpld/app/tx/detail/SetOracle.cpp index 453d799b0d..10d40b7859 100644 --- a/src/xrpld/app/tx/detail/SetOracle.cpp +++ b/src/xrpld/app/tx/detail/SetOracle.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { static inline std::pair tokenPairKey(STObject const& pair) @@ -310,4 +310,4 @@ SetOracle::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SetOracle.h b/src/xrpld/app/tx/detail/SetOracle.h index 5b69d80214..c1c9a3d3fb 100644 --- a/src/xrpld/app/tx/detail/SetOracle.h +++ b/src/xrpld/app/tx/detail/SetOracle.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { /** Price Oracle is a system that acts as a bridge between @@ -35,6 +35,6 @@ public: using OracleSet = SetOracle; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_SETORACLE_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/SetRegularKey.cpp b/src/xrpld/app/tx/detail/SetRegularKey.cpp index 2e8f01b355..ff1dbdf769 100644 --- a/src/xrpld/app/tx/detail/SetRegularKey.cpp +++ b/src/xrpld/app/tx/detail/SetRegularKey.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { XRPAmount SetRegularKey::calculateBaseFee(ReadView const& view, STTx const& tx) @@ -70,4 +70,4 @@ SetRegularKey::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SetRegularKey.h b/src/xrpld/app/tx/detail/SetRegularKey.h index 97754af63c..735ac522fd 100644 --- a/src/xrpld/app/tx/detail/SetRegularKey.h +++ b/src/xrpld/app/tx/detail/SetRegularKey.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class SetRegularKey : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/SetSignerList.cpp b/src/xrpld/app/tx/detail/SetSignerList.cpp index 449e0ff90c..f65c17e303 100644 --- a/src/xrpld/app/tx/detail/SetSignerList.cpp +++ b/src/xrpld/app/tx/detail/SetSignerList.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { // We're prepared for there to be multiple signer lists in the future, // but we don't need them yet. So for the time being we're manually @@ -116,7 +116,7 @@ SetSignerList::doApply() break; } // LCOV_EXCL_START - UNREACHABLE("ripple::SetSignerList::doApply : invalid operation"); + UNREACHABLE("xrpl::SetSignerList::doApply : invalid operation"); return temMALFORMED; // LCOV_EXCL_STOP } @@ -128,10 +128,10 @@ SetSignerList::preCompute() auto result = determineOperation(ctx_.tx, view().flags(), j_); XRPL_ASSERT( std::get<0>(result) == tesSUCCESS, - "ripple::SetSignerList::preCompute : result is tesSUCCESS"); + "xrpl::SetSignerList::preCompute : result is tesSUCCESS"); XRPL_ASSERT( std::get<3>(result) != unknown, - "ripple::SetSignerList::preCompute : result is known operation"); + "xrpl::SetSignerList::preCompute : result is known operation"); quorum_ = std::get<1>(result); signers_ = std::get<2>(result); @@ -162,10 +162,10 @@ signerCountBasedOwnerCountDelta(std::size_t entryCount, Rules const& rules) // We've got a lot of room to grow. XRPL_ASSERT( entryCount >= STTx::minMultiSigners, - "ripple::signerCountBasedOwnerCountDelta : minimum signers"); + "xrpl::signerCountBasedOwnerCountDelta : minimum signers"); XRPL_ASSERT( entryCount <= STTx::maxMultiSigners, - "ripple::signerCountBasedOwnerCountDelta : maximum signers"); + "xrpl::signerCountBasedOwnerCountDelta : maximum signers"); return 2 + static_cast(entryCount); } @@ -257,7 +257,7 @@ SetSignerList::validateQuorumAndSignerEntries( // Make sure there are no duplicate signers. XRPL_ASSERT( std::is_sorted(signers.begin(), signers.end()), - "ripple::SetSignerList::validateQuorumAndSignerEntries : sorted " + "xrpl::SetSignerList::validateQuorumAndSignerEntries : sorted " "signers"); if (std::adjacent_find(signers.begin(), signers.end()) != signers.end()) { @@ -412,4 +412,4 @@ SetSignerList::writeSignersToSLE( ledgerEntry->setFieldArray(sfSignerEntries, toLedger); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SetSignerList.h b/src/xrpld/app/tx/detail/SetSignerList.h index 2ee9b4806a..f6f63d2b7d 100644 --- a/src/xrpld/app/tx/detail/SetSignerList.h +++ b/src/xrpld/app/tx/detail/SetSignerList.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { /** See the README.md for an overview of the SetSignerList transaction that @@ -79,6 +79,6 @@ private: using SignerListSet = SetSignerList; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/SetTrust.cpp b/src/xrpld/app/tx/detail/SetTrust.cpp index 4e8f20f3ae..77d7e6d9b5 100644 --- a/src/xrpld/app/tx/detail/SetTrust.cpp +++ b/src/xrpld/app/tx/detail/SetTrust.cpp @@ -24,21 +24,19 @@ computeFreezeFlags( { if (bSetFreeze && !bClearFreeze && !bNoFreeze) { - uFlags |= (bHigh ? ripple::lsfHighFreeze : ripple::lsfLowFreeze); + uFlags |= (bHigh ? xrpl::lsfHighFreeze : xrpl::lsfLowFreeze); } else if (bClearFreeze && !bSetFreeze) { - uFlags &= ~(bHigh ? ripple::lsfHighFreeze : ripple::lsfLowFreeze); + uFlags &= ~(bHigh ? xrpl::lsfHighFreeze : xrpl::lsfLowFreeze); } if (bSetDeepFreeze && !bClearDeepFreeze && !bNoFreeze) { - uFlags |= - (bHigh ? ripple::lsfHighDeepFreeze : ripple::lsfLowDeepFreeze); + uFlags |= (bHigh ? xrpl::lsfHighDeepFreeze : xrpl::lsfLowDeepFreeze); } else if (bClearDeepFreeze && !bSetDeepFreeze) { - uFlags &= - ~(bHigh ? ripple::lsfHighDeepFreeze : ripple::lsfLowDeepFreeze); + uFlags &= ~(bHigh ? xrpl::lsfHighDeepFreeze : xrpl::lsfLowDeepFreeze); } return uFlags; @@ -46,7 +44,7 @@ computeFreezeFlags( } // namespace -namespace ripple { +namespace xrpl { std::uint32_t SetTrust::getFlagsMask(PreflightContext const& ctx) @@ -689,4 +687,4 @@ SetTrust::doApply() return terResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SetTrust.h b/src/xrpld/app/tx/detail/SetTrust.h index 5ae3f2ea23..b5776c6d33 100644 --- a/src/xrpld/app/tx/detail/SetTrust.h +++ b/src/xrpld/app/tx/detail/SetTrust.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { class SetTrust : public Transactor { @@ -34,6 +34,6 @@ public: using TrustSet = SetTrust; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/SignerEntries.cpp b/src/xrpld/app/tx/detail/SignerEntries.cpp index f9bc939190..128cc984e4 100644 --- a/src/xrpld/app/tx/detail/SignerEntries.cpp +++ b/src/xrpld/app/tx/detail/SignerEntries.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { Expected, NotTEC> SignerEntries::deserialize( @@ -48,4 +48,4 @@ SignerEntries::deserialize( return accountVec; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/SignerEntries.h b/src/xrpld/app/tx/detail/SignerEntries.h index f7a7823069..0a66fd33f5 100644 --- a/src/xrpld/app/tx/detail/SignerEntries.h +++ b/src/xrpld/app/tx/detail/SignerEntries.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { // Forward declarations class STObject; @@ -69,6 +69,6 @@ public: std::string_view annotation); }; -} // namespace ripple +} // namespace xrpl #endif // XRPL_TX_IMPL_SIGNER_ENTRIES_H_INCLUDED diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 2ddef72c39..7b0cbbbdd4 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Performs early sanity checks on the txid */ NotTEC @@ -307,7 +307,7 @@ Transactor::calculateOwnerReserveFee(ReadView const& view, STTx const& tx) // condition. XRPL_ASSERT( view.fees().increment > view.fees().base * 100, - "ripple::Transactor::calculateOwnerReserveFee : Owner reserve is " + "xrpl::Transactor::calculateOwnerReserveFee : Owner reserve is " "reasonable"); return view.fees().increment; } @@ -527,7 +527,7 @@ TER Transactor::consumeSeqProxy(SLE::pointer const& sleAccount) { XRPL_ASSERT( - sleAccount, "ripple::Transactor::consumeSeqProxy : non-null account"); + sleAccount, "xrpl::Transactor::consumeSeqProxy : non-null account"); SeqProxy const seqProx = ctx_.tx.getSeqProxy(); if (seqProx.isSeq()) { @@ -609,7 +609,7 @@ Transactor::preCompute() { XRPL_ASSERT( account_ != beast::zero, - "ripple::Transactor::preCompute : nonzero account"); + "xrpl::Transactor::preCompute : nonzero account"); } TER @@ -625,7 +625,7 @@ Transactor::apply() // that allow zero account. XRPL_ASSERT( sle != nullptr || account_ == beast::zero, - "ripple::Transactor::apply : non-null SLE or zero account"); + "xrpl::Transactor::apply : non-null SLE or zero account"); if (sle) { @@ -699,7 +699,7 @@ Transactor::checkSign( // Check Single Sign XRPL_ASSERT( - !pkSigner.empty(), "ripple::Transactor::checkSign : non-empty signer"); + !pkSigner.empty(), "xrpl::Transactor::checkSign : non-empty signer"); if (!publicKeyType(makeSlice(pkSigner))) { @@ -829,10 +829,10 @@ Transactor::checkMultiSign( // presence and defaulted value of the SignerListID field will enable that. XRPL_ASSERT( sleAccountSigners->isFieldPresent(sfSignerListID), - "ripple::Transactor::checkMultiSign : has signer list ID"); + "xrpl::Transactor::checkMultiSign : has signer list ID"); XRPL_ASSERT( sleAccountSigners->getFieldU32(sfSignerListID) == 0, - "ripple::Transactor::checkMultiSign : signer list ID is 0"); + "xrpl::Transactor::checkMultiSign : signer list ID is 0"); auto accountSigners = SignerEntries::deserialize(*sleAccountSigners, j, "ledger"); @@ -888,7 +888,7 @@ Transactor::checkMultiSign( XRPL_ASSERT( (flags & tapDRY_RUN) || !spk.empty(), - "ripple::Transactor::checkMultiSign : non-empty signer or " + "xrpl::Transactor::checkMultiSign : non-empty signer or " "simulation"); AccountID const signingAcctIDFromPubKey = spk.empty() ? txSignerAcctID @@ -1087,7 +1087,7 @@ Transactor::reset(XRPAmount fee) // balance should have already been checked in checkFee / preFlight. XRPL_ASSERT( balance != beast::zero && (!view().open() || balance >= fee), - "ripple::Transactor::reset : valid balance"); + "xrpl::Transactor::reset : valid balance"); // We retry/reject the transaction if the account balance is zero or // we're applying against an open ledger and the balance is less than @@ -1104,7 +1104,7 @@ Transactor::reset(XRPAmount fee) payerSle->setFieldAmount(sfBalance, balance - fee); TER const ter{consumeSeqProxy(txnAcct)}; XRPL_ASSERT( - isTesSuccess(ter), "ripple::Transactor::reset : result is tesSUCCESS"); + isTesSuccess(ter), "xrpl::Transactor::reset : result is tesSUCCESS"); if (isTesSuccess(ter)) { @@ -1149,7 +1149,7 @@ Transactor::operator()() JLOG(j_.info()) << to_string(ctx_.tx.getJson(JsonOptions::none)); JLOG(j_.fatal()) << s2.getJson(JsonOptions::none); UNREACHABLE( - "ripple::Transactor::operator() : transaction serdes mismatch"); + "xrpl::Transactor::operator() : transaction serdes mismatch"); // LCOV_EXCL_STOP } } @@ -1169,7 +1169,7 @@ Transactor::operator()() // and it can't be passed in from a preclaim. XRPL_ASSERT( result != temUNKNOWN, - "ripple::Transactor::operator() : result is not temUNKNOWN"); + "xrpl::Transactor::operator() : result is not temUNKNOWN"); if (auto stream = j_.trace()) stream << "preclaim result: " << transToken(result); @@ -1226,7 +1226,7 @@ Transactor::operator()() { XRPL_ASSERT( before && after, - "ripple::Transactor::operator()::visit : non-null SLE " + "xrpl::Transactor::operator()::visit : non-null SLE " "inputs"); if (doOffers && before && after && (before->getType() == ltOFFER) && @@ -1346,4 +1346,4 @@ Transactor::operator()() return {result, applied, metadata}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/Transactor.h b/src/xrpld/app/tx/detail/Transactor.h index ea3479ee6f..7d24df0a3b 100644 --- a/src/xrpld/app/tx/detail/Transactor.h +++ b/src/xrpld/app/tx/detail/Transactor.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** State information when preflighting a tx. */ struct PreflightContext @@ -247,7 +247,7 @@ protected: @param app The application hosting the server @param baseFee The base fee of a candidate transaction - @see ripple::calculateBaseFee + @see xrpl::calculateBaseFee @param fees Fee settings from the current ledger @param flags Transaction processing fees */ @@ -452,6 +452,6 @@ Transactor::validNumericMinimum( return validNumericMinimum(value, min.value()); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultClawback.cpp b/src/xrpld/app/tx/detail/VaultClawback.cpp index 7c56ca1d60..cc7dec993a 100644 --- a/src/xrpld/app/tx/detail/VaultClawback.cpp +++ b/src/xrpld/app/tx/detail/VaultClawback.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC VaultClawback::preflight(PreflightContext const& ctx) @@ -144,14 +144,14 @@ VaultClawback::doApply() }(); XRPL_ASSERT( amount.asset() == vaultAsset, - "ripple::VaultClawback::doApply : matching asset"); + "xrpl::VaultClawback::doApply : matching asset"); auto assetsAvailable = vault->at(sfAssetsAvailable); auto assetsTotal = vault->at(sfAssetsTotal); [[maybe_unused]] auto const lossUnrealized = vault->at(sfLossUnrealized); XRPL_ASSERT( lossUnrealized <= (assetsTotal - assetsAvailable), - "ripple::VaultClawback::doApply : loss and assets do balance"); + "xrpl::VaultClawback::doApply : loss and assets do balance"); AccountID holder = tx[sfHolder]; MPTIssue const share{mptIssuanceID}; @@ -311,4 +311,4 @@ VaultClawback::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultClawback.h b/src/xrpld/app/tx/detail/VaultClawback.h index 888ecf59bf..80a5f73ad0 100644 --- a/src/xrpld/app/tx/detail/VaultClawback.h +++ b/src/xrpld/app/tx/detail/VaultClawback.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultClawback : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultCreate.cpp b/src/xrpld/app/tx/detail/VaultCreate.cpp index d8a2e7bc3b..893a1108fa 100644 --- a/src/xrpld/app/tx/detail/VaultCreate.cpp +++ b/src/xrpld/app/tx/detail/VaultCreate.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { bool VaultCreate::checkExtraFeatures(PreflightContext const& ctx) @@ -233,4 +233,4 @@ VaultCreate::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultCreate.h b/src/xrpld/app/tx/detail/VaultCreate.h index 987bbe7df4..78593eb491 100644 --- a/src/xrpld/app/tx/detail/VaultCreate.h +++ b/src/xrpld/app/tx/detail/VaultCreate.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultCreate : public Transactor { @@ -30,6 +30,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultDelete.cpp b/src/xrpld/app/tx/detail/VaultDelete.cpp index 903b5a83a7..756e7b94e6 100644 --- a/src/xrpld/app/tx/detail/VaultDelete.cpp +++ b/src/xrpld/app/tx/detail/VaultDelete.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC VaultDelete::preflight(PreflightContext const& ctx) @@ -208,4 +208,4 @@ VaultDelete::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultDelete.h b/src/xrpld/app/tx/detail/VaultDelete.h index 1144ebcc36..e7c71b408c 100644 --- a/src/xrpld/app/tx/detail/VaultDelete.h +++ b/src/xrpld/app/tx/detail/VaultDelete.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultDelete : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultDeposit.cpp b/src/xrpld/app/tx/detail/VaultDeposit.cpp index aeaf890126..d9471a38f5 100644 --- a/src/xrpld/app/tx/detail/VaultDeposit.cpp +++ b/src/xrpld/app/tx/detail/VaultDeposit.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC VaultDeposit::preflight(PreflightContext const& ctx) @@ -179,7 +179,7 @@ VaultDeposit::doApply() // This follows from the reverse of the outer enclosing if condition XRPL_ASSERT( account_ == vault->at(sfOwner), - "ripple::VaultDeposit::doApply : account is owner"); + "xrpl::VaultDeposit::doApply : account is owner"); if (auto const err = authorizeMPToken( view(), mPriorBalance, // priorBalance @@ -236,7 +236,7 @@ VaultDeposit::doApply() XRPL_ASSERT( sharesCreated.asset() != assetsDeposited.asset(), - "ripple::VaultDeposit::doApply : assets are not shares"); + "xrpl::VaultDeposit::doApply : assets are not shares"); vault->at(sfAssetsTotal) += assetsDeposited; vault->at(sfAssetsAvailable) += assetsDeposited; @@ -287,4 +287,4 @@ VaultDeposit::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultDeposit.h b/src/xrpld/app/tx/detail/VaultDeposit.h index 7d725fe6fe..1fd62b95ff 100644 --- a/src/xrpld/app/tx/detail/VaultDeposit.h +++ b/src/xrpld/app/tx/detail/VaultDeposit.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultDeposit : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultSet.cpp b/src/xrpld/app/tx/detail/VaultSet.cpp index 97522dad12..648ac12c3d 100644 --- a/src/xrpld/app/tx/detail/VaultSet.cpp +++ b/src/xrpld/app/tx/detail/VaultSet.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { bool VaultSet::checkExtraFeatures(PreflightContext const& ctx) @@ -175,4 +175,4 @@ VaultSet::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultSet.h b/src/xrpld/app/tx/detail/VaultSet.h index 0db0e0fd13..bfa38e5284 100644 --- a/src/xrpld/app/tx/detail/VaultSet.h +++ b/src/xrpld/app/tx/detail/VaultSet.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultSet : public Transactor { @@ -27,6 +27,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/VaultWithdraw.cpp b/src/xrpld/app/tx/detail/VaultWithdraw.cpp index a3bef88d49..f8b7a1a739 100644 --- a/src/xrpld/app/tx/detail/VaultWithdraw.cpp +++ b/src/xrpld/app/tx/detail/VaultWithdraw.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { NotTEC VaultWithdraw::preflight(PreflightContext const& ctx) @@ -182,7 +182,7 @@ VaultWithdraw::doApply() [[maybe_unused]] auto const lossUnrealized = vault->at(sfLossUnrealized); XRPL_ASSERT( lossUnrealized <= (assetsTotal - assetsAvailable), - "ripple::VaultWithdraw::doApply : loss and assets do balance"); + "xrpl::VaultWithdraw::doApply : loss and assets do balance"); // The vault must have enough assets on hand. The vault may hold assets // that it has already pledged. That is why we look at AssetAvailable @@ -250,4 +250,4 @@ VaultWithdraw::doApply() j_); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/VaultWithdraw.h b/src/xrpld/app/tx/detail/VaultWithdraw.h index 4a6ee3b548..33463831e5 100644 --- a/src/xrpld/app/tx/detail/VaultWithdraw.h +++ b/src/xrpld/app/tx/detail/VaultWithdraw.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class VaultWithdraw : public Transactor { @@ -24,6 +24,6 @@ public: doApply() override; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/XChainBridge.cpp b/src/xrpld/app/tx/detail/XChainBridge.cpp index e555dca0a1..88cc236e0b 100644 --- a/src/xrpld/app/tx/detail/XChainBridge.cpp +++ b/src/xrpld/app/tx/detail/XChainBridge.cpp @@ -27,7 +27,7 @@ #include #include -namespace ripple { +namespace xrpl { /* Bridges connect two independent ledgers: a "locking chain" and an "issuing @@ -206,8 +206,8 @@ claimHelper( { // LCOV_EXCL_START UNREACHABLE( - "ripple::claimHelper : invalid inputs"); // should have already - // been checked + "xrpl::claimHelper : invalid inputs"); // should have already + // been checked continue; // LCOV_EXCL_STOP } @@ -423,7 +423,7 @@ transferHelper( if (amt.native()) { auto const sleSrc = psb.peek(keylet::account(src)); - XRPL_ASSERT(sleSrc, "ripple::transferHelper : non-null source account"); + XRPL_ASSERT(sleSrc, "xrpl::transferHelper : non-null source account"); if (!sleSrc) return tecINTERNAL; // LCOV_EXCL_LINE @@ -2238,4 +2238,4 @@ XChainCreateAccountCommit::doApply() return tesSUCCESS; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/XChainBridge.h b/src/xrpld/app/tx/detail/XChainBridge.h index 8636f4f30e..db1026ebb4 100644 --- a/src/xrpld/app/tx/detail/XChainBridge.h +++ b/src/xrpld/app/tx/detail/XChainBridge.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { constexpr size_t xbridgeMaxAccountCreateClaims = 128; @@ -239,6 +239,6 @@ using XChainAccountCreateCommit = XChainCreateAccountCommit; //------------------------------------------------------------------------------ -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/tx/detail/apply.cpp b/src/xrpld/app/tx/detail/apply.cpp index 06be378c2b..5209c46f8f 100644 --- a/src/xrpld/app/tx/detail/apply.cpp +++ b/src/xrpld/app/tx/detail/apply.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // These are the same flags defined as HashRouterFlags::PRIVATE1-4 in // HashRouter.h @@ -267,4 +267,4 @@ applyTransaction( } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/tx/detail/applySteps.cpp b/src/xrpld/app/tx/detail/applySteps.cpp index 81a930f562..7f0d971fdc 100644 --- a/src/xrpld/app/tx/detail/applySteps.cpp +++ b/src/xrpld/app/tx/detail/applySteps.cpp @@ -18,7 +18,7 @@ #include -namespace ripple { +namespace xrpl { namespace { @@ -113,7 +113,7 @@ invoke_preflight(PreflightContext const& ctx) // LCOV_EXCL_START JLOG(ctx.j.fatal()) << "Unknown transaction type in preflight: " << e.txnType; - UNREACHABLE("ripple::invoke_preflight : unknown transaction type"); + UNREACHABLE("xrpl::invoke_preflight : unknown transaction type"); return {temUNKNOWN, TxConsequences{temUNKNOWN}}; // LCOV_EXCL_STOP } @@ -177,7 +177,7 @@ invoke_preclaim(PreclaimContext const& ctx) // LCOV_EXCL_START JLOG(ctx.j.fatal()) << "Unknown transaction type in preclaim: " << e.txnType; - UNREACHABLE("ripple::invoke_preclaim : unknown transaction type"); + UNREACHABLE("xrpl::invoke_preclaim : unknown transaction type"); return temUNKNOWN; // LCOV_EXCL_STOP } @@ -211,8 +211,7 @@ invoke_calculateBaseFee(ReadView const& view, STTx const& tx) catch (UnknownTxnType const& e) { // LCOV_EXCL_START - UNREACHABLE( - "ripple::invoke_calculateBaseFee : unknown transaction type"); + UNREACHABLE("xrpl::invoke_calculateBaseFee : unknown transaction type"); return XRPAmount{0}; // LCOV_EXCL_STOP } @@ -227,7 +226,7 @@ TxConsequences::TxConsequences(NotTEC pfresult) { XRPL_ASSERT( !isTesSuccess(pfresult), - "ripple::TxConsequences::TxConsequences : is not tesSUCCESS"); + "xrpl::TxConsequences::TxConsequences : is not tesSUCCESS"); } TxConsequences::TxConsequences(STTx const& tx) @@ -275,7 +274,7 @@ invoke_apply(ApplyContext& ctx) // LCOV_EXCL_START JLOG(ctx.journal.fatal()) << "Unknown transaction type in apply: " << e.txnType; - UNREACHABLE("ripple::invoke_apply : unknown transaction type"); + UNREACHABLE("xrpl::invoke_apply : unknown transaction type"); return {temUNKNOWN, false}; // LCOV_EXCL_STOP } @@ -426,4 +425,4 @@ doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/conditions/Condition.h b/src/xrpld/conditions/Condition.h index ff83f69afe..52a6bcd9bb 100644 --- a/src/xrpld/conditions/Condition.h +++ b/src/xrpld/conditions/Condition.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { enum class Type : std::uint8_t { @@ -94,6 +94,6 @@ operator!=(Condition const& lhs, Condition const& rhs) } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/conditions/Fulfillment.h b/src/xrpld/conditions/Fulfillment.h index 13144288d9..970aed121c 100644 --- a/src/xrpld/conditions/Fulfillment.h +++ b/src/xrpld/conditions/Fulfillment.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { struct Fulfillment @@ -122,6 +122,6 @@ bool validate(Fulfillment const& f, Condition const& c); } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/conditions/detail/Condition.cpp b/src/xrpld/conditions/detail/Condition.cpp index b6ba60e6d5..ebf61dd245 100644 --- a/src/xrpld/conditions/detail/Condition.cpp +++ b/src/xrpld/conditions/detail/Condition.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { namespace detail { @@ -212,4 +212,4 @@ Condition::deserialize(Slice s, std::error_code& ec) } } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/conditions/detail/Fulfillment.cpp b/src/xrpld/conditions/detail/Fulfillment.cpp index e8c5928fcf..9ecaa44ab8 100644 --- a/src/xrpld/conditions/detail/Fulfillment.cpp +++ b/src/xrpld/conditions/detail/Fulfillment.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { bool @@ -130,4 +130,4 @@ Fulfillment::deserialize(Slice s, std::error_code& ec) } } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/conditions/detail/PreimageSha256.h b/src/xrpld/conditions/detail/PreimageSha256.h index 62043f5a45..642a7afdc0 100644 --- a/src/xrpld/conditions/detail/PreimageSha256.h +++ b/src/xrpld/conditions/detail/PreimageSha256.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { class PreimageSha256 final : public Fulfillment @@ -130,6 +130,6 @@ public: }; } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/conditions/detail/error.cpp b/src/xrpld/conditions/detail/error.cpp index fbcd70d009..a74aa79e3f 100644 --- a/src/xrpld/conditions/detail/error.cpp +++ b/src/xrpld/conditions/detail/error.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { namespace detail { @@ -116,4 +116,4 @@ make_error_code(error ev) } } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/conditions/detail/error.h b/src/xrpld/conditions/detail/error.h index bd1f2413f3..65584e974a 100644 --- a/src/xrpld/conditions/detail/error.h +++ b/src/xrpld/conditions/detail/error.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { enum class error { @@ -30,12 +30,12 @@ std::error_code make_error_code(error ev); } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl namespace std { template <> -struct is_error_code_enum +struct is_error_code_enum { explicit is_error_code_enum() = default; diff --git a/src/xrpld/conditions/detail/utils.h b/src/xrpld/conditions/detail/utils.h index b03b393e43..b07b7b29e0 100644 --- a/src/xrpld/conditions/detail/utils.h +++ b/src/xrpld/conditions/detail/utils.h @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { namespace cryptoconditions { // A collection of functions to decode binary blobs @@ -208,6 +208,6 @@ parseInteger(Slice& s, std::size_t count, std::error_code& ec) } // namespace der } // namespace cryptoconditions -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/Consensus.cpp b/src/xrpld/consensus/Consensus.cpp index 8a0bec236e..b71a36d538 100644 --- a/src/xrpld/consensus/Consensus.cpp +++ b/src/xrpld/consensus/Consensus.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { bool shouldCloseLedger( @@ -250,4 +250,4 @@ checkConsensus( return ConsensusState::No; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index d1aed31870..01d4dfaedf 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Determines whether the current ledger should close at this time. @@ -897,7 +897,7 @@ Consensus::gotTxSet( // so this txSet must differ XRPL_ASSERT( id != result_->position.position(), - "ripple::Consensus::gotTxSet : updated transaction set"); + "xrpl::Consensus::gotTxSet : updated transaction set"); bool any = false; for (auto const& [nodeId, peerPos] : currPeerPositions_) { @@ -1047,7 +1047,7 @@ Consensus::handleWrongLedger( CLOG(clog) << "handleWrongLedger. "; XRPL_ASSERT( lgrId != prevLedgerID_ || previousLedger_.id() != lgrId, - "ripple::Consensus::handleWrongLedger : have wrong ledger"); + "xrpl::Consensus::handleWrongLedger : have wrong ledger"); // Stop proposing because we are out of sync leaveConsensus(clog); @@ -1349,7 +1349,7 @@ Consensus::phaseEstablish( { CLOG(clog) << "phaseEstablish. "; // can only establish consensus if we already took a stance - XRPL_ASSERT(result_, "ripple::Consensus::phaseEstablish : result is set"); + XRPL_ASSERT(result_, "xrpl::Consensus::phaseEstablish : result is set"); ++peerUnchangedCounter_; ++establishCounter_; @@ -1415,7 +1415,7 @@ void Consensus::closeLedger(std::unique_ptr const& clog) { // We should not be closing if we already have a position - XRPL_ASSERT(!result_, "ripple::Consensus::closeLedger : result is not set"); + XRPL_ASSERT(!result_, "xrpl::Consensus::closeLedger : result is not set"); phase_ = ConsensusPhase::establish; JLOG(j_.debug()) << "transitioned to ConsensusPhase::establish"; @@ -1474,8 +1474,7 @@ Consensus::updateOurPositions( std::unique_ptr const& clog) { // We must have a position if we are updating it - XRPL_ASSERT( - result_, "ripple::Consensus::updateOurPositions : result is set"); + XRPL_ASSERT(result_, "xrpl::Consensus::updateOurPositions : result is set"); ConsensusParms const& parms = adaptor_.parms(); // Compute a cutoff time @@ -1664,7 +1663,7 @@ Consensus::haveConsensus( std::unique_ptr const& clog) { // Must have a stance if we are checking for consensus - XRPL_ASSERT(result_, "ripple::Consensus::haveConsensus : has result"); + XRPL_ASSERT(result_, "xrpl::Consensus::haveConsensus : has result"); // CHECKME: should possibly count unacquired TX sets as disagreeing int agree = 0, disagree = 0; @@ -1804,7 +1803,7 @@ Consensus::createDisputes( std::unique_ptr const& clog) { // Cannot create disputes without our stance - XRPL_ASSERT(result_, "ripple::Consensus::createDisputes : result is set"); + XRPL_ASSERT(result_, "xrpl::Consensus::createDisputes : result is set"); // Only create disputes if this is a new set auto const emplaced = result_->compares.emplace(o.id()).second; @@ -1835,7 +1834,7 @@ Consensus::createDisputes( XRPL_ASSERT( (inThisSet && result_->txns.find(txId) && !o.find(txId)) || (!inThisSet && !result_->txns.find(txId) && o.find(txId)), - "ripple::Consensus::createDisputes : has disputed transactions"); + "xrpl::Consensus::createDisputes : has disputed transactions"); Tx_t tx = inThisSet ? result_->txns.find(txId) : o.find(txId); auto txID = tx.id(); @@ -1873,7 +1872,7 @@ void Consensus::updateDisputes(NodeID_t const& node, TxSet_t const& other) { // Cannot updateDisputes without our stance - XRPL_ASSERT(result_, "ripple::Consensus::updateDisputes : result is set"); + XRPL_ASSERT(result_, "xrpl::Consensus::updateDisputes : result is set"); // Ensure we have created disputes against this set if we haven't seen // it before @@ -1895,6 +1894,6 @@ Consensus::asCloseTime(NetClock::time_point raw) const return roundCloseTime(raw, closeResolution_); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/ConsensusParms.h b/src/xrpld/consensus/ConsensusParms.h index 8015c2547b..bd1d866082 100644 --- a/src/xrpld/consensus/ConsensusParms.h +++ b/src/xrpld/consensus/ConsensusParms.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Consensus algorithm parameters @@ -170,7 +170,7 @@ getNeededWeight( // See if enough time has passed to move on to the next. XRPL_ASSERT( nextCutoff.consensusTime >= currentCutoff.consensusTime, - "ripple::getNeededWeight : next state valid"); + "xrpl::getNeededWeight : next state valid"); if (percentTime >= nextCutoff.consensusTime) { return {nextCutoff.consensusPct, currentCutoff.next}; @@ -179,5 +179,5 @@ getNeededWeight( return {currentCutoff.consensusPct, {}}; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/ConsensusProposal.h b/src/xrpld/consensus/ConsensusProposal.h index 344f87f0db..eadf3565f2 100644 --- a/src/xrpld/consensus/ConsensusProposal.h +++ b/src/xrpld/consensus/ConsensusProposal.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents a proposed position taken during a round of consensus. During consensus, peers seek agreement on a set of transactions to @@ -262,5 +262,5 @@ operator==( a.prevLedger() == b.prevLedger() && a.position() == b.position() && a.closeTime() == b.closeTime() && a.seenTime() == b.seenTime(); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/ConsensusTypes.h b/src/xrpld/consensus/ConsensusTypes.h index b2712f17e7..43fb4021b1 100644 --- a/src/xrpld/consensus/ConsensusTypes.h +++ b/src/xrpld/consensus/ConsensusTypes.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents how a node currently participates in Consensus. @@ -200,7 +200,7 @@ struct ConsensusResult { XRPL_ASSERT( txns.id() == position.position(), - "ripple::ConsensusResult : valid inputs"); + "xrpl::ConsensusResult : valid inputs"); } //! The set of transactions consensus agrees go in the ledger @@ -225,6 +225,6 @@ struct ConsensusResult // The number of peers proposing during the round std::size_t proposers = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index ce15b4b7f3..f4b841c795 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { /** A transaction discovered to be in dispute during consensus. @@ -341,6 +341,6 @@ DisputedTx::getJson() const return ret; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/LedgerTiming.h b/src/xrpld/consensus/LedgerTiming.h index 869cf1980e..5d6348ffb6 100644 --- a/src/xrpld/consensus/LedgerTiming.h +++ b/src/xrpld/consensus/LedgerTiming.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { /** Possible ledger close time resolutions. @@ -149,5 +149,5 @@ effCloseTime( roundCloseTime(closeTime, resolution), (priorCloseTime + 1s)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/LedgerTrie.h b/src/xrpld/consensus/LedgerTrie.h index 0f23a8ffc3..b8382c555f 100644 --- a/src/xrpld/consensus/LedgerTrie.h +++ b/src/xrpld/consensus/LedgerTrie.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { /** The tip of a span of ledger ancestry */ @@ -45,7 +45,7 @@ public: ID ancestor(Seq const& s) const { - XRPL_ASSERT(s <= seq, "ripple::SpanTip::ancestor : valid input"); + XRPL_ASSERT(s <= seq, "xrpl::SpanTip::ancestor : valid input"); return ledger[s]; } @@ -72,7 +72,7 @@ public: { // Require default ledger to be genesis seq XRPL_ASSERT( - ledger_.seq() == start_, "ripple::Span::Span : ledger is genesis"); + ledger_.seq() == start_, "xrpl::Span::Span : ledger is genesis"); } Span(Ledger ledger) @@ -141,7 +141,7 @@ private: : start_{start}, end_{end}, ledger_{l} { // Spans cannot be empty - XRPL_ASSERT(start < end, "ripple::Span::Span : non-empty span input"); + XRPL_ASSERT(start < end, "xrpl::Span::Span : non-empty span input"); } Seq @@ -214,7 +214,7 @@ struct Node [child](std::unique_ptr const& curr) { return curr.get() == child; }); - XRPL_ASSERT(it != children.end(), "ripple::Node::erase : valid input"); + XRPL_ASSERT(it != children.end(), "xrpl::Node::erase : valid input"); std::swap(*it, children.back()); children.pop_back(); } @@ -355,7 +355,7 @@ class LedgerTrie Node* curr = root.get(); // Root is always defined and is in common with all ledgers - XRPL_ASSERT(curr, "ripple::LedgerTrie::find : non-null root"); + XRPL_ASSERT(curr, "xrpl::LedgerTrie::find : non-null root"); Seq pos = curr->span.diff(ledger); bool done = false; @@ -436,7 +436,7 @@ public: auto const [loc, diffSeq] = find(ledger); // There is always a place to insert - XRPL_ASSERT(loc, "ripple::LedgerTrie::insert : valid input ledger"); + XRPL_ASSERT(loc, "xrpl::LedgerTrie::insert : valid input ledger"); // Node from which to start incrementing branchSupport Node* incNode = loc; @@ -473,12 +473,12 @@ public: newNode->children = std::move(loc->children); XRPL_ASSERT( loc->children.empty(), - "ripple::LedgerTrie::insert : moved-from children"); + "xrpl::LedgerTrie::insert : moved-from children"); for (std::unique_ptr& child : newNode->children) child->parent = newNode.get(); // Loc truncates to prefix and newNode is its child - XRPL_ASSERT(prefix, "ripple::LedgerTrie::insert : prefix is set"); + XRPL_ASSERT(prefix, "xrpl::LedgerTrie::insert : prefix is set"); loc->span = *prefix; newNode->parent = loc; loc->children.emplace_back(std::move(newNode)); @@ -533,7 +533,7 @@ public: auto const it = seqSupport.find(ledger.seq()); XRPL_ASSERT( it != seqSupport.end() && it->second >= count, - "ripple::LedgerTrie::remove : valid input ledger"); + "xrpl::LedgerTrie::remove : valid input ledger"); it->second -= count; if (it->second == 0) seqSupport.erase(it->first); @@ -830,5 +830,5 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index 830d05f188..15b33c89c4 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Timing parameters to control validation staleness and expiration. @@ -418,7 +418,7 @@ private: { XRPL_ASSERT( val.trusted(), - "ripple::Validations::updateTrie : trusted input validation"); + "xrpl::Validations::updateTrie : trusted input validation"); // Clear any prior acquiring ledger for this node if (prior) @@ -698,7 +698,7 @@ public: { std::lock_guard lock{mutex_}; XRPL_ASSERT( - low < high, "ripple::Validations::setSeqToKeep : valid inputs"); + low < high, "xrpl::Validations::setSeqToKeep : valid inputs"); toKeep_ = {low, high}; } @@ -1156,5 +1156,5 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index f48f2765e3..cfd260787c 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { class Rules; @@ -362,6 +362,6 @@ public: FeeSetup setup_FeeVote(Section const& section); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/core/ConfigSections.h b/src/xrpld/core/ConfigSections.h index 554362edd6..6f8a13a145 100644 --- a/src/xrpld/core/ConfigSections.h +++ b/src/xrpld/core/ConfigSections.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // VFALCO DEPRECATED in favor of the BasicConfig interface struct ConfigSection @@ -78,6 +78,6 @@ struct ConfigSection #define SECTION_VETO_AMENDMENTS "veto_amendments" #define SECTION_WORKERS "workers" -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/core/DatabaseCon.h b/src/xrpld/core/DatabaseCon.h index b2f400780b..a7fc21bc38 100644 --- a/src/xrpld/core/DatabaseCon.h +++ b/src/xrpld/core/DatabaseCon.h @@ -17,7 +17,7 @@ namespace soci { class session; } -namespace ripple { +namespace xrpl { class LockedSociSession { @@ -83,7 +83,7 @@ public: { XRPL_ASSERT( !useGlobalPragma || globalPragma, - "ripple::DatabaseCon::Setup::commonPragma : consistent global " + "xrpl::DatabaseCon::Setup::commonPragma : consistent global " "pragma"); return useGlobalPragma && globalPragma ? globalPragma.get() : nullptr; @@ -242,6 +242,6 @@ setup_DatabaseCon( Config const& c, std::optional j = std::nullopt); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/core/SociDB.h b/src/xrpld/core/SociDB.h index 7e2c7323d8..fe3c15e26e 100644 --- a/src/xrpld/core/SociDB.h +++ b/src/xrpld/core/SociDB.h @@ -28,7 +28,7 @@ namespace sqlite_api { struct sqlite3; } -namespace ripple { +namespace xrpl { class BasicConfig; @@ -121,7 +121,7 @@ makeCheckpointer( JobQueue&, Logs&); -} // namespace ripple +} // namespace xrpl #if defined(__clang__) #pragma clang diagnostic pop diff --git a/src/xrpld/core/TimeKeeper.h b/src/xrpld/core/TimeKeeper.h index f5c14a67fd..67b389bf94 100644 --- a/src/xrpld/core/TimeKeeper.h +++ b/src/xrpld/core/TimeKeeper.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { /** Manages various times used by the server. */ class TimeKeeper : public beast::abstract_clock @@ -97,6 +97,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/core/detail/Config.cpp b/src/xrpld/core/detail/Config.cpp index 6a49416a45..e6c61e1471 100644 --- a/src/xrpld/core/detail/Config.cpp +++ b/src/xrpld/core/detail/Config.cpp @@ -26,7 +26,7 @@ #if BOOST_OS_WINDOWS #include -namespace ripple { +namespace xrpl { namespace detail { [[nodiscard]] std::uint64_t @@ -39,13 +39,13 @@ getMemorySize() } } // namespace detail -} // namespace ripple +} // namespace xrpl #endif #if BOOST_OS_LINUX #include -namespace ripple { +namespace xrpl { namespace detail { [[nodiscard]] std::uint64_t @@ -58,7 +58,7 @@ getMemorySize() } } // namespace detail -} // namespace ripple +} // namespace xrpl #endif @@ -66,7 +66,7 @@ getMemorySize() #include #include -namespace ripple { +namespace xrpl { namespace detail { [[nodiscard]] std::uint64_t @@ -83,10 +83,10 @@ getMemorySize() } } // namespace detail -} // namespace ripple +} // namespace xrpl #endif -namespace ripple { +namespace xrpl { // clang-format off // The configurable node sizes are "tiny", "small", "medium", "large", "huge" @@ -250,7 +250,7 @@ void Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone) { XRPL_ASSERT( - NODE_SIZE == 0, "ripple::Config::setupControl : node size not set"); + NODE_SIZE == 0, "xrpl::Config::setupControl : node size not set"); QUIET = bQuiet || bSilent; SILENT = bSilent; @@ -273,7 +273,7 @@ Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone) XRPL_ASSERT( ns != threshold.second.end(), - "ripple::Config::setupControl : valid node size"); + "xrpl::Config::setupControl : valid node size"); if (ns != threshold.second.end()) NODE_SIZE = std::distance(threshold.second.begin(), ns); @@ -285,7 +285,7 @@ Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone) } XRPL_ASSERT( - NODE_SIZE <= 4, "ripple::Config::setupControl : node size is set"); + NODE_SIZE <= 4, "xrpl::Config::setupControl : node size is set"); } void @@ -1099,10 +1099,9 @@ Config::getValueFor(SizedItem item, std::optional node) const auto const index = static_cast>(item); XRPL_ASSERT( index < sizedItems.size(), - "ripple::Config::getValueFor : valid index input"); + "xrpl::Config::getValueFor : valid index input"); XRPL_ASSERT( - !node || *node <= 4, - "ripple::Config::getValueFor : unset or valid node"); + !node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node"); return sizedItems.at(index).second.at(node.value_or(NODE_SIZE)); } @@ -1126,4 +1125,4 @@ setup_FeeVote(Section const& section) return setup; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/core/detail/DatabaseCon.cpp b/src/xrpld/core/detail/DatabaseCon.cpp index efff0d8192..35eaf31898 100644 --- a/src/xrpld/core/detail/DatabaseCon.cpp +++ b/src/xrpld/core/detail/DatabaseCon.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { class CheckpointersCollection { @@ -215,7 +215,7 @@ setup_DatabaseCon(Config const& c, std::optional j) } XRPL_ASSERT( result->size() == 3, - "ripple::setup_DatabaseCon::globalPragma : result size is 3"); + "xrpl::setup_DatabaseCon::globalPragma : result size is 3"); return result; }(); } @@ -265,4 +265,4 @@ DatabaseCon::setupCheckpointing(JobQueue* q, Logs& l) checkpointer_ = checkpointers.create(session_, *q, l); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/core/detail/SociDB.cpp b/src/xrpld/core/detail/SociDB.cpp index 65294acc4c..a90e59beed 100644 --- a/src/xrpld/core/detail/SociDB.cpp +++ b/src/xrpld/core/detail/SociDB.cpp @@ -16,7 +16,7 @@ #include -namespace ripple { +namespace xrpl { static auto checkpointPageCount = 1000; @@ -206,7 +206,7 @@ public: { if (auto p = session_.lock()) { - return {ripple::getConnection(*p), p}; + return {xrpl::getConnection(*p), p}; } return {nullptr, std::shared_ptr{}}; } @@ -324,7 +324,7 @@ makeCheckpointer( id, std::move(session), queue, logs); } -} // namespace ripple +} // namespace xrpl #if defined(__clang__) #pragma clang diagnostic pop diff --git a/src/xrpld/overlay/Cluster.h b/src/xrpld/overlay/Cluster.h index ff0a1a97f5..30627f90ae 100644 --- a/src/xrpld/overlay/Cluster.h +++ b/src/xrpld/overlay/Cluster.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { class Cluster { @@ -94,6 +94,6 @@ public: load(Section const& nodes); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/ClusterNode.h b/src/xrpld/overlay/ClusterNode.h index a21f7a3870..03c294c736 100644 --- a/src/xrpld/overlay/ClusterNode.h +++ b/src/xrpld/overlay/ClusterNode.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class ClusterNode { @@ -54,6 +54,6 @@ private: NetClock::time_point mReportTime = {}; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/Compression.h b/src/xrpld/overlay/Compression.h index b13b009dcf..8f9b1e2a14 100644 --- a/src/xrpld/overlay/Compression.h +++ b/src/xrpld/overlay/Compression.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace compression { @@ -37,7 +37,7 @@ decompress( try { if (algorithm == Algorithm::LZ4) - return ripple::compression_algorithms::lz4Decompress( + return xrpl::compression_algorithms::lz4Decompress( in, inSize, decompressed, decompressedSize); else { @@ -46,7 +46,7 @@ decompress( << "decompress: invalid compression algorithm " << static_cast(algorithm); UNREACHABLE( - "ripple::compression::decompress : invalid compression " + "xrpl::compression::decompress : invalid compression " "algorithm"); // LCOV_EXCL_STOP } @@ -77,7 +77,7 @@ compress( try { if (algorithm == Algorithm::LZ4) - return ripple::compression_algorithms::lz4Compress( + return xrpl::compression_algorithms::lz4Compress( in, inSize, std::forward(bf)); else { @@ -85,7 +85,7 @@ compress( JLOG(debugLog().warn()) << "compress: invalid compression algorithm" << static_cast(algorithm); UNREACHABLE( - "ripple::compression::compress : invalid compression " + "xrpl::compression::compress : invalid compression " "algorithm"); // LCOV_EXCL_STOP } @@ -97,6 +97,6 @@ compress( } } // namespace compression -} // namespace ripple +} // namespace xrpl #endif // XRPL_COMPRESSION_H_INCLUDED diff --git a/src/xrpld/overlay/Message.h b/src/xrpld/overlay/Message.h index afa15657f0..f2b021840d 100644 --- a/src/xrpld/overlay/Message.h +++ b/src/xrpld/overlay/Message.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { constexpr std::size_t maximiumMessageSize = megabytes(64); @@ -117,6 +117,6 @@ private: getType(std::uint8_t const* in) const; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/Overlay.h b/src/xrpld/overlay/Overlay.h index 6eaf14b8df..c30d0f5205 100644 --- a/src/xrpld/overlay/Overlay.h +++ b/src/xrpld/overlay/Overlay.h @@ -23,7 +23,7 @@ class context; } // namespace asio } // namespace boost -namespace ripple { +namespace xrpl { /** Manages the set of connected peers. */ class Overlay : public beast::PropertyStream::Source @@ -215,6 +215,6 @@ public: txMetrics() const = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/Peer.h b/src/xrpld/overlay/Peer.h index abe18d48dc..35feb05271 100644 --- a/src/xrpld/overlay/Peer.h +++ b/src/xrpld/overlay/Peer.h @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace Resource { class Charge; @@ -119,6 +119,6 @@ public: txReduceRelayEnabled() const = 0; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/PeerReservationTable.h b/src/xrpld/overlay/PeerReservationTable.h index 1cabbb56f9..9ddf79aca9 100644 --- a/src/xrpld/overlay/PeerReservationTable.h +++ b/src/xrpld/overlay/PeerReservationTable.h @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { class DatabaseCon; @@ -97,6 +97,6 @@ private: std::unordered_set, KeyEqual> table_; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/PeerSet.h b/src/xrpld/overlay/PeerSet.h index f90d1670f4..850ba21c53 100644 --- a/src/xrpld/overlay/PeerSet.h +++ b/src/xrpld/overlay/PeerSet.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Supports data retrieval by managing a set of peers. @@ -73,6 +73,6 @@ make_PeerSetBuilder(Application& app); std::unique_ptr make_DummyPeerSet(Application& app); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/ReduceRelayCommon.h b/src/xrpld/overlay/ReduceRelayCommon.h index 207a279cd6..990e4b51d2 100644 --- a/src/xrpld/overlay/ReduceRelayCommon.h +++ b/src/xrpld/overlay/ReduceRelayCommon.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { // Blog post explaining the rationale behind reduction of flooding gossip // protocol: @@ -41,6 +41,6 @@ static constexpr std::size_t MAX_TX_QUEUE_SIZE = 10000; } // namespace reduce_relay -} // namespace ripple +} // namespace xrpl #endif // XRPL_REDUCERELAYCOMMON_H_INCLUDED diff --git a/src/xrpld/overlay/Slot.h b/src/xrpld/overlay/Slot.h index 388323d3c0..9e717fef9c 100644 --- a/src/xrpld/overlay/Slot.h +++ b/src/xrpld/overlay/Slot.h @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace reduce_relay { @@ -374,7 +374,7 @@ Slot::update( XRPL_ASSERT( peers_.size() >= maxSelectedPeers_, - "ripple::reduce_relay::Slot::update : minimum peers"); + "xrpl::reduce_relay::Slot::update : minimum peers"); // squelch peers which are not selected and // not already squelched @@ -417,7 +417,7 @@ Slot::getSquelchDuration(std::size_t npeers) JLOG(journal_.warn()) << "getSquelchDuration: unexpected squelch duration " << npeers; } - return seconds{ripple::rand_int(MIN_UNSQUELCH_EXPIRE / 1s, m / 1s)}; + return seconds{xrpl::rand_int(MIN_UNSQUELCH_EXPIRE / 1s, m / 1s)}; } template @@ -821,6 +821,6 @@ Slots::deleteIdlePeers() } // namespace reduce_relay -} // namespace ripple +} // namespace xrpl #endif // XRPL_OVERLAY_SLOT_H_INCLUDED diff --git a/src/xrpld/overlay/Squelch.h b/src/xrpld/overlay/Squelch.h index d935087fbc..486cb0073c 100644 --- a/src/xrpld/overlay/Squelch.h +++ b/src/xrpld/overlay/Squelch.h @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace reduce_relay { @@ -105,6 +105,6 @@ Squelch::expireSquelch(PublicKey const& validator) } // namespace reduce_relay -} // namespace ripple +} // namespace xrpl #endif // XRPL_SQUELCH_H diff --git a/src/xrpld/overlay/detail/Cluster.cpp b/src/xrpld/overlay/detail/Cluster.cpp index f4505116b1..606699b841 100644 --- a/src/xrpld/overlay/detail/Cluster.cpp +++ b/src/xrpld/overlay/detail/Cluster.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { Cluster::Cluster(beast::Journal j) : j_(j) { @@ -114,4 +114,4 @@ Cluster::load(Section const& nodes) return true; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/ConnectAttempt.cpp b/src/xrpld/overlay/detail/ConnectAttempt.cpp index 57565b5c19..bd18d96442 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.cpp +++ b/src/xrpld/overlay/detail/ConnectAttempt.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { ConnectAttempt::ConnectAttempt( Application& app, @@ -92,7 +92,7 @@ ConnectAttempt::shutdown() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::ConnectAttempt::shutdown: strand in this thread"); + "xrpl::ConnectAttempt::shutdown: strand in this thread"); if (!socket_.is_open()) return; @@ -108,7 +108,7 @@ ConnectAttempt::tryAsyncShutdown() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::ConnectAttempt::tryAsyncShutdown : strand in this thread"); + "xrpl::ConnectAttempt::tryAsyncShutdown : strand in this thread"); if (!shutdown_ || currentStep_ == ConnectionStep::ShutdownStarted) return; @@ -165,7 +165,7 @@ ConnectAttempt::close() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::ConnectAttempt::close : strand in this thread"); + "xrpl::ConnectAttempt::close : strand in this thread"); if (!socket_.is_open()) return; @@ -619,4 +619,4 @@ ConnectAttempt::processResponse() } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index 6f0a151383..69053f3bc1 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { /** * @class ConnectAttempt @@ -273,6 +273,6 @@ private: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/Handshake.cpp b/src/xrpld/overlay/detail/Handshake.cpp index 45dc37f52c..411884dc12 100644 --- a/src/xrpld/overlay/detail/Handshake.cpp +++ b/src/xrpld/overlay/detail/Handshake.cpp @@ -14,7 +14,7 @@ // VFALCO Shouldn't we have to include the OpenSSL // headers or something for SSL_get_finished? -namespace ripple { +namespace xrpl { std::optional getFeatureValue( @@ -158,7 +158,7 @@ makeSharedValue(stream_type& ssl, beast::Journal journal) void buildHandshake( boost::beast::http::fields& h, - ripple::uint256 const& sharedValue, + xrpl::uint256 const& sharedValue, std::optional networkID, beast::IP::Address public_ip, beast::IP::Address remote_ip, @@ -207,7 +207,7 @@ buildHandshake( PublicKey verifyHandshake( boost::beast::http::fields const& headers, - ripple::uint256 const& sharedValue, + xrpl::uint256 const& sharedValue, std::optional networkID, beast::IP::Address public_ip, beast::IP::Address remote, @@ -402,4 +402,4 @@ makeResponse( return resp; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/Handshake.h b/src/xrpld/overlay/detail/Handshake.h index 52777d2bd8..95eb18394d 100644 --- a/src/xrpld/overlay/detail/Handshake.h +++ b/src/xrpld/overlay/detail/Handshake.h @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { using socket_type = boost::beast::tcp_stream; using stream_type = boost::beast::ssl_stream; @@ -233,6 +233,6 @@ makeFeaturesResponseHeader( bool txReduceRelayEnabled, bool vpReduceRelayEnabled); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/Message.cpp b/src/xrpld/overlay/detail/Message.cpp index b4cd4262aa..eb7b88894a 100644 --- a/src/xrpld/overlay/detail/Message.cpp +++ b/src/xrpld/overlay/detail/Message.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { Message::Message( ::google::protobuf::Message const& message, @@ -12,12 +12,12 @@ Message::Message( : category_(TrafficCount::categorize(message, type, false)) , validatorKey_(validator) { - using namespace ripple::compression; + using namespace xrpl::compression; auto const messageBytes = messageSize(message); XRPL_ASSERT( - messageBytes, "ripple::Message::Message : non-empty message input"); + messageBytes, "xrpl::Message::Message : non-empty message input"); buffer_.resize(headerBytes + messageBytes); @@ -28,7 +28,7 @@ Message::Message( XRPL_ASSERT( getBufferSize() == totalSize(message), - "ripple::Message::Message : message size matches the buffer"); + "xrpl::Message::Message : message size matches the buffer"); } // static @@ -52,7 +52,7 @@ Message::totalSize(::google::protobuf::Message const& message) void Message::compress() { - using namespace ripple::compression; + using namespace xrpl::compression; auto const messageBytes = buffer_.size() - headerBytes; auto type = getType(buffer_.data()); @@ -92,7 +92,7 @@ Message::compress() { auto payload = static_cast(buffer_.data() + headerBytes); - auto compressedSize = ripple::compression::compress( + auto compressedSize = xrpl::compression::compress( payload, messageBytes, [&](std::size_t inSize) { // size of required compressed buffer @@ -208,4 +208,4 @@ Message::getType(std::uint8_t const* in) const return type; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index d2a994fa8e..e5f77021d7 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace CrawlOptions { enum { @@ -285,7 +285,7 @@ OverlayImpl::onHandoff( auto const result = m_peers.emplace(peer->slot(), peer); XRPL_ASSERT( result.second, - "ripple::OverlayImpl::onHandoff : peer is inserted"); + "xrpl::OverlayImpl::onHandoff : peer is inserted"); (void)result.second; } list_.emplace(peer.get(), peer); @@ -378,7 +378,7 @@ OverlayImpl::makeErrorResponse( void OverlayImpl::connect(beast::IP::Endpoint const& remote_endpoint) { - XRPL_ASSERT(work_, "ripple::OverlayImpl::connect : work is set"); + XRPL_ASSERT(work_, "xrpl::OverlayImpl::connect : work is set"); auto usage = resourceManager().newOutboundEndpoint(remote_endpoint); if (usage.disconnect(journal_)) @@ -425,8 +425,7 @@ OverlayImpl::add_active(std::shared_ptr const& peer) { auto const result = m_peers.emplace(peer->slot(), peer); XRPL_ASSERT( - result.second, - "ripple::OverlayImpl::add_active : peer is inserted"); + result.second, "xrpl::OverlayImpl::add_active : peer is inserted"); (void)result.second; } @@ -437,7 +436,7 @@ OverlayImpl::add_active(std::shared_ptr const& peer) std::make_tuple(peer)); XRPL_ASSERT( result.second, - "ripple::OverlayImpl::add_active : peer ID is inserted"); + "xrpl::OverlayImpl::add_active : peer ID is inserted"); (void)result.second; } @@ -457,7 +456,7 @@ OverlayImpl::remove(std::shared_ptr const& slot) std::lock_guard lock(mutex_); auto const iter = m_peers.find(slot); XRPL_ASSERT( - iter != m_peers.end(), "ripple::OverlayImpl::remove : valid input"); + iter != m_peers.end(), "xrpl::OverlayImpl::remove : valid input"); m_peers.erase(iter); } @@ -598,15 +597,14 @@ OverlayImpl::activate(std::shared_ptr const& peer) std::make_tuple(peer->id()), std::make_tuple(peer))); XRPL_ASSERT( - result.second, - "ripple::OverlayImpl::activate : peer ID is inserted"); + result.second, "xrpl::OverlayImpl::activate : peer ID is inserted"); (void)result.second; } JLOG(journal.debug()) << "activated"; // We just accepted this peer so we have non-zero active peers - XRPL_ASSERT(size(), "ripple::OverlayImpl::activate : nonzero peers"); + XRPL_ASSERT(size(), "xrpl::OverlayImpl::activate : nonzero peers"); } void @@ -647,7 +645,7 @@ OverlayImpl::onManifests( mo = deserializeManifest(serialized); XRPL_ASSERT( mo, - "ripple::OverlayImpl::onManifests : manifest " + "xrpl::OverlayImpl::onManifests : manifest " "deserialization succeeded"); app_.getOPs().pubManifest(*mo); @@ -1603,4 +1601,4 @@ make_Overlay( collector); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 18f2aa0c3f..dc7e4975a3 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -35,7 +35,7 @@ #include #include -namespace ripple { +namespace xrpl { class PeerImp; class BasicConfig; @@ -595,7 +595,7 @@ private: std::lock_guard lock(m_statsMutex); XRPL_ASSERT( counts.size() == m_stats.trafficGauges.size(), - "ripple::OverlayImpl::collect_metrics : counts size do match"); + "xrpl::OverlayImpl::collect_metrics : counts size do match"); for (auto const& [key, value] : counts) { @@ -607,7 +607,7 @@ private: XRPL_ASSERT( gauge.name == value.name, - "ripple::OverlayImpl::collect_metrics : gauge and counter " + "xrpl::OverlayImpl::collect_metrics : gauge and counter " "match"); gauge.bytesIn = value.bytesIn; @@ -620,6 +620,6 @@ private: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 7adfef4064..c92a95149e 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -33,7 +33,7 @@ using namespace std::chrono_literals; -namespace ripple { +namespace xrpl { namespace { /** The threshold above which we treat a peer connection as high latency */ @@ -562,7 +562,7 @@ PeerImp::fail(std::string const& name, error_code ec) { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::fail : strand in this thread"); + "xrpl::PeerImp::fail : strand in this thread"); if (!socket_.is_open()) return; @@ -601,7 +601,7 @@ PeerImp::tryAsyncShutdown() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::tryAsyncShutdown : strand in this thread"); + "xrpl::PeerImp::tryAsyncShutdown : strand in this thread"); if (!shutdown_ || shutdownStarted_) return; @@ -625,7 +625,7 @@ PeerImp::shutdown() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::shutdown: strand in this thread"); + "xrpl::PeerImp::shutdown: strand in this thread"); if (!socket_.is_open() || shutdown_) return; @@ -668,7 +668,7 @@ PeerImp::close() { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::close : strand in this thread"); + "xrpl::PeerImp::close : strand in this thread"); if (!socket_.is_open()) return; @@ -723,7 +723,7 @@ PeerImp::onTimer(error_code const& ec) { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::onTimer : strand in this thread"); + "xrpl::PeerImp::onTimer : strand in this thread"); if (!socket_.is_open()) return; @@ -804,7 +804,7 @@ PeerImp::doAccept() { XRPL_ASSERT( read_buffer_.size() == 0, - "ripple::PeerImp::doAccept : empty read buffer"); + "xrpl::PeerImp::doAccept : empty read buffer"); JLOG(journal_.debug()) << "doAccept"; @@ -933,7 +933,7 @@ PeerImp::onReadMessage(error_code ec, std::size_t bytes_transferred) { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::onReadMessage : strand in this thread"); + "xrpl::PeerImp::onReadMessage : strand in this thread"); readPending_ = false; @@ -1005,7 +1005,7 @@ PeerImp::onReadMessage(error_code ec, std::size_t bytes_transferred) readPending_ = true; XRPL_ASSERT( - !shutdownStarted_, "ripple::PeerImp::onReadMessage : shutdown started"); + !shutdownStarted_, "xrpl::PeerImp::onReadMessage : shutdown started"); // Timeout on writes only stream_.async_read_some( @@ -1024,7 +1024,7 @@ PeerImp::onWriteMessage(error_code ec, std::size_t bytes_transferred) { XRPL_ASSERT( strand_.running_in_this_thread(), - "ripple::PeerImp::onWriteMessage : strand in this thread"); + "xrpl::PeerImp::onWriteMessage : strand in this thread"); writePending_ = false; @@ -1051,7 +1051,7 @@ PeerImp::onWriteMessage(error_code ec, std::size_t bytes_transferred) XRPL_ASSERT( !send_queue_.empty(), - "ripple::PeerImp::onWriteMessage : non-empty send buffer"); + "xrpl::PeerImp::onWriteMessage : non-empty send buffer"); send_queue_.pop(); if (shutdown_) @@ -1062,7 +1062,7 @@ PeerImp::onWriteMessage(error_code ec, std::size_t bytes_transferred) writePending_ = true; XRPL_ASSERT( !shutdownStarted_, - "ripple::PeerImp::onWriteMessage : shutdown started"); + "xrpl::PeerImp::onWriteMessage : shutdown started"); // Timeout on writes only return boost::asio::async_write( @@ -1343,7 +1343,7 @@ PeerImp::handleTransaction( { XRPL_ASSERT( eraseTxQueue != batch, - ("ripple::PeerImp::handleTransaction : valid inputs")); + ("xrpl::PeerImp::handleTransaction : valid inputs")); if (tracking_.load() == Tracking::diverged) return; @@ -2186,7 +2186,7 @@ PeerImp::onValidatorListMessage( XRPL_ASSERT( applyResult.publisherKey, - "ripple::PeerImp::onValidatorListMessage : publisher key is " + "xrpl::PeerImp::onValidatorListMessage : publisher key is " "set"); auto const& pubKey = *applyResult.publisherKey; #ifndef NDEBUG @@ -2195,7 +2195,7 @@ PeerImp::onValidatorListMessage( { XRPL_ASSERT( iter->second < applyResult.sequence, - "ripple::PeerImp::onValidatorListMessage : lower sequence"); + "xrpl::PeerImp::onValidatorListMessage : lower sequence"); } #endif publisherListSequences_[pubKey] = applyResult.sequence; @@ -2208,12 +2208,12 @@ PeerImp::onValidatorListMessage( std::lock_guard sl(recentLock_); XRPL_ASSERT( applyResult.sequence && applyResult.publisherKey, - "ripple::PeerImp::onValidatorListMessage : nonzero sequence " + "xrpl::PeerImp::onValidatorListMessage : nonzero sequence " "and set publisher key"); XRPL_ASSERT( publisherListSequences_[*applyResult.publisherKey] <= applyResult.sequence, - "ripple::PeerImp::onValidatorListMessage : maximum sequence"); + "xrpl::PeerImp::onValidatorListMessage : maximum sequence"); } #endif // !NDEBUG @@ -2226,7 +2226,7 @@ PeerImp::onValidatorListMessage( // LCOV_EXCL_START default: UNREACHABLE( - "ripple::PeerImp::onValidatorListMessage : invalid best list " + "xrpl::PeerImp::onValidatorListMessage : invalid best list " "disposition"); // LCOV_EXCL_STOP } @@ -2272,7 +2272,7 @@ PeerImp::onValidatorListMessage( // LCOV_EXCL_START default: UNREACHABLE( - "ripple::PeerImp::onValidatorListMessage : invalid worst list " + "xrpl::PeerImp::onValidatorListMessage : invalid worst list " "disposition"); // LCOV_EXCL_STOP } @@ -2327,7 +2327,7 @@ PeerImp::onValidatorListMessage( // LCOV_EXCL_START default: UNREACHABLE( - "ripple::PeerImp::onValidatorListMessage : invalid list " + "xrpl::PeerImp::onValidatorListMessage : invalid list " "disposition"); // LCOV_EXCL_STOP } @@ -2986,7 +2986,7 @@ PeerImp::checkTransaction( auto tx = std::make_shared(stx, reason, app_); XRPL_ASSERT( tx->getStatus() == NEW, - "ripple::PeerImp::checkTransaction Transaction created " + "xrpl::PeerImp::checkTransaction Transaction created " "correctly"); if (tx->getStatus() == NEW) { @@ -3089,7 +3089,7 @@ PeerImp::checkPropose( JLOG(p_journal_.trace()) << "Checking " << (isTrusted ? "trusted" : "UNTRUSTED") << " proposal"; - XRPL_ASSERT(packet, "ripple::PeerImp::checkPropose : non-null packet"); + XRPL_ASSERT(packet, "xrpl::PeerImp::checkPropose : non-null packet"); if (!cluster() && !peerPos.checkSign()) { @@ -3655,4 +3655,4 @@ PeerImp::Metrics::total_bytes() const return totalBytes_; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/PeerImp.h b/src/xrpld/overlay/detail/PeerImp.h index 78f3e46509..565c3f9d0f 100644 --- a/src/xrpld/overlay/detail/PeerImp.h +++ b/src/xrpld/overlay/detail/PeerImp.h @@ -26,7 +26,7 @@ #include #include -namespace ripple { +namespace xrpl { struct ValidatorBlobInfo; class SHAMap; @@ -202,7 +202,7 @@ private: { XRPL_ASSERT( f >= fee, - "ripple::PeerImp::ChargeWithContext::update : fee increases"); + "xrpl::PeerImp::ChargeWithContext::update : fee increases"); fee = f; if (!context.empty()) { @@ -903,6 +903,6 @@ PeerImp::sendEndpoints(FwdIt first, FwdIt last) send(std::make_shared(tm, protocol::mtENDPOINTS)); } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/PeerReservationTable.cpp b/src/xrpld/overlay/detail/PeerReservationTable.cpp index 27cf749ab1..1e3452ca17 100644 --- a/src/xrpld/overlay/detail/PeerReservationTable.cpp +++ b/src/xrpld/overlay/detail/PeerReservationTable.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { auto PeerReservation::toJson() const -> Json::Value @@ -111,4 +111,4 @@ PeerReservationTable::erase(PublicKey const& nodeId) return previous; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/PeerSet.cpp b/src/xrpld/overlay/detail/PeerSet.cpp index 9f5b810ffc..f11a07f7a3 100644 --- a/src/xrpld/overlay/detail/PeerSet.cpp +++ b/src/xrpld/overlay/detail/PeerSet.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { class PeerSetImpl : public PeerSet { @@ -29,7 +29,7 @@ public: private: // Used in this class for access to boost::asio::io_context and - // ripple::Overlay. + // xrpl::Overlay. Application& app_; beast::Journal journal_; @@ -171,4 +171,4 @@ make_DummyPeerSet(Application& app) return std::make_unique(app); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/ProtocolMessage.h b/src/xrpld/overlay/detail/ProtocolMessage.h index 0eaa4ca720..1a35deb6f0 100644 --- a/src/xrpld/overlay/detail/ProtocolMessage.h +++ b/src/xrpld/overlay/detail/ProtocolMessage.h @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { inline protocol::MessageType protocolMessageType(protocol::TMGetLedger const&) @@ -152,13 +152,13 @@ parseMessageHeader( BufferSequence const& bufs, std::size_t size) { - using namespace ripple::compression; + using namespace xrpl::compression; MessageHeader hdr; auto iter = buffersBegin(bufs); XRPL_ASSERT( iter != buffersEnd(bufs), - "ripple::detail::parseMessageHeader : non-empty buffer"); + "xrpl::detail::parseMessageHeader : non-empty buffer"); // Check valid header compressed message: // - 4 bits are the compression algorithm, 1st bit is always set to 1 @@ -256,7 +256,7 @@ parseMessageContent(MessageHeader const& header, Buffers const& buffers) std::vector payload; payload.resize(header.uncompressed_size); - auto const payloadSize = ripple::compression::decompress( + auto const payloadSize = xrpl::compression::decompress( stream, header.payload_wire_size, payload.data(), @@ -285,7 +285,7 @@ invoke(MessageHeader const& header, Buffers const& buffers, Handler& handler) if (!m) return false; - using namespace ripple::compression; + using namespace xrpl::compression; handler.onMessageBegin( header.message_type, m, @@ -465,6 +465,6 @@ invokeProtocolMessage( return result; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/ProtocolVersion.cpp b/src/xrpld/overlay/detail/ProtocolVersion.cpp index 4a5c3d10b3..a99e38e8ea 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.cpp +++ b/src/xrpld/overlay/detail/ProtocolVersion.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** The list of protocol versions we speak and we prefer to use. @@ -164,4 +164,4 @@ isProtocolSupported(ProtocolVersion const& v) v); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/ProtocolVersion.h b/src/xrpld/overlay/detail/ProtocolVersion.h index 02b8720563..ff49c89f1a 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.h +++ b/src/xrpld/overlay/detail/ProtocolVersion.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Represents a particular version of the peer-to-peer protocol. @@ -58,6 +58,6 @@ supportedProtocolVersions(); bool isProtocolSupported(ProtocolVersion const& v); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/TrafficCount.cpp b/src/xrpld/overlay/detail/TrafficCount.cpp index 03b83d29de..6fb397ea71 100644 --- a/src/xrpld/overlay/detail/TrafficCount.cpp +++ b/src/xrpld/overlay/detail/TrafficCount.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { std::unordered_map const type_lookup = { @@ -127,4 +127,4 @@ TrafficCount::categorize( return TrafficCount::category::unknown; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/TrafficCount.h b/src/xrpld/overlay/detail/TrafficCount.h index c6d10ee286..7d005c22d0 100644 --- a/src/xrpld/overlay/detail/TrafficCount.h +++ b/src/xrpld/overlay/detail/TrafficCount.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /** TrafficCount is used to count ingress and egress wire bytes and number of @@ -196,7 +196,7 @@ public: { XRPL_ASSERT( cat <= category::unknown, - "ripple::TrafficCount::addCount : valid category input"); + "xrpl::TrafficCount::addCount : valid category input"); auto it = counts_.find(cat); @@ -355,5 +355,5 @@ protected: }; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/Tuning.h b/src/xrpld/overlay/detail/Tuning.h index c78ac20572..c18d17c359 100644 --- a/src/xrpld/overlay/detail/Tuning.h +++ b/src/xrpld/overlay/detail/Tuning.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace Tuning { @@ -47,6 +47,6 @@ std::size_t constexpr readBufferBytes = 16384; } // namespace Tuning -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/TxMetrics.cpp b/src/xrpld/overlay/detail/TxMetrics.cpp index 088137c58d..10f14183a3 100644 --- a/src/xrpld/overlay/detail/TxMetrics.cpp +++ b/src/xrpld/overlay/detail/TxMetrics.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace metrics { @@ -130,4 +130,4 @@ TxMetrics::json() const } // namespace metrics -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/TxMetrics.h b/src/xrpld/overlay/detail/TxMetrics.h index 2db755466c..3c34aaf9f9 100644 --- a/src/xrpld/overlay/detail/TxMetrics.h +++ b/src/xrpld/overlay/detail/TxMetrics.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace metrics { @@ -117,6 +117,6 @@ struct TxMetrics } // namespace metrics -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/detail/ZeroCopyStream.h b/src/xrpld/overlay/detail/ZeroCopyStream.h index 2f5279a6fe..2373ea16d0 100644 --- a/src/xrpld/overlay/detail/ZeroCopyStream.h +++ b/src/xrpld/overlay/detail/ZeroCopyStream.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** Implements ZeroCopyInputStream around a buffer sequence. @tparam Buffers A type meeting the requirements of ConstBufferSequence. @@ -188,13 +188,13 @@ void ZeroCopyOutputStream::BackUp(int count) { XRPL_ASSERT( - count <= commit_, "ripple::ZeroCopyOutputStream::BackUp : valid input"); + count <= commit_, "xrpl::ZeroCopyOutputStream::BackUp : valid input"); auto const n = commit_ - count; streambuf_.commit(n); count_ += n; commit_ = 0; } -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/make_Overlay.h b/src/xrpld/overlay/make_Overlay.h index 9bf867fba6..6c37c1c825 100644 --- a/src/xrpld/overlay/make_Overlay.h +++ b/src/xrpld/overlay/make_Overlay.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { Overlay::Setup setup_Overlay(BasicConfig const& config); @@ -25,6 +25,6 @@ make_Overlay( BasicConfig const& config, beast::insight::Collector::ptr const& collector); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/overlay/predicates.h b/src/xrpld/overlay/predicates.h index 36d0cf28b1..6683d8007f 100644 --- a/src/xrpld/overlay/predicates.h +++ b/src/xrpld/overlay/predicates.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { /** Sends a message to all peers */ struct send_always @@ -156,6 +156,6 @@ struct peer_in_set } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/PeerfinderManager.h b/src/xrpld/peerfinder/PeerfinderManager.h index bde9645efd..7a25edcce5 100644 --- a/src/xrpld/peerfinder/PeerfinderManager.h +++ b/src/xrpld/peerfinder/PeerfinderManager.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { using clock_type = beast::abstract_clock; @@ -86,7 +86,7 @@ struct Config */ static Config makeConfig( - ripple::Config const& config, + xrpl::Config const& config, std::uint16_t port, bool validationPublicKey, int ipLimit); @@ -303,6 +303,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/Slot.h b/src/xrpld/peerfinder/Slot.h index 6a8515fc29..1d5d58884a 100644 --- a/src/xrpld/peerfinder/Slot.h +++ b/src/xrpld/peerfinder/Slot.h @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Properties and state associated with a peer to peer overlay connection. */ @@ -60,6 +60,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Bootcache.cpp b/src/xrpld/peerfinder/detail/Bootcache.cpp index 3d11ee74ee..4505c02872 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.cpp +++ b/src/xrpld/peerfinder/detail/Bootcache.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { Bootcache::Bootcache(Store& store, clock_type& clock, beast::Journal journal) @@ -270,4 +270,4 @@ Bootcache::flagForUpdate() } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Bootcache.h b/src/xrpld/peerfinder/detail/Bootcache.h index b0646a21d5..42867907c1 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.h +++ b/src/xrpld/peerfinder/detail/Bootcache.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Stores IP addresses useful for gaining initial connections. @@ -68,8 +68,8 @@ private: using left_t = boost::bimaps::unordered_set_of< beast::IP::Endpoint, boost::hash, - ripple::equal_to>; - using right_t = boost::bimaps::multiset_of>; + xrpl::equal_to>; + using right_t = boost::bimaps::multiset_of>; using map_type = boost::bimap; using value_type = map_type::value_type; @@ -176,6 +176,6 @@ private: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Checker.h b/src/xrpld/peerfinder/detail/Checker.h index d8a3d667e4..277ce8c74d 100644 --- a/src/xrpld/peerfinder/detail/Checker.h +++ b/src/xrpld/peerfinder/detail/Checker.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Tests remote listening sockets to make sure they are connectible. */ @@ -210,6 +210,6 @@ Checker::remove(basic_async_op& op) } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Counts.h b/src/xrpld/peerfinder/detail/Counts.h index ec4b068802..7bb17278cc 100644 --- a/src/xrpld/peerfinder/detail/Counts.h +++ b/src/xrpld/peerfinder/detail/Counts.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Manages the count of available connections for the various slots. */ @@ -53,7 +53,7 @@ public: // Must be handshaked and in the right state XRPL_ASSERT( s.state() == Slot::connected || s.state() == Slot::accept, - "ripple::PeerFinder::Counts::can_activate : valid input state"); + "xrpl::PeerFinder::Counts::can_activate : valid input state"); if (s.fixed() || s.reserved()) return true; @@ -246,7 +246,7 @@ private: case Slot::accept: XRPL_ASSERT( s.inbound(), - "ripple::PeerFinder::Counts::adjust : input is inbound"); + "xrpl::PeerFinder::Counts::adjust : input is inbound"); m_acceptCount += n; break; @@ -254,7 +254,7 @@ private: case Slot::connected: XRPL_ASSERT( !s.inbound(), - "ripple::PeerFinder::Counts::adjust : input is not " + "xrpl::PeerFinder::Counts::adjust : input is not " "inbound"); m_attempts += n; break; @@ -279,7 +279,7 @@ private: // LCOV_EXCL_START default: UNREACHABLE( - "ripple::PeerFinder::Counts::adjust : invalid input state"); + "xrpl::PeerFinder::Counts::adjust : invalid input state"); break; // LCOV_EXCL_STOP }; @@ -322,6 +322,6 @@ private: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Endpoint.cpp b/src/xrpld/peerfinder/detail/Endpoint.cpp index 5ae3839cb5..46f4f28b88 100644 --- a/src/xrpld/peerfinder/detail/Endpoint.cpp +++ b/src/xrpld/peerfinder/detail/Endpoint.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { Endpoint::Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_) @@ -10,4 +10,4 @@ Endpoint::Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_) } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Fixed.h b/src/xrpld/peerfinder/detail/Fixed.h index c238c34477..4c89bc598e 100644 --- a/src/xrpld/peerfinder/detail/Fixed.h +++ b/src/xrpld/peerfinder/detail/Fixed.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Metadata for a Fixed slot. */ @@ -47,6 +47,6 @@ private: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Handouts.h b/src/xrpld/peerfinder/detail/Handouts.h index e88376d0d6..60789ae7ab 100644 --- a/src/xrpld/peerfinder/detail/Handouts.h +++ b/src/xrpld/peerfinder/detail/Handouts.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { namespace detail { @@ -25,7 +25,7 @@ handout_one(Target& t, HopContainer& h) { XRPL_ASSERT( !t.full(), - "ripple::PeerFinder::detail::handout_one : target is not full"); + "xrpl::PeerFinder::detail::handout_one : target is not full"); for (auto it = h.begin(); it != h.end(); ++it) { auto const& e = *it; @@ -340,6 +340,6 @@ ConnectHandouts::try_insert(beast::IP::Endpoint const& endpoint) } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Livecache.h b/src/xrpld/peerfinder/detail/Livecache.h index 2664d2cbf3..0927593ed1 100644 --- a/src/xrpld/peerfinder/detail/Livecache.h +++ b/src/xrpld/peerfinder/detail/Livecache.h @@ -15,7 +15,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { template @@ -417,7 +417,7 @@ Livecache::insert(Endpoint const& ep) // XRPL_ASSERT( ep.hops <= (Tuning::maxHops + 1), - "ripple::PeerFinder::Livecache::insert : maximum input hops"); + "xrpl::PeerFinder::Livecache::insert : maximum input hops"); auto result = m_cache.emplace(ep.address, ep); Element& e(result.first->second); if (result.second) @@ -517,7 +517,7 @@ Livecache::hops_t::insert(Element& e) { XRPL_ASSERT( e.endpoint.hops <= Tuning::maxHops + 1, - "ripple::PeerFinder::Livecache::hops_t::insert : maximum input hops"); + "xrpl::PeerFinder::Livecache::hops_t::insert : maximum input hops"); // This has security implications without a shuffle m_lists[e.endpoint.hops].push_front(e); ++m_hist[e.endpoint.hops]; @@ -529,7 +529,7 @@ Livecache::hops_t::reinsert(Element& e, std::uint32_t numHops) { XRPL_ASSERT( numHops <= Tuning::maxHops + 1, - "ripple::PeerFinder::Livecache::hops_t::reinsert : maximum hops input"); + "xrpl::PeerFinder::Livecache::hops_t::reinsert : maximum hops input"); auto& list = m_lists[e.endpoint.hops]; list.erase(list.iterator_to(e)); @@ -551,6 +551,6 @@ Livecache::hops_t::remove(Element& e) } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index a4ec77fd96..50026cc886 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** The Logic for maintaining the list of Slot addresses. @@ -288,7 +288,7 @@ public: // Remote address must not already exist XRPL_ASSERT( result.second, - "ripple::PeerFinder::Logic::new_inbound_slot : remote endpoint " + "xrpl::PeerFinder::Logic::new_inbound_slot : remote endpoint " "inserted"); // Add to the connected address list connectedAddresses_.emplace(remote_endpoint.address()); @@ -326,7 +326,7 @@ public: // Remote address must not already exist XRPL_ASSERT( result.second, - "ripple::PeerFinder::Logic::new_outbound_slot : remote endpoint " + "xrpl::PeerFinder::Logic::new_outbound_slot : remote endpoint " "inserted"); // Add to the connected address list @@ -353,7 +353,7 @@ public: // The object must exist in our table XRPL_ASSERT( slots_.find(slot->remote_endpoint()) != slots_.end(), - "ripple::PeerFinder::Logic::onConnected : valid slot input"); + "xrpl::PeerFinder::Logic::onConnected : valid slot input"); // Assign the local endpoint now that it's known slot->local_endpoint(local_endpoint); @@ -364,7 +364,7 @@ public: { XRPL_ASSERT( iter->second->local_endpoint() == slot->remote_endpoint(), - "ripple::PeerFinder::Logic::onConnected : local and remote " + "xrpl::PeerFinder::Logic::onConnected : local and remote " "endpoints do match"); JLOG(journal.warn()) << "Logic dropping as self connect"; return false; @@ -393,11 +393,11 @@ public: // The object must exist in our table XRPL_ASSERT( slots_.find(slot->remote_endpoint()) != slots_.end(), - "ripple::PeerFinder::Logic::activate : valid slot input"); + "xrpl::PeerFinder::Logic::activate : valid slot input"); // Must be accepted or connected XRPL_ASSERT( slot->state() == Slot::accept || slot->state() == Slot::connected, - "ripple::PeerFinder::Logic::activate : valid slot state"); + "xrpl::PeerFinder::Logic::activate : valid slot state"); // Check for duplicate connection by key if (keys_.find(key) != keys_.end()) @@ -427,7 +427,7 @@ public: // Public key must not already exist XRPL_ASSERT( inserted, - "ripple::PeerFinder::Logic::activate : public key inserted"); + "xrpl::PeerFinder::Logic::activate : public key inserted"); } // Change state and update counts @@ -792,12 +792,12 @@ public: // The object must exist in our table XRPL_ASSERT( slots_.find(slot->remote_endpoint()) != slots_.end(), - "ripple::PeerFinder::Logic::on_endpoints : valid slot input"); + "xrpl::PeerFinder::Logic::on_endpoints : valid slot input"); // Must be handshaked! XRPL_ASSERT( slot->state() == Slot::active, - "ripple::PeerFinder::Logic::on_endpoints : valid slot state"); + "xrpl::PeerFinder::Logic::on_endpoints : valid slot state"); clock_type::time_point const now(m_clock.now()); @@ -811,7 +811,7 @@ public: { XRPL_ASSERT( ep.hops, - "ripple::PeerFinder::Logic::on_endpoints : nonzero hops"); + "xrpl::PeerFinder::Logic::on_endpoints : nonzero hops"); slot->recent.insert(ep.address, ep.hops); @@ -964,7 +964,7 @@ public: // LCOV_EXCL_START default: UNREACHABLE( - "ripple::PeerFinder::Logic::on_closed : invalid slot " + "xrpl::PeerFinder::Logic::on_closed : invalid slot " "state"); break; // LCOV_EXCL_STOP @@ -1264,6 +1264,6 @@ Logic::onRedirects( } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp b/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp index 44e4f64197..726c18fdc0 100644 --- a/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp +++ b/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { Config::Config() @@ -68,7 +68,7 @@ Config::onWrite(beast::PropertyStream::Map& map) Config Config::makeConfig( - ripple::Config const& cfg, + xrpl::Config const& cfg, std::uint16_t port, bool validationPublicKey, int ipLimit) @@ -129,4 +129,4 @@ Config::makeConfig( } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/PeerfinderManager.cpp b/src/xrpld/peerfinder/detail/PeerfinderManager.cpp index 05a9a89362..17faf35351 100644 --- a/src/xrpld/peerfinder/detail/PeerfinderManager.cpp +++ b/src/xrpld/peerfinder/detail/PeerfinderManager.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { class ManagerImp : public Manager @@ -266,4 +266,4 @@ make_Manager( } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SlotImp.cpp b/src/xrpld/peerfinder/detail/SlotImp.cpp index be08bcff7c..ac2ae25d46 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.cpp +++ b/src/xrpld/peerfinder/detail/SlotImp.cpp @@ -2,7 +2,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { SlotImp::SlotImp( @@ -47,29 +47,29 @@ SlotImp::state(State state_) // Must go through activate() to set active state XRPL_ASSERT( state_ != active, - "ripple::PeerFinder::SlotImp::state : input state is not active"); + "xrpl::PeerFinder::SlotImp::state : input state is not active"); // The state must be different XRPL_ASSERT( state_ != m_state, - "ripple::PeerFinder::SlotImp::state : input state is different from " + "xrpl::PeerFinder::SlotImp::state : input state is different from " "current"); // You can't transition into the initial states XRPL_ASSERT( state_ != accept && state_ != connect, - "ripple::PeerFinder::SlotImp::state : input state is not an initial"); + "xrpl::PeerFinder::SlotImp::state : input state is not an initial"); // Can only become connected from outbound connect state XRPL_ASSERT( state_ != connected || (!m_inbound && m_state == connect), - "ripple::PeerFinder::SlotImp::state : input state is not connected an " + "xrpl::PeerFinder::SlotImp::state : input state is not connected an " "invalid state"); // Can't gracefully close on an outbound connection attempt XRPL_ASSERT( state_ != closing || m_state != connect, - "ripple::PeerFinder::SlotImp::state : input state is not closing an " + "xrpl::PeerFinder::SlotImp::state : input state is not closing an " "invalid state"); m_state = state_; @@ -81,7 +81,7 @@ SlotImp::activate(clock_type::time_point const& now) // Can only become active from the accept or connected state XRPL_ASSERT( m_state == accept || m_state == connected, - "ripple::PeerFinder::SlotImp::activate : valid state"); + "xrpl::PeerFinder::SlotImp::activate : valid state"); m_state = active; whenAcceptEndpoints = now; @@ -131,4 +131,4 @@ SlotImp::recent_t::expire() } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SlotImp.h b/src/xrpld/peerfinder/detail/SlotImp.h index 9898ca490d..cb5ce87202 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.h +++ b/src/xrpld/peerfinder/detail/SlotImp.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { class SlotImp : public Slot @@ -195,6 +195,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Source.h b/src/xrpld/peerfinder/detail/Source.h index b6971790b3..1fe33e053a 100644 --- a/src/xrpld/peerfinder/detail/Source.h +++ b/src/xrpld/peerfinder/detail/Source.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** A static or dynamic source of peer addresses. @@ -45,6 +45,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/SourceStrings.cpp b/src/xrpld/peerfinder/detail/SourceStrings.cpp index 0c7431917a..772ec2d485 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.cpp +++ b/src/xrpld/peerfinder/detail/SourceStrings.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { class SourceStringsImp : public SourceStrings @@ -49,4 +49,4 @@ SourceStrings::New(std::string const& name, Strings const& strings) } } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SourceStrings.h b/src/xrpld/peerfinder/detail/SourceStrings.h index cbd03ed352..2babe1d616 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.h +++ b/src/xrpld/peerfinder/detail/SourceStrings.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Provides addresses from a static set of strings. */ @@ -21,6 +21,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Store.h b/src/xrpld/peerfinder/detail/Store.h index 738462c9c3..d3b283eabf 100644 --- a/src/xrpld/peerfinder/detail/Store.h +++ b/src/xrpld/peerfinder/detail/Store.h @@ -1,7 +1,7 @@ #ifndef XRPL_PEERFINDER_STORE_H_INCLUDED #define XRPL_PEERFINDER_STORE_H_INCLUDED -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Abstract persistence for PeerFinder data. */ @@ -30,6 +30,6 @@ public: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/StoreSqdb.h b/src/xrpld/peerfinder/detail/StoreSqdb.h index 1d87545522..074428c0bc 100644 --- a/src/xrpld/peerfinder/detail/StoreSqdb.h +++ b/src/xrpld/peerfinder/detail/StoreSqdb.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Database persistence for PeerFinder using SQLite */ @@ -89,6 +89,6 @@ private: }; } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/detail/Tuning.h b/src/xrpld/peerfinder/detail/Tuning.h index 856a11a9fe..ba9cf9e615 100644 --- a/src/xrpld/peerfinder/detail/Tuning.h +++ b/src/xrpld/peerfinder/detail/Tuning.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Heuristically tuned constants. */ @@ -116,6 +116,6 @@ std::chrono::seconds constexpr recentAttemptDuration(60); /** @} */ } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/peerfinder/make_Manager.h b/src/xrpld/peerfinder/make_Manager.h index e4bd571261..a86e6d4ccb 100644 --- a/src/xrpld/peerfinder/make_Manager.h +++ b/src/xrpld/peerfinder/make_Manager.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace PeerFinder { /** Create a new Manager. */ @@ -20,6 +20,6 @@ make_Manager( beast::insight::Collector::ptr const& collector); } // namespace PeerFinder -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/perflog/detail/PerfLogImp.cpp b/src/xrpld/perflog/detail/PerfLogImp.cpp index 8d6d68137a..4c0c4d2f6f 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.cpp +++ b/src/xrpld/perflog/detail/PerfLogImp.cpp @@ -18,7 +18,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace perf { PerfLogImp::Counters::Counters( @@ -36,7 +36,7 @@ PerfLogImp::Counters::Counters( // Ensure that no other function populates this entry. // LCOV_EXCL_START UNREACHABLE( - "ripple::perf::PerfLogImp::Counters::Counters : failed to " + "xrpl::perf::PerfLogImp::Counters::Counters : failed to " "insert label"); // LCOV_EXCL_STOP } @@ -53,7 +53,7 @@ PerfLogImp::Counters::Counters( // Ensure that no other function populates this entry. // LCOV_EXCL_START UNREACHABLE( - "ripple::perf::PerfLogImp::Counters::Counters : failed to " + "xrpl::perf::PerfLogImp::Counters::Counters : failed to " "insert job type"); // LCOV_EXCL_STOP } @@ -315,7 +315,7 @@ PerfLogImp::rpcStart(std::string const& method, std::uint64_t const requestId) if (counter == counters_.rpc_.end()) { // LCOV_EXCL_START - UNREACHABLE("ripple::perf::PerfLogImp::rpcStart : valid method input"); + UNREACHABLE("xrpl::perf::PerfLogImp::rpcStart : valid method input"); return; // LCOV_EXCL_STOP } @@ -339,7 +339,7 @@ PerfLogImp::rpcEnd( if (counter == counters_.rpc_.end()) { // LCOV_EXCL_START - UNREACHABLE("ripple::perf::PerfLogImp::rpcEnd : valid method input"); + UNREACHABLE("xrpl::perf::PerfLogImp::rpcEnd : valid method input"); return; // LCOV_EXCL_STOP } @@ -356,7 +356,7 @@ PerfLogImp::rpcEnd( { // LCOV_EXCL_START UNREACHABLE( - "ripple::perf::PerfLogImp::rpcEnd : valid requestId input"); + "xrpl::perf::PerfLogImp::rpcEnd : valid requestId input"); // LCOV_EXCL_STOP } } @@ -376,8 +376,7 @@ PerfLogImp::jobQueue(JobType const type) if (counter == counters_.jq_.end()) { // LCOV_EXCL_START - UNREACHABLE( - "ripple::perf::PerfLogImp::jobQueue : valid job type input"); + UNREACHABLE("xrpl::perf::PerfLogImp::jobQueue : valid job type input"); return; // LCOV_EXCL_STOP } @@ -396,8 +395,7 @@ PerfLogImp::jobStart( if (counter == counters_.jq_.end()) { // LCOV_EXCL_START - UNREACHABLE( - "ripple::perf::PerfLogImp::jobStart : valid job type input"); + UNREACHABLE("xrpl::perf::PerfLogImp::jobStart : valid job type input"); return; // LCOV_EXCL_STOP } @@ -419,8 +417,7 @@ PerfLogImp::jobFinish(JobType const type, microseconds dur, int instance) if (counter == counters_.jq_.end()) { // LCOV_EXCL_START - UNREACHABLE( - "ripple::perf::PerfLogImp::jobFinish : valid job type input"); + UNREACHABLE("xrpl::perf::PerfLogImp::jobFinish : valid job type input"); return; // LCOV_EXCL_STOP } @@ -511,4 +508,4 @@ make_PerfLog( } } // namespace perf -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/perflog/detail/PerfLogImp.h b/src/xrpld/perflog/detail/PerfLogImp.h index d8e5e7943d..740d7ea952 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.h +++ b/src/xrpld/perflog/detail/PerfLogImp.h @@ -17,7 +17,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace perf { /** A box coupling data with a mutex for locking access to it. */ @@ -103,7 +103,7 @@ class PerfLogImp : public PerfLog Application& app_; beast::Journal const j_; std::function const signalStop_; - Counters counters_{ripple::RPC::getHandlerNames(), JobTypes::instance()}; + Counters counters_{xrpl::RPC::getHandlerNames(), JobTypes::instance()}; std::ofstream logFile_; std::thread thread_; std::mutex mutex_; @@ -185,6 +185,6 @@ public: }; } // namespace perf -} // namespace ripple +} // namespace xrpl #endif // XRPL_BASICS_PERFLOGIMP_H diff --git a/src/xrpld/rpc/BookChanges.h b/src/xrpld/rpc/BookChanges.h index c30dadb9fe..dc20b60c49 100644 --- a/src/xrpld/rpc/BookChanges.h +++ b/src/xrpld/rpc/BookChanges.h @@ -14,7 +14,7 @@ namespace Json { class Value; } -namespace ripple { +namespace xrpl { class ReadView; class Transaction; @@ -205,6 +205,6 @@ computeBookChanges(std::shared_ptr const& lpAccepted) } } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/CTID.h b/src/xrpld/rpc/CTID.h index 0fbd15601e..b7f25894ee 100644 --- a/src/xrpld/rpc/CTID.h +++ b/src/xrpld/rpc/CTID.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -113,6 +113,6 @@ decodeCTID(T const ctid) noexcept } } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 1faafa1627..8bb0bd3cbc 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; class NetworkOPs; @@ -53,6 +53,6 @@ struct GRPCContext : public Context }; } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/DeliveredAmount.h b/src/xrpld/rpc/DeliveredAmount.h index 25af5c084e..fbd2545963 100644 --- a/src/xrpld/rpc/DeliveredAmount.h +++ b/src/xrpld/rpc/DeliveredAmount.h @@ -11,7 +11,7 @@ namespace Json { class Value; } -namespace ripple { +namespace xrpl { class ReadView; class Transaction; @@ -62,6 +62,6 @@ getDeliveredAmount( /** @} */ } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/GRPCHandlers.h b/src/xrpld/rpc/GRPCHandlers.h index e9bce3ccbf..f3e8d74f9d 100644 --- a/src/xrpld/rpc/GRPCHandlers.h +++ b/src/xrpld/rpc/GRPCHandlers.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /* * These handlers are for gRPC. They each take in a protobuf message that is @@ -32,6 +32,6 @@ std::pair doLedgerDiffGrpc( RPC::GRPCContext& context); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/InfoSub.h b/src/xrpld/rpc/InfoSub.h index f3affd40ae..97ff266364 100644 --- a/src/xrpld/rpc/InfoSub.h +++ b/src/xrpld/rpc/InfoSub.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { // Operations that clients may wish to perform against the network // Master operational handler, server sequencer, network tracker @@ -237,6 +237,6 @@ private: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/MPTokenIssuanceID.h b/src/xrpld/rpc/MPTokenIssuanceID.h index ad96c2b78b..85f44e79b8 100644 --- a/src/xrpld/rpc/MPTokenIssuanceID.h +++ b/src/xrpld/rpc/MPTokenIssuanceID.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -37,6 +37,6 @@ insertMPTokenIssuanceID( /** @} */ } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/Output.h b/src/xrpld/rpc/Output.h index 0b0d62bbf9..431cbb6bbf 100644 --- a/src/xrpld/rpc/Output.h +++ b/src/xrpld/rpc/Output.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { using Output = std::function; @@ -15,6 +15,6 @@ stringOutput(std::string& s) } } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/README.md b/src/xrpld/rpc/README.md index 5bb9655a76..749f3d0ed1 100644 --- a/src/xrpld/rpc/README.md +++ b/src/xrpld/rpc/README.md @@ -15,7 +15,7 @@ For this purpose, the rippled RPC handler allows _suspension with continuation_ ## The classes. -Suspension with continuation uses four `std::function`s in the `ripple::RPC` +Suspension with continuation uses four `std::function`s in the `xrpl::RPC` namespace: using Callback = std::function ; diff --git a/src/xrpld/rpc/RPCCall.h b/src/xrpld/rpc/RPCCall.h index b27e60c8ea..2ee9e33cf3 100644 --- a/src/xrpld/rpc/RPCCall.h +++ b/src/xrpld/rpc/RPCCall.h @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { // This a trusted interface, the user is expected to provide valid input to // perform valid requests. Error catching and reporting is not a requirement of @@ -66,6 +66,6 @@ rpcClient( unsigned int apiVersion, std::unordered_map const& headers = {}); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/RPCHandler.h b/src/xrpld/rpc/RPCHandler.h index c6f4dfc6bd..0b91528605 100644 --- a/src/xrpld/rpc/RPCHandler.h +++ b/src/xrpld/rpc/RPCHandler.h @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { struct JsonContext; @@ -17,6 +17,6 @@ Role roleRequired(unsigned int version, bool betaEnabled, std::string const& method); } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/RPCSub.h b/src/xrpld/rpc/RPCSub.h index ea0cc993e8..b6bb32aaf3 100644 --- a/src/xrpld/rpc/RPCSub.h +++ b/src/xrpld/rpc/RPCSub.h @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { /** Subscription object for JSON RPC. */ class RPCSub : public InfoSub @@ -33,6 +33,6 @@ make_RPCSub( std::string const& strPassword, Logs& logs); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/Request.h b/src/xrpld/rpc/Request.h index ceab2944d7..c7b2cedef0 100644 --- a/src/xrpld/rpc/Request.h +++ b/src/xrpld/rpc/Request.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { class Application; @@ -51,6 +51,6 @@ private: }; } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/Role.h b/src/xrpld/rpc/Role.h index 6967474f17..04b288600a 100644 --- a/src/xrpld/rpc/Role.h +++ b/src/xrpld/rpc/Role.h @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { /** Indicates the level of administrative permission to grant. * IDENTIFIED role has unlimited resources but cannot perform some @@ -70,6 +70,6 @@ ipAllowed( std::string_view forwardedFor(http_request_type const& request); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/ServerHandler.h b/src/xrpld/rpc/ServerHandler.h index 4cf5a0ce88..0ad3144caf 100644 --- a/src/xrpld/rpc/ServerHandler.h +++ b/src/xrpld/rpc/ServerHandler.h @@ -20,7 +20,7 @@ #include #include -namespace ripple { +namespace xrpl { inline bool operator<(Port const& lhs, Port const& rhs) @@ -210,6 +210,6 @@ make_ServerHandler( Resource::Manager&, CollectorManager& cm); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/Status.h b/src/xrpld/rpc/Status.h index 2ff804f17c..f4ffcae9b2 100644 --- a/src/xrpld/rpc/Status.h +++ b/src/xrpld/rpc/Status.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { /** Status represents the results of an operation that might fail. @@ -77,7 +77,7 @@ public: toTER() const { XRPL_ASSERT( - type_ == Type::TER, "ripple::RPC::Status::toTER : type is TER"); + type_ == Type::TER, "xrpl::RPC::Status::toTER : type is TER"); return TER::fromInt(code_); } @@ -88,7 +88,7 @@ public: { XRPL_ASSERT( type_ == Type::error_code_i, - "ripple::RPC::Status::toTER : type is error code"); + "xrpl::RPC::Status::toTER : type is error code"); return error_code_i(code_); } @@ -139,6 +139,6 @@ private: }; } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/DeliveredAmount.cpp b/src/xrpld/rpc/detail/DeliveredAmount.cpp index bcc7c4389d..7a0629a42d 100644 --- a/src/xrpld/rpc/detail/DeliveredAmount.cpp +++ b/src/xrpld/rpc/detail/DeliveredAmount.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { /* @@ -186,4 +186,4 @@ insertDeliveredAmount( } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Handler.cpp b/src/xrpld/rpc/detail/Handler.cpp index a4a1be3343..2000af5e81 100644 --- a/src/xrpld/rpc/detail/Handler.cpp +++ b/src/xrpld/rpc/detail/Handler.cpp @@ -7,7 +7,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { namespace { @@ -21,7 +21,7 @@ byRef(Function const& f) if (result.type() != Json::objectValue) { // LCOV_EXCL_START - UNREACHABLE("ripple::RPC::byRef : result is object"); + UNREACHABLE("xrpl::RPC::byRef : result is object"); result = RPC::makeObjectValue(result); // LCOV_EXCL_STOP } @@ -37,7 +37,7 @@ handle(JsonContext& context, Object& object) XRPL_ASSERT( context.apiVersion >= HandlerImpl::minApiVer && context.apiVersion <= HandlerImpl::maxApiVer, - "ripple::RPC::handle : valid API version"); + "xrpl::RPC::handle : valid API version"); HandlerImpl handler(context); auto status = handler.check(); @@ -193,10 +193,10 @@ private: { XRPL_ASSERT( minVer <= maxVer, - "ripple::RPC::HandlerTable : valid API version range"); + "xrpl::RPC::HandlerTable : valid API version range"); XRPL_ASSERT( maxVer <= RPC::apiMaximumValidVersion, - "ripple::RPC::HandlerTable : valid max API version"); + "xrpl::RPC::HandlerTable : valid max API version"); return std::any_of( range.first, @@ -304,4 +304,4 @@ getHandlerNames() } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Handler.h b/src/xrpld/rpc/detail/Handler.h index 8178d83dee..dac18c966f 100644 --- a/src/xrpld/rpc/detail/Handler.h +++ b/src/xrpld/rpc/detail/Handler.h @@ -13,7 +13,7 @@ namespace Json { class Object; } -namespace ripple { +namespace xrpl { namespace RPC { // Under what condition can we call this RPC? @@ -121,6 +121,6 @@ conditionMet(Condition condition_required, T& context) } } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/InfoSub.cpp b/src/xrpld/rpc/detail/InfoSub.cpp index 14696292f8..a0869b9d96 100644 --- a/src/xrpld/rpc/detail/InfoSub.cpp +++ b/src/xrpld/rpc/detail/InfoSub.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { // This is the primary interface into the "client" portion of the program. // Code that wants to do normal operations on the network such as @@ -126,8 +126,8 @@ unsigned int InfoSub::getApiVersion() const noexcept { XRPL_ASSERT( - apiVersion_ > 0, "ripple::InfoSub::getApiVersion : valid API version"); + apiVersion_ > 0, "xrpl::InfoSub::getApiVersion : valid API version"); return apiVersion_; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/LegacyPathFind.cpp b/src/xrpld/rpc/detail/LegacyPathFind.cpp index c3bcd928cd..e06ae4062d 100644 --- a/src/xrpld/rpc/detail/LegacyPathFind.cpp +++ b/src/xrpld/rpc/detail/LegacyPathFind.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { LegacyPathFind::LegacyPathFind(bool isAdmin, Application& app) : m_isOk(false) @@ -50,4 +50,4 @@ LegacyPathFind::~LegacyPathFind() std::atomic LegacyPathFind::inProgress(0); } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/LegacyPathFind.h b/src/xrpld/rpc/detail/LegacyPathFind.h index 40fc11aee8..d175e7c532 100644 --- a/src/xrpld/rpc/detail/LegacyPathFind.h +++ b/src/xrpld/rpc/detail/LegacyPathFind.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Application; @@ -28,6 +28,6 @@ private: }; } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp b/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp index 440b783316..3c7f2c5fc3 100644 --- a/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp +++ b/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp @@ -1,6 +1,6 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { @@ -56,4 +56,4 @@ insertMPTokenIssuanceID( } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCCall.cpp b/src/xrpld/rpc/detail/RPCCall.cpp index 185043302a..fa1a089efb 100644 --- a/src/xrpld/rpc/detail/RPCCall.cpp +++ b/src/xrpld/rpc/detail/RPCCall.cpp @@ -28,7 +28,7 @@ #include #include -namespace ripple { +namespace xrpl { class RPCParser; @@ -102,7 +102,7 @@ private: jvParseCurrencyIssuer(std::string const& strCurrencyIssuer) { // Matches a sequence of 3 characters from - // `ripple::detail::isoCharSet` (the currency), + // `xrpl::detail::isoCharSet` (the currency), // optionally followed by a forward slash and some other characters // (the issuer). // https://www.boost.org/doc/libs/1_82_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html @@ -140,7 +140,7 @@ private: std::string const& strPk, TokenType type = TokenType::AccountPublic) { - if (parseBase58(type, strPk)) + if (parseBase58(type, strPk)) return true; auto pkHex = strUnHex(strPk); @@ -1033,7 +1033,7 @@ private: // Parameter count should have already been verified. XRPL_ASSERT( jvParams.size() == 2, - "ripple::RPCParser::parseTransactionEntry : valid parameter count"); + "xrpl::RPCParser::parseTransactionEntry : valid parameter count"); std::string const txHash = jvParams[0u].asString(); if (txHash.length() != 64) @@ -1516,7 +1516,7 @@ rpcClient( } else { - ripple::ServerHandler::Setup setup; + xrpl::ServerHandler::Setup setup; try { setup = setup_ServerHandler( @@ -1720,4 +1720,4 @@ fromNetwork( } // namespace RPCCall -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index fca926a1c7..eb5b3f7340 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -22,7 +22,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { namespace { @@ -250,4 +250,4 @@ roleRequired(unsigned int version, bool betaEnabled, std::string const& method) } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index a9c75a05e8..d10f4f9a5a 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -15,7 +15,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { std::uint64_t @@ -355,7 +355,7 @@ chooseLedgerEntryType(Json::Value const& params) rpcINVALID_PARAMS, "Invalid field 'type', not string."}; XRPL_ASSERT( result.first.type() == RPC::Status::Type::error_code_i, - "ripple::RPC::chooseLedgerEntryType : first valid result type"); + "xrpl::RPC::chooseLedgerEntryType : first valid result type"); return result; } @@ -374,7 +374,7 @@ chooseLedgerEntryType(Json::Value const& params) RPC::Status{rpcINVALID_PARAMS, "Invalid field 'type'."}; XRPL_ASSERT( result.first.type() == RPC::Status::Type::error_code_i, - "ripple::RPC::chooseLedgerEntryType : second valid result " + "xrpl::RPC::chooseLedgerEntryType : second valid result " "type"); return result; } @@ -400,4 +400,4 @@ isAccountObjectsValidType(LedgerEntryType const& type) } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index 3fa652d93b..0f26ca8667 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { class ReadView; @@ -160,6 +160,6 @@ keypairForSignature( } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp index d2bf7d5349..c58a7ba561 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { namespace { @@ -277,7 +277,7 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context const& context) } XRPL_ASSERT( - !ledger->open(), "ripple::RPC::getLedger : validated is not open"); + !ledger->open(), "xrpl::RPC::getLedger : validated is not open"); } else { @@ -285,13 +285,13 @@ getLedger(T& ledger, LedgerShortcut shortcut, Context const& context) { ledger = context.ledgerMaster.getCurrentLedger(); XRPL_ASSERT( - ledger->open(), "ripple::RPC::getLedger : current is open"); + ledger->open(), "xrpl::RPC::getLedger : current is open"); } else if (shortcut == LedgerShortcut::Closed) { ledger = context.ledgerMaster.getClosedLedger(); XRPL_ASSERT( - !ledger->open(), "ripple::RPC::getLedger : closed is not open"); + !ledger->open(), "xrpl::RPC::getLedger : closed is not open"); } else { @@ -449,8 +449,7 @@ getOrAcquireLedger(RPC::JsonContext const& context) auto const refIndex = getCandidateLedger(ledgerIndex); auto refHash = hashOfSeq(*ledger, refIndex, j); XRPL_ASSERT( - refHash, - "ripple::RPC::getOrAcquireLedger : nonzero ledger hash"); + refHash, "xrpl::RPC::getOrAcquireLedger : nonzero ledger hash"); ledger = ledgerMaster.getLedgerByHash(*refHash); if (!ledger) @@ -485,8 +484,7 @@ getOrAcquireLedger(RPC::JsonContext const& context) neededHash = hashOfSeq(*ledger, ledgerIndex, j); } XRPL_ASSERT( - neededHash, - "ripple::RPC::getOrAcquireLedger : nonzero needed hash"); + neededHash, "xrpl::RPC::getOrAcquireLedger : nonzero needed hash"); ledgerHash = neededHash ? *neededHash : beast::zero; // kludge } @@ -510,4 +508,4 @@ getOrAcquireLedger(RPC::JsonContext const& context) } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 0a070a16ab..8fe81ef024 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { class ReadView; class Transaction; @@ -176,6 +176,6 @@ getOrAcquireLedger(RPC::JsonContext const& context); } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/RPCSub.cpp b/src/xrpld/rpc/detail/RPCSub.cpp index 9477eab231..5d008e4ee6 100644 --- a/src/xrpld/rpc/detail/RPCSub.cpp +++ b/src/xrpld/rpc/detail/RPCSub.cpp @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { // Subscription object for JSON-RPC class RPCSubImp : public RPCSub @@ -205,4 +205,4 @@ make_RPCSub( logs); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Role.cpp b/src/xrpld/rpc/detail/Role.cpp index 95549068a0..28d00245a5 100644 --- a/src/xrpld/rpc/detail/Role.cpp +++ b/src/xrpld/rpc/detail/Role.cpp @@ -5,14 +5,14 @@ #include -namespace ripple { +namespace xrpl { bool passwordUnrequiredOrSentCorrect(Port const& port, Json::Value const& params) { XRPL_ASSERT( !(port.admin_nets_v4.empty() && port.admin_nets_v6.empty()), - "ripple::passwordUnrequiredOrSentCorrect : non-empty admin nets"); + "xrpl::passwordUnrequiredOrSentCorrect : non-empty admin nets"); bool const passwordRequired = (!port.admin_user.empty() || !port.admin_password.empty()); @@ -292,4 +292,4 @@ forwardedFor(http_request_type const& request) return {}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index de44f93749..91b709bc06 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -35,7 +35,7 @@ #include #include -namespace ripple { +namespace xrpl { class Peer; class LedgerMaster; @@ -1276,4 +1276,4 @@ make_ServerHandler( cm); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Status.cpp b/src/xrpld/rpc/detail/Status.cpp index 3b5aded8b2..ce3082f0fa 100644 --- a/src/xrpld/rpc/detail/Status.cpp +++ b/src/xrpld/rpc/detail/Status.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { std::string @@ -19,7 +19,7 @@ Status::codeString() const std::string s1, s2; [[maybe_unused]] auto const success = transResultInfo(toTER(), s1, s2); - XRPL_ASSERT(success, "ripple::RPC::codeString : valid TER result"); + XRPL_ASSERT(success, "xrpl::RPC::codeString : valid TER result"); return s1 + ": " + s2; } @@ -33,7 +33,7 @@ Status::codeString() const } // LCOV_EXCL_START - UNREACHABLE("ripple::RPC::codeString : invalid type"); + UNREACHABLE("xrpl::RPC::codeString : invalid type"); return ""; // LCOV_EXCL_STOP } @@ -80,4 +80,4 @@ Status::toString() const } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/TransactionSign.cpp b/src/xrpld/rpc/detail/TransactionSign.cpp index 8ca58d671e..252e5fc91e 100644 --- a/src/xrpld/rpc/detail/TransactionSign.cpp +++ b/src/xrpld/rpc/detail/TransactionSign.cpp @@ -24,7 +24,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { namespace detail { @@ -654,7 +654,7 @@ transactionPreProcessImpl( { Serializer s = buildMultiSigningData(*stTx, signingArgs.getSigner()); - auto multisig = ripple::sign(pk, sk, s.slice()); + auto multisig = xrpl::sign(pk, sk, s.slice()); signingArgs.moveMultiSignature(std::move(multisig)); } @@ -1206,7 +1206,7 @@ transactionSignFor( XRPL_ASSERT( signForParams.validMultiSign(), - "ripple::RPC::transactionSignFor : valid multi-signature"); + "xrpl::RPC::transactionSignFor : valid multi-signature"); { std::shared_ptr account_state = @@ -1452,4 +1452,4 @@ transactionSubmitMultiSigned( } } // namespace RPC -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index ba14ad0cdc..181737ad28 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // Forward declarations class Application; @@ -126,6 +126,6 @@ transactionSubmitMultiSigned( ProcessTransactionFn const& processTransaction); } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/Tuning.h b/src/xrpld/rpc/detail/Tuning.h index 902ba2ecf0..5837146b02 100644 --- a/src/xrpld/rpc/detail/Tuning.h +++ b/src/xrpld/rpc/detail/Tuning.h @@ -1,7 +1,7 @@ #ifndef XRPL_RPC_TUNING_H_INCLUDED #define XRPL_RPC_TUNING_H_INCLUDED -namespace ripple { +namespace xrpl { namespace RPC { /** Tuned constants. */ @@ -71,6 +71,6 @@ static int constexpr max_auto_src_cur = 88; /** @} */ } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/detail/WSInfoSub.h b/src/xrpld/rpc/detail/WSInfoSub.h index 707f81fb19..91dc47fa2b 100644 --- a/src/xrpld/rpc/detail/WSInfoSub.h +++ b/src/xrpld/rpc/detail/WSInfoSub.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { class WSInfoSub : public InfoSub { @@ -65,6 +65,6 @@ public: } }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/handlers/AMMInfo.cpp b/src/xrpld/rpc/handlers/AMMInfo.cpp index 5ea826fce5..7bf2dd7eae 100644 --- a/src/xrpld/rpc/handlers/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/AMMInfo.cpp @@ -10,7 +10,7 @@ #include -namespace ripple { +namespace xrpl { Expected getIssue(Json::Value const& v, beast::Journal j) @@ -118,12 +118,12 @@ doAMMInfo(RPC::JsonContext& context) XRPL_ASSERT( (issue1.has_value() == issue2.has_value()) && (issue1.has_value() != ammID.has_value()), - "ripple::doAMMInfo : issue1 and issue2 do match"); + "xrpl::doAMMInfo : issue1 and issue2 do match"); auto const ammKeylet = [&]() { if (issue1 && issue2) return keylet::amm(*issue1, *issue2); - XRPL_ASSERT(ammID, "ripple::doAMMInfo::ammKeylet : ammID is set"); + XRPL_ASSERT(ammID, "xrpl::doAMMInfo::ammKeylet : ammID is set"); return keylet::amm(*ammID); }(); auto const amm = ledger->read(ammKeylet); @@ -185,7 +185,7 @@ doAMMInfo(RPC::JsonContext& context) XRPL_ASSERT( !ledger->rules().enabled(fixInnerObjTemplate) || amm->isFieldPresent(sfAuctionSlot), - "ripple::doAMMInfo : auction slot is set"); + "xrpl::doAMMInfo : auction slot is set"); if (amm->isFieldPresent(sfAuctionSlot)) { auto const& auctionSlot = @@ -236,4 +236,4 @@ doAMMInfo(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountChannels.cpp b/src/xrpld/rpc/handlers/AccountChannels.cpp index 281b0ec8c4..597a6f893a 100644 --- a/src/xrpld/rpc/handlers/AccountChannels.cpp +++ b/src/xrpld/rpc/handlers/AccountChannels.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { void addChannel(Json::Value& jsonLines, SLE const& line) @@ -149,7 +149,7 @@ doAccountChannels(RPC::JsonContext& context) if (!sleCur) { // LCOV_EXCL_START - UNREACHABLE("ripple::doAccountChannels : null SLE"); + UNREACHABLE("xrpl::doAccountChannels : null SLE"); return false; // LCOV_EXCL_STOP } @@ -194,4 +194,4 @@ doAccountChannels(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountCurrenciesHandler.cpp b/src/xrpld/rpc/handlers/AccountCurrenciesHandler.cpp index 10f22ad654..cc43992723 100644 --- a/src/xrpld/rpc/handlers/AccountCurrenciesHandler.cpp +++ b/src/xrpld/rpc/handlers/AccountCurrenciesHandler.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doAccountCurrencies(RPC::JsonContext& context) @@ -76,4 +76,4 @@ doAccountCurrencies(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountInfo.cpp b/src/xrpld/rpc/handlers/AccountInfo.cpp index 1bf05276f2..30d16e3099 100644 --- a/src/xrpld/rpc/handlers/AccountInfo.cpp +++ b/src/xrpld/rpc/handlers/AccountInfo.cpp @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { /** * @brief Injects JSON describing a ledger entry. @@ -179,7 +179,7 @@ doAccountInfo(RPC::JsonContext& context) name = name.substr(0, name.size() - 2); XRPL_ASSERT_PARTS( !name.empty(), - "ripple::doAccountInfo", + "xrpl::doAccountInfo", "name is not empty"); } // ValidPseudoAccounts invariant guarantees that only one field @@ -331,4 +331,4 @@ doAccountInfo(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountLines.cpp b/src/xrpld/rpc/handlers/AccountLines.cpp index b28f4d7483..fc92707aa6 100644 --- a/src/xrpld/rpc/handlers/AccountLines.cpp +++ b/src/xrpld/rpc/handlers/AccountLines.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { void addLine(Json::Value& jsonLines, RPCTrustLine const& line) @@ -173,7 +173,7 @@ doAccountLines(RPC::JsonContext& context) if (!sleCur) { // LCOV_EXCL_START - UNREACHABLE("ripple::doAccountLines : null SLE"); + UNREACHABLE("xrpl::doAccountLines : null SLE"); return false; // LCOV_EXCL_STOP } @@ -240,4 +240,4 @@ doAccountLines(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountObjects.cpp b/src/xrpld/rpc/handlers/AccountObjects.cpp index 669d96a44f..6440c78e58 100644 --- a/src/xrpld/rpc/handlers/AccountObjects.cpp +++ b/src/xrpld/rpc/handlers/AccountObjects.cpp @@ -15,7 +15,7 @@ #include -namespace ripple { +namespace xrpl { /** General RPC command that can retrieve objects in the account root. { @@ -482,4 +482,4 @@ doAccountObjects(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountOffers.cpp b/src/xrpld/rpc/handlers/AccountOffers.cpp index e8bc2bcf79..c0f29b0b8f 100644 --- a/src/xrpld/rpc/handlers/AccountOffers.cpp +++ b/src/xrpld/rpc/handlers/AccountOffers.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { void appendOfferJson(std::shared_ptr const& offer, Json::Value& offers) @@ -125,7 +125,7 @@ doAccountOffers(RPC::JsonContext& context) if (!sle) { // LCOV_EXCL_START - UNREACHABLE("ripple::doAccountOffers : null SLE"); + UNREACHABLE("xrpl::doAccountOffers : null SLE"); return false; // LCOV_EXCL_STOP } @@ -164,4 +164,4 @@ doAccountOffers(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/AccountTx.cpp b/src/xrpld/rpc/handlers/AccountTx.cpp index efb246b4d5..362bdd0eaa 100644 --- a/src/xrpld/rpc/handlers/AccountTx.cpp +++ b/src/xrpld/rpc/handlers/AccountTx.cpp @@ -19,7 +19,7 @@ #include #include -namespace ripple { +namespace xrpl { using TxnsData = RelationalDatabase::AccountTxs; using TxnsDataBinary = RelationalDatabase::MetaTxsList; @@ -289,8 +289,7 @@ populateJsonResponse( if (auto txnsData = std::get_if(&result.transactions)) { XRPL_ASSERT( - !args.binary, - "ripple::populateJsonResponse : binary is not set"); + !args.binary, "xrpl::populateJsonResponse : binary is not set"); for (auto const& [txn, txnMeta] : *txnsData) { @@ -340,7 +339,7 @@ populateJsonResponse( { // LCOV_EXCL_START UNREACHABLE( - "ripple::populateJsonResponse : missing " + "xrpl::populateJsonResponse : missing " "transaction medatata"); // LCOV_EXCL_STOP } @@ -350,7 +349,7 @@ populateJsonResponse( else { XRPL_ASSERT( - args.binary, "ripple::populateJsonResponse : binary is set"); + args.binary, "xrpl::populateJsonResponse : binary is set"); for (auto const& binaryData : std::get(result.transactions)) @@ -466,4 +465,4 @@ doAccountTxJson(RPC::JsonContext& context) return populateJsonResponse(res, args, context); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/BlackList.cpp b/src/xrpld/rpc/handlers/BlackList.cpp index 859eb1fbce..102041b8d0 100644 --- a/src/xrpld/rpc/handlers/BlackList.cpp +++ b/src/xrpld/rpc/handlers/BlackList.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doBlackList(RPC::JsonContext& context) @@ -16,4 +16,4 @@ doBlackList(RPC::JsonContext& context) return rm.getJson(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/BookOffers.cpp b/src/xrpld/rpc/handlers/BookOffers.cpp index e82b2fa345..6cbefe5dc7 100644 --- a/src/xrpld/rpc/handlers/BookOffers.cpp +++ b/src/xrpld/rpc/handlers/BookOffers.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doBookOffers(RPC::JsonContext& context) @@ -212,4 +212,4 @@ doBookChanges(RPC::JsonContext& context) return RPC::computeBookChanges(ledger); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/CanDelete.cpp b/src/xrpld/rpc/handlers/CanDelete.cpp index d07d344242..ea19736bc2 100644 --- a/src/xrpld/rpc/handlers/CanDelete.cpp +++ b/src/xrpld/rpc/handlers/CanDelete.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { // can_delete [||now|always|never] Json::Value @@ -79,4 +79,4 @@ doCanDelete(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Connect.cpp b/src/xrpld/rpc/handlers/Connect.cpp index 2c6d67c3f0..2cd3b70149 100644 --- a/src/xrpld/rpc/handlers/Connect.cpp +++ b/src/xrpld/rpc/handlers/Connect.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // ip: , @@ -51,4 +51,4 @@ doConnect(RPC::JsonContext& context) " port: " + std::to_string(iPort)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ConsensusInfo.cpp b/src/xrpld/rpc/handlers/ConsensusInfo.cpp index 8459cc6520..386ff99458 100644 --- a/src/xrpld/rpc/handlers/ConsensusInfo.cpp +++ b/src/xrpld/rpc/handlers/ConsensusInfo.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doConsensusInfo(RPC::JsonContext& context) @@ -17,4 +17,4 @@ doConsensusInfo(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/DepositAuthorized.cpp b/src/xrpld/rpc/handlers/DepositAuthorized.cpp index 7beaffaf99..8c2f7dce96 100644 --- a/src/xrpld/rpc/handlers/DepositAuthorized.cpp +++ b/src/xrpld/rpc/handlers/DepositAuthorized.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // source_account : @@ -182,4 +182,4 @@ doDepositAuthorized(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/DoManifest.cpp b/src/xrpld/rpc/handlers/DoManifest.cpp index eabdc51d56..5928947e21 100644 --- a/src/xrpld/rpc/handlers/DoManifest.cpp +++ b/src/xrpld/rpc/handlers/DoManifest.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doManifest(RPC::JsonContext& context) { @@ -56,4 +56,4 @@ doManifest(RPC::JsonContext& context) ret[jss::details] = details; return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Feature1.cpp b/src/xrpld/rpc/handlers/Feature1.cpp index f452f562c2..dc1ccaee6c 100644 --- a/src/xrpld/rpc/handlers/Feature1.cpp +++ b/src/xrpld/rpc/handlers/Feature1.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // feature : @@ -78,4 +78,4 @@ doFeature(RPC::JsonContext& context) return jvReply; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Fee1.cpp b/src/xrpld/rpc/handlers/Fee1.cpp index 8349c67875..49a36261f4 100644 --- a/src/xrpld/rpc/handlers/Fee1.cpp +++ b/src/xrpld/rpc/handlers/Fee1.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doFee(RPC::JsonContext& context) { @@ -15,10 +15,10 @@ doFee(RPC::JsonContext& context) return result; // LCOV_EXCL_START - UNREACHABLE("ripple::doFee : invalid result type"); + UNREACHABLE("xrpl::doFee : invalid result type"); RPC::inject_error(rpcINTERNAL, context.params); return context.params; // LCOV_EXCL_STOP } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/FetchInfo.cpp b/src/xrpld/rpc/handlers/FetchInfo.cpp index 9e3f61495b..0c251fe9d6 100644 --- a/src/xrpld/rpc/handlers/FetchInfo.cpp +++ b/src/xrpld/rpc/handlers/FetchInfo.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doFetchInfo(RPC::JsonContext& context) @@ -24,4 +24,4 @@ doFetchInfo(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/GatewayBalances.cpp b/src/xrpld/rpc/handlers/GatewayBalances.cpp index 88411b020e..55959d8641 100644 --- a/src/xrpld/rpc/handlers/GatewayBalances.cpp +++ b/src/xrpld/rpc/handlers/GatewayBalances.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { // Query: // 1) Specify ledger to query. @@ -271,4 +271,4 @@ doGatewayBalances(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/GetAggregatePrice.cpp b/src/xrpld/rpc/handlers/GetAggregatePrice.cpp index c74a4331fd..6d40ee707b 100644 --- a/src/xrpld/rpc/handlers/GetAggregatePrice.cpp +++ b/src/xrpld/rpc/handlers/GetAggregatePrice.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { using namespace boost::bimaps; // sorted descending by lastUpdateTime, ascending by AssetPrice @@ -361,4 +361,4 @@ doGetAggregatePrice(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/GetCounts.cpp b/src/xrpld/rpc/handlers/GetCounts.cpp index 17b2c8565b..ad158a57a5 100644 --- a/src/xrpld/rpc/handlers/GetCounts.cpp +++ b/src/xrpld/rpc/handlers/GetCounts.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { static void textTime( @@ -126,4 +126,4 @@ doGetCounts(RPC::JsonContext& context) return getCountsJson(context.app, minCount); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/GetCounts.h b/src/xrpld/rpc/handlers/GetCounts.h index aed024ca1a..0d544a4f11 100644 --- a/src/xrpld/rpc/handlers/GetCounts.h +++ b/src/xrpld/rpc/handlers/GetCounts.h @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value getCountsJson(Application& app, int minObjectCount); diff --git a/src/xrpld/rpc/handlers/Handlers.h b/src/xrpld/rpc/handlers/Handlers.h index 6f4abfd421..773186237b 100644 --- a/src/xrpld/rpc/handlers/Handlers.h +++ b/src/xrpld/rpc/handlers/Handlers.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doAccountCurrencies(RPC::JsonContext&); @@ -149,6 +149,6 @@ Json::Value doValidatorInfo(RPC::JsonContext&); Json::Value doVaultInfo(RPC::JsonContext&); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/handlers/LedgerAccept.cpp b/src/xrpld/rpc/handlers/LedgerAccept.cpp index 6221b2f7fc..8938e3f152 100644 --- a/src/xrpld/rpc/handlers/LedgerAccept.cpp +++ b/src/xrpld/rpc/handlers/LedgerAccept.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doLedgerAccept(RPC::JsonContext& context) @@ -31,4 +31,4 @@ doLedgerAccept(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerCleanerHandler.cpp b/src/xrpld/rpc/handlers/LedgerCleanerHandler.cpp index 5926bfed8f..408cd16023 100644 --- a/src/xrpld/rpc/handlers/LedgerCleanerHandler.cpp +++ b/src/xrpld/rpc/handlers/LedgerCleanerHandler.cpp @@ -5,7 +5,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doLedgerCleaner(RPC::JsonContext& context) @@ -14,4 +14,4 @@ doLedgerCleaner(RPC::JsonContext& context) return RPC::makeObjectValue("Cleaner configured"); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerClosed.cpp b/src/xrpld/rpc/handlers/LedgerClosed.cpp index 3628c0f8d6..3b93e0734f 100644 --- a/src/xrpld/rpc/handlers/LedgerClosed.cpp +++ b/src/xrpld/rpc/handlers/LedgerClosed.cpp @@ -5,13 +5,13 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doLedgerClosed(RPC::JsonContext& context) { auto ledger = context.ledgerMaster.getClosedLedger(); - XRPL_ASSERT(ledger, "ripple::doLedgerClosed : non-null closed ledger"); + XRPL_ASSERT(ledger, "xrpl::doLedgerClosed : non-null closed ledger"); Json::Value jvResult; jvResult[jss::ledger_index] = ledger->header().seq; @@ -20,4 +20,4 @@ doLedgerClosed(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerCurrent.cpp b/src/xrpld/rpc/handlers/LedgerCurrent.cpp index 84e9820ac5..21b72147c6 100644 --- a/src/xrpld/rpc/handlers/LedgerCurrent.cpp +++ b/src/xrpld/rpc/handlers/LedgerCurrent.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doLedgerCurrent(RPC::JsonContext& context) @@ -16,4 +16,4 @@ doLedgerCurrent(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerData.cpp b/src/xrpld/rpc/handlers/LedgerData.cpp index 35e5055242..5e0c9152e7 100644 --- a/src/xrpld/rpc/handlers/LedgerData.cpp +++ b/src/xrpld/rpc/handlers/LedgerData.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { // Get state nodes from a ledger // Inputs: @@ -192,4 +192,4 @@ doLedgerDataGrpc( return {response, status}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerDiff.cpp b/src/xrpld/rpc/handlers/LedgerDiff.cpp index 3628138329..61ab7da93f 100644 --- a/src/xrpld/rpc/handlers/LedgerDiff.cpp +++ b/src/xrpld/rpc/handlers/LedgerDiff.cpp @@ -1,7 +1,7 @@ #include #include -namespace ripple { +namespace xrpl { std::pair doLedgerDiffGrpc( RPC::GRPCContext& context) @@ -75,7 +75,7 @@ doLedgerDiffGrpc( { XRPL_ASSERT( inDesired->size() > 0, - "ripple::doLedgerDiffGrpc : non-empty desired"); + "xrpl::doLedgerDiffGrpc : non-empty desired"); diff->set_key(k.data(), k.size()); if (request.include_blobs()) { @@ -86,4 +86,4 @@ doLedgerDiffGrpc( return {response, status}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerEntry.cpp b/src/xrpld/rpc/handlers/LedgerEntry.cpp index 5a1dfb4ace..5b5db72c22 100644 --- a/src/xrpld/rpc/handlers/LedgerEntry.cpp +++ b/src/xrpld/rpc/handlers/LedgerEntry.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { static Expected parseObjectID( @@ -918,4 +918,4 @@ doLedgerEntryGrpc( *(response.mutable_ledger()) = request.ledger(); return {response, status}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerEntryHelpers.h b/src/xrpld/rpc/handlers/LedgerEntryHelpers.h index d83b7e2896..0a4453c063 100644 --- a/src/xrpld/rpc/handlers/LedgerEntryHelpers.h +++ b/src/xrpld/rpc/handlers/LedgerEntryHelpers.h @@ -12,7 +12,7 @@ #include -namespace ripple { +namespace xrpl { namespace LedgerEntryHelpers { @@ -277,4 +277,4 @@ parseBridgeFields(Json::Value const& params) } // namespace LedgerEntryHelpers -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerHandler.cpp b/src/xrpld/rpc/handlers/LedgerHandler.cpp index 14c6fc67d9..2929776549 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.cpp +++ b/src/xrpld/rpc/handlers/LedgerHandler.cpp @@ -10,7 +10,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { LedgerHandler::LedgerHandler(JsonContext& context) : context_(context) @@ -114,7 +114,7 @@ doLedgerGrpc(RPC::GRPCContext& context) for (auto& i : ledger->txs) { XRPL_ASSERT( - i.first, "ripple::doLedgerGrpc : non-null transaction"); + i.first, "xrpl::doLedgerGrpc : non-null transaction"); if (request.expand()) { auto txn = response.mutable_transactions_list() @@ -192,7 +192,7 @@ doLedgerGrpc(RPC::GRPCContext& context) { XRPL_ASSERT( inDesired->size() > 0, - "ripple::doLedgerGrpc : non-empty desired"); + "xrpl::doLedgerGrpc : non-empty desired"); obj->set_data(inDesired->data(), inDesired->size()); } if (inBase && inDesired) @@ -298,4 +298,4 @@ doLedgerGrpc(RPC::GRPCContext& context) return {response, status}; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerHandler.h b/src/xrpld/rpc/handlers/LedgerHandler.h index e1a789b66f..fbf60fb22e 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.h +++ b/src/xrpld/rpc/handlers/LedgerHandler.h @@ -18,7 +18,7 @@ namespace Json { class Object; } -namespace ripple { +namespace xrpl { namespace RPC { struct JsonContext; @@ -103,6 +103,6 @@ LedgerHandler::writeResult(Object& value) } } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/handlers/LedgerHeader.cpp b/src/xrpld/rpc/handlers/LedgerHeader.cpp index 8c34b8a7cc..6b93594020 100644 --- a/src/xrpld/rpc/handlers/LedgerHeader.cpp +++ b/src/xrpld/rpc/handlers/LedgerHeader.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // ledger_hash : @@ -31,4 +31,4 @@ doLedgerHeader(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LedgerRequest.cpp b/src/xrpld/rpc/handlers/LedgerRequest.cpp index 8ae0e543f2..da29addd2d 100644 --- a/src/xrpld/rpc/handlers/LedgerRequest.cpp +++ b/src/xrpld/rpc/handlers/LedgerRequest.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // ledger_hash : @@ -29,4 +29,4 @@ doLedgerRequest(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LogLevel.cpp b/src/xrpld/rpc/handlers/LogLevel.cpp index cf5a1d2573..373db55fa0 100644 --- a/src/xrpld/rpc/handlers/LogLevel.cpp +++ b/src/xrpld/rpc/handlers/LogLevel.cpp @@ -9,7 +9,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doLogLevel(RPC::JsonContext& context) @@ -64,4 +64,4 @@ doLogLevel(RPC::JsonContext& context) return rpcError(rpcINVALID_PARAMS); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/LogRotate.cpp b/src/xrpld/rpc/handlers/LogRotate.cpp index 595d84b191..3d52dc6538 100644 --- a/src/xrpld/rpc/handlers/LogRotate.cpp +++ b/src/xrpld/rpc/handlers/LogRotate.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doLogRotate(RPC::JsonContext& context) @@ -13,4 +13,4 @@ doLogRotate(RPC::JsonContext& context) return RPC::makeObjectValue(context.app.logs().rotate()); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/NFTOffers.cpp b/src/xrpld/rpc/handlers/NFTOffers.cpp index 51290a404c..3c6898b5c2 100644 --- a/src/xrpld/rpc/handlers/NFTOffers.cpp +++ b/src/xrpld/rpc/handlers/NFTOffers.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { static void appendNftOfferJson( @@ -157,4 +157,4 @@ doNFTBuyOffers(RPC::JsonContext& context) return enumerateNFTOffers(context, nftId, keylet::nft_buys(nftId)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/NoRippleCheck.cpp b/src/xrpld/rpc/handlers/NoRippleCheck.cpp index 9ff2757a40..521ba1599a 100644 --- a/src/xrpld/rpc/handlers/NoRippleCheck.cpp +++ b/src/xrpld/rpc/handlers/NoRippleCheck.cpp @@ -12,7 +12,7 @@ #include #include -namespace ripple { +namespace xrpl { static void fillTransaction( @@ -185,4 +185,4 @@ doNoRippleCheck(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/OwnerInfo.cpp b/src/xrpld/rpc/handlers/OwnerInfo.cpp index 8f43bfcc99..37a4ceb60d 100644 --- a/src/xrpld/rpc/handlers/OwnerInfo.cpp +++ b/src/xrpld/rpc/handlers/OwnerInfo.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // 'ident' : , @@ -40,4 +40,4 @@ doOwnerInfo(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/PathFind.cpp b/src/xrpld/rpc/handlers/PathFind.cpp index 430212fe46..55575b5513 100644 --- a/src/xrpld/rpc/handlers/PathFind.cpp +++ b/src/xrpld/rpc/handlers/PathFind.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doPathFind(RPC::JsonContext& context) @@ -63,4 +63,4 @@ doPathFind(RPC::JsonContext& context) return rpcError(rpcINVALID_PARAMS); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/PayChanClaim.cpp b/src/xrpld/rpc/handlers/PayChanClaim.cpp index 95c4ba5f3d..89eb1806b8 100644 --- a/src/xrpld/rpc/handlers/PayChanClaim.cpp +++ b/src/xrpld/rpc/handlers/PayChanClaim.cpp @@ -11,7 +11,7 @@ #include -namespace ripple { +namespace xrpl { // { // secret_key: @@ -45,7 +45,7 @@ doChannelAuthorize(RPC::JsonContext& context) XRPL_ASSERT( keyPair || RPC::contains_error(result), - "ripple::doChannelAuthorize : valid keyPair or an error"); + "xrpl::doChannelAuthorize : valid keyPair or an error"); if (!keyPair || RPC::contains_error(result)) return result; @@ -141,4 +141,4 @@ doChannelVerify(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Peers.cpp b/src/xrpld/rpc/handlers/Peers.cpp index ba9f459b41..5a34f4b557 100644 --- a/src/xrpld/rpc/handlers/Peers.cpp +++ b/src/xrpld/rpc/handlers/Peers.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doPeers(RPC::JsonContext& context) @@ -63,4 +63,4 @@ doPeers(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Ping.cpp b/src/xrpld/rpc/handlers/Ping.cpp index 459f743e86..cc3c558cd9 100644 --- a/src/xrpld/rpc/handlers/Ping.cpp +++ b/src/xrpld/rpc/handlers/Ping.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { struct JsonContext; @@ -41,4 +41,4 @@ doPing(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Print.cpp b/src/xrpld/rpc/handlers/Print.cpp index 2c3b886797..6ea1f355aa 100644 --- a/src/xrpld/rpc/handlers/Print.cpp +++ b/src/xrpld/rpc/handlers/Print.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doPrint(RPC::JsonContext& context) @@ -24,4 +24,4 @@ doPrint(RPC::JsonContext& context) return stream.top(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Random.cpp b/src/xrpld/rpc/handlers/Random.cpp index 7156e20f59..2fb8abf3c9 100644 --- a/src/xrpld/rpc/handlers/Random.cpp +++ b/src/xrpld/rpc/handlers/Random.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace RPC { struct JsonContext; @@ -36,4 +36,4 @@ doRandom(RPC::JsonContext& context) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Reservations.cpp b/src/xrpld/rpc/handlers/Reservations.cpp index 2c7ec2d8c9..195a5be453 100644 --- a/src/xrpld/rpc/handlers/Reservations.cpp +++ b/src/xrpld/rpc/handlers/Reservations.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doPeerReservationsAdd(RPC::JsonContext& context) @@ -108,4 +108,4 @@ doPeerReservationsList(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/RipplePathFind.cpp b/src/xrpld/rpc/handlers/RipplePathFind.cpp index 771c1cb95f..5baf6820f4 100644 --- a/src/xrpld/rpc/handlers/RipplePathFind.cpp +++ b/src/xrpld/rpc/handlers/RipplePathFind.cpp @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { // This interface is deprecated. Json::Value @@ -155,4 +155,4 @@ doRipplePathFind(RPC::JsonContext& context) return result; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ServerDefinitions.cpp b/src/xrpld/rpc/handlers/ServerDefinitions.cpp index a25716066e..9fce4d5a5b 100644 --- a/src/xrpld/rpc/handlers/ServerDefinitions.cpp +++ b/src/xrpld/rpc/handlers/ServerDefinitions.cpp @@ -14,7 +14,7 @@ #include -namespace ripple { +namespace xrpl { namespace detail { @@ -214,7 +214,7 @@ ServerDefinitions::ServerDefinitions() : defs_{Json::objectValue} defs_[jss::FIELDS][i++] = a; } - for (auto const& [code, f] : ripple::SField::getKnownCodeToField()) + for (auto const& [code, f] : xrpl::SField::getKnownCodeToField()) { if (f->fieldName == "") continue; @@ -268,7 +268,7 @@ ServerDefinitions::ServerDefinitions() : defs_{Json::objectValue} // generate hash { std::string const out = Json::FastWriter().write(defs_); - defsHash_ = ripple::sha512Half(ripple::Slice{out.data(), out.size()}); + defsHash_ = xrpl::sha512Half(xrpl::Slice{out.data(), out.size()}); defs_[jss::hash] = to_string(defsHash_); } } @@ -298,4 +298,4 @@ doServerDefinitions(RPC::JsonContext& context) return defs.get(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ServerInfo.cpp b/src/xrpld/rpc/handlers/ServerInfo.cpp index c13ebfe788..c7bd7f271d 100644 --- a/src/xrpld/rpc/handlers/ServerInfo.cpp +++ b/src/xrpld/rpc/handlers/ServerInfo.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doServerInfo(RPC::JsonContext& context) @@ -22,4 +22,4 @@ doServerInfo(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ServerState.cpp b/src/xrpld/rpc/handlers/ServerState.cpp index 7769b32f71..4ec08540fb 100644 --- a/src/xrpld/rpc/handlers/ServerState.cpp +++ b/src/xrpld/rpc/handlers/ServerState.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doServerState(RPC::JsonContext& context) @@ -21,4 +21,4 @@ doServerState(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/SignFor.cpp b/src/xrpld/rpc/handlers/SignFor.cpp index 5750e20245..7926dd7c8e 100644 --- a/src/xrpld/rpc/handlers/SignFor.cpp +++ b/src/xrpld/rpc/handlers/SignFor.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // tx_json: , @@ -40,4 +40,4 @@ doSignFor(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/SignHandler.cpp b/src/xrpld/rpc/handlers/SignHandler.cpp index 5a6a5a2947..cab957d8c7 100644 --- a/src/xrpld/rpc/handlers/SignHandler.cpp +++ b/src/xrpld/rpc/handlers/SignHandler.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // tx_json: , @@ -41,4 +41,4 @@ doSign(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Simulate.cpp b/src/xrpld/rpc/handlers/Simulate.cpp index 42cdd66a69..09d9688ad0 100644 --- a/src/xrpld/rpc/handlers/Simulate.cpp +++ b/src/xrpld/rpc/handlers/Simulate.cpp @@ -16,7 +16,7 @@ #include #include -namespace ripple { +namespace xrpl { static Expected getAutofillSequence(Json::Value const& tx_json, RPC::JsonContext& context) @@ -369,4 +369,4 @@ doSimulate(RPC::JsonContext& context) // LCOV_EXCL_STOP } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Stop.cpp b/src/xrpld/rpc/handlers/Stop.cpp index 33221d601d..d2f1cd7a80 100644 --- a/src/xrpld/rpc/handlers/Stop.cpp +++ b/src/xrpld/rpc/handlers/Stop.cpp @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { struct JsonContext; @@ -16,4 +16,4 @@ doStop(RPC::JsonContext& context) return RPC::makeObjectValue(systemName() + " server stopping"); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Submit.cpp b/src/xrpld/rpc/handlers/Submit.cpp index 5cce61a1a6..e3888187ae 100644 --- a/src/xrpld/rpc/handlers/Submit.cpp +++ b/src/xrpld/rpc/handlers/Submit.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { static NetworkOPs::FailHard getFailHard(RPC::JsonContext const& context) @@ -173,4 +173,4 @@ doSubmit(RPC::JsonContext& context) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/SubmitMultiSigned.cpp b/src/xrpld/rpc/handlers/SubmitMultiSigned.cpp index 614ba4abbf..52213e174a 100644 --- a/src/xrpld/rpc/handlers/SubmitMultiSigned.cpp +++ b/src/xrpld/rpc/handlers/SubmitMultiSigned.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // SigningAccounts , @@ -28,4 +28,4 @@ doSubmitMultiSigned(RPC::JsonContext& context) RPC::getProcessTxnFn(context.netOps)); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Subscribe.cpp b/src/xrpld/rpc/handlers/Subscribe.cpp index ab4f20d8ce..018268defb 100644 --- a/src/xrpld/rpc/handlers/Subscribe.cpp +++ b/src/xrpld/rpc/handlers/Subscribe.cpp @@ -13,7 +13,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doSubscribe(RPC::JsonContext& context) @@ -367,4 +367,4 @@ doSubscribe(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/TransactionEntry.cpp b/src/xrpld/rpc/handlers/TransactionEntry.cpp index 9553c2d41e..a554b242c5 100644 --- a/src/xrpld/rpc/handlers/TransactionEntry.cpp +++ b/src/xrpld/rpc/handlers/TransactionEntry.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // ledger_hash : , @@ -95,4 +95,4 @@ doTransactionEntry(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index e7e812563d..c79f40ce3d 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -18,7 +18,7 @@ #include -namespace ripple { +namespace xrpl { static bool isValidated(LedgerMaster& ledgerMaster, std::uint32_t seq, uint256 const& hash) @@ -236,7 +236,7 @@ populateJsonResponse( if (auto blob = std::get_if(&result.meta)) { XRPL_ASSERT( - args.binary, "ripple::populateJsonResponse : binary is set"); + args.binary, "xrpl::populateJsonResponse : binary is set"); auto json_meta = (context.apiVersion > 1 ? jss::meta_blob : jss::meta); response[json_meta] = strHex(makeSlice(*blob)); @@ -327,4 +327,4 @@ doTxJson(RPC::JsonContext& context) return populateJsonResponse(res, args, context); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/TxHistory.cpp b/src/xrpld/rpc/handlers/TxHistory.cpp index 9c8c2faece..a210f61c54 100644 --- a/src/xrpld/rpc/handlers/TxHistory.cpp +++ b/src/xrpld/rpc/handlers/TxHistory.cpp @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { // { // start: @@ -49,4 +49,4 @@ doTxHistory(RPC::JsonContext& context) return obj; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/TxReduceRelay.cpp b/src/xrpld/rpc/handlers/TxReduceRelay.cpp index e2ef4c5b18..d269ef448e 100644 --- a/src/xrpld/rpc/handlers/TxReduceRelay.cpp +++ b/src/xrpld/rpc/handlers/TxReduceRelay.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doTxReduceRelay(RPC::JsonContext& context) @@ -12,4 +12,4 @@ doTxReduceRelay(RPC::JsonContext& context) return context.app.overlay().txMetrics(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/UnlList.cpp b/src/xrpld/rpc/handlers/UnlList.cpp index 6a23daab58..8c28373a05 100644 --- a/src/xrpld/rpc/handlers/UnlList.cpp +++ b/src/xrpld/rpc/handlers/UnlList.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doUnlList(RPC::JsonContext& context) @@ -26,4 +26,4 @@ doUnlList(RPC::JsonContext& context) return obj; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Unsubscribe.cpp b/src/xrpld/rpc/handlers/Unsubscribe.cpp index f84ae00cfc..bc192510bf 100644 --- a/src/xrpld/rpc/handlers/Unsubscribe.cpp +++ b/src/xrpld/rpc/handlers/Unsubscribe.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doUnsubscribe(RPC::JsonContext& context) @@ -244,4 +244,4 @@ doUnsubscribe(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ValidationCreate.cpp b/src/xrpld/rpc/handlers/ValidationCreate.cpp index fc7be5777c..c4bdf1b3de 100644 --- a/src/xrpld/rpc/handlers/ValidationCreate.cpp +++ b/src/xrpld/rpc/handlers/ValidationCreate.cpp @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { static std::optional validationSeed(Json::Value const& params) @@ -47,4 +47,4 @@ doValidationCreate(RPC::JsonContext& context) return obj; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ValidatorInfo.cpp b/src/xrpld/rpc/handlers/ValidatorInfo.cpp index ba2f963851..20d07df866 100644 --- a/src/xrpld/rpc/handlers/ValidatorInfo.cpp +++ b/src/xrpld/rpc/handlers/ValidatorInfo.cpp @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { Json::Value doValidatorInfo(RPC::JsonContext& context) { @@ -43,4 +43,4 @@ doValidatorInfo(RPC::JsonContext& context) return ret; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ValidatorListSites.cpp b/src/xrpld/rpc/handlers/ValidatorListSites.cpp index 22644d65e3..7acaa27168 100644 --- a/src/xrpld/rpc/handlers/ValidatorListSites.cpp +++ b/src/xrpld/rpc/handlers/ValidatorListSites.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doValidatorListSites(RPC::JsonContext& context) @@ -12,4 +12,4 @@ doValidatorListSites(RPC::JsonContext& context) return context.app.validatorSites().getJson(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Validators.cpp b/src/xrpld/rpc/handlers/Validators.cpp index 67d1c60e3a..a83a6fe4b0 100644 --- a/src/xrpld/rpc/handlers/Validators.cpp +++ b/src/xrpld/rpc/handlers/Validators.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { Json::Value doValidators(RPC::JsonContext& context) @@ -12,4 +12,4 @@ doValidators(RPC::JsonContext& context) return context.app.validators().getJson(); } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/VaultInfo.cpp b/src/xrpld/rpc/handlers/VaultInfo.cpp index 7e040fef82..ca2c1d070f 100644 --- a/src/xrpld/rpc/handlers/VaultInfo.cpp +++ b/src/xrpld/rpc/handlers/VaultInfo.cpp @@ -8,7 +8,7 @@ #include #include -namespace ripple { +namespace xrpl { static std::optional parseVault(Json::Value const& params, Json::Value& jvResult) @@ -92,4 +92,4 @@ doVaultInfo(RPC::JsonContext& context) return jvResult; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Version.h b/src/xrpld/rpc/handlers/Version.h index 57c5abfd4b..8af2fd20bc 100644 --- a/src/xrpld/rpc/handlers/Version.h +++ b/src/xrpld/rpc/handlers/Version.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { namespace RPC { class VersionHandler @@ -43,6 +43,6 @@ private: }; } // namespace RPC -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/handlers/WalletPropose.cpp b/src/xrpld/rpc/handlers/WalletPropose.cpp index 575bb84322..c245d5546d 100644 --- a/src/xrpld/rpc/handlers/WalletPropose.cpp +++ b/src/xrpld/rpc/handlers/WalletPropose.cpp @@ -14,7 +14,7 @@ #include #include -namespace ripple { +namespace xrpl { double estimate_entropy(std::string const& input) @@ -158,4 +158,4 @@ walletPropose(Json::Value const& params) return obj; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/WalletPropose.h b/src/xrpld/rpc/handlers/WalletPropose.h index e041b6608f..42c7973055 100644 --- a/src/xrpld/rpc/handlers/WalletPropose.h +++ b/src/xrpld/rpc/handlers/WalletPropose.h @@ -3,11 +3,11 @@ #include -namespace ripple { +namespace xrpl { Json::Value walletPropose(Json::Value const& params); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/rpc/json_body.h b/src/xrpld/rpc/json_body.h index 4dd9142c09..af20ec17ac 100644 --- a/src/xrpld/rpc/json_body.h +++ b/src/xrpld/rpc/json_body.h @@ -7,7 +7,7 @@ #include #include -namespace ripple { +namespace xrpl { /// Body that holds JSON struct json_body @@ -91,6 +91,6 @@ struct json_body }; }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/shamap/NodeFamily.cpp b/src/xrpld/shamap/NodeFamily.cpp index b9cca65d36..d43ab1d648 100644 --- a/src/xrpld/shamap/NodeFamily.cpp +++ b/src/xrpld/shamap/NodeFamily.cpp @@ -4,7 +4,7 @@ #include #include -namespace ripple { +namespace xrpl { NodeFamily::NodeFamily(Application& app, CollectorManager& cm) : app_(app) @@ -87,4 +87,4 @@ NodeFamily::acquire(uint256 const& hash, std::uint32_t seq) } } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/shamap/NodeFamily.h b/src/xrpld/shamap/NodeFamily.h index f8bb278ac9..14c2ebb093 100644 --- a/src/xrpld/shamap/NodeFamily.h +++ b/src/xrpld/shamap/NodeFamily.h @@ -3,7 +3,7 @@ #include -namespace ripple { +namespace xrpl { class Application; @@ -83,6 +83,6 @@ private: acquire(uint256 const& hash, std::uint32_t seq); }; -} // namespace ripple +} // namespace xrpl #endif diff --git a/tests/conan/src/example.cpp b/tests/conan/src/example.cpp index 41dcd62462..acfb253a7d 100644 --- a/tests/conan/src/example.cpp +++ b/tests/conan/src/example.cpp @@ -5,6 +5,6 @@ int main(int argc, char const** argv) { - std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str()); + std::printf("%s\n", xrpl::BuildInfo::getVersionString().c_str()); return 0; } From cf748702af3a7cfe78171313832fdc0fb5ae8e4f Mon Sep 17 00:00:00 2001 From: liuyueyangxmu Date: Sat, 13 Dec 2025 00:06:17 +0800 Subject: [PATCH 07/20] chore: Fix some typos in comments (#6082) --- src/test/app/CrossingLimits_test.cpp | 4 ++-- src/test/app/Offer_test.cpp | 2 +- src/test/app/RCLValidations_test.cpp | 4 ++-- src/test/app/TxQ_test.cpp | 2 +- src/test/csf/Histogram.h | 4 ++-- src/test/csf/submitters.h | 2 +- src/xrpld/rpc/detail/TransactionSign.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/app/CrossingLimits_test.cpp b/src/test/app/CrossingLimits_test.cpp index 9e9b1a3d45..8c11dd6737 100644 --- a/src/test/app/CrossingLimits_test.cpp +++ b/src/test/app/CrossingLimits_test.cpp @@ -303,7 +303,7 @@ public: // offers unfunded. // b. Carol's remaining 800 offers are consumed as unfunded. // c. 199 of alice's XRP(1) to USD(3) offers are consumed. - // A book step is allowed to consume a maxium of 1000 offers + // A book step is allowed to consume a maximum of 1000 offers // at a given quality, and that limit is now reached. // d. Now the strand is dry, even though there are still funded // XRP(1) to USD(3) offers available. @@ -384,7 +384,7 @@ public: // offers unfunded. // b. Carol's remaining 800 offers are consumed as unfunded. // c. 199 of alice's XRP(1) to USD(3) offers are consumed. - // A book step is allowed to consume a maxium of 1000 offers + // A book step is allowed to consume a maximum of 1000 offers // at a given quality, and that limit is now reached. // d. Now the strand is dry, even though there are still funded // XRP(1) to USD(3) offers available. Bob has spent 400 EUR and diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 1117510a45..46a2cabec1 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -1298,7 +1298,7 @@ public: testNegativeBalance(FeatureBitset features) { // This test creates an offer test for negative balance - // with transfer fees and miniscule funds. + // with transfer fees and minuscule funds. testcase("Negative Balance"); using namespace jtx; diff --git a/src/test/app/RCLValidations_test.cpp b/src/test/app/RCLValidations_test.cpp index a4f0d6a7cb..729f373738 100644 --- a/src/test/app/RCLValidations_test.cpp +++ b/src/test/app/RCLValidations_test.cpp @@ -254,7 +254,7 @@ class RCLValidations_test : public beast::unit_test::suite BEAST_EXPECT(trie.branchSupport(ledg_258) == 4); // Move three of the s258 ledgers to s259, which splits the trie - // due to the 256 ancestory limit + // due to the 256 ancestry limit BEAST_EXPECT(trie.remove(ledg_258, 3)); trie.insert(ledg_259, 3); trie.getPreferred(1); @@ -275,7 +275,7 @@ class RCLValidations_test : public beast::unit_test::suite // then verify the remove call works // past bug: remove had assumed the first child of a node in the trie // which matches is the *only* child in the trie which matches. - // This is **NOT** true with the limited 256 ledger ancestory + // This is **NOT** true with the limited 256 ledger ancestry // quirk of RCLValidation and prevents deleting the old support // for ledger 257 diff --git a/src/test/app/TxQ_test.cpp b/src/test/app/TxQ_test.cpp index 3e19fc2842..f6ab13e04f 100644 --- a/src/test/app/TxQ_test.cpp +++ b/src/test/app/TxQ_test.cpp @@ -3821,7 +3821,7 @@ public: return result; }; - testcase("straightfoward positive case"); + testcase("straightforward positive case"); { // Queue up some transactions at a too-low fee. auto aliceSeq = env.seq(alice); diff --git a/src/test/csf/Histogram.h b/src/test/csf/Histogram.h index b55af34846..e32fded2f2 100644 --- a/src/test/csf/Histogram.h +++ b/src/test/csf/Histogram.h @@ -18,14 +18,14 @@ namespace csf { - Comparison : T a, b; bool res = a < b - Addition: T a, b; T c = a + b; - Multiplication : T a, std::size_t b; T c = a * b; - - Divison: T a; std::size_t b; T c = a/b; + - Division: T a; std::size_t b; T c = a/b; */ template > class Histogram { - // TODO: Consider logarithimic bins around expected median if this becomes + // TODO: Consider logarithmic bins around expected median if this becomes // unscaleable std::map counts_; std::size_t samples = 0; diff --git a/src/test/csf/submitters.h b/src/test/csf/submitters.h index 8a3632eb97..0c5d46e075 100644 --- a/src/test/csf/submitters.h +++ b/src/test/csf/submitters.h @@ -31,7 +31,7 @@ struct Rate /** Submits transactions to a specified peer Submits successive transactions beginning at start, then spaced according - to succesive calls of distribution(), until stop. + to successive calls of distribution(), until stop. @tparam Distribution is a `UniformRandomBitGenerator` from the STL that is used by random distributions to generate random samples diff --git a/src/xrpld/rpc/detail/TransactionSign.cpp b/src/xrpld/rpc/detail/TransactionSign.cpp index 252e5fc91e..a4ac32ee17 100644 --- a/src/xrpld/rpc/detail/TransactionSign.cpp +++ b/src/xrpld/rpc/detail/TransactionSign.cpp @@ -277,7 +277,7 @@ checkPayment( app); if (pf.findPaths(app.config().PATH_SEARCH_OLD)) { - // 4 is the maxium paths + // 4 is the maximum paths pf.computePathRanks(4); STPath fullLiquidityPath; STPathSet paths; From f816ffa55ffac8d78e150cf13fa90cad8a4f6f0f Mon Sep 17 00:00:00 2001 From: Bart Date: Fri, 12 Dec 2025 14:47:34 -0500 Subject: [PATCH 08/20] ci: Update shared actions (#6147) The latest update to `cleanup-workspace`, `get-nproc`, and `prepare-runner` moved the action to the repository root directory, and also includes some ccache changes. In response, this change updates the various shared actions to the latest commit hash. --- .github/workflows/publish-docs.yml | 2 +- .github/workflows/reusable-build-test-config.yml | 6 +++--- .github/workflows/upload-conan-deps.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 14a2ba2fc0..6f0927a2b3 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Get number of processors - uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a + uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 id: nproc with: subtract: ${{ env.NPROC_SUBTRACT }} diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index 70d4f93e16..43acfab542 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -71,13 +71,13 @@ jobs: steps: - name: Cleanup workspace (macOS and Windows) if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }} - uses: XRPLF/actions/.github/actions/cleanup-workspace@01b244d2718865d427b499822fbd3f15e7197fcc + uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6 - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Prepare runner - uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a + uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6 with: disable_ccache: false @@ -85,7 +85,7 @@ jobs: uses: ./.github/actions/print-env - name: Get number of processors - uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a + uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 id: nproc with: subtract: ${{ inputs.nproc_subtract }} diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index 320396c899..ec283e564c 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -64,13 +64,13 @@ jobs: steps: - name: Cleanup workspace (macOS and Windows) if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }} - uses: XRPLF/actions/.github/actions/cleanup-workspace@01b244d2718865d427b499822fbd3f15e7197fcc + uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6 - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - name: Prepare runner - uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a + uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6 with: disable_ccache: false @@ -78,7 +78,7 @@ jobs: uses: ./.github/actions/print-env - name: Get number of processors - uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a + uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6 id: nproc with: subtract: ${{ env.NPROC_SUBTRACT }} From 41c1be2baca43ee2b7a6f85fac3ee329a25ae2cc Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 15 Dec 2025 10:40:08 -0800 Subject: [PATCH 09/20] refactor: remove `Json::Object` and related files/classes (#5894) `Json::Object` and related objects are not used at all, so this change removes `include/xrpl/json/Object.h` and all downstream files. There are a number of minor downstream changes as well. Full list of deleted classes and functions: * `Json::Collections` * `Json::Object` * `Json::Array` * `Json::WriterObject` * `Json::setArray` * `Json::addObject` * `Json::appendArray` * `Json::appendObject` The last helper function, `copyFrom`, seemed a bit more complex and was actually used in a few places, so it was moved to `LedgerToJson.h` instead of deleting it. --- include/xrpl/json/Object.h | 445 ------------------- include/xrpl/protocol/ApiVersion.h | 8 +- include/xrpl/protocol/ErrorCodes.h | 26 +- include/xrpl/protocol/RPCErr.h | 2 +- src/libxrpl/json/Object.cpp | 233 ---------- src/libxrpl/protocol/ErrorCodes.cpp | 18 + src/libxrpl/protocol/RPCErr.cpp | 2 +- src/test/json/Object_test.cpp | 239 ---------- src/test/jtx/impl/utility.cpp | 3 +- src/xrpld/app/ledger/LedgerToJson.h | 8 +- src/xrpld/app/ledger/detail/LedgerToJson.cpp | 46 +- src/xrpld/rpc/Status.h | 3 +- src/xrpld/rpc/handlers/GetCounts.h | 2 - src/xrpld/rpc/handlers/LedgerHandler.cpp | 37 ++ src/xrpld/rpc/handlers/LedgerHandler.h | 47 +- src/xrpld/rpc/handlers/Version.h | 3 +- 16 files changed, 100 insertions(+), 1022 deletions(-) delete mode 100644 include/xrpl/json/Object.h delete mode 100644 src/libxrpl/json/Object.cpp delete mode 100644 src/test/json/Object_test.cpp diff --git a/include/xrpl/json/Object.h b/include/xrpl/json/Object.h deleted file mode 100644 index 754d0dcb08..0000000000 --- a/include/xrpl/json/Object.h +++ /dev/null @@ -1,445 +0,0 @@ -#ifndef XRPL_JSON_OBJECT_H_INCLUDED -#define XRPL_JSON_OBJECT_H_INCLUDED - -#include - -#include - -namespace Json { - -/** - Collection is a base class for Array and Object, classes which provide the - facade of JSON collections for the O(1) JSON writer, while still using no - heap memory and only a very small amount of stack. - - From http://json.org, JSON has two types of collection: array, and object. - Everything else is a *scalar* - a number, a string, a boolean, the special - value null, or a legacy Json::Value. - - Collections must write JSON "as-it-goes" in order to get the strong - performance guarantees. This puts restrictions upon API users: - - 1. Only one collection can be open for change at any one time. - - This condition is enforced automatically and a std::logic_error thrown if - it is violated. - - 2. A tag may only be used once in an Object. - - Some objects have many tags, so this condition might be a little - expensive. Enforcement of this condition is turned on in debug builds and - a std::logic_error is thrown when the tag is added for a second time. - - Code samples: - - Writer writer; - - // An empty object. - { - Object::Root (writer); - } - // Outputs {} - - // An object with one scalar value. - { - Object::Root root (writer); - write["hello"] = "world"; - } - // Outputs {"hello":"world"} - - // Same, using chaining. - { - Object::Root (writer)["hello"] = "world"; - } - // Output is the same. - - // Add several scalars, with chaining. - { - Object::Root (writer) - .set ("hello", "world") - .set ("flag", false) - .set ("x", 42); - } - // Outputs {"hello":"world","flag":false,"x":42} - - // Add an array. - { - Object::Root root (writer); - { - auto array = root.setArray ("hands"); - array.append ("left"); - array.append ("right"); - } - } - // Outputs {"hands":["left", "right"]} - - // Same, using chaining. - { - Object::Root (writer) - .setArray ("hands") - .append ("left") - .append ("right"); - } - // Output is the same. - - // Add an object. - { - Object::Root root (writer); - { - auto object = root.setObject ("hands"); - object["left"] = false; - object["right"] = true; - } - } - // Outputs {"hands":{"left":false,"right":true}} - - // Same, using chaining. - { - Object::Root (writer) - .setObject ("hands") - .set ("left", false) - .set ("right", true); - } - } - // Outputs {"hands":{"left":false,"right":true}} - - - Typical ways to make mistakes and get a std::logic_error: - - Writer writer; - Object::Root root (writer); - - // Repeat a tag. - { - root ["hello"] = "world"; - root ["hello"] = "there"; // THROWS! in a debug build. - } - - // Open a subcollection, then set something else. - { - auto object = root.setObject ("foo"); - root ["hello"] = "world"; // THROWS! - } - - // Open two subcollections at a time. - { - auto object = root.setObject ("foo"); - auto array = root.setArray ("bar"); // THROWS!! - } - - For more examples, check the unit tests. - */ - -class Collection -{ -public: - Collection(Collection&& c) noexcept; - Collection& - operator=(Collection&& c) noexcept; - Collection() = delete; - - ~Collection(); - -protected: - // A null parent means "no parent at all". - // Writers cannot be null. - Collection(Collection* parent, Writer*); - void - checkWritable(std::string const& label); - - Collection* parent_; - Writer* writer_; - bool enabled_; -}; - -class Array; - -//------------------------------------------------------------------------------ - -/** Represents a JSON object being written to a Writer. */ -class Object : protected Collection -{ -public: - /** Object::Root is the only Collection that has a public constructor. */ - class Root; - - /** Set a scalar value in the Object for a key. - - A JSON scalar is a single value - a number, string, boolean, nullptr or - a Json::Value. - - `set()` throws an exception if this object is disabled (which means that - one of its children is enabled). - - In a debug build, `set()` also throws an exception if the key has - already been set() before. - - An operator[] is provided to allow writing `object["key"] = scalar;`. - */ - template - void - set(std::string const& key, Scalar const&); - - void - set(std::string const& key, Json::Value const&); - - // Detail class and method used to implement operator[]. - class Proxy; - - Proxy - operator[](std::string const& key); - Proxy - operator[](Json::StaticString const& key); - - /** Make a new Object at a key and return it. - - This Object is disabled until that sub-object is destroyed. - Throws an exception if this Object was already disabled. - */ - Object - setObject(std::string const& key); - - /** Make a new Array at a key and return it. - - This Object is disabled until that sub-array is destroyed. - Throws an exception if this Object was already disabled. - */ - Array - setArray(std::string const& key); - -protected: - friend class Array; - Object(Collection* parent, Writer* w) : Collection(parent, w) - { - } -}; - -class Object::Root : public Object -{ -public: - /** Each Object::Root must be constructed with its own unique Writer. */ - Root(Writer&); -}; - -//------------------------------------------------------------------------------ - -/** Represents a JSON array being written to a Writer. */ -class Array : private Collection -{ -public: - /** Append a scalar to the Arrary. - - Throws an exception if this array is disabled (which means that one of - its sub-collections is enabled). - */ - template - void - append(Scalar const&); - - /** - Appends a Json::Value to an array. - Throws an exception if this Array was disabled. - */ - void - append(Json::Value const&); - - /** Append a new Object and return it. - - This Array is disabled until that sub-object is destroyed. - Throws an exception if this Array was disabled. - */ - Object - appendObject(); - - /** Append a new Array and return it. - - This Array is disabled until that sub-array is destroyed. - Throws an exception if this Array was already disabled. - */ - Array - appendArray(); - -protected: - friend class Object; - Array(Collection* parent, Writer* w) : Collection(parent, w) - { - } -}; - -//------------------------------------------------------------------------------ - -// Generic accessor functions to allow Json::Value and Collection to -// interoperate. - -/** Add a new subarray at a named key in a Json object. */ -Json::Value& -setArray(Json::Value&, Json::StaticString const& key); - -/** Add a new subarray at a named key in a Json object. */ -Array -setArray(Object&, Json::StaticString const& key); - -/** Add a new subobject at a named key in a Json object. */ -Json::Value& -addObject(Json::Value&, Json::StaticString const& key); - -/** Add a new subobject at a named key in a Json object. */ -Object -addObject(Object&, Json::StaticString const& key); - -/** Append a new subarray to a Json array. */ -Json::Value& -appendArray(Json::Value&); - -/** Append a new subarray to a Json array. */ -Array -appendArray(Array&); - -/** Append a new subobject to a Json object. */ -Json::Value& -appendObject(Json::Value&); - -/** Append a new subobject to a Json object. */ -Object -appendObject(Array&); - -/** Copy all the keys and values from one object into another. */ -void -copyFrom(Json::Value& to, Json::Value const& from); - -/** Copy all the keys and values from one object into another. */ -void -copyFrom(Object& to, Json::Value const& from); - -/** An Object that contains its own Writer. */ -class WriterObject -{ -public: - WriterObject(Output const& output) - : writer_(std::make_unique(output)) - , object_(std::make_unique(*writer_)) - { - } - - WriterObject(WriterObject&& other) = default; - - Object* - operator->() - { - return object_.get(); - } - - Object& - operator*() - { - return *object_; - } - -private: - std::unique_ptr writer_; - std::unique_ptr object_; -}; - -WriterObject -stringWriterObject(std::string&); - -//------------------------------------------------------------------------------ -// Implementation details. - -// Detail class for Object::operator[]. -class Object::Proxy -{ -private: - Object& object_; - std::string const key_; - -public: - Proxy(Object& object, std::string const& key); - - template - void - operator=(T const& t) - { - object_.set(key_, t); - // Note: This function shouldn't return *this, because it's a trap. - // - // In Json::Value, foo[jss::key] returns a reference to a - // mutable Json::Value contained _inside_ foo. But in the case of - // Json::Object, where we write once only, there isn't any such - // reference that can be returned. Returning *this would return an - // object "a level higher" than in Json::Value, leading to obscure bugs, - // particularly in generic code. - } -}; - -//------------------------------------------------------------------------------ - -template -void -Array::append(Scalar const& value) -{ - checkWritable("append"); - if (writer_) - writer_->append(value); -} - -template -void -Object::set(std::string const& key, Scalar const& value) -{ - checkWritable("set"); - if (writer_) - writer_->set(key, value); -} - -inline Json::Value& -setArray(Json::Value& json, Json::StaticString const& key) -{ - return (json[key] = Json::arrayValue); -} - -inline Array -setArray(Object& json, Json::StaticString const& key) -{ - return json.setArray(std::string(key)); -} - -inline Json::Value& -addObject(Json::Value& json, Json::StaticString const& key) -{ - return (json[key] = Json::objectValue); -} - -inline Object -addObject(Object& object, Json::StaticString const& key) -{ - return object.setObject(std::string(key)); -} - -inline Json::Value& -appendArray(Json::Value& json) -{ - return json.append(Json::arrayValue); -} - -inline Array -appendArray(Array& json) -{ - return json.appendArray(); -} - -inline Json::Value& -appendObject(Json::Value& json) -{ - return json.append(Json::objectValue); -} - -inline Object -appendObject(Array& json) -{ - return json.appendObject(); -} - -} // namespace Json - -#endif diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index b2ee64621e..d1a84e76b0 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -58,14 +58,14 @@ static_assert(apiMaximumSupportedVersion >= apiMinimumSupportedVersion); static_assert(apiBetaVersion >= apiMaximumSupportedVersion); static_assert(apiMaximumValidVersion >= apiMaximumSupportedVersion); -template -void -setVersion(JsonObject& parent, unsigned int apiVersion, bool betaEnabled) +inline void +setVersion(Json::Value& parent, unsigned int apiVersion, bool betaEnabled) { XRPL_ASSERT( apiVersion != apiInvalidVersion, "xrpl::RPC::setVersion : input is valid"); - auto& retObj = addObject(parent, jss::version); + + auto& retObj = parent[jss::version] = Json::objectValue; if (apiVersion == apiVersionIfUnspecified) { diff --git a/include/xrpl/protocol/ErrorCodes.h b/include/xrpl/protocol/ErrorCodes.h index 8d5d871aa1..3a2645347a 100644 --- a/include/xrpl/protocol/ErrorCodes.h +++ b/include/xrpl/protocol/ErrorCodes.h @@ -209,33 +209,11 @@ get_error_info(error_code_i code); /** Add or update the json update to reflect the error code. */ /** @{ */ -template void -inject_error(error_code_i code, JsonValue& json) -{ - ErrorInfo const& info(get_error_info(code)); - json[jss::error] = info.token; - json[jss::error_code] = info.code; - json[jss::error_message] = info.message; -} +inject_error(error_code_i code, Json::Value& json); -template void -inject_error(int code, JsonValue& json) -{ - inject_error(error_code_i(code), json); -} - -template -void -inject_error(error_code_i code, std::string const& message, JsonValue& json) -{ - ErrorInfo const& info(get_error_info(code)); - json[jss::error] = info.token; - json[jss::error_code] = info.code; - json[jss::error_message] = message; -} - +inject_error(error_code_i code, std::string const& message, Json::Value& json); /** @} */ /** Returns a new json object that reflects the error code. */ diff --git a/include/xrpl/protocol/RPCErr.h b/include/xrpl/protocol/RPCErr.h index 90df1562e7..fcca15747e 100644 --- a/include/xrpl/protocol/RPCErr.h +++ b/include/xrpl/protocol/RPCErr.h @@ -9,7 +9,7 @@ namespace xrpl { bool isRpcError(Json::Value jvResult); Json::Value -rpcError(int iError); +rpcError(error_code_i iError); } // namespace xrpl diff --git a/src/libxrpl/json/Object.cpp b/src/libxrpl/json/Object.cpp deleted file mode 100644 index ea5e5a32d8..0000000000 --- a/src/libxrpl/json/Object.cpp +++ /dev/null @@ -1,233 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace Json { - -Collection::Collection(Collection* parent, Writer* writer) - : parent_(parent), writer_(writer), enabled_(true) -{ - checkWritable("Collection::Collection()"); - if (parent_) - { - check(parent_->enabled_, "Parent not enabled in constructor"); - parent_->enabled_ = false; - } -} - -Collection::~Collection() -{ - if (writer_) - writer_->finish(); - if (parent_) - parent_->enabled_ = true; -} - -Collection& -Collection::operator=(Collection&& that) noexcept -{ - parent_ = that.parent_; - writer_ = that.writer_; - enabled_ = that.enabled_; - - that.parent_ = nullptr; - that.writer_ = nullptr; - that.enabled_ = false; - - return *this; -} - -Collection::Collection(Collection&& that) noexcept -{ - *this = std::move(that); -} - -void -Collection::checkWritable(std::string const& label) -{ - if (!enabled_) - xrpl::Throw(label + ": not enabled"); - if (!writer_) - xrpl::Throw(label + ": not writable"); -} - -//------------------------------------------------------------------------------ - -Object::Root::Root(Writer& w) : Object(nullptr, &w) -{ - writer_->startRoot(Writer::object); -} - -Object -Object::setObject(std::string const& key) -{ - checkWritable("Object::setObject"); - if (writer_) - writer_->startSet(Writer::object, key); - return Object(this, writer_); -} - -Array -Object::setArray(std::string const& key) -{ - checkWritable("Object::setArray"); - if (writer_) - writer_->startSet(Writer::array, key); - return Array(this, writer_); -} - -//------------------------------------------------------------------------------ - -Object -Array::appendObject() -{ - checkWritable("Array::appendObject"); - if (writer_) - writer_->startAppend(Writer::object); - return Object(this, writer_); -} - -Array -Array::appendArray() -{ - checkWritable("Array::makeArray"); - if (writer_) - writer_->startAppend(Writer::array); - return Array(this, writer_); -} - -//------------------------------------------------------------------------------ - -Object::Proxy::Proxy(Object& object, std::string const& key) - : object_(object), key_(key) -{ -} - -Object::Proxy -Object::operator[](std::string const& key) -{ - return Proxy(*this, key); -} - -Object::Proxy -Object::operator[](Json::StaticString const& key) -{ - return Proxy(*this, std::string(key)); -} - -//------------------------------------------------------------------------------ - -void -Array::append(Json::Value const& v) -{ - auto t = v.type(); - switch (t) - { - case Json::nullValue: - return append(nullptr); - case Json::intValue: - return append(v.asInt()); - case Json::uintValue: - return append(v.asUInt()); - case Json::realValue: - return append(v.asDouble()); - case Json::stringValue: - return append(v.asString()); - case Json::booleanValue: - return append(v.asBool()); - - case Json::objectValue: { - auto object = appendObject(); - copyFrom(object, v); - return; - } - - case Json::arrayValue: { - auto array = appendArray(); - for (auto& item : v) - array.append(item); - return; - } - } - UNREACHABLE("Json::Array::append : invalid type"); // LCOV_EXCL_LINE -} - -void -Object::set(std::string const& k, Json::Value const& v) -{ - auto t = v.type(); - switch (t) - { - case Json::nullValue: - return set(k, nullptr); - case Json::intValue: - return set(k, v.asInt()); - case Json::uintValue: - return set(k, v.asUInt()); - case Json::realValue: - return set(k, v.asDouble()); - case Json::stringValue: - return set(k, v.asString()); - case Json::booleanValue: - return set(k, v.asBool()); - - case Json::objectValue: { - auto object = setObject(k); - copyFrom(object, v); - return; - } - - case Json::arrayValue: { - auto array = setArray(k); - for (auto& item : v) - array.append(item); - return; - } - } - UNREACHABLE("Json::Object::set : invalid type"); // LCOV_EXCL_LINE -} - -//------------------------------------------------------------------------------ - -namespace { - -template -void -doCopyFrom(Object& to, Json::Value const& from) -{ - XRPL_ASSERT(from.isObjectOrNull(), "Json::doCopyFrom : valid input type"); - auto members = from.getMemberNames(); - for (auto& m : members) - to[m] = from[m]; -} - -} // namespace - -void -copyFrom(Json::Value& to, Json::Value const& from) -{ - if (!to) // Short circuit this very common case. - to = from; - else - doCopyFrom(to, from); -} - -void -copyFrom(Object& to, Json::Value const& from) -{ - doCopyFrom(to, from); -} - -WriterObject -stringWriterObject(std::string& s) -{ - return WriterObject(stringOutput(s)); -} - -} // namespace Json diff --git a/src/libxrpl/protocol/ErrorCodes.cpp b/src/libxrpl/protocol/ErrorCodes.cpp index f37ba0c8e4..d78ff594e1 100644 --- a/src/libxrpl/protocol/ErrorCodes.cpp +++ b/src/libxrpl/protocol/ErrorCodes.cpp @@ -160,6 +160,24 @@ constexpr ErrorInfo unknownError; //------------------------------------------------------------------------------ +void +inject_error(error_code_i code, Json::Value& json) +{ + ErrorInfo const& info(get_error_info(code)); + json[jss::error] = info.token; + json[jss::error_code] = info.code; + json[jss::error_message] = info.message; +} + +void +inject_error(error_code_i code, std::string const& message, Json::Value& json) +{ + ErrorInfo const& info(get_error_info(code)); + json[jss::error] = info.token; + json[jss::error_code] = info.code; + json[jss::error_message] = message; +} + ErrorInfo const& get_error_info(error_code_i code) { diff --git a/src/libxrpl/protocol/RPCErr.cpp b/src/libxrpl/protocol/RPCErr.cpp index 658dd06b3d..e25b5e574b 100644 --- a/src/libxrpl/protocol/RPCErr.cpp +++ b/src/libxrpl/protocol/RPCErr.cpp @@ -9,7 +9,7 @@ struct RPCErr; // VFALCO NOTE Deprecated function Json::Value -rpcError(int iError) +rpcError(error_code_i iError) { Json::Value jvResult(Json::objectValue); RPC::inject_error(iError, jvResult); diff --git a/src/test/json/Object_test.cpp b/src/test/json/Object_test.cpp deleted file mode 100644 index b74754db33..0000000000 --- a/src/test/json/Object_test.cpp +++ /dev/null @@ -1,239 +0,0 @@ -#include - -#include -#include - -namespace Json { - -class JsonObject_test : public xrpl::test::TestOutputSuite -{ - void - setup(std::string const& testName) - { - testcase(testName); - output_.clear(); - } - - std::unique_ptr writerObject_; - - Object& - makeRoot() - { - writerObject_ = - std::make_unique(stringWriterObject(output_)); - return **writerObject_; - } - - void - expectResult(std::string const& expected) - { - writerObject_.reset(); - TestOutputSuite::expectResult(expected); - } - -public: - void - testTrivial() - { - setup("trivial"); - - { - auto& root = makeRoot(); - (void)root; - } - expectResult("{}"); - } - - void - testSimple() - { - setup("simple"); - { - auto& root = makeRoot(); - root["hello"] = "world"; - root["skidoo"] = 23; - root["awake"] = false; - root["temperature"] = 98.6; - } - - expectResult( - "{\"hello\":\"world\"," - "\"skidoo\":23," - "\"awake\":false," - "\"temperature\":98.6}"); - } - - void - testOneSub() - { - setup("oneSub"); - { - auto& root = makeRoot(); - root.setArray("ar"); - } - expectResult("{\"ar\":[]}"); - } - - void - testSubs() - { - setup("subs"); - { - auto& root = makeRoot(); - - { - // Add an array with three entries. - auto array = root.setArray("ar"); - array.append(23); - array.append(false); - array.append(23.5); - } - - { - // Add an object with one entry. - auto obj = root.setObject("obj"); - obj["hello"] = "world"; - } - - { - // Add another object with two entries. - Json::Value value; - value["h"] = "w"; - value["f"] = false; - root["obj2"] = value; - } - } - - // Json::Value has an unstable order... - auto case1 = - "{\"ar\":[23,false,23.5]," - "\"obj\":{\"hello\":\"world\"}," - "\"obj2\":{\"h\":\"w\",\"f\":false}}"; - auto case2 = - "{\"ar\":[23,false,23.5]," - "\"obj\":{\"hello\":\"world\"}," - "\"obj2\":{\"f\":false,\"h\":\"w\"}}"; - writerObject_.reset(); - BEAST_EXPECT(output_ == case1 || output_ == case2); - } - - void - testSubsShort() - { - setup("subsShort"); - - { - auto& root = makeRoot(); - - { - // Add an array with three entries. - auto array = root.setArray("ar"); - array.append(23); - array.append(false); - array.append(23.5); - } - - // Add an object with one entry. - root.setObject("obj")["hello"] = "world"; - - { - // Add another object with two entries. - auto object = root.setObject("obj2"); - object.set("h", "w"); - object.set("f", false); - } - } - expectResult( - "{\"ar\":[23,false,23.5]," - "\"obj\":{\"hello\":\"world\"}," - "\"obj2\":{\"h\":\"w\",\"f\":false}}"); - } - - void - testFailureObject() - { - { - setup("object failure assign"); - auto& root = makeRoot(); - auto obj = root.setObject("o1"); - expectException([&]() { root["fail"] = "complete"; }); - } - { - setup("object failure object"); - auto& root = makeRoot(); - auto obj = root.setObject("o1"); - expectException([&]() { root.setObject("o2"); }); - } - { - setup("object failure Array"); - auto& root = makeRoot(); - auto obj = root.setArray("o1"); - expectException([&]() { root.setArray("o2"); }); - } - } - - void - testFailureArray() - { - { - setup("array failure append"); - auto& root = makeRoot(); - auto array = root.setArray("array"); - auto subarray = array.appendArray(); - auto fail = [&]() { array.append("fail"); }; - expectException(fail); - } - { - setup("array failure appendArray"); - auto& root = makeRoot(); - auto array = root.setArray("array"); - auto subarray = array.appendArray(); - auto fail = [&]() { array.appendArray(); }; - expectException(fail); - } - { - setup("array failure appendObject"); - auto& root = makeRoot(); - auto array = root.setArray("array"); - auto subarray = array.appendArray(); - auto fail = [&]() { array.appendObject(); }; - expectException(fail); - } - } - - void - testKeyFailure() - { - setup("repeating keys"); - auto& root = makeRoot(); - root.set("foo", "bar"); - root.set("baz", 0); - // setting key again throws in !NDEBUG builds - auto set_again = [&]() { root.set("foo", "bar"); }; -#ifdef NDEBUG - set_again(); - pass(); -#else - expectException(set_again); -#endif - } - - void - run() override - { - testTrivial(); - testSimple(); - - testOneSub(); - testSubs(); - testSubsShort(); - - testFailureObject(); - testFailureArray(); - testKeyFailure(); - } -}; - -BEAST_DEFINE_TESTSUITE(JsonObject, json, xrpl); - -} // namespace Json diff --git a/src/test/jtx/impl/utility.cpp b/src/test/jtx/impl/utility.cpp index 81bce576ce..920e715c16 100644 --- a/src/test/jtx/impl/utility.cpp +++ b/src/test/jtx/impl/utility.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -83,7 +82,7 @@ cmdToJSONRPC( // If paramsObj is not empty, put it in a [params] array. if (paramsObj.begin() != paramsObj.end()) { - auto& paramsArray = Json::setArray(jv, jss::params); + auto& paramsArray = jv[jss::params] = Json::arrayValue; paramsArray.append(paramsObj); } if (paramsObj.isMember(jss::jsonrpc)) diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index 7ebbfc655e..7b7e267d81 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -7,7 +7,6 @@ #include #include -#include #include namespace xrpl { @@ -42,10 +41,9 @@ struct LedgerFill std::optional closeTime; }; -/** Given a Ledger and options, fill a Json::Object or Json::Value with a +/** Given a Ledger and options, fill a Json::Value with a description of the ledger. */ - void addJson(Json::Value&, LedgerFill const&); @@ -53,6 +51,10 @@ addJson(Json::Value&, LedgerFill const&); Json::Value getJson(LedgerFill const&); +/** Copy all the keys and values from one object into another. */ +void +copyFrom(Json::Value& to, Json::Value const& from); + } // namespace xrpl #endif diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index 8c9e21acde..b1f6d6b297 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -32,10 +32,9 @@ isBinary(LedgerFill const& fill) return fill.options & LedgerFill::binary; } -template void fillJson( - Object& json, + Json::Value& json, bool closed, LedgerHeader const& info, bool bFull, @@ -78,9 +77,8 @@ fillJson( } } -template void -fillJsonBinary(Object& json, bool closed, LedgerHeader const& info) +fillJsonBinary(Json::Value& json, bool closed, LedgerHeader const& info) { if (!closed) json[jss::closed] = false; @@ -207,11 +205,10 @@ fillJsonTx( return txJson; } -template void -fillJsonTx(Object& json, LedgerFill const& fill) +fillJsonTx(Json::Value& json, LedgerFill const& fill) { - auto&& txns = setArray(json, jss::transactions); + auto& txns = json[jss::transactions] = Json::arrayValue; auto bBinary = isBinary(fill); auto bExpanded = isExpanded(fill); @@ -238,12 +235,11 @@ fillJsonTx(Object& json, LedgerFill const& fill) } } -template void -fillJsonState(Object& json, LedgerFill const& fill) +fillJsonState(Json::Value& json, LedgerFill const& fill) { auto& ledger = fill.ledger; - auto&& array = Json::setArray(json, jss::accountState); + auto& array = json[jss::accountState] = Json::arrayValue; auto expanded = isExpanded(fill); auto binary = isBinary(fill); @@ -251,7 +247,7 @@ fillJsonState(Object& json, LedgerFill const& fill) { if (binary) { - auto&& obj = appendObject(array); + auto& obj = array.append(Json::objectValue); obj[jss::hash] = to_string(sle->key()); obj[jss::tx_blob] = serializeHex(*sle); } @@ -262,17 +258,16 @@ fillJsonState(Object& json, LedgerFill const& fill) } } -template void -fillJsonQueue(Object& json, LedgerFill const& fill) +fillJsonQueue(Json::Value& json, LedgerFill const& fill) { - auto&& queueData = Json::setArray(json, jss::queue_data); + auto& queueData = json[jss::queue_data] = Json::arrayValue; auto bBinary = isBinary(fill); auto bExpanded = isExpanded(fill); for (auto const& tx : fill.txQueue) { - auto&& txJson = appendObject(queueData); + auto& txJson = queueData.append(Json::objectValue); txJson[jss::fee_level] = to_string(tx.feeLevel); if (tx.lastValid) txJson[jss::LastLedgerSequence] = *tx.lastValid; @@ -297,9 +292,8 @@ fillJsonQueue(Object& json, LedgerFill const& fill) } } -template void -fillJson(Object& json, LedgerFill const& fill) +fillJson(Json::Value& json, LedgerFill const& fill) { // TODO: what happens if bBinary and bExtracted are both set? // Is there a way to report this back? @@ -327,7 +321,7 @@ fillJson(Object& json, LedgerFill const& fill) void addJson(Json::Value& json, LedgerFill const& fill) { - auto&& object = Json::addObject(json, jss::ledger); + auto& object = json[jss::ledger] = Json::objectValue; fillJson(object, fill); if ((fill.options & LedgerFill::dumpQueue) && !fill.txQueue.empty()) @@ -342,4 +336,20 @@ getJson(LedgerFill const& fill) return json; } +void +copyFrom(Json::Value& to, Json::Value const& from) +{ + if (!to) // Short circuit this very common case. + to = from; + else + { + // TODO: figure out if there is a way to remove this clause + // or check that it does/needs to do a deep copy + XRPL_ASSERT(from.isObjectOrNull(), "copyFrom : invalid input type"); + auto const members = from.getMemberNames(); + for (auto const& m : members) + to[m] = from[m]; + } +} + } // namespace xrpl diff --git a/src/xrpld/rpc/Status.h b/src/xrpld/rpc/Status.h index f4ffcae9b2..5d6175336e 100644 --- a/src/xrpld/rpc/Status.h +++ b/src/xrpld/rpc/Status.h @@ -94,9 +94,8 @@ public: /** Apply the Status to a JsonObject */ - template void - inject(Object& object) const + inject(Json::Value& object) const { if (auto ec = toErrorCode()) { diff --git a/src/xrpld/rpc/handlers/GetCounts.h b/src/xrpld/rpc/handlers/GetCounts.h index 0d544a4f11..de2c4f2f96 100644 --- a/src/xrpld/rpc/handlers/GetCounts.h +++ b/src/xrpld/rpc/handlers/GetCounts.h @@ -3,8 +3,6 @@ #include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/LedgerHandler.cpp b/src/xrpld/rpc/handlers/LedgerHandler.cpp index 2929776549..f8e8111aad 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.cpp +++ b/src/xrpld/rpc/handlers/LedgerHandler.cpp @@ -75,6 +75,43 @@ LedgerHandler::check() return Status::OK; } +void +LedgerHandler::writeResult(Json::Value& value) +{ + if (ledger_) + { + copyFrom(value, result_); + addJson(value, {*ledger_, &context_, options_, queueTxs_}); + } + else + { + auto& master = context_.app.getLedgerMaster(); + { + auto& closed = value[jss::closed] = Json::objectValue; + addJson(closed, {*master.getClosedLedger(), &context_, 0}); + } + { + auto& open = value[jss::open] = Json::objectValue; + addJson(open, {*master.getCurrentLedger(), &context_, 0}); + } + } + + Json::Value warnings{Json::arrayValue}; + if (context_.params.isMember(jss::type)) + { + Json::Value& w = warnings.append(Json::objectValue); + w[jss::id] = warnRPC_FIELDS_DEPRECATED; + w[jss::message] = + "Some fields from your request are deprecated. Please check the " + "documentation at " + "https://xrpl.org/docs/references/http-websocket-apis/ " + "and update your request. Field `type` is deprecated."; + } + + if (warnings.size()) + value[jss::warnings] = std::move(warnings); +} + } // namespace RPC std::pair diff --git a/src/xrpld/rpc/handlers/LedgerHandler.h b/src/xrpld/rpc/handlers/LedgerHandler.h index fbf60fb22e..3285118d11 100644 --- a/src/xrpld/rpc/handlers/LedgerHandler.h +++ b/src/xrpld/rpc/handlers/LedgerHandler.h @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -37,9 +36,8 @@ public: Status check(); - template void - writeResult(Object&); + writeResult(Json::Value&); static constexpr char name[] = "ledger"; @@ -59,49 +57,6 @@ private: int options_ = 0; }; -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -// -// Implementation. - -template -void -LedgerHandler::writeResult(Object& value) -{ - if (ledger_) - { - Json::copyFrom(value, result_); - addJson(value, {*ledger_, &context_, options_, queueTxs_}); - } - else - { - auto& master = context_.app.getLedgerMaster(); - { - auto&& closed = Json::addObject(value, jss::closed); - addJson(closed, {*master.getClosedLedger(), &context_, 0}); - } - { - auto&& open = Json::addObject(value, jss::open); - addJson(open, {*master.getCurrentLedger(), &context_, 0}); - } - } - - Json::Value warnings{Json::arrayValue}; - if (context_.params.isMember(jss::type)) - { - Json::Value& w = warnings.append(Json::objectValue); - w[jss::id] = warnRPC_FIELDS_DEPRECATED; - w[jss::message] = - "Some fields from your request are deprecated. Please check the " - "documentation at " - "https://xrpl.org/docs/references/http-websocket-apis/ " - "and update your request. Field `type` is deprecated."; - } - - if (warnings.size()) - value[jss::warnings] = std::move(warnings); -} - } // namespace RPC } // namespace xrpl diff --git a/src/xrpld/rpc/handlers/Version.h b/src/xrpld/rpc/handlers/Version.h index 8af2fd20bc..b8f9512ef3 100644 --- a/src/xrpld/rpc/handlers/Version.h +++ b/src/xrpld/rpc/handlers/Version.h @@ -20,9 +20,8 @@ public: return Status::OK; } - template void - writeResult(Object& obj) + writeResult(Json::Value& obj) { setVersion(obj, apiVersion_, betaEnabled_); } From f059f0beda746b444d191a207b343ac457fd58db Mon Sep 17 00:00:00 2001 From: Bart Date: Wed, 17 Dec 2025 18:21:01 -0500 Subject: [PATCH 10/20] Set version to 3.2.0-b0 (#6153) --- src/libxrpl/protocol/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libxrpl/protocol/BuildInfo.cpp b/src/libxrpl/protocol/BuildInfo.cpp index 472a8cb039..65caa9ecd3 100644 --- a/src/libxrpl/protocol/BuildInfo.cpp +++ b/src/libxrpl/protocol/BuildInfo.cpp @@ -17,7 +17,7 @@ namespace BuildInfo { // and follow the format described at http://semver.org/ //------------------------------------------------------------------------------ // clang-format off -char const* const versionString = "3.1.0-b0" +char const* const versionString = "3.2.0-b0" // clang-format on #if defined(DEBUG) || defined(SANITIZER) From 40198d9792af68df4f5a7610c614e8420c487d7b Mon Sep 17 00:00:00 2001 From: Bart Date: Mon, 22 Dec 2025 16:30:23 -0500 Subject: [PATCH 11/20] ci: Remove superfluous build directory creation (#6159) This change modifies the build directory structure from `build/build/xxx` or `.build/build/xxx` to just `build/xxx`. Namely, the `conanfile.py` has the CMake generators build directory hardcoded to `build/generators`. We may as well leverage the top-level build directory without introducing another layer of directory nesting. --- .github/actions/build-deps/action.yml | 9 +----- .github/workflows/publish-docs.yml | 2 +- .../workflows/reusable-build-test-config.yml | 29 +++++++++---------- .github/workflows/reusable-build-test.yml | 6 ---- .github/workflows/upload-conan-deps.yml | 1 - 5 files changed, 15 insertions(+), 32 deletions(-) diff --git a/.github/actions/build-deps/action.yml b/.github/actions/build-deps/action.yml index f20eb3a595..d1fb980dac 100644 --- a/.github/actions/build-deps/action.yml +++ b/.github/actions/build-deps/action.yml @@ -4,9 +4,6 @@ description: "Install Conan dependencies, optionally forcing a rebuild of all de # Note that actions do not support 'type' and all inputs are strings, see # https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#inputs. inputs: - build_dir: - description: "The directory where to build." - required: true build_type: description: 'The build type to use ("Debug", "Release").' required: true @@ -28,17 +25,13 @@ runs: - name: Install Conan dependencies shell: bash env: - BUILD_DIR: ${{ inputs.build_dir }} BUILD_NPROC: ${{ inputs.build_nproc }} BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }} BUILD_TYPE: ${{ inputs.build_type }} LOG_VERBOSITY: ${{ inputs.log_verbosity }} run: | echo 'Installing dependencies.' - mkdir -p "${BUILD_DIR}" - cd "${BUILD_DIR}" conan install \ - --output-folder . \ --build="${BUILD_OPTION}" \ --options:host='&:tests=True' \ --options:host='&:xrpld=True' \ @@ -46,4 +39,4 @@ runs: --conf:all tools.build:jobs=${BUILD_NPROC} \ --conf:all tools.build:verbosity="${LOG_VERBOSITY}" \ --conf:all tools.compilation:verbosity="${LOG_VERBOSITY}" \ - .. + . diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 6f0927a2b3..c37a82a2f3 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -22,7 +22,7 @@ defaults: shell: bash env: - BUILD_DIR: .build + BUILD_DIR: build NPROC_SUBTRACT: 2 jobs: diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index 43acfab542..98bf107225 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -3,11 +3,6 @@ name: Build and test configuration on: workflow_call: inputs: - build_dir: - description: "The directory where to build." - required: true - type: string - build_only: description: 'Whether to only build or to build and test the code ("true", "false").' required: true @@ -59,6 +54,11 @@ defaults: run: shell: bash +env: + # Conan installs the generators in the build/generators directory, see the + # layout() method in conanfile.py. We then run CMake from the build directory. + BUILD_DIR: build + jobs: build-and-test: name: ${{ inputs.config_name }} @@ -96,7 +96,6 @@ jobs: - name: Build dependencies uses: ./.github/actions/build-deps with: - build_dir: ${{ inputs.build_dir }} build_nproc: ${{ steps.nproc.outputs.nproc }} build_type: ${{ inputs.build_type }} # Set the verbosity to "quiet" for Windows to avoid an excessive @@ -104,7 +103,7 @@ jobs: log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }} - name: Configure CMake - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} env: BUILD_TYPE: ${{ inputs.build_type }} CMAKE_ARGS: ${{ inputs.cmake_args }} @@ -117,7 +116,7 @@ jobs: .. - name: Build the binary - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} env: BUILD_NPROC: ${{ steps.nproc.outputs.nproc }} BUILD_TYPE: ${{ inputs.build_type }} @@ -132,8 +131,6 @@ jobs: - name: Upload the binary (Linux) if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - env: - BUILD_DIR: ${{ inputs.build_dir }} with: name: xrpld-${{ inputs.config_name }} path: ${{ env.BUILD_DIR }}/xrpld @@ -142,7 +139,7 @@ jobs: - name: Check linking (Linux) if: ${{ runner.os == 'Linux' }} - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} run: | ldd ./xrpld if [ "$(ldd ./xrpld | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then @@ -154,13 +151,13 @@ jobs: - name: Verify presence of instrumentation (Linux) if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }} - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} run: | ./xrpld --version | grep libvoidstar - name: Run the separate tests if: ${{ !inputs.build_only }} - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} # Windows locks some of the build files while running tests, and parallel jobs can collide env: BUILD_TYPE: ${{ inputs.build_type }} @@ -173,7 +170,7 @@ jobs: - name: Run the embedded tests if: ${{ !inputs.build_only }} - working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', inputs.build_dir, inputs.build_type) || inputs.build_dir }} + working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', env.BUILD_DIR, inputs.build_type) || env.BUILD_DIR }} env: BUILD_NPROC: ${{ steps.nproc.outputs.nproc }} run: | @@ -189,7 +186,7 @@ jobs: - name: Prepare coverage report if: ${{ !inputs.build_only && env.ENABLED_COVERAGE == 'true' }} - working-directory: ${{ inputs.build_dir }} + working-directory: ${{ env.BUILD_DIR }} env: BUILD_NPROC: ${{ steps.nproc.outputs.nproc }} BUILD_TYPE: ${{ inputs.build_type }} @@ -207,7 +204,7 @@ jobs: disable_search: true disable_telem: true fail_ci_if_error: true - files: ${{ inputs.build_dir }}/coverage.xml + files: ${{ env.BUILD_DIR }}/coverage.xml plugins: noop token: ${{ secrets.CODECOV_TOKEN }} verbose: true diff --git a/.github/workflows/reusable-build-test.yml b/.github/workflows/reusable-build-test.yml index c6e991df79..7f14aacb9b 100644 --- a/.github/workflows/reusable-build-test.yml +++ b/.github/workflows/reusable-build-test.yml @@ -8,11 +8,6 @@ name: Build and test on: workflow_call: inputs: - build_dir: - description: "The directory where to build." - required: false - type: string - default: ".build" os: description: 'The operating system to use for the build ("linux", "macos", "windows").' required: true @@ -46,7 +41,6 @@ jobs: matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} max-parallel: 10 with: - build_dir: ${{ inputs.build_dir }} build_only: ${{ matrix.build_only }} build_type: ${{ matrix.build_type }} cmake_args: ${{ matrix.cmake_args }} diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index ec283e564c..5024666394 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -92,7 +92,6 @@ jobs: - name: Build dependencies uses: ./.github/actions/build-deps with: - build_dir: .build build_nproc: ${{ steps.nproc.outputs.nproc }} build_type: ${{ matrix.build_type }} force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }} From b7139da4d09c55cae3f6ec69c092b1c87c34b631 Mon Sep 17 00:00:00 2001 From: Michael Legleux Date: Tue, 23 Dec 2025 16:38:35 -0800 Subject: [PATCH 12/20] fix: Remove cryptographic libs from libxrpl Conan package (#6163) * fix: rm crypto libs and fix protobuf path * update/rm comments --- conanfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 8dc09da0af..48e28cb275 100644 --- a/conanfile.py +++ b/conanfile.py @@ -182,12 +182,10 @@ class Xrpl(ConanFile): libxrpl.libs = [ "xrpl", "xrpl.libpb", - "ed25519", - "secp256k1", ] # TODO: Fix the protobufs to include each other relative to - # `include/`, not `include/ripple/proto/`. - libxrpl.includedirs = ["include", "include/ripple/proto"] + # `include/`, not `include/xrpl/proto/`. + libxrpl.includedirs = ["include", "include/xrpl/proto"] libxrpl.requires = [ "boost::headers", "boost::chrono", From 0f23ad820c84d0c8e97e2f0caa7c2e2690397207 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 2 Jan 2026 16:53:33 +0000 Subject: [PATCH 13/20] chore: Pin ruamel.yaml<0.19 in pre-commit-hooks (#6166) See https://github.com/pre-commit/pre-commit-hooks/issues/1229 for more details. --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c85e0798f7..01b0e85930 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,10 +13,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: + # https://github.com/pre-commit/pre-commit-hooks/issues/1229 + # regarding ruamel.yaml version - id: trailing-whitespace + additional_dependencies: [ruamel.yaml<0.19] - id: end-of-file-fixer + additional_dependencies: [ruamel.yaml<0.19] - id: mixed-line-ending + additional_dependencies: [ruamel.yaml<0.19] - id: check-merge-conflict + additional_dependencies: [ruamel.yaml<0.19] args: [--assume-in-merge] - repo: https://github.com/pre-commit/mirrors-clang-format From 0b87a26f04641b1d48a7738d6a2228bc02159e85 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 5 Jan 2026 14:01:14 +0000 Subject: [PATCH 14/20] Revert "chore: Pin ruamel.yaml<0.19 in pre-commit-hooks (#6166)" (#6167) This reverts commit 0f23ad820c84d0c8e97e2f0caa7c2e2690397207. --- .pre-commit-config.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01b0e85930..c85e0798f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,16 +13,10 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - # https://github.com/pre-commit/pre-commit-hooks/issues/1229 - # regarding ruamel.yaml version - id: trailing-whitespace - additional_dependencies: [ruamel.yaml<0.19] - id: end-of-file-fixer - additional_dependencies: [ruamel.yaml<0.19] - id: mixed-line-ending - additional_dependencies: [ruamel.yaml<0.19] - id: check-merge-conflict - additional_dependencies: [ruamel.yaml<0.19] args: [--assume-in-merge] - repo: https://github.com/pre-commit/mirrors-clang-format From 3d1b3a49b3601a0a7037fa0b19d5df7b5e0e2fc1 Mon Sep 17 00:00:00 2001 From: Bart Date: Mon, 5 Jan 2026 09:55:12 -0500 Subject: [PATCH 15/20] refactor: Rename `rippled.cfg` to `xrpld.cfg` (#6098) This change renames all occurrences of `rippled.cfg` to `xrpld.cfg`. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts. For the time being it maintains support for `rippled.cfg` as config file, if `xrpld.cfg` does not exist. --- .github/scripts/rename/README.md | 4 + .github/scripts/rename/config.sh | 72 ++++ .github/workflows/reusable-check-rename.yml | 2 + .gitignore | 1 + cfg/validators-example.txt | 2 +- ...{rippled-example.cfg => xrpld-example.cfg} | 108 +++--- cmake/XrplInstall.cmake | 2 +- include/xrpl/core/PerfLog.h | 2 +- include/xrpl/nodestore/README.md | 2 +- src/libxrpl/nodestore/ManagerImp.cpp | 4 +- src/test/core/Config_test.cpp | 310 +++++++++++++----- src/xrpld/app/misc/SHAMapStoreImp.h | 2 +- src/xrpld/core/Config.h | 1 + src/xrpld/core/detail/Config.cpp | 113 +++---- src/xrpld/overlay/README.md | 2 +- src/xrpld/overlay/detail/OverlayImpl.cpp | 2 +- 16 files changed, 433 insertions(+), 196 deletions(-) create mode 100755 .github/scripts/rename/config.sh rename cfg/{rippled-example.cfg => xrpld-example.cfg} (94%) diff --git a/.github/scripts/rename/README.md b/.github/scripts/rename/README.md index 392f0b1efc..8336f23bec 100644 --- a/.github/scripts/rename/README.md +++ b/.github/scripts/rename/README.md @@ -31,6 +31,9 @@ run from the repository root. the `xrpld` binary. 5. `.github/scripts/rename/namespace.sh`: This script will rename the C++ namespaces from `ripple` to `xrpl`. +6. `.github/scripts/rename/config.sh`: This script will rename the config from + `rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old + filename will still be accepted. You can run all these scripts from the repository root as follows: @@ -40,4 +43,5 @@ You can run all these scripts from the repository root as follows: ./.github/scripts/rename/cmake.sh . ./.github/scripts/rename/binary.sh . ./.github/scripts/rename/namespace.sh . +./.github/scripts/rename/config.sh . ``` diff --git a/.github/scripts/rename/config.sh b/.github/scripts/rename/config.sh new file mode 100755 index 0000000000..7f36e8fd21 --- /dev/null +++ b/.github/scripts/rename/config.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# Exit the script as soon as an error occurs. +set -e + +# On MacOS, ensure that GNU sed is installed and available as `gsed`. +SED_COMMAND=sed +if [[ "${OSTYPE}" == 'darwin'* ]]; then + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed +fi + +# This script renames the config from `rippled.cfg` to `xrpld.cfg`, and updates +# the code accordingly. The old filename will still be accepted. +# Usage: .github/scripts/rename/config.sh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +DIRECTORY=$1 +echo "Processing directory: ${DIRECTORY}" +if [ ! -d "${DIRECTORY}" ]; then + echo "Error: Directory '${DIRECTORY}' does not exist." + exit 1 +fi +pushd ${DIRECTORY} + +# Add the xrpld.cfg to the .gitignore. +if ! grep -q 'xrpld.cfg' .gitignore; then + ${SED_COMMAND} -i '/rippled.cfg/a\ +/xrpld.cfg' .gitignore +fi + +# Rename the files. +if [ -e rippled.cfg ]; then + mv rippled.cfg xrpld.cfg +fi +if [ -e cfg/rippled-example.cfg ]; then + mv cfg/rippled-example.cfg cfg/xrpld-example.cfg +fi + +# Rename inside the files. +DIRECTORIES=("cfg" "cmake" "include" "src") +for DIRECTORY in "${DIRECTORIES[@]}"; do + echo "Processing directory: ${DIRECTORY}" + + find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}" + done +done +${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg +${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp +${SED_COMMAND} -i 's/ripplevalidators/xrplvalidators/g' src/test/core/Config_test.cpp +${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' src/test/core/Config_test.cpp +${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp +${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp + + +# Restore the old config file name in the code that maintains support for now. +${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp + +# Restore an URL. +${SED_COMMAND} -i 's/connect-your-xrpld-to-the-xrp-test-net.html/connect-your-rippled-to-the-xrp-test-net.html/g' cfg/xrpld-example.cfg + +popd +echo "Renaming complete." diff --git a/.github/workflows/reusable-check-rename.yml b/.github/workflows/reusable-check-rename.yml index fb9ed2c6a8..af55084405 100644 --- a/.github/workflows/reusable-check-rename.yml +++ b/.github/workflows/reusable-check-rename.yml @@ -29,6 +29,8 @@ jobs: run: .github/scripts/rename/binary.sh . - name: Check namespaces run: .github/scripts/rename/namespace.sh . + - name: Check config name + run: .github/scripts/rename/config.sh . - name: Check for differences env: MESSAGE: | diff --git a/.gitignore b/.gitignore index 55844462e5..c4e81408bb 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ gmon.out # Customized configs. /rippled.cfg +/xrpld.cfg /validators.txt # Locally patched Conan recipes diff --git a/cfg/validators-example.txt b/cfg/validators-example.txt index dbcff90f12..6eb49da697 100644 --- a/cfg/validators-example.txt +++ b/cfg/validators-example.txt @@ -1,7 +1,7 @@ # # Default validators.txt # -# This file is located in the same folder as your rippled.cfg file +# This file is located in the same folder as your xrpld.cfg file # and defines which validators your server trusts not to collude. # # This file is UTF-8 with DOS, UNIX, or Mac style line endings. diff --git a/cfg/rippled-example.cfg b/cfg/xrpld-example.cfg similarity index 94% rename from cfg/rippled-example.cfg rename to cfg/xrpld-example.cfg index 5db008431d..b5180dce52 100644 --- a/cfg/rippled-example.cfg +++ b/cfg/xrpld-example.cfg @@ -29,18 +29,18 @@ # # Purpose # -# This file documents and provides examples of all rippled server process -# configuration options. When the rippled server instance is launched, it +# This file documents and provides examples of all xrpld server process +# configuration options. When the xrpld server instance is launched, it # looks for a file with the following name: # -# rippled.cfg +# xrpld.cfg # -# For more information on where the rippled server instance searches for the +# For more information on where the xrpld server instance searches for the # file, visit: # # https://xrpl.org/commandline-usage.html#generic-options # -# This file should be named rippled.cfg. This file is UTF-8 with DOS, UNIX, +# This file should be named xrpld.cfg. This file is UTF-8 with DOS, UNIX, # or Mac style end of lines. Blank lines and lines beginning with '#' are # ignored. Undefined sections are reserved. No escapes are currently defined. # @@ -89,8 +89,8 @@ # # # -# rippled offers various server protocols to clients making inbound -# connections. The listening ports rippled uses are "universal" ports +# xrpld offers various server protocols to clients making inbound +# connections. The listening ports xrpld uses are "universal" ports # which may be configured to handshake in one or more of the available # supported protocols. These universal ports simplify administration: # A single open port can be used for multiple protocols. @@ -103,7 +103,7 @@ # # A list of port names and key/value pairs. A port name must start with a # letter and contain only letters and numbers. The name is not case-sensitive. -# For each name in this list, rippled will look for a configuration file +# For each name in this list, xrpld will look for a configuration file # section with the same name and use it to create a listening port. The # name is informational only; the choice of name does not affect the function # of the listening port. @@ -134,7 +134,7 @@ # ip = 127.0.0.1 # protocol = http # -# When rippled is used as a command line client (for example, issuing a +# When xrpld is used as a command line client (for example, issuing a # server stop command), the first port advertising the http or https # protocol will be used to make the connection. # @@ -175,7 +175,7 @@ # same time. It is possible have both Websockets and Secure Websockets # together in one port. # -# NOTE If no ports support the peer protocol, rippled cannot +# NOTE If no ports support the peer protocol, xrpld cannot # receive incoming peer connections or become a superpeer. # # limit = @@ -194,7 +194,7 @@ # required. IP address restrictions, if any, will be checked in addition # to the credentials specified here. # -# When acting in the client role, rippled will supply these credentials +# When acting in the client role, xrpld will supply these credentials # using HTTP's Basic Authentication headers when making outbound HTTP/S # requests. # @@ -237,7 +237,7 @@ # WS, or WSS protocol interfaces. If administrative commands are # disabled for a port, these credentials have no effect. # -# When acting in the client role, rippled will supply these credentials +# When acting in the client role, xrpld will supply these credentials # in the submitted JSON for any administrative command requests when # invoking JSON-RPC commands on remote servers. # @@ -258,7 +258,7 @@ # resource controls will default to those for non-administrative users. # # The secure_gateway IP addresses are intended to represent -# proxies. Since rippled trusts these hosts, they must be +# proxies. Since xrpld trusts these hosts, they must be # responsible for properly authenticating the remote user. # # If some IP addresses are included for both "admin" and @@ -272,7 +272,7 @@ # Use the specified files when configuring SSL on the port. # # NOTE If no files are specified and secure protocols are selected, -# rippled will generate an internal self-signed certificate. +# xrpld will generate an internal self-signed certificate. # # The files have these meanings: # @@ -297,12 +297,12 @@ # Control the ciphers which the server will support over SSL on the port, # specified using the OpenSSL "cipher list format". # -# NOTE If unspecified, rippled will automatically configure a modern +# NOTE If unspecified, xrpld will automatically configure a modern # cipher suite. This default suite should be widely supported. # # You should not modify this string unless you have a specific # reason and cryptographic expertise. Incorrect modification may -# keep rippled from connecting to other instances of rippled or +# keep xrpld from connecting to other instances of xrpld or # prevent RPC and WebSocket clients from connecting. # # send_queue_limit = [1..65535] @@ -382,7 +382,7 @@ #----------------- # # These settings control security and access attributes of the Peer to Peer -# server section of the rippled process. Peer Protocol implements the +# server section of the xrpld process. Peer Protocol implements the # Ripple Payment protocol. It is over peer connections that transactions # and validations are passed from to machine to machine, to determine the # contents of validated ledgers. @@ -396,7 +396,7 @@ # true - enables compression # false - disables compression [default]. # -# The rippled server can save bandwidth by compressing its peer-to-peer communications, +# The xrpld server can save bandwidth by compressing its peer-to-peer communications, # at a cost of greater CPU usage. If you enable link compression, # the server automatically compresses communications with peer servers # that also have link compression enabled. @@ -432,7 +432,7 @@ # # [ips_fixed] # -# List of IP addresses or hostnames to which rippled should always attempt to +# List of IP addresses or hostnames to which xrpld should always attempt to # maintain peer connections with. This is useful for manually forming private # networks, for example to configure a validation server that connects to the # Ripple network through a public-facing server, or for building a set @@ -573,7 +573,7 @@ # # minimum_txn_in_ledger_standalone = # -# Like minimum_txn_in_ledger when rippled is running in standalone +# Like minimum_txn_in_ledger when xrpld is running in standalone # mode. Default: 1000. # # target_txn_in_ledger = @@ -710,7 +710,7 @@ # # [validator_token] # -# This is an alternative to [validation_seed] that allows rippled to perform +# This is an alternative to [validation_seed] that allows xrpld to perform # validation without having to store the validator keys on the network # connected server. The field should contain a single token in the form of a # base64-encoded blob. @@ -745,7 +745,7 @@ # # Specify the file by its name or path. # Unless an absolute path is specified, it will be considered relative to -# the folder in which the rippled.cfg file is located. +# the folder in which the xrpld.cfg file is located. # # Examples: # /home/ripple/validators.txt @@ -840,7 +840,7 @@ # # 0: Disable the ledger replay feature [default] # 1: Enable the ledger replay feature. With this feature enabled, when -# acquiring a ledger from the network, a rippled node only downloads +# acquiring a ledger from the network, a xrpld node only downloads # the ledger header and the transactions instead of the whole ledger. # And the ledger is built by applying the transactions to the parent # ledger. @@ -851,7 +851,7 @@ # #---------------- # -# The rippled server instance uses HTTPS GET requests in a variety of +# The xrpld server instance uses HTTPS GET requests in a variety of # circumstances, including but not limited to contacting trusted domains to # fetch information such as mapping an email address to a Ripple Payment # Network address. @@ -891,7 +891,7 @@ # #------------ # -# rippled creates 4 SQLite database to hold bookkeeping information +# xrpld creates 4 SQLite database to hold bookkeeping information # about transactions, local credentials, and various other things. # It also creates the NodeDB, which holds all the objects that # make up the current and historical ledgers. @@ -902,7 +902,7 @@ # the performance of the server. # # Partial pathnames will be considered relative to the location of -# the rippled.cfg file. +# the xrpld.cfg file. # # [node_db] Settings for the Node Database (required) # @@ -920,11 +920,11 @@ # type = NuDB # # NuDB is a high-performance database written by Ripple Labs and optimized -# for rippled and solid-state drives. +# for xrpld and solid-state drives. # # NuDB maintains its high speed regardless of the amount of history # stored. Online delete may be selected, but is not required. NuDB is -# available on all platforms that rippled runs on. +# available on all platforms that xrpld runs on. # # type = RocksDB # @@ -1049,7 +1049,7 @@ # # recovery_wait_seconds # The online delete process checks periodically -# that rippled is still in sync with the network, +# that xrpld is still in sync with the network, # and that the validated ledger is less than # 'age_threshold_seconds' old. If not, then continue # sleeping for this number of seconds and @@ -1069,8 +1069,8 @@ # The server creates and maintains 4 to 5 bookkeeping SQLite databases in # the 'database_path' location. If you omit this configuration setting, # the server creates a directory called "db" located in the same place as -# your rippled.cfg file. -# Partial pathnames are relative to the location of the rippled executable. +# your xrpld.cfg file. +# Partial pathnames are relative to the location of the xrpld executable. # # [sqlite] Tuning settings for the SQLite databases (optional) # @@ -1120,7 +1120,7 @@ # The default is "wal", which uses a write-ahead # log to implement database transactions. # Alternately, "memory" saves disk I/O, but if -# rippled crashes during a transaction, the +# xrpld crashes during a transaction, the # database is likely to be corrupted. # See https://www.sqlite.org/pragma.html#pragma_journal_mode # for more details about the available options. @@ -1130,7 +1130,7 @@ # synchronous Valid values: off, normal, full, extra # The default is "normal", which works well with # the "wal" journal mode. Alternatively, "off" -# allows rippled to continue as soon as data is +# allows xrpld to continue as soon as data is # passed to the OS, which can significantly # increase speed, but risks data corruption if # the host computer crashes before writing that @@ -1144,7 +1144,7 @@ # The default is "file", which will use files # for temporary database tables and indices. # Alternatively, "memory" may save I/O, but -# rippled does not currently use many, if any, +# xrpld does not currently use many, if any, # of these temporary objects. # See https://www.sqlite.org/pragma.html#pragma_temp_store # for more details about the available options. @@ -1173,7 +1173,7 @@ # # These settings are designed to help server administrators diagnose # problems, and obtain detailed information about the activities being -# performed by the rippled process. +# performed by the xrpld process. # # # @@ -1190,7 +1190,7 @@ # # Configuration parameters for the Beast. Insight stats collection module. # -# Insight is a module that collects information from the areas of rippled +# Insight is a module that collects information from the areas of xrpld # that have instrumentation. The configuration parameters control where the # collection metrics are sent. The parameters are expressed as key = value # pairs with no white space. The main parameter is the choice of server: @@ -1199,7 +1199,7 @@ # # Choice of server to send metrics to. Currently the only choice is # "statsd" which sends UDP packets to a StatsD daemon, which must be -# running while rippled is running. More information on StatsD is +# running while xrpld is running. More information on StatsD is # available here: # https://github.com/b/statsd_spec # @@ -1209,7 +1209,7 @@ # in the format, n.n.n.n:port. # # "prefix" A string prepended to each collected metric. This is used -# to distinguish between different running instances of rippled. +# to distinguish between different running instances of xrpld. # # If this section is missing, or the server type is unspecified or unknown, # statistics are not collected or reported. @@ -1236,7 +1236,7 @@ # # Example: # [perf] -# perf_log=/var/log/rippled/perf.log +# perf_log=/var/log/xrpld/perf.log # log_interval=2 # #------------------------------------------------------------------------------- @@ -1246,7 +1246,7 @@ #---------- # # The vote settings configure settings for the entire Ripple network. -# While a single instance of rippled cannot unilaterally enforce network-wide +# While a single instance of xrpld cannot unilaterally enforce network-wide # settings, these choices become part of the instance's vote during the # consensus process for each voting ledger. # @@ -1260,7 +1260,7 @@ # The reference transaction is the simplest form of transaction. # It represents an XRP payment between two parties. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: @@ -1272,7 +1272,7 @@ # account's XRP balance that is at or below the reserve may only be # spent on transaction fees, and not transferred out of the account. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: @@ -1284,7 +1284,7 @@ # each ledger item owned by the account. Ledger items an account may # own include trust lines, open orders, and tickets. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: @@ -1326,7 +1326,7 @@ # tool instead. # # This flag has no effect on the "sign" and "sign_for" command line options -# that rippled makes available. +# that xrpld makes available. # # The default value of this field is "false" # @@ -1405,7 +1405,7 @@ #-------------------- # # Administrators can use these values as a starting point for configuring -# their instance of rippled, but each value should be checked to make sure +# their instance of xrpld, but each value should be checked to make sure # it meets the business requirements for the organization. # # Server @@ -1415,7 +1415,7 @@ # "peer" # # Peer protocol open to everyone. This is required to accept -# incoming rippled connections. This does not affect automatic +# incoming xrpld connections. This does not affect automatic # or manual outgoing Peer protocol connections. # # "rpc" @@ -1432,7 +1432,7 @@ # # ETL commands for Clio. We recommend setting secure_gateway # in this section to a comma-separated list of the addresses -# of your Clio servers, in order to bypass rippled's rate limiting. +# of your Clio servers, in order to bypass xrpld's rate limiting. # # This port is commented out but can be enabled by removing # the '#' from each corresponding line including the entry under [server] @@ -1449,8 +1449,8 @@ # NOTE # # To accept connections on well known ports such as 80 (HTTP) or -# 443 (HTTPS), most operating systems will require rippled to -# run with administrator privileges, or else rippled will not start. +# 443 (HTTPS), most operating systems will require xrpld to +# run with administrator privileges, or else xrpld will not start. [server] port_rpc_admin_local @@ -1496,7 +1496,7 @@ secure_gateway = 127.0.0.1 #------------------------------------------------------------------------------- -# This is primary persistent datastore for rippled. This includes transaction +# This is primary persistent datastore for xrpld. This includes transaction # metadata, account states, and ledger headers. Helpful information can be # found at https://xrpl.org/capacity-planning.html#node-db-type # type=NuDB is recommended for non-validators with fast SSDs. Validators or @@ -1511,19 +1511,19 @@ secure_gateway = 127.0.0.1 # deletion. [node_db] type=NuDB -path=/var/lib/rippled/db/nudb +path=/var/lib/xrpld/db/nudb nudb_block_size=4096 online_delete=512 advisory_delete=0 [database_path] -/var/lib/rippled/db +/var/lib/xrpld/db # This needs to be an absolute directory reference, not a relative one. # Modify this value as required. [debug_logfile] -/var/log/rippled/debug.log +/var/log/xrpld/debug.log # To use the XRP test network # (see https://xrpl.org/connect-your-rippled-to-the-xrp-test-net.html), @@ -1533,7 +1533,7 @@ advisory_delete=0 # File containing trusted validator keys or validator list publishers. # Unless an absolute path is specified, it will be considered relative to the -# folder in which the rippled.cfg file is located. +# folder in which the xrpld.cfg file is located. [validators_file] validators.txt diff --git a/cmake/XrplInstall.cmake b/cmake/XrplInstall.cmake index 67aca8f048..310436998d 100644 --- a/cmake/XrplInstall.cmake +++ b/cmake/XrplInstall.cmake @@ -62,7 +62,7 @@ if (is_root_project AND TARGET xrpld) message (\"-- Skipping : \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\") endif () endmacro() - copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/rippled-example.cfg\" etc rippled.cfg) + copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg) copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt) ") install(CODE " diff --git a/include/xrpl/core/PerfLog.h b/include/xrpl/core/PerfLog.h index eb009de433..f8ca779963 100644 --- a/include/xrpl/core/PerfLog.h +++ b/include/xrpl/core/PerfLog.h @@ -40,7 +40,7 @@ public: using microseconds = std::chrono::microseconds; /** - * Configuration from [perf] section of rippled.cfg. + * Configuration from [perf] section of xrpld.cfg. */ struct Setup { diff --git a/include/xrpl/nodestore/README.md b/include/xrpl/nodestore/README.md index a5d1128d17..83da29d9ce 100644 --- a/include/xrpl/nodestore/README.md +++ b/include/xrpl/nodestore/README.md @@ -130,7 +130,7 @@ newer versions of RocksDB (TBD). ## Discussion RocksDBQuickFactory is intended to provide a testbed for comparing potential -rocksdb performance with the existing recommended configuration in rippled.cfg. +rocksdb performance with the existing recommended configuration in xrpld.cfg. Through various executions and profiling some conclusions are presented below. - If the write ahead log is enabled, insert speed soon clogs up under load. The diff --git a/src/libxrpl/nodestore/ManagerImp.cpp b/src/libxrpl/nodestore/ManagerImp.cpp index b53d03e668..58accd4108 100644 --- a/src/libxrpl/nodestore/ManagerImp.cpp +++ b/src/libxrpl/nodestore/ManagerImp.cpp @@ -18,8 +18,8 @@ void ManagerImp::missing_backend() { Throw( - "Your rippled.cfg is missing a [node_db] entry, " - "please see the rippled-example.cfg file!"); + "Your xrpld.cfg is missing a [node_db] entry, " + "please see the xrpld-example.cfg file!"); } // We shouldn't rely on global variables for lifetime management because their diff --git a/src/test/core/Config_test.cpp b/src/test/core/Config_test.cpp index 86f09e6c02..139e8702eb 100644 --- a/src/test/core/Config_test.cpp +++ b/src/test/core/Config_test.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -18,7 +19,7 @@ namespace detail { std::string configContents(std::string const& dbPath, std::string const& validatorsFile) { - static boost::format configContentsTemplate(R"rippleConfig( + static boost::format configContentsTemplate(R"xrpldConfig( [server] port_rpc port_peer @@ -51,14 +52,14 @@ protocol = wss [node_size] medium -# This is primary persistent datastore for rippled. This includes transaction +# This is primary persistent datastore for xrpld. This includes transaction # metadata, account states, and ledger headers. Helpful information can be # found on https://xrpl.org/capacity-planning.html#node-db-type # delete old ledgers while maintaining at least 2000. Do not require an # external administrative command to initiate deletion. [node_db] type=memory -path=/Users/dummy/ripple/config/db/rocksdb +path=/Users/dummy/xrpld/config/db/rocksdb open_files=2000 filter_bits=12 cache_mb=256 @@ -72,7 +73,7 @@ file_size_mult=2 # This needs to be an absolute directory reference, not a relative one. # Modify this value as required. [debug_logfile] -/Users/dummy/ripple/config/log/debug.log +/Users/dummy/xrpld/config/log/debug.log [sntp_servers] time.windows.com @@ -97,7 +98,7 @@ r.ripple.com 51235 [sqdb] backend=sqlite -)rippleConfig"); +)xrpldConfig"); std::string dbPathSection = dbPath.empty() ? "" : "[database_path]\n" + dbPath; @@ -107,9 +108,9 @@ backend=sqlite } /** - Write a rippled config file and remove when done. + Write a xrpld config file and remove when done. */ -class RippledCfgGuard : public xrpl::detail::FileDirGuard +class FileCfgGuard : public xrpl::detail::FileDirGuard { private: path dataDir_; @@ -119,17 +120,18 @@ private: Config config_; public: - RippledCfgGuard( + FileCfgGuard( beast::unit_test::suite& test, path subDir, path const& dbPath, + path const& configFile, path const& validatorsFile, bool useCounter = true, std::string confContents = "") : FileDirGuard( test, std::move(subDir), - path(Config::configFileName), + configFile, confContents.empty() ? configContents(dbPath.string(), validatorsFile.string()) : confContents, @@ -171,7 +173,7 @@ public: return fileExists(); } - ~RippledCfgGuard() + ~FileCfgGuard() { try { @@ -182,7 +184,7 @@ public: catch (std::exception& e) { // if we throw here, just let it die. - test_.log << "Error in ~RippledCfgGuard: " << e.what() << std::endl; + test_.log << "Error in ~FileCfgGuard: " << e.what() << std::endl; }; } }; @@ -190,7 +192,7 @@ public: std::string valFileContents() { - std::string configContents(R"rippleConfig( + std::string configContents(R"xrpldConfig( [validators] n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7 n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj @@ -204,8 +206,8 @@ nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8 nHUPDdcdb2Y5DZAJne4c2iabFuAP3F34xZUgYQT2NH7qfkdapgnz [validator_list_sites] -recommendedripplevalidators.com -moreripplevalidators.net +recommendedxrplvalidators.com +morexrplvalidators.net [validator_list_keys] 03E74EE14CB525AFBB9F1B7D86CD58ECC4B91452294B42AB4E78F260BD905C091D @@ -213,7 +215,7 @@ moreripplevalidators.net [validator_list_threshold] 2 -)rippleConfig"); +)xrpldConfig"); return configContents; } @@ -270,7 +272,7 @@ public: Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [server] port_rpc port_peer @@ -278,7 +280,7 @@ port_wss_admin [ssl_verify] 0 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); @@ -291,6 +293,126 @@ port_wss_admin BEAST_EXPECT(c.legacy("not_in_file") == "new_value"); } void + testConfigFile() + { + testcase("config_file"); + + using namespace boost::filesystem; + auto const cwd = current_path(); + + // Test both config file names. + char const* configFiles[] = { + Config::configFileName, Config::configLegacyName}; + + // Config file in current directory. + for (auto const& configFile : configFiles) + { + // Use a temporary directory for testing. + beast::temp_dir td; + current_path(td.path()); + path const f = td.file(configFile); + std::ofstream o(f.string()); + o << detail::configContents("", ""); + o.close(); + + // Load the config file from the current directory and verify it. + Config c; + c.setup("", true, false, true); + BEAST_EXPECT(c.section(SECTION_DEBUG_LOGFILE).values().size() == 1); + BEAST_EXPECT( + c.section(SECTION_DEBUG_LOGFILE).values()[0] == + "/Users/dummy/xrpld/config/log/debug.log"); + } + + // Config file in HOME or XDG_CONFIG_HOME directory. +#if BOOST_OS_LINUX || BOOST_OS_MACOS + for (auto const& configFile : configFiles) + { + // Point the current working directory to a temporary directory, so + // we don't pick up an actual config file from the repository root. + beast::temp_dir td; + current_path(td.path()); + + // The XDG config directory is set: the config file must be in a + // subdirectory named after the system. + { + beast::temp_dir tc; + + // Set the HOME and XDG_CONFIG_HOME environment variables. The + // HOME variable is not used when XDG_CONFIG_HOME is set, but + // must be set. + char const* h = getenv("HOME"); + setenv("HOME", tc.path().c_str(), 1); + char const* x = getenv("XDG_CONFIG_HOME"); + setenv("XDG_CONFIG_HOME", tc.path().c_str(), 1); + + // Create the config file in '${XDG_CONFIG_HOME}/[systemName]'. + path p = tc.file(systemName()); + create_directory(p); + p = tc.file(systemName() + "/" + configFile); + std::ofstream o(p.string()); + o << detail::configContents("", ""); + o.close(); + + // Load the config file from the config directory and verify it. + Config c; + c.setup("", true, false, true); + BEAST_EXPECT( + c.section(SECTION_DEBUG_LOGFILE).values().size() == 1); + BEAST_EXPECT( + c.section(SECTION_DEBUG_LOGFILE).values()[0] == + "/Users/dummy/xrpld/config/log/debug.log"); + + // Restore the environment variables. + h ? setenv("HOME", h, 1) : unsetenv("HOME"); + x ? setenv("XDG_CONFIG_HOME", x, 1) + : unsetenv("XDG_CONFIG_HOME"); + } + + // The XDG config directory is not set: the config file must be in a + // subdirectory named .config followed by the system name. + { + beast::temp_dir tc; + + // Set only the HOME environment variable. + char const* h = getenv("HOME"); + setenv("HOME", tc.path().c_str(), 1); + char const* x = getenv("XDG_CONFIG_HOME"); + unsetenv("XDG_CONFIG_HOME"); + + // Create the config file in '${HOME}/.config/[systemName]'. + std::string s = ".config"; + path p = tc.file(s); + create_directory(p); + s += "/" + systemName(); + p = tc.file(s); + create_directory(p); + p = tc.file(s + "/" + configFile); + std::ofstream o(p.string()); + o << detail::configContents("", ""); + o.close(); + + // Load the config file from the config directory and verify it. + Config c; + c.setup("", true, false, true); + BEAST_EXPECT( + c.section(SECTION_DEBUG_LOGFILE).values().size() == 1); + BEAST_EXPECT( + c.section(SECTION_DEBUG_LOGFILE).values()[0] == + "/Users/dummy/xrpld/config/log/debug.log"); + + // Restore the environment variables. + h ? setenv("HOME", h, 1) : unsetenv("HOME"); + if (x) + setenv("XDG_CONFIG_HOME", x, 1); + } + } +#endif + + // Restore the current working directory. + current_path(cwd); + } + void testDbPath() { testcase("database_path"); @@ -326,11 +448,16 @@ port_wss_admin { // read from file absolute path auto const cwd = current_path(); - xrpl::detail::DirGuard const g0(*this, "test_db"); + detail::DirGuard const g0(*this, "test_db"); path const dataDirRel("test_data_dir"); path const dataDirAbs(cwd / g0.subdir() / dataDirRel); - detail::RippledCfgGuard const g( - *this, g0.subdir(), dataDirAbs, "", false); + detail::FileCfgGuard const g( + *this, + g0.subdir(), + dataDirAbs, + Config::configFileName, + "", + false); auto const& c(g.config()); BEAST_EXPECT(g.dataDirExists()); BEAST_EXPECT(g.configFileExists()); @@ -339,7 +466,8 @@ port_wss_admin { // read from file relative path std::string const dbPath("my_db"); - detail::RippledCfgGuard const g(*this, "test_db", dbPath, ""); + detail::FileCfgGuard const g( + *this, "test_db", dbPath, Config::configFileName, ""); auto const& c(g.config()); std::string const nativeDbPath = absolute(path(dbPath)).string(); BEAST_EXPECT(g.dataDirExists()); @@ -348,7 +476,8 @@ port_wss_admin } { // read from file no path - detail::RippledCfgGuard const g(*this, "test_db", "", ""); + detail::FileCfgGuard const g( + *this, "test_db", "", Config::configFileName, ""); auto const& c(g.config()); std::string const nativeDbPath = absolute(g.subdir() / path(Config::databaseDirName)).string(); @@ -378,13 +507,13 @@ port_wss_admin { Config c; - static boost::format configTemplate(R"rippleConfig( + static boost::format configTemplate(R"xrpldConfig( [validation_seed] %1% [validator_token] %2% -)rippleConfig"); +)xrpldConfig"); std::string error; auto const expectedError = "Cannot have both [validation_seed] " @@ -410,10 +539,10 @@ port_wss_admin Config c; try { - c.loadFromString(R"rippleConfig( + c.loadFromString(R"xrpldConfig( [network_id] main -)rippleConfig"); +)xrpldConfig"); } catch (std::runtime_error& e) { @@ -425,8 +554,8 @@ main try { - c.loadFromString(R"rippleConfig( -)rippleConfig"); + c.loadFromString(R"xrpldConfig( +)xrpldConfig"); } catch (std::runtime_error& e) { @@ -438,10 +567,10 @@ main try { - c.loadFromString(R"rippleConfig( + c.loadFromString(R"xrpldConfig( [network_id] 255 -)rippleConfig"); +)xrpldConfig"); } catch (std::runtime_error& e) { @@ -453,10 +582,10 @@ main try { - c.loadFromString(R"rippleConfig( + c.loadFromString(R"xrpldConfig( [network_id] 10000 -)rippleConfig"); +)xrpldConfig"); } catch (std::runtime_error& e) { @@ -516,7 +645,7 @@ main { // load validators from config into single section Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validators] n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7 n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj @@ -525,7 +654,7 @@ n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C [validator_keys] nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5 nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.legacy("validators_file").empty()); BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 5); @@ -534,9 +663,9 @@ nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8 { // load validator list sites and keys from config Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] @@ -544,13 +673,13 @@ trustthesevalidators.gov [validator_list_threshold] 1 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == - "ripplevalidators.com"); + "xrplvalidators.com"); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trustthesevalidators.gov"); @@ -570,9 +699,9 @@ trustthesevalidators.gov { // load validator list sites and keys from config Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] @@ -580,13 +709,13 @@ trustthesevalidators.gov [validator_list_threshold] 0 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] == - "ripplevalidators.com"); + "xrplvalidators.com"); BEAST_EXPECT( c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] == "trustthesevalidators.gov"); @@ -607,9 +736,9 @@ trustthesevalidators.gov // load should throw if [validator_list_threshold] is greater than // the number of [validator_list_keys] Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] @@ -617,7 +746,7 @@ trustthesevalidators.gov [validator_list_threshold] 2 -)rippleConfig"); +)xrpldConfig"); std::string error; auto const expectedError = "Value in config section [validator_list_threshold] exceeds " @@ -636,9 +765,9 @@ trustthesevalidators.gov { // load should throw if [validator_list_threshold] is malformed Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] @@ -646,7 +775,7 @@ trustthesevalidators.gov [validator_list_threshold] value = 2 -)rippleConfig"); +)xrpldConfig"); std::string error; auto const expectedError = "Config section [validator_list_threshold] should contain " @@ -665,9 +794,9 @@ value = 2 { // load should throw if [validator_list_threshold] is negative Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] @@ -675,7 +804,7 @@ trustthesevalidators.gov [validator_list_threshold] -1 -)rippleConfig"); +)xrpldConfig"); bool error = false; try { @@ -692,11 +821,11 @@ trustthesevalidators.gov // load should throw if [validator_list_sites] is configured but // [validator_list_keys] is not Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov -)rippleConfig"); +)xrpldConfig"); std::string error; auto const expectedError = "[validator_list_keys] config section is missing"; @@ -736,8 +865,13 @@ trustthesevalidators.gov std::string const valFileName = "validators.txt"; detail::ValidatorsTxtGuard const vtg( *this, "test_cfg", valFileName); - detail::RippledCfgGuard const rcg( - *this, vtg.subdir(), "", valFileName, false); + detail::FileCfgGuard const rcg( + *this, + vtg.subdir(), + "", + Config::configFileName, + valFileName, + false); BEAST_EXPECT(vtg.validatorsFileExists()); BEAST_EXPECT(rcg.configFileExists()); auto const& c(rcg.config()); @@ -758,8 +892,13 @@ trustthesevalidators.gov detail::ValidatorsTxtGuard const vtg( *this, "test_cfg", "validators.txt"); auto const valFilePath = ".." / vtg.subdir() / "validators.txt"; - detail::RippledCfgGuard const rcg( - *this, vtg.subdir(), "", valFilePath, false); + detail::FileCfgGuard const rcg( + *this, + vtg.subdir(), + "", + Config::configFileName, + valFilePath, + false); BEAST_EXPECT(vtg.validatorsFileExists()); BEAST_EXPECT(rcg.configFileExists()); auto const& c(rcg.config()); @@ -778,8 +917,8 @@ trustthesevalidators.gov // load from validators file in default location detail::ValidatorsTxtGuard const vtg( *this, "test_cfg", "validators.txt"); - detail::RippledCfgGuard const rcg( - *this, vtg.subdir(), "", "", false); + detail::FileCfgGuard const rcg( + *this, vtg.subdir(), "", Config::configFileName, "", false); BEAST_EXPECT(vtg.validatorsFileExists()); BEAST_EXPECT(rcg.configFileExists()); auto const& c(rcg.config()); @@ -803,8 +942,13 @@ trustthesevalidators.gov detail::ValidatorsTxtGuard const vtgDefault( *this, vtg.subdir(), "validators.txt", false); BEAST_EXPECT(vtgDefault.validatorsFileExists()); - detail::RippledCfgGuard const rcg( - *this, vtg.subdir(), "", vtg.validatorsFile(), false); + detail::FileCfgGuard const rcg( + *this, + vtg.subdir(), + "", + Config::configFileName, + vtg.validatorsFile(), + false); BEAST_EXPECT(rcg.configFileExists()); auto const& c(rcg.config()); BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile()); @@ -821,7 +965,7 @@ trustthesevalidators.gov { // load validators from both config and validators file - boost::format cc(R"rippleConfig( + boost::format cc(R"xrpldConfig( [validators_file] %1% @@ -837,12 +981,12 @@ nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB [validator_list_sites] -ripplevalidators.com +xrplvalidators.com trustthesevalidators.gov [validator_list_keys] 021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566 -)rippleConfig"); +)xrpldConfig"); detail::ValidatorsTxtGuard const vtg( *this, "test_cfg", "validators.cfg"); BEAST_EXPECT(vtg.validatorsFileExists()); @@ -861,14 +1005,14 @@ trustthesevalidators.gov } { // load should throw if [validator_list_threshold] is present both - // in rippled cfg and validators file - boost::format cc(R"rippleConfig( + // in xrpld.cfg and validators file + boost::format cc(R"xrpldConfig( [validators_file] %1% [validator_list_threshold] 1 -)rippleConfig"); +)xrpldConfig"); std::string error; detail::ValidatorsTxtGuard const vtg( *this, "test_cfg", "validators.cfg"); @@ -890,7 +1034,7 @@ trustthesevalidators.gov } { // load should throw if [validators], [validator_keys] and - // [validator_list_keys] are missing from rippled cfg and + // [validator_list_keys] are missing from xrpld.cfg and // validators file Config c; boost::format cc("[validators_file]\n%1%\n"); @@ -920,9 +1064,13 @@ trustthesevalidators.gov void testSetup(bool explicitPath) { - detail::RippledCfgGuard const cfg( - *this, "testSetup", explicitPath ? "test_db" : "", ""); - /* RippledCfgGuard has a Config object that gets loaded on + detail::FileCfgGuard const cfg( + *this, + "testSetup", + explicitPath ? "test_db" : "", + Config::configFileName, + ""); + /* FileCfgGuard has a Config object that gets loaded on construction, but Config::setup is not reentrant, so we need a fresh config for every test case, so ignore it. */ @@ -1039,7 +1187,8 @@ trustthesevalidators.gov void testPort() { - detail::RippledCfgGuard const cfg(*this, "testPort", "", ""); + detail::FileCfgGuard const cfg( + *this, "testPort", "", Config::configFileName, ""); auto const& conf = cfg.config(); if (!BEAST_EXPECT(conf.exists("port_rpc"))) return; @@ -1065,8 +1214,14 @@ trustthesevalidators.gov try { - detail::RippledCfgGuard const cfg( - *this, "testPort", "", "", true, contents); + detail::FileCfgGuard const cfg( + *this, + "testPort", + "", + Config::configFileName, + "", + true, + contents); BEAST_EXPECT(false); } catch (std::exception const& ex) @@ -1377,9 +1532,9 @@ r.ripple.com:51235 for (auto& [unit, sec, val, shouldPass] : units) { Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [amendment_majority_time] -)rippleConfig"); +)xrpldConfig"); toLoad += std::to_string(val) + space + unit; space = space == "" ? " " : ""; @@ -1480,6 +1635,7 @@ r.ripple.com:51235 run() override { testLegacy(); + testConfigFile(); testDbPath(); testValidatorKeys(); testValidatorsFile(); diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index e5a7435b0a..aed2343a49 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -87,7 +87,7 @@ private: /// If the node is out of sync during an online_delete healthWait() /// call, sleep the thread for this time, and continue checking until /// recovery. - /// See also: "recovery_wait_seconds" in rippled-example.cfg + /// See also: "recovery_wait_seconds" in xrpld-example.cfg std::chrono::seconds recoveryWaitTime_{5}; // these do not exist upon SHAMapStore creation, but do exist diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index cfd260787c..e25148aaa9 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -68,6 +68,7 @@ class Config : public BasicConfig public: // Settings related to the configuration file location and directories static char const* const configFileName; + static char const* const configLegacyName; static char const* const databaseDirName; static char const* const validatorsFileName; diff --git a/src/xrpld/core/detail/Config.cpp b/src/xrpld/core/detail/Config.cpp index e6c61e1471..1eb8d5984e 100644 --- a/src/xrpld/core/detail/Config.cpp +++ b/src/xrpld/core/detail/Config.cpp @@ -221,11 +221,12 @@ getSingleSection( //------------------------------------------------------------------------------ // -// Config (DEPRECATED) +// Config // //------------------------------------------------------------------------------ -char const* const Config::configFileName = "rippled.cfg"; +char const* const Config::configFileName = "xrpld.cfg"; +char const* const Config::configLegacyName = "rippled.cfg"; char const* const Config::databaseDirName = "db"; char const* const Config::validatorsFileName = "validators.txt"; @@ -295,76 +296,78 @@ Config::setup( bool bSilent, bool bStandalone) { - boost::filesystem::path dataDir; - std::string strDbPath, strConfFile; + setupControl(bQuiet, bSilent, bStandalone); // Determine the config and data directories. // If the config file is found in the current working // directory, use the current working directory as the // config directory and that with "db" as the data // directory. - - setupControl(bQuiet, bSilent, bStandalone); - - strDbPath = databaseDirName; - - if (!strConf.empty()) - strConfFile = strConf; - else - strConfFile = configFileName; + boost::filesystem::path dataDir; if (!strConf.empty()) { // --conf= : everything is relative that file. - CONFIG_FILE = strConfFile; + CONFIG_FILE = strConf; CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE); CONFIG_DIR.remove_filename(); - dataDir = CONFIG_DIR / strDbPath; + dataDir = CONFIG_DIR / databaseDirName; } else { - CONFIG_DIR = boost::filesystem::current_path(); - CONFIG_FILE = CONFIG_DIR / strConfFile; - dataDir = CONFIG_DIR / strDbPath; - - // Construct XDG config and data home. - // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html - auto const strHome = getEnvVar("HOME"); - auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME"); - auto strXdgDataHome = getEnvVar("XDG_DATA_HOME"); - - if (boost::filesystem::exists(CONFIG_FILE) - // Can we figure out XDG dirs? - || (strHome.empty() && - (strXdgConfigHome.empty() || strXdgDataHome.empty()))) + do { - // Current working directory is fine, put dbs in a subdir. - } - else - { - if (strXdgConfigHome.empty()) + // Check if either of the config files exist in the current working + // directory, in which case the databases will be stored in a + // subdirectory. + CONFIG_DIR = boost::filesystem::current_path(); + dataDir = CONFIG_DIR / databaseDirName; + CONFIG_FILE = CONFIG_DIR / configFileName; + if (boost::filesystem::exists(CONFIG_FILE)) + break; + CONFIG_FILE = CONFIG_DIR / configLegacyName; + if (boost::filesystem::exists(CONFIG_FILE)) + break; + + // Check if the home directory is set, and optionally the XDG config + // and/or data directories, as the config may be there. See + // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html. + auto const strHome = getEnvVar("HOME"); + if (!strHome.empty()) { - // $XDG_CONFIG_HOME was not set, use default based on $HOME. - strXdgConfigHome = strHome + "/.config"; + auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME"); + auto strXdgDataHome = getEnvVar("XDG_DATA_HOME"); + if (strXdgConfigHome.empty()) + { + // $XDG_CONFIG_HOME was not set, use default based on $HOME. + strXdgConfigHome = strHome + "/.config"; + } + if (strXdgDataHome.empty()) + { + // $XDG_DATA_HOME was not set, use default based on $HOME. + strXdgDataHome = strHome + "/.local/share"; + } + + // Check if either of the config files exist in the XDG config + // dir. + dataDir = strXdgDataHome + "/" + systemName(); + CONFIG_DIR = strXdgConfigHome + "/" + systemName(); + CONFIG_FILE = CONFIG_DIR / configFileName; + if (boost::filesystem::exists(CONFIG_FILE)) + break; + CONFIG_FILE = CONFIG_DIR / configLegacyName; + if (boost::filesystem::exists(CONFIG_FILE)) + break; } - if (strXdgDataHome.empty()) - { - // $XDG_DATA_HOME was not set, use default based on $HOME. - strXdgDataHome = strHome + "/.local/share"; - } - - CONFIG_DIR = strXdgConfigHome + "/" + systemName(); - CONFIG_FILE = CONFIG_DIR / strConfFile; - dataDir = strXdgDataHome + "/" + systemName(); - - if (!boost::filesystem::exists(CONFIG_FILE)) - { - CONFIG_DIR = "/etc/opt/" + systemName(); - CONFIG_FILE = CONFIG_DIR / strConfFile; - dataDir = "/var/opt/" + systemName(); - } - } + // As a last resort, check the system config directory. + dataDir = "/var/opt/" + systemName(); + CONFIG_DIR = "/etc/opt/" + systemName(); + CONFIG_FILE = CONFIG_DIR / configFileName; + if (boost::filesystem::exists(CONFIG_FILE)) + break; + CONFIG_FILE = CONFIG_DIR / configLegacyName; + } while (false); } // Update default values @@ -374,11 +377,9 @@ Config::setup( std::string const dbPath(legacy("database_path")); if (!dbPath.empty()) dataDir = boost::filesystem::path(dbPath); - else if (RUN_STANDALONE) - dataDir.clear(); } - if (!dataDir.empty()) + if (!RUN_STANDALONE) { boost::system::error_code ec; boost::filesystem::create_directories(dataDir, ec); diff --git a/src/xrpld/overlay/README.md b/src/xrpld/overlay/README.md index cd00488915..51eb96a001 100644 --- a/src/xrpld/overlay/README.md +++ b/src/xrpld/overlay/README.md @@ -373,7 +373,7 @@ command. The key is in the `pubkey_node` value, and is a text string beginning with the letter `n`. The key is maintained across runs in a database. -Cluster members are configured in the `rippled.cfg` file under +Cluster members are configured in the `xrpld.cfg` file under `[cluster_nodes]`. Each member should be configured on a line beginning with the node public key, followed optionally by a space and a friendly name. diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index e5f77021d7..7cd02c72e0 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -514,7 +514,7 @@ OverlayImpl::start() m_peerFinder->addFallbackStrings(base + name, ips); }); - // Add the ips_fixed from the rippled.cfg file + // Add the ips_fixed from the xrpld.cfg file if (!app_.config().standalone() && !app_.config().IPS_FIXED.empty()) { m_resolver.resolve( From 44d21b8f6daf87b286473686c5e75b7b513c7db2 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 5 Jan 2026 10:54:24 -0500 Subject: [PATCH 16/20] test: add more tests for `ledger_entry` RPC (#5858) This change adds some basic tests for all the `ledger_entry` helper functions, so each ledger entry type is covered. There are further some minor refactors in `parseAMM` to provide better error messages. Finally, to improve readability, alphabetization was applied in the helper functions. --- src/test/rpc/LedgerEntry_test.cpp | 482 +++++++++++++++++--- src/xrpld/rpc/handlers/LedgerEntry.cpp | 23 +- src/xrpld/rpc/handlers/LedgerEntryHelpers.h | 23 + 3 files changed, 447 insertions(+), 81 deletions(-) diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index ef5abdd800..551e67dc5e 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -30,6 +30,7 @@ enum class FieldType { CurrencyField, HashField, HashOrObjectField, + IssueField, ObjectField, StringField, TwoAccountArrayField, @@ -40,6 +41,8 @@ enum class FieldType { std::vector> mappings{ {jss::account, FieldType::AccountField}, {jss::accounts, FieldType::TwoAccountArrayField}, + {jss::asset, FieldType::IssueField}, + {jss::asset2, FieldType::IssueField}, {jss::authorize, FieldType::AccountField}, {jss::authorized, FieldType::AccountField}, {jss::credential_type, FieldType::BlobField}, @@ -74,24 +77,26 @@ getTypeName(FieldType typeID) { switch (typeID) { - case FieldType::UInt32Field: - return "number"; - case FieldType::UInt64Field: - return "number"; - case FieldType::HashField: - return "hex string"; case FieldType::AccountField: return "AccountID"; + case FieldType::ArrayField: + return "array"; case FieldType::BlobField: return "hex string"; case FieldType::CurrencyField: return "Currency"; - case FieldType::ArrayField: - return "array"; + case FieldType::HashField: + return "hex string"; case FieldType::HashOrObjectField: return "hex string or object"; + case FieldType::IssueField: + return "Issue"; case FieldType::TwoAccountArrayField: return "length-2 array of Accounts"; + case FieldType::UInt32Field: + return "number"; + case FieldType::UInt64Field: + return "number"; default: Throw( "unknown type " + std::to_string(static_cast(typeID))); @@ -192,34 +197,37 @@ class LedgerEntry_test : public beast::unit_test::suite return values; }; - static auto const& badUInt32Values = remove({2, 3}); - static auto const& badUInt64Values = remove({2, 3}); - static auto const& badHashValues = remove({2, 3, 7, 8, 16}); static auto const& badAccountValues = remove({12}); + static auto const& badArrayValues = remove({17, 20}); static auto const& badBlobValues = remove({3, 7, 8, 16}); static auto const& badCurrencyValues = remove({14}); - static auto const& badArrayValues = remove({17, 20}); + static auto const& badHashValues = remove({2, 3, 7, 8, 16}); static auto const& badIndexValues = remove({12, 16, 18, 19}); + static auto const& badUInt32Values = remove({2, 3}); + static auto const& badUInt64Values = remove({2, 3}); + static auto const& badIssueValues = remove({}); switch (fieldType) { - case FieldType::UInt32Field: - return badUInt32Values; - case FieldType::UInt64Field: - return badUInt64Values; - case FieldType::HashField: - return badHashValues; case FieldType::AccountField: return badAccountValues; + case FieldType::ArrayField: + case FieldType::TwoAccountArrayField: + return badArrayValues; case FieldType::BlobField: return badBlobValues; case FieldType::CurrencyField: return badCurrencyValues; - case FieldType::ArrayField: - case FieldType::TwoAccountArrayField: - return badArrayValues; + case FieldType::HashField: + return badHashValues; case FieldType::HashOrObjectField: return badIndexValues; + case FieldType::IssueField: + return badIssueValues; + case FieldType::UInt32Field: + return badUInt32Values; + case FieldType::UInt64Field: + return badUInt64Values; default: Throw( "unknown type " + @@ -236,30 +244,37 @@ class LedgerEntry_test : public beast::unit_test::suite arr[1u] = "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5"; return arr; }(); + static Json::Value const issueObject = []() { + Json::Value arr(Json::objectValue); + arr[jss::currency] = "XRP"; + return arr; + }(); auto const typeID = getFieldType(fieldName); switch (typeID) { - case FieldType::UInt32Field: - return 1; - case FieldType::UInt64Field: - return 1; - case FieldType::HashField: - return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6" - "B01403D6D"; case FieldType::AccountField: return "r4MrUGTdB57duTnRs6KbsRGQXgkseGb1b5"; + case FieldType::ArrayField: + return Json::arrayValue; case FieldType::BlobField: return "ABCDEF"; case FieldType::CurrencyField: return "USD"; - case FieldType::ArrayField: - return Json::arrayValue; + case FieldType::HashField: + return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6" + "B01403D6D"; + case FieldType::IssueField: + return issueObject; case FieldType::HashOrObjectField: return "5233D68B4D44388F98559DE42903767803EFA7C1F8D01413FC16EE6" "B01403D6D"; case FieldType::TwoAccountArrayField: return twoAccountArray; + case FieldType::UInt32Field: + return 1; + case FieldType::UInt64Field: + return 1; default: Throw( "unknown type " + @@ -444,7 +459,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryInvalid() + testInvalid() { testcase("Invalid requests"); using namespace test::jtx; @@ -526,7 +541,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryAccountRoot() + testAccountRoot() { testcase("AccountRoot"); using namespace test::jtx; @@ -632,7 +647,147 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryCheck() + testAmendments() + { + testcase("Amendments"); + using namespace test::jtx; + Env env{*this}; + + // positive test + { + Keylet const keylet = keylet::amendments(); + + // easier to hack an object into the ledger than generate it + // legitimately + { + auto const amendments = [&](OpenView& view, + beast::Journal) -> bool { + auto const sle = std::make_shared(keylet); + + // Create Amendments vector (enabled amendments) + std::vector enabledAmendments; + enabledAmendments.push_back( + uint256::fromVoid("42426C4D4F1009EE67080A9B7965B44656D7" + "714D104A72F9B4369F97ABF044EE")); + enabledAmendments.push_back( + uint256::fromVoid("4C97EBA926031A7CF7D7B36FDE3ED66DDA54" + "21192D63DE53FFB46E43B9DC8373")); + enabledAmendments.push_back( + uint256::fromVoid("03BDC0099C4E14163ADA272C1B6F6FABB448" + "CC3E51F522F978041E4B57D9158C")); + enabledAmendments.push_back( + uint256::fromVoid("35291ADD2D79EB6991343BDA0912269C817D" + "0F094B02226C1C14AD2858962ED4")); + sle->setFieldV256( + sfAmendments, STVector256(enabledAmendments)); + + // Create Majorities array + STArray majorities; + + auto majority1 = STObject::makeInnerObject(sfMajority); + majority1.setFieldH256( + sfAmendment, + uint256::fromVoid("7BB62DC13EC72B775091E9C71BF8CF97E122" + "647693B50C5E87A80DFD6FCFAC50")); + majority1.setFieldU32(sfCloseTime, 779561310); + majorities.push_back(std::move(majority1)); + + auto majority2 = STObject::makeInnerObject(sfMajority); + majority2.setFieldH256( + sfAmendment, + uint256::fromVoid("755C971C29971C9F20C6F080F2ED96F87884" + "E40AD19554A5EBECDCEC8A1F77FE")); + majority2.setFieldU32(sfCloseTime, 779561310); + majorities.push_back(std::move(majority2)); + + sle->setFieldArray(sfMajorities, majorities); + + view.rawInsert(sle); + return true; + }; + env.app().openLedger().modify(amendments); + } + + Json::Value jvParams; + jvParams[jss::amendments] = to_string(keylet.key); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Amendments); + } + + // negative tests + runLedgerEntryTest(env, jss::amendments); + } + + void + testAMM() + { + testcase("AMM"); + using namespace test::jtx; + Env env{*this}; + + // positive test + Account const alice{"alice"}; + env.fund(XRP(10000), alice); + env.close(); + AMM amm(env, alice, XRP(10), alice["USD"](1000)); + env.close(); + + { + Json::Value jvParams; + jvParams[jss::amm] = to_string(amm.ammID()); + auto const result = + env.rpc("json", "ledger_entry", to_string(jvParams)); + BEAST_EXPECT( + result.isObject() && result.isMember(jss::result) && + !result[jss::result].isMember(jss::error) && + result[jss::result].isMember(jss::node) && + result[jss::result][jss::node].isMember( + sfLedgerEntryType.jsonName) && + result[jss::result][jss::node][sfLedgerEntryType.jsonName] == + jss::AMM); + } + + { + Json::Value jvParams; + Json::Value ammParams(Json::objectValue); + { + Json::Value obj(Json::objectValue); + obj[jss::currency] = "XRP"; + ammParams[jss::asset] = obj; + } + { + Json::Value obj(Json::objectValue); + obj[jss::currency] = "USD"; + obj[jss::issuer] = alice.human(); + ammParams[jss::asset2] = obj; + } + jvParams[jss::amm] = ammParams; + auto const result = + env.rpc("json", "ledger_entry", to_string(jvParams)); + BEAST_EXPECT( + result.isObject() && result.isMember(jss::result) && + !result[jss::result].isMember(jss::error) && + result[jss::result].isMember(jss::node) && + result[jss::result][jss::node].isMember( + sfLedgerEntryType.jsonName) && + result[jss::result][jss::node][sfLedgerEntryType.jsonName] == + jss::AMM); + } + + // negative tests + runLedgerEntryTest( + env, + jss::amm, + { + {jss::asset, "malformedRequest"}, + {jss::asset2, "malformedRequest"}, + }); + } + + void + testCheck() { testcase("Check"); using namespace test::jtx; @@ -684,7 +839,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryCredentials() + testCredentials() { testcase("Credentials"); @@ -752,7 +907,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryDelegate() + testDelegate() { testcase("Delegate"); @@ -807,7 +962,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryDepositPreauth() + testDepositPreauth() { testcase("Deposit Preauth"); @@ -868,7 +1023,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryDepositPreauthCred() + testDepositPreauthCred() { testcase("Deposit Preauth with credentials"); @@ -1149,7 +1304,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryDirectory() + testDirectory() { testcase("Directory"); using namespace test::jtx; @@ -1303,7 +1458,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryEscrow() + testEscrow() { testcase("Escrow"); using namespace test::jtx; @@ -1365,7 +1520,177 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryOffer() + testFeeSettings() + { + testcase("Fee Settings"); + using namespace test::jtx; + Env env{*this}; + + // positive test + { + Keylet const keylet = keylet::fees(); + Json::Value jvParams; + jvParams[jss::fee] = to_string(keylet.key); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == jss::FeeSettings); + } + + // negative tests + runLedgerEntryTest(env, jss::fee); + } + + void + testLedgerHashes() + { + testcase("Ledger Hashes"); + using namespace test::jtx; + Env env{*this}; + + // positive test + { + Keylet const keylet = keylet::skip(); + Json::Value jvParams; + jvParams[jss::hashes] = to_string(keylet.key); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == + jss::LedgerHashes); + } + + // negative tests + runLedgerEntryTest(env, jss::hashes); + } + + void + testNFTokenOffer() + { + testcase("NFT Offer"); + using namespace test::jtx; + Env env{*this}; + + // positive test + Account const issuer{"issuer"}; + Account const buyer{"buyer"}; + env.fund(XRP(1000), issuer, buyer); + + uint256 const nftokenID0 = + token::getNextID(env, issuer, 0, tfTransferable); + env(token::mint(issuer, 0), txflags(tfTransferable)); + env.close(); + uint256 const offerID = keylet::nftoffer(issuer, env.seq(issuer)).key; + env(token::createOffer(issuer, nftokenID0, drops(1)), + token::destination(buyer), + txflags(tfSellNFToken)); + + { + Json::Value jvParams; + jvParams[jss::nft_offer] = to_string(offerID); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == + jss::NFTokenOffer); + BEAST_EXPECT(jrr[jss::node][sfOwner.jsonName] == issuer.human()); + BEAST_EXPECT( + jrr[jss::node][sfNFTokenID.jsonName] == to_string(nftokenID0)); + BEAST_EXPECT(jrr[jss::node][sfAmount.jsonName] == "1"); + } + + // negative tests + runLedgerEntryTest(env, jss::nft_offer); + } + + void + testNFTokenPage() + { + testcase("NFT Page"); + using namespace test::jtx; + Env env{*this}; + + // positive test + Account const issuer{"issuer"}; + env.fund(XRP(1000), issuer); + + env(token::mint(issuer, 0), txflags(tfTransferable)); + env.close(); + + auto const nftpage = keylet::nftpage_max(issuer); + BEAST_EXPECT(env.le(nftpage) != nullptr); + + { + Json::Value jvParams; + jvParams[jss::nft_page] = to_string(nftpage.key); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NFTokenPage); + } + + // negative tests + runLedgerEntryTest(env, jss::nft_page); + } + + void + testNegativeUNL() + { + testcase("Negative UNL"); + using namespace test::jtx; + Env env{*this}; + + // positive test + { + Keylet const keylet = keylet::negativeUNL(); + + // easier to hack an object into the ledger than generate it + // legitimately + { + auto const nUNL = [&](OpenView& view, beast::Journal) -> bool { + auto const sle = std::make_shared(keylet); + + // Create DisabledValidators array + STArray disabledValidators; + auto disabledValidator = + STObject::makeInnerObject(sfDisabledValidator); + auto pubKeyBlob = strUnHex( + "ED58F6770DB5DD77E59D28CB650EC3816E2FC95021BB56E720C9A1" + "2DA79C58A3AB"); + disabledValidator.setFieldVL(sfPublicKey, *pubKeyBlob); + disabledValidator.setFieldU32( + sfFirstLedgerSequence, 91371264); + disabledValidators.push_back(std::move(disabledValidator)); + + sle->setFieldArray( + sfDisabledValidators, disabledValidators); + sle->setFieldH256( + sfPreviousTxnID, + uint256::fromVoid("8D47FFE664BE6C335108DF689537625855A6" + "A95160CC6D351341B9" + "2624D9C5E3")); + sle->setFieldU32(sfPreviousTxnLgrSeq, 91442944); + + view.rawInsert(sle); + return true; + }; + env.app().openLedger().modify(nUNL); + } + + Json::Value jvParams; + jvParams[jss::nunl] = to_string(keylet.key); + Json::Value const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + BEAST_EXPECT( + jrr[jss::node][sfLedgerEntryType.jsonName] == jss::NegativeUNL); + } + + // negative tests + runLedgerEntryTest(env, jss::nunl); + } + + void + testOffer() { testcase("Offer"); using namespace test::jtx; @@ -1413,7 +1738,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryPayChan() + testPayChan() { testcase("Pay Chan"); using namespace test::jtx; @@ -1475,7 +1800,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryRippleState() + testRippleState() { testcase("RippleState"); using namespace test::jtx; @@ -1626,7 +1951,16 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryTicket() + testSignerList() + { + testcase("Signer List"); + using namespace test::jtx; + Env env{*this}; + runLedgerEntryTest(env, jss::signer_list); + } + + void + testTicket() { testcase("Ticket"); using namespace test::jtx; @@ -1711,7 +2045,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryDID() + testDID() { testcase("DID"); using namespace test::jtx; @@ -1848,7 +2182,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryMPT() + testMPT() { testcase("MPT"); using namespace test::jtx; @@ -1931,7 +2265,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryPermissionedDomain() + testPermissionedDomain() { testcase("PermissionedDomain"); @@ -2010,7 +2344,7 @@ class LedgerEntry_test : public beast::unit_test::suite } void - testLedgerEntryCLI() + testCLI() { testcase("command-line"); using namespace test::jtx; @@ -2040,25 +2374,33 @@ public: void run() override { - testLedgerEntryInvalid(); - testLedgerEntryAccountRoot(); - testLedgerEntryCheck(); - testLedgerEntryCredentials(); - testLedgerEntryDelegate(); - testLedgerEntryDepositPreauth(); - testLedgerEntryDepositPreauthCred(); - testLedgerEntryDirectory(); - testLedgerEntryEscrow(); - testLedgerEntryOffer(); - testLedgerEntryPayChan(); - testLedgerEntryRippleState(); - testLedgerEntryTicket(); - testLedgerEntryDID(); + testInvalid(); + testAccountRoot(); + testAmendments(); + testAMM(); + testCheck(); + testCredentials(); + testDelegate(); + testDepositPreauth(); + testDepositPreauthCred(); + testDirectory(); + testEscrow(); + testFeeSettings(); + testLedgerHashes(); + testNFTokenOffer(); + testNFTokenPage(); + testNegativeUNL(); + testOffer(); + testPayChan(); + testRippleState(); + testSignerList(); + testTicket(); + testDID(); testInvalidOracleLedgerEntry(); testOracleLedgerEntry(); - testLedgerEntryMPT(); - testLedgerEntryPermissionedDomain(); - testLedgerEntryCLI(); + testMPT(); + testPermissionedDomain(); + testCLI(); } }; @@ -2086,7 +2428,7 @@ class LedgerEntry_XChain_test : public beast::unit_test::suite, } void - testLedgerEntryBridge() + testBridge() { testcase("ledger_entry: bridge"); using namespace test::jtx; @@ -2177,7 +2519,7 @@ class LedgerEntry_XChain_test : public beast::unit_test::suite, } void - testLedgerEntryClaimID() + testClaimID() { testcase("ledger_entry: xchain_claim_id"); using namespace test::jtx; @@ -2235,7 +2577,7 @@ class LedgerEntry_XChain_test : public beast::unit_test::suite, } void - testLedgerEntryCreateAccountClaimID() + testCreateAccountClaimID() { testcase("ledger_entry: xchain_create_account_claim_id"); using namespace test::jtx; @@ -2362,9 +2704,9 @@ public: void run() override { - testLedgerEntryBridge(); - testLedgerEntryClaimID(); - testLedgerEntryCreateAccountClaimID(); + testBridge(); + testClaimID(); + testCreateAccountClaimID(); } }; diff --git a/src/xrpld/rpc/handlers/LedgerEntry.cpp b/src/xrpld/rpc/handlers/LedgerEntry.cpp index 5b5db72c22..2e9d5b35bf 100644 --- a/src/xrpld/rpc/handlers/LedgerEntry.cpp +++ b/src/xrpld/rpc/handlers/LedgerEntry.cpp @@ -71,16 +71,17 @@ parseAMM(Json::Value const& params, Json::StaticString const fieldName) return Unexpected(value.error()); } - try - { - auto const issue = issueFromJson(params[jss::asset]); - auto const issue2 = issueFromJson(params[jss::asset2]); - return keylet::amm(issue, issue2).key; - } - catch (std::runtime_error const&) - { - return LedgerEntryHelpers::malformedError("malformedRequest", ""); - } + auto const asset = LedgerEntryHelpers::requiredIssue( + params, jss::asset, "malformedRequest"); + if (!asset) + return Unexpected(asset.error()); + + auto const asset2 = LedgerEntryHelpers::requiredIssue( + params, jss::asset2, "malformedRequest"); + if (!asset2) + return Unexpected(asset2.error()); + + return keylet::amm(*asset, *asset2).key; } static Expected @@ -424,7 +425,7 @@ parseLoan(Json::Value const& params, Json::StaticString const fieldName) } auto const id = LedgerEntryHelpers::requiredUInt256( - params, jss::loan_broker_id, "malformedOwner"); + params, jss::loan_broker_id, "malformedLoanBrokerID"); if (!id) return Unexpected(id.error()); auto const seq = LedgerEntryHelpers::requiredUInt32( diff --git a/src/xrpld/rpc/handlers/LedgerEntryHelpers.h b/src/xrpld/rpc/handlers/LedgerEntryHelpers.h index 0a4453c063..4b656e6b05 100644 --- a/src/xrpld/rpc/handlers/LedgerEntryHelpers.h +++ b/src/xrpld/rpc/handlers/LedgerEntryHelpers.h @@ -218,6 +218,29 @@ requiredUInt192( return required(params, fieldName, err, "Hash192"); } +template <> +std::optional +parse(Json::Value const& param) +{ + try + { + return issueFromJson(param); + } + catch (std::runtime_error const&) + { + return std::nullopt; + } +} + +Expected +requiredIssue( + Json::Value const& params, + Json::StaticString const fieldName, + std::string const& err) +{ + return required(params, fieldName, err, "Issue"); +} + Expected parseBridgeFields(Json::Value const& params) { From 1d8994065398234318cdada96c63c290822e466a Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 5 Jan 2026 18:48:09 -0500 Subject: [PATCH 17/20] merge fixes --- src/test/app/HostFuncImpl_test.cpp | 4 ++-- src/test/app/TestHostFunctions.h | 6 +++--- src/xrpld/app/wasm/detail/HostFuncImpl.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/app/HostFuncImpl_test.cpp b/src/test/app/HostFuncImpl_test.cpp index 6ada72b765..956c93a653 100644 --- a/src/test/app/HostFuncImpl_test.cpp +++ b/src/test/app/HostFuncImpl_test.cpp @@ -92,7 +92,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const result = hfs.getLedgerSqn(); if (BEAST_EXPECT(result.has_value())) - BEAST_EXPECT(result.value() == env.current()->info().seq); + BEAST_EXPECT(result.value() == env.current()->header().seq); } void @@ -149,7 +149,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite auto const result = hfs.getParentLedgerHash(); if (BEAST_EXPECT(result.has_value())) - BEAST_EXPECT(result.value() == env.current()->info().parentHash); + BEAST_EXPECT(result.value() == env.current()->header().parentHash); } void diff --git a/src/test/app/TestHostFunctions.h b/src/test/app/TestHostFunctions.h index 128bfa446f..5eb81cc0cb 100644 --- a/src/test/app/TestHostFunctions.h +++ b/src/test/app/TestHostFunctions.h @@ -87,7 +87,7 @@ public: Expected getParentLedgerHash() override { - return env_.current()->info().parentHash; + return env_.current()->header().parentHash; } Expected @@ -284,7 +284,7 @@ public: Expected computeSha512HalfHash(Slice const& data) override { - return env_.current()->info().parentHash; + return env_.current()->header().parentHash; } Expected @@ -603,7 +603,7 @@ struct PerfHostFunctions : public TestHostFunctions Expected getParentLedgerHash() override { - return env_.current()->info().parentHash; + return env_.current()->header().parentHash; } Expected diff --git a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp index 59c4cbfc84..d9f3550a7c 100644 --- a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp +++ b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp @@ -32,7 +32,7 @@ WasmHostFunctionsImpl::getParentLedgerTime() Expected WasmHostFunctionsImpl::getParentLedgerHash() { - return ctx.view().info().parentHash; + return ctx.view().header().parentHash; } Expected From 0e9c7458bb5d52901755c982e20a297c1f22911b Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 5 Jan 2026 18:53:14 -0500 Subject: [PATCH 18/20] fix more merge issues --- include/xrpl/protocol/detail/ledger_entries.macro | 2 +- src/test/app/HostFuncImpl_test.cpp | 4 ++-- src/test/app/TestHostFunctions.h | 6 +++--- src/test/app/Wasm_test.cpp | 4 ++-- src/xrpld/app/wasm/HostFunc.h | 4 ++-- src/xrpld/app/wasm/HostFuncImpl.h | 4 ++-- src/xrpld/app/wasm/HostFuncWrapper.h | 4 ++-- src/xrpld/app/wasm/ParamsHelper.h | 6 +++--- src/xrpld/app/wasm/WasmVM.h | 4 ++-- src/xrpld/app/wasm/WasmiVM.h | 4 ++-- src/xrpld/app/wasm/detail/HostFuncImpl.cpp | 4 ++-- src/xrpld/app/wasm/detail/HostFuncWrapper.cpp | 4 ++-- src/xrpld/app/wasm/detail/WasmVM.cpp | 4 ++-- src/xrpld/app/wasm/detail/WasmiVM.cpp | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/xrpl/protocol/detail/ledger_entries.macro b/include/xrpl/protocol/detail/ledger_entries.macro index 1034c35895..e11099dcf9 100644 --- a/include/xrpl/protocol/detail/ledger_entries.macro +++ b/include/xrpl/protocol/detail/ledger_entries.macro @@ -578,7 +578,7 @@ LEDGER_ENTRY(ltLOAN, 0x0089, Loan, loan, ({ // The unrounded true total value of the loan. // // - TrueTotalPrincialOutstanding can be computed using the algorithm - // in the ripple::detail::loanPrincipalFromPeriodicPayment function. + // in the xrpl::detail::loanPrincipalFromPeriodicPayment function. // // - TrueTotalInterestOutstanding = TrueTotalLoanValue - // TrueTotalPrincipalOutstanding diff --git a/src/test/app/HostFuncImpl_test.cpp b/src/test/app/HostFuncImpl_test.cpp index 956c93a653..8eeca41b7c 100644 --- a/src/test/app/HostFuncImpl_test.cpp +++ b/src/test/app/HostFuncImpl_test.cpp @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { static Bytes @@ -2963,4 +2963,4 @@ struct HostFuncImpl_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(HostFuncImpl, app, ripple); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/TestHostFunctions.h b/src/test/app/TestHostFunctions.h index 5eb81cc0cb..0cb010b0e9 100644 --- a/src/test/app/TestHostFunctions.h +++ b/src/test/app/TestHostFunctions.h @@ -9,7 +9,7 @@ #include #include -namespace ripple { +namespace xrpl { namespace test { @@ -1024,7 +1024,7 @@ struct PerfHostFunctions : public TestHostFunctions if (data.size() > maxWasmDataLength) return Unexpected(HostFunctionError::DATA_FIELD_TOO_LARGE); - ripple::detail::ApplyViewBase v( + xrpl::detail::ApplyViewBase v( env_.app().openLedger().current().get(), tapNONE); auto sle = v.peek(leKey); @@ -1326,4 +1326,4 @@ struct PerfHostFunctions : public TestHostFunctions }; } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/test/app/Wasm_test.cpp b/src/test/app/Wasm_test.cpp index 0a8cacca42..2fc2952e2d 100644 --- a/src/test/app/Wasm_test.cpp +++ b/src/test/app/Wasm_test.cpp @@ -6,7 +6,7 @@ #include -namespace ripple { +namespace xrpl { namespace test { bool @@ -743,4 +743,4 @@ struct Wasm_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Wasm, app, ripple); } // namespace test -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/HostFunc.h b/src/xrpld/app/wasm/HostFunc.h index 9963754bfb..e59507757c 100644 --- a/src/xrpld/app/wasm/HostFunc.h +++ b/src/xrpld/app/wasm/HostFunc.h @@ -11,7 +11,7 @@ #include #include -namespace ripple { +namespace xrpl { enum class HostFunctionError : int32_t { INTERNAL = -1, @@ -514,4 +514,4 @@ struct HostFunctions // LCOV_EXCL_STOP }; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/HostFuncImpl.h b/src/xrpld/app/wasm/HostFuncImpl.h index f5ed190230..fccea11252 100644 --- a/src/xrpld/app/wasm/HostFuncImpl.h +++ b/src/xrpld/app/wasm/HostFuncImpl.h @@ -3,7 +3,7 @@ #include #include -namespace ripple { +namespace xrpl { class WasmHostFunctionsImpl : public HostFunctions { ApplyContext& ctx; @@ -271,4 +271,4 @@ public: floatLog(Slice const& x, int32_t mode) override; }; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/HostFuncWrapper.h b/src/xrpld/app/wasm/HostFuncWrapper.h index 13ed916e82..745bbe9a2c 100644 --- a/src/xrpld/app/wasm/HostFuncWrapper.h +++ b/src/xrpld/app/wasm/HostFuncWrapper.h @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { using getLedgerSqn_proto = int32_t(); wasm_trap_t* @@ -531,4 +531,4 @@ using floatLog_proto = wasm_trap_t* floatLog_wrap(void* env, wasm_val_vec_t const* params, wasm_val_vec_t* results); -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/ParamsHelper.h b/src/xrpld/app/wasm/ParamsHelper.h index a0eece7931..508a9438b0 100644 --- a/src/xrpld/app/wasm/ParamsHelper.h +++ b/src/xrpld/app/wasm/ParamsHelper.h @@ -13,10 +13,10 @@ namespace bft = boost::function_types; -namespace ripple { +namespace xrpl { using Bytes = std::vector; -using Hash = ripple::uint256; +using Hash = xrpl::uint256; struct wmem { @@ -247,4 +247,4 @@ wasmParams(Types&&... args) return v; } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/WasmVM.h b/src/xrpld/app/wasm/WasmVM.h index e8230175a4..c9c8d9c8e0 100644 --- a/src/xrpld/app/wasm/WasmVM.h +++ b/src/xrpld/app/wasm/WasmVM.h @@ -4,7 +4,7 @@ #include -namespace ripple { +namespace xrpl { static std::string_view const W_ENV = "env"; static std::string_view const W_HOST_LIB = "host_lib"; @@ -87,4 +87,4 @@ preflightEscrowWasm( std::string_view funcName = ESCROW_FUNCTION_NAME, std::vector const& params = {}); -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/WasmiVM.h b/src/xrpld/app/wasm/WasmiVM.h index b4148b7dea..06e18ef29e 100644 --- a/src/xrpld/app/wasm/WasmiVM.h +++ b/src/xrpld/app/wasm/WasmiVM.h @@ -5,7 +5,7 @@ #include #include -namespace ripple { +namespace xrpl { template struct WasmVec @@ -345,4 +345,4 @@ private: Types&&... args); }; -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp index d9f3550a7c..7d2136f4f7 100644 --- a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp +++ b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp @@ -9,7 +9,7 @@ // #define DEBUG_OUTPUT 1 #endif -namespace ripple { +namespace xrpl { Expected WasmHostFunctionsImpl::getLedgerSqn() @@ -1302,4 +1302,4 @@ floatLogImpl(Slice const& x, int32_t mode) // LCOV_EXCL_STOP } -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/detail/HostFuncWrapper.cpp b/src/xrpld/app/wasm/detail/HostFuncWrapper.cpp index 5dc935735c..b5da69f71d 100644 --- a/src/xrpld/app/wasm/detail/HostFuncWrapper.cpp +++ b/src/xrpld/app/wasm/detail/HostFuncWrapper.cpp @@ -6,7 +6,7 @@ #include #include -namespace ripple { +namespace xrpl { using SFieldCRef = std::reference_wrapper; @@ -2182,4 +2182,4 @@ testGetDataIncrement() } // namespace test // LCOV_EXCL_STOP -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/detail/WasmVM.cpp b/src/xrpld/app/wasm/detail/WasmVM.cpp index 9ac91358dc..062e50ba93 100644 --- a/src/xrpld/app/wasm/detail/WasmVM.cpp +++ b/src/xrpld/app/wasm/detail/WasmVM.cpp @@ -13,7 +13,7 @@ #include -namespace ripple { +namespace xrpl { static void setCommonHostFunctions(HostFunctions* hfs, ImportVec& i) @@ -213,4 +213,4 @@ WasmEngine::getJournal() const } // LCOV_EXCL_STOP -} // namespace ripple +} // namespace xrpl diff --git a/src/xrpld/app/wasm/detail/WasmiVM.cpp b/src/xrpld/app/wasm/detail/WasmiVM.cpp index 1a37910105..82c502f63f 100644 --- a/src/xrpld/app/wasm/detail/WasmiVM.cpp +++ b/src/xrpld/app/wasm/detail/WasmiVM.cpp @@ -9,7 +9,7 @@ #endif // #define SHOW_CALL_TIME 1 -namespace ripple { +namespace xrpl { namespace { @@ -963,4 +963,4 @@ WasmiEngine::getJournal() const } // LCOV_EXCL_STOP -} // namespace ripple +} // namespace xrpl From b66bc47ca9df478f9389cfeadb5f5f88812b6147 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 6 Jan 2026 13:30:30 -0500 Subject: [PATCH 19/20] fix more merge issues --- src/test/app/HostFuncImpl_test.cpp | 2 +- src/test/app/Wasm_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/app/HostFuncImpl_test.cpp b/src/test/app/HostFuncImpl_test.cpp index 8eeca41b7c..692b085102 100644 --- a/src/test/app/HostFuncImpl_test.cpp +++ b/src/test/app/HostFuncImpl_test.cpp @@ -2960,7 +2960,7 @@ struct HostFuncImpl_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(HostFuncImpl, app, ripple); +BEAST_DEFINE_TESTSUITE(HostFuncImpl, app, xrpl); } // namespace test } // namespace xrpl diff --git a/src/test/app/Wasm_test.cpp b/src/test/app/Wasm_test.cpp index 2fc2952e2d..c22054fac0 100644 --- a/src/test/app/Wasm_test.cpp +++ b/src/test/app/Wasm_test.cpp @@ -740,7 +740,7 @@ struct Wasm_test : public beast::unit_test::suite } }; -BEAST_DEFINE_TESTSUITE(Wasm, app, ripple); +BEAST_DEFINE_TESTSUITE(Wasm, app, xrpl); } // namespace test } // namespace xrpl From 397bc8781ed2a7841f1a098b1a779124868a458e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 6 Jan 2026 14:27:46 -0500 Subject: [PATCH 20/20] fix more merge issues --- cfg/xrpld-example.cfg | 6 +++--- src/xrpld/app/misc/NetworkOPs.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cfg/xrpld-example.cfg b/cfg/xrpld-example.cfg index c57d8d8e6f..b8ba33fec7 100644 --- a/cfg/xrpld-example.cfg +++ b/cfg/xrpld-example.cfg @@ -1296,7 +1296,7 @@ # consumed by a single transaction. The gas limit is used to prevent # transactions from consuming too many resources. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: @@ -1308,7 +1308,7 @@ # bytes. The size limit is used to prevent extensions from consuming # too many resources. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: @@ -1318,7 +1318,7 @@ # # The gas price is the conversion between WASM gas and its price in drops. # -# If this parameter is unspecified, rippled will use an internal +# If this parameter is unspecified, xrpld will use an internal # default. Don't change this without understanding the consequences. # # Example: diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index e29eedb336..34315ae6c6 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -4236,6 +4236,7 @@ NetworkOPsImp::subLedger(InfoSub::ref isrListener, Json::Value& jvResult) jvResult[jss::fee_base] = lpClosed->fees().base.jsonClipped(); jvResult[jss::reserve_base] = lpClosed->fees().reserve.jsonClipped(); jvResult[jss::reserve_inc] = lpClosed->fees().increment.jsonClipped(); + jvResult[jss::network_id] = app_.config().NETWORK_ID; if (lpClosed->rules().enabled(featureSmartEscrow)) { jvResult[jss::extension_compute] =