5#include <blockfilter.h>
25#include <boost/test/unit_test.hpp>
79 std::chrono::steady_clock::time_point
fake_time;
109 file_number =
oldTip->GetBlockPos().nFile;
138 file_number =
newTip->GetBlockPos().nFile;
182 BOOST_REQUIRE(filter_index.BlockUntilSyncedToCurrentChain());
347 wallet.SetLastBlockProcessed(tip_height, tip_hash);
368 wallet.SetLastBlockProcessed(tip_height, tip_hash);
403 auto handler =
wallet.ShowProgress.connect([&](
const std::string&,
int) {
442 std::chrono::steady_clock::time_point
fake_time;
470 file_number =
old_tip->GetBlockPos().nFile;
524 tip_hash =
tip->GetBlockHash();
525 wallet.SetLastBlockProcessed(tip_height, tip_hash);
557 m_args.ForceSetArg(
"-unsafesqlitesync",
"1");
constexpr CAmount COIN
The amount of satoshis in one BTC.
bool DestroyBlockFilterIndex(BlockFilterType filter_type)
Destroy the block filter index with the given type.
BlockFilterIndex * GetBlockFilterIndex(BlockFilterType filter_type)
Get a block filter index by type.
bool InitBlockFilterIndex(std::function< std::unique_ptr< interfaces::Chain >()> make_chain, BlockFilterType filter_type, size_t n_cache_size, bool f_memory, bool f_wipe)
Initialize a block filter index for the given type if one does not already exist.
constexpr int64_t TIMESTAMP_WINDOW
Timestamp window used as a grace period by code that compares external timestamps (such as timestamps...
#define Assert(val)
Identity function.
Complete block filter struct as defined in BIP 157.
BlockFilterIndex is used to store and retrieve block filters, hashes, and headers for a range of bloc...
The block chain is a tree shaped structure starting with the genesis block at the root,...
Serialized script, used inside transaction inputs and outputs.
constexpr bool IsNull() const
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Access to the wallet database.
RAII object to check and reserve a wallet rescan.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
CKey GenerateRandomKey(bool compressed) noexcept
std::unique_ptr< Chain > MakeChain(node::NodeContext &node)
Return implementation of Chain interface.
constexpr unsigned int MAX_BLOCKFILE_SIZE
The maximum size of a blk?????.dat file (since 0.8)
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase()
BOOST_FIXTURE_TEST_CASE(wallet_coinsresult_test, BasicTestingSetup)
void TestUnloadWallet(std::shared_ptr< CWallet > &&wallet)
void AddKey(CWallet &wallet, const CKey &key)
std::shared_ptr< CWallet > TestLoadWallet(std::unique_ptr< WalletDatabase > database, WalletContext &context)
Balance GetBalance(const CWallet &wallet, const int min_depth, bool avoid_reuse, bool include_nonmempool)
std::shared_ptr< CWallet > TestCreateWallet(std::unique_ptr< WalletDatabase > database, WalletContext &context, uint64_t create_flags)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
bool(* handler)(const std::any &context, HTTPRequest *req, const std::string &strReq)
static bool GetPubKey(const SigningProvider &provider, const SignatureData &sigdata, const CKeyID &address, CPubKey &pubkey)
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
std::vector< uint256 > vHave
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
Testing setup that configures a complete environment.
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< interfaces::Chain > chain
uint256 last_scanned_block
Hash and height of most recent block that was successfully scanned.
enum wallet::ScanResult::@19 status
std::optional< int > last_scanned_height
uint256 last_failed_block
Height of the most recent block that could not be scanned due to read errors or pruning.
WalletContext struct containing references to state shared between CWallet instances,...
interfaces::Chain * chain
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
void StopIndex(BaseIndex &index, node::NodeContext &node)
Drain validation callbacks before stopping an index, matching Shutdown() in init.cpp.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.