Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
wallet::MockableSQLiteDatabase Class Reference

A WalletDatabase whose contents and return values can be modified as needed for testing. More...

#include <util.h>

Inheritance diagram for wallet::MockableSQLiteDatabase:
[legend]
Collaboration diagram for wallet::MockableSQLiteDatabase:
[legend]

Public Member Functions

 MockableSQLiteDatabase ()
bool Backup (const std::string &strDest) const override
 Back up the entire database to a file.
std::string Filename () override
 Return path to main database file for logs and error messages.
std::string Format () override
std::unique_ptr< DatabaseBatch > MakeBatch () override
 Make a DatabaseBatch connected to this database.
Public Member Functions inherited from wallet::InMemoryWalletDatabase
 InMemoryWalletDatabase ()
std::vector< fs::path > Files () override
 Return paths to all database created files.
Public Member Functions inherited from wallet::SQLiteDatabase
 SQLiteDatabase ()=delete
 SQLiteDatabase (const fs::path &dir_path, const fs::path &file_path, const DatabaseOptions &options)
 Create DB handle to real database.
 ~SQLiteDatabase ()
bool Verify (bilingual_str &error)
void Open () override
 Open the database if it is not already opened.
void Close () override
 Close the database.
bool Rewrite () override
 Rewrite the entire database on disk.
bool Backup (const std::string &dest) const override
 Back up the entire database to a file.
std::string Filename () override
 Return path to main database file for logs and error messages.
std::vector< fs::path > Files () override
 Return paths to all database created files.
std::string Format () override
std::unique_ptr< DatabaseBatch > MakeBatch () override
 Make a SQLiteBatch connected to this database.
bool HasActiveTxn ()
 Return true if there is an on-going txn in this connection.
Public Member Functions inherited from wallet::WalletDatabase
 WalletDatabase ()=default
 Create dummy DB handle.
virtual ~WalletDatabase ()=default

Additional Inherited Members

Public Attributes inherited from wallet::SQLiteDatabase
std::binary_semaphore m_write_semaphore
sqlite3 * m_db {nullptr}
bool m_use_unsafe_sync
Protected Member Functions inherited from wallet::SQLiteDatabase
 SQLiteDatabase (const fs::path &dir_path, const fs::path &file_path, const DatabaseOptions &options, int additional_flags)

Detailed Description

A WalletDatabase whose contents and return values can be modified as needed for testing.

Definition at line 59 of file util.h.

Constructor & Destructor Documentation

◆ MockableSQLiteDatabase()

wallet::MockableSQLiteDatabase::MockableSQLiteDatabase ( )

Definition at line 116 of file util.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Backup()

bool wallet::MockableSQLiteDatabase::Backup ( const std::string & strDest) const
inlineoverridevirtual

Back up the entire database to a file.

Implements wallet::WalletDatabase.

Definition at line 64 of file util.h.

◆ Filename()

std::string wallet::MockableSQLiteDatabase::Filename ( )
inlineoverridevirtual

Return path to main database file for logs and error messages.

Implements wallet::WalletDatabase.

Definition at line 66 of file util.h.

◆ Format()

std::string wallet::MockableSQLiteDatabase::Format ( )
inlineoverridevirtual

Implements wallet::WalletDatabase.

Definition at line 67 of file util.h.

◆ MakeBatch()

std::unique_ptr< DatabaseBatch > wallet::MockableSQLiteDatabase::MakeBatch ( )
inlineoverridevirtual

Make a DatabaseBatch connected to this database.

Implements wallet::WalletDatabase.

Definition at line 68 of file util.h.


The documentation for this class was generated from the following files: