Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

wallet_tests.cpp File Reference
#include <wallet/wallet.h>
#include <iostream>
#include <memory>
#include <set>
#include <stdint.h>
#include <utility>
#include <vector>
#include <consensus/validation.h>
#include <rpc/server.h>
#include <test/test_dash.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/test/wallet_test_fixture.h>
#include <boost/test/unit_test.hpp>
#include <univalue.h>
+ Include dependency graph for wallet_tests.cpp:

Go to the source code of this file.

Classes

class  ListCoinsTestingSetup
 
class  CreateTransactionTestSetup
 

Macros

#define RUN_TESTS   100
 
#define RANDOM_REPEATS   5
 

Typedefs

typedef std::set< CInputCoinCoinSet
 

Functions

UniValue importmulti (const JSONRPCRequest &request)
 
UniValue dumpwallet (const JSONRPCRequest &request)
 
UniValue importwallet (const JSONRPCRequest &request)
 
UniValue getnewaddress (const JSONRPCRequest &request)
 
static void add_coin (const CAmount &nValue, int nAge=6 *24, bool fIsFromMe=false, int nInput=0)
 
static void empty_wallet (void)
 
static bool equal_sets (CoinSet a, CoinSet b)
 
 BOOST_AUTO_TEST_CASE (coin_selection_tests)
 
 BOOST_AUTO_TEST_CASE (ApproximateBestSubset)
 
static void AddKey (CWallet &wallet, const CKey &key)
 
 BOOST_FIXTURE_TEST_CASE (rescan, TestChain100Setup)
 
 BOOST_FIXTURE_TEST_CASE (importwallet_rescan, TestChain100Setup)
 
 BOOST_FIXTURE_TEST_CASE (coin_mark_dirty_immature_credit, TestChain100Setup)
 
static int64_t AddTx (CWallet &wallet, uint32_t lockTime, int64_t mockTime, int64_t blockTime)
 
 BOOST_AUTO_TEST_CASE (ComputeTimeSmart)
 
 BOOST_AUTO_TEST_CASE (LoadReceiveRequests)
 
 BOOST_FIXTURE_TEST_CASE (ListCoins, ListCoinsTestingSetup)
 
 BOOST_FIXTURE_TEST_CASE (CreateTransactionTest, CreateTransactionTestSetup)
 

Variables

std::vector< std::unique_ptr< CWalletTx > > wtxn
 
static const CWallet testWallet ("dummy", WalletDatabase::CreateDummy())
 
static std::vector< COutputvCoins
 

Macro Definition Documentation

◆ RANDOM_REPEATS

#define RANDOM_REPEATS   5

Definition at line 34 of file wallet_tests.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ RUN_TESTS

#define RUN_TESTS   100

Definition at line 30 of file wallet_tests.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Typedef Documentation

◆ CoinSet

typedef std::set<CInputCoin> CoinSet

Definition at line 38 of file wallet_tests.cpp.

Function Documentation

◆ add_coin()

static void add_coin ( const CAmount nValue,
int  nAge = 6*24,
bool  fIsFromMe = false,
int  nInput = 0 
)
static

◆ AddKey()

◆ AddTx()

◆ BOOST_AUTO_TEST_CASE() [1/4]

◆ BOOST_AUTO_TEST_CASE() [2/4]

◆ BOOST_AUTO_TEST_CASE() [3/4]

BOOST_AUTO_TEST_CASE ( ComputeTimeSmart  )

Definition at line 564 of file wallet_tests.cpp.

References AddTx(), BOOST_CHECK_EQUAL, and SetMockTime().

◆ BOOST_AUTO_TEST_CASE() [4/4]

BOOST_AUTO_TEST_CASE ( LoadReceiveRequests  )

Definition at line 590 of file wallet_tests.cpp.

References BOOST_CHECK_EQUAL, and LOCK.

◆ BOOST_FIXTURE_TEST_CASE() [1/5]

◆ BOOST_FIXTURE_TEST_CASE() [2/5]

◆ BOOST_FIXTURE_TEST_CASE() [3/5]

◆ BOOST_FIXTURE_TEST_CASE() [4/5]

BOOST_FIXTURE_TEST_CASE ( ListCoins  ,
ListCoinsTestingSetup   
)

Definition at line 652 of file wallet_tests.cpp.

References AddTx(), BOOST_CHECK_EQUAL, COIN, GetScriptForRawPubKey(), and LOCK.

◆ BOOST_FIXTURE_TEST_CASE() [5/5]

BOOST_FIXTURE_TEST_CASE ( CreateTransactionTest  ,
CreateTransactionTestSetup   
)

◆ dumpwallet()

◆ empty_wallet()

static void empty_wallet ( void  )
static

Definition at line 68 of file wallet_tests.cpp.

References vCoins, and wtxn.

Referenced by BOOST_AUTO_TEST_CASE().

◆ equal_sets()

static bool equal_sets ( CoinSet  a,
CoinSet  b 
)
static

Definition at line 74 of file wallet_tests.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ getnewaddress()

◆ importmulti()

◆ importwallet()

Variable Documentation

◆ testWallet

const CWallet testWallet("dummy", WalletDatabase::CreateDummy())
static

Referenced by add_coin(), and BOOST_AUTO_TEST_CASE().

◆ vCoins

◆ wtxn

std::vector<std::unique_ptr<CWalletTx> > wtxn

Definition at line 36 of file wallet_tests.cpp.

Referenced by add_coin(), and empty_wallet().

Released under the MIT license