Bitcoin ABC 0.30.7
P2P Digital Currency
|
#include <chain.h>
#include <chainparams.h>
#include <config.h>
#include <interfaces/chain.h>
#include <node/blockstorage.h>
#include <node/context.h>
#include <policy/policy.h>
#include <rpc/server.h>
#include <util/translation.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/receive.h>
#include <wallet/rpc/backup.h>
#include <wallet/spend.h>
#include <wallet/wallet.h>
#include <test/util/logging.h>
#include <test/util/setup_common.h>
#include <wallet/test/wallet_test_fixture.h>
#include <boost/test/unit_test.hpp>
#include <univalue.h>
#include <any>
#include <cstdint>
#include <future>
#include <memory>
#include <variant>
#include <vector>
Go to the source code of this file.
Classes | |
class | ListCoinsTestingSetup |
Functions | |
static std::shared_ptr< CWallet > | TestLoadWallet (interfaces::Chain &chain) |
static void | TestUnloadWallet (std::shared_ptr< CWallet > &&wallet) |
static CMutableTransaction | TestSimpleSpend (const CTransaction &from, uint32_t index, const CKey &key, const CScript &pubkey) |
static void | AddKey (CWallet &wallet, const CKey &key) |
BOOST_FIXTURE_TEST_CASE (scan_for_wallet_transactions, TestChain100Setup) | |
BOOST_FIXTURE_TEST_CASE (importmulti_rescan, TestChain100Setup) | |
BOOST_FIXTURE_TEST_CASE (importwallet_rescan, TestChain100Setup) | |
BOOST_FIXTURE_TEST_CASE (coin_mark_dirty_immature_credit, TestChain100Setup) | |
static int64_t | AddTx (ChainstateManager &chainman, CWallet &wallet, uint32_t lockTime, int64_t mockTime, int64_t blockTime) |
BOOST_AUTO_TEST_CASE (ComputeTimeSmart) | |
BOOST_AUTO_TEST_CASE (LoadReceiveRequests) | |
static void | TestWatchOnlyPubKey (LegacyScriptPubKeyMan *spk_man, const CPubKey &add_pubkey) |
static void | PollutePubKey (CPubKey &pubkey) |
BOOST_AUTO_TEST_CASE (WatchOnlyPubKeys) | |
BOOST_FIXTURE_TEST_CASE (ListCoinsTest, ListCoinsTestingSetup) | |
BOOST_FIXTURE_TEST_CASE (wallet_disableprivkeys, TestChain100Setup) | |
static size_t | CalculateP2PKHInputSize (bool use_max_sig) |
BOOST_FIXTURE_TEST_CASE (dummy_input_size_test, TestChain100Setup) | |
bool | malformed_descriptor (std::ios_base::failure e) |
BOOST_FIXTURE_TEST_CASE (wallet_descriptor_test, BasicTestingSetup) | |
BOOST_FIXTURE_TEST_CASE (CreateWallet, TestChain100Setup) | |
Test CWallet::Create() and its behavior handling potential race conditions if it's called the same time an incoming transaction shows up in the mempool or a new block. More... | |
BOOST_FIXTURE_TEST_CASE (ZapSelectTx, TestChain100Setup) | |
Variables | |
RecursiveMutex | cs_wallets |
Definition at line 77 of file wallet_tests.cpp.
|
static |
Definition at line 400 of file wallet_tests.cpp.
BOOST_AUTO_TEST_CASE | ( | ComputeTimeSmart | ) |
BOOST_AUTO_TEST_CASE | ( | LoadReceiveRequests | ) |
Definition at line 458 of file wallet_tests.cpp.
BOOST_AUTO_TEST_CASE | ( | WatchOnlyPubKeys | ) |
BOOST_FIXTURE_TEST_CASE | ( | coin_mark_dirty_immature_credit | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | CreateWallet | , |
TestChain100Setup | |||
) |
Test CWallet::Create() and its behavior handling potential race conditions if it's called the same time an incoming transaction shows up in the mempool or a new block.
It isn't possible to verify there aren't race condition in every case, so this test just checks two specific cases and ensures that timing of notifications in these cases doesn't prevent the wallet from detecting transactions.
In the first case, block and mempool transactions are created before the wallet is loaded, but notifications about these transactions are delayed until after it is loaded. The notifications are superfluous in this case, so the test verifies the transactions are detected before they arrive.
In the second case, block and mempool transactions are created after the wallet rescan and notifications are immediately synced, to verify the wallet must already have a handler in place for them, and there's no gap after rescanning where new transactions in new blocks could be lost.
Definition at line 779 of file wallet_tests.cpp.
BOOST_FIXTURE_TEST_CASE | ( | dummy_input_size_test | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | importmulti_rescan | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | importwallet_rescan | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | ListCoinsTest | , |
ListCoinsTestingSetup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | scan_for_wallet_transactions | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | wallet_descriptor_test | , |
BasicTestingSetup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | wallet_disableprivkeys | , |
TestChain100Setup | |||
) |
BOOST_FIXTURE_TEST_CASE | ( | ZapSelectTx | , |
TestChain100Setup | |||
) |
|
static |
Definition at line 705 of file wallet_tests.cpp.
bool malformed_descriptor | ( | std::ios_base::failure | e | ) |
|
static |
Definition at line 513 of file wallet_tests.cpp.
|
static |
Definition at line 42 of file wallet_tests.cpp.
|
static |
Definition at line 60 of file wallet_tests.cpp.
|
static |
Definition at line 54 of file wallet_tests.cpp.
|
static |
Definition at line 477 of file wallet_tests.cpp.
|
extern |
Definition at line 51 of file wallet.cpp.