refactor: Consolidate redundant wallet database path and exists functions

No change in behavior. Just remove a little bit of code, reduce macro usage,
remove duplicative functions, and make BDB and SQLite implementations more
consistent with each other.
This commit is contained in:
Russell Yanofsky
2020-10-30 16:41:23 -04:00
parent 6a7a63644c
commit d70dc89e78
8 changed files with 38 additions and 54 deletions

View File

@@ -13,6 +13,13 @@
BOOST_FIXTURE_TEST_SUITE(db_tests, BasicTestingSetup)
static std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& path, std::string& database_filename)
{
fs::path data_file = BDBDataFile(path);
database_filename = data_file.filename().string();
return GetBerkeleyEnv(data_file.parent_path());
}
BOOST_AUTO_TEST_CASE(getwalletenv_file)
{
std::string test_name = "test_name.dat";