Advance ripple.app.rdb

This commit is contained in:
Devon White
2021-09-11 13:51:29 -04:00
committed by manojsdoshi
parent 767dd4ff3f
commit dac080f1c8
70 changed files with 3653 additions and 3867 deletions

View File

@@ -20,7 +20,7 @@
#include <ripple/app/main/DBInit.h>
#include <ripple/app/misc/Manifest.h>
#include <ripple/app/misc/ValidatorList.h>
#include <ripple/app/rdb/RelationalDBInterface_global.h>
#include <ripple/app/rdb/Wallet.h>
#include <ripple/basics/StringUtilities.h>
#include <ripple/basics/base64.h>
#include <ripple/basics/contract.h>

View File

@@ -19,7 +19,7 @@
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/SHAMapStore.h>
#include <ripple/app/rdb/backend/RelationalDBInterfaceSqlite.h>
#include <ripple/app/rdb/backend/SQLiteDatabase.h>
#include <ripple/core/ConfigSections.h>
#include <ripple/protocol/jss.h>
#include <test/jtx.h>
@@ -65,7 +65,7 @@ class SHAMapStore_test : public beast::unit_test::suite
auto const seq = json[jss::result][jss::ledger_index].asUInt();
std::optional<LedgerInfo> oinfo =
env.app().getRelationalDBInterface().getLedgerInfoByIndex(seq);
env.app().getRelationalDatabase().getLedgerInfoByIndex(seq);
if (!oinfo)
return false;
const LedgerInfo& info = oinfo.value();
@@ -120,8 +120,7 @@ class SHAMapStore_test : public beast::unit_test::suite
ledgerCheck(jtx::Env& env, int const rows, int const first)
{
const auto [actualRows, actualFirst, actualLast] =
dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface())
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase())
->getLedgerCountMinMax();
BEAST_EXPECT(actualRows == rows);
@@ -133,8 +132,7 @@ class SHAMapStore_test : public beast::unit_test::suite
transactionCheck(jtx::Env& env, int const rows)
{
BEAST_EXPECT(
dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface())
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase())
->getTransactionCount() == rows);
}
@@ -142,8 +140,7 @@ class SHAMapStore_test : public beast::unit_test::suite
accountTransactionCheck(jtx::Env& env, int const rows)
{
BEAST_EXPECT(
dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface())
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase())
->getAccountTransactionCount() == rows);
}

View File

@@ -21,7 +21,7 @@
#include <ripple/app/ledger/LedgerToJson.h>
#include <ripple/app/misc/LoadFeeTrack.h>
#include <ripple/app/misc/SHAMapStore.h>
#include <ripple/app/rdb/backend/RelationalDBInterfaceSqlite.h>
#include <ripple/app/rdb/backend/SQLiteDatabase.h>
#include <ripple/basics/Slice.h>
#include <ripple/basics/random.h>
#include <ripple/beast/hash/hash_append.h>
@@ -1762,9 +1762,9 @@ class DatabaseShard_test : public TestBase
}
void
testRelationalDBInterfaceSqlite(std::uint64_t const seedValue)
testSQLiteDatabase(std::uint64_t const seedValue)
{
testcase("Relational DB Interface SQLite");
testcase("SQLite Database");
using namespace test::jtx;
@@ -1782,8 +1782,8 @@ class DatabaseShard_test : public TestBase
BEAST_EXPECT(shardStore->getShardInfo()->finalized().empty());
BEAST_EXPECT(shardStore->getShardInfo()->incompleteToString().empty());
auto rdb = dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface());
auto rdb =
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase());
BEAST_EXPECT(rdb);
@@ -1796,7 +1796,7 @@ class DatabaseShard_test : public TestBase
return;
}
// Close these databases to force the RelationalDBInterfaceSqlite
// Close these databases to force the SQLiteDatabase
// to use the shard databases and lookup tables.
rdb->closeLedgerDB();
rdb->closeTransactionDB();
@@ -1814,7 +1814,7 @@ class DatabaseShard_test : public TestBase
for (auto const& ledger : data.ledgers_)
{
// Compare each test ledger to the data retrieved
// from the RelationalDBInterfaceSqlite class
// from the SQLiteDatabase class
if (shardStore->seqToShardIndex(ledger->seq()) <
shardStore->earliestShardIndex() ||
@@ -1829,8 +1829,7 @@ class DatabaseShard_test : public TestBase
for (auto const& transaction : ledger->txs)
{
// Compare each test transaction to the data
// retrieved from the RelationalDBInterfaceSqlite
// class
// retrieved from the SQLiteDatabase class
error_code_i error{rpcSUCCESS};
@@ -1885,7 +1884,7 @@ public:
testPrepareWithHistoricalPaths(seedValue());
testOpenShardManagement(seedValue());
testShardInfo(seedValue());
testRelationalDBInterfaceSqlite(seedValue());
testSQLiteDatabase(seedValue());
}
};

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <ripple/app/rdb/RelationalDBInterface_shards.h>
#include <ripple/app/rdb/ShardArchive.h>
#include <ripple/beast/utility/temp_dir.h>
#include <ripple/core/ConfigSections.h>
#include <ripple/nodestore/DummyScheduler.h>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <ripple/app/rdb/backend/RelationalDBInterfaceSqlite.h>
#include <ripple/app/rdb/backend/SQLiteDatabase.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/jss.h>
#include <test/jtx.h>
@@ -119,8 +119,7 @@ class Transaction_test : public beast::unit_test::suite
const auto deletedLedger = (startLegSeq + endLegSeq) / 2;
{
// Remove one of the ledgers from the database directly
dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface())
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase())
->deleteTransactionByLedgerSeq(deletedLedger);
}

View File

@@ -19,7 +19,7 @@
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/misc/TxQ.h>
#include <ripple/app/rdb/backend/RelationalDBInterfaceSqlite.h>
#include <ripple/app/rdb/backend/SQLiteDatabase.h>
#include <ripple/basics/mulDiv.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/jss.h>
@@ -769,8 +769,7 @@ class Tx_test : public beast::unit_test::suite
const auto deletedLedger = (startLegSeq + endLegSeq) / 2;
{
// Remove one of the ledgers from the database directly
dynamic_cast<RelationalDBInterfaceSqlite*>(
&env.app().getRelationalDBInterface())
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase())
->deleteTransactionByLedgerSeq(deletedLedger);
}