add legacy memory type called testmemory

This commit is contained in:
Richard Holland
2024-11-10 15:08:15 +11:00
parent e031e50678
commit d88902f687
4 changed files with 11 additions and 12 deletions

View File

@@ -539,6 +539,7 @@ target_sources (rippled PRIVATE
#]===============================]
src/ripple/nodestore/backend/CassandraFactory.cpp
src/ripple/nodestore/backend/MemoryFactory.cpp
src/ripple/nodestore/backend/TestMemoryFactory.cpp
src/ripple/nodestore/backend/FlatmapFactory.cpp
src/ripple/nodestore/backend/NuDBFactory.cpp
src/ripple/nodestore/backend/NullFactory.cpp

View File

@@ -355,18 +355,16 @@ public:
mem_backend() const
{
static bool const isMem =
((!section(SECTION_RELATIONAL_DB).empty() &&
(!section(SECTION_RELATIONAL_DB).empty() &&
boost::beast::iequals(
get(section(SECTION_RELATIONAL_DB), "backend"), "memory")) ||
(!section("node_db").empty() &&
(boost::beast::iequals(
get(section("node_db"), "type"), "memory") ||
boost::beast::iequals(
get(section(SECTION_RELATIONAL_DB), "backend"), "memory")) ||
(!section("node_db").empty() &&
get(section("node_db"), "type"), "flatmap") ||
boost::beast::iequals(
get(section("node_db"), "type"), "memory"))) ||
((!section(SECTION_RELATIONAL_DB).empty() &&
boost::beast::iequals(
get(section(SECTION_RELATIONAL_DB), "backend"), "flatmap")) ||
(!section("node_db").empty() &&
boost::beast::iequals(
get(section("node_db"), "type"), "flatmap")));
get(section("node_db"), "type"), "testmemory")));
return isMem;
}

View File

@@ -49,7 +49,7 @@ setupConfigForUnitTests(Config& cfg)
cfg.FEES.account_reserve = XRP(200).value().xrp().drops();
cfg.FEES.owner_reserve = XRP(50).value().xrp().drops();
cfg.overwrite(ConfigSection::nodeDatabase(), "type", "memory");
cfg.overwrite(ConfigSection::nodeDatabase(), "type", "testmemory");
cfg.overwrite(ConfigSection::nodeDatabase(), "path", "main");
cfg.deprecatedClearSection(ConfigSection::importNodeDatabase());
cfg.legacy("database_path", "");

View File

@@ -57,7 +57,7 @@ public:
, j_(j)
{
Section testSection;
testSection.set("type", "memory");
testSection.set("type", "testmemory");
testSection.set("path", "SHAMap_test");
db_ = NodeStore::Manager::instance().make_Database(
megabytes(4), scheduler_, 1, testSection, j);