mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
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.
This commit is contained in:
@@ -30,17 +30,17 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
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<protocol::TMGetLedger>();
|
||||
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<protocol::TMLedgerData>();
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user