Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/walletdb_tests.cpp
// Copyright (c) 2017 The Bitcoin developers | // Copyright (c) 2017 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <wallet/walletdb.h> | #include <wallet/walletdb.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <interfaces/chain.h> | |||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <test/test_bitcoin.h> | #include <test/test_bitcoin.h> | ||||
#include <wallet/test/wallet_test_fixture.h> | #include <wallet/test/wallet_test_fixture.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <memory> | #include <memory> | ||||
namespace { | namespace { | ||||
static std::unique_ptr<CWallet> LoadWallet(WalletBatch &batch) { | static std::unique_ptr<CWallet> LoadWallet(WalletBatch &batch) { | ||||
auto chain = interfaces::MakeChain(); | |||||
std::unique_ptr<CWallet> wallet = std::make_unique<CWallet>( | std::unique_ptr<CWallet> wallet = std::make_unique<CWallet>( | ||||
Params(), WalletLocation(), WalletDatabase::CreateDummy()); | Params(), *chain, WalletLocation(), WalletDatabase::CreateDummy()); | ||||
DBErrors res = batch.LoadWallet(wallet.get()); | DBErrors res = batch.LoadWallet(wallet.get()); | ||||
BOOST_CHECK(res == DBErrors::LOAD_OK); | BOOST_CHECK(res == DBErrors::LOAD_OK); | ||||
return wallet; | return wallet; | ||||
} | } | ||||
} // namespace | } // namespace | ||||
BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletTestingSetup) | BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletTestingSetup) | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |