Skip to content

Commit

Permalink
[test] move wallet helper functions into test library
Browse files Browse the repository at this point in the history
  • Loading branch information
mzumsande committed Nov 25, 2019
1 parent f613e5d commit 78e283e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ bench_bench_bitcoin_SOURCES = \
bench/bech32.cpp \
bench/lockedpool.cpp \
bench/poly1305.cpp \
bench/prevector.cpp \
test/util.h \
test/util.cpp
bench/prevector.cpp

nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES)

Expand Down
4 changes: 3 additions & 1 deletion src/Makefile.test_util.include
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ TEST_UTIL_H = \
test/util/mining.h \
test/util/setup_common.h \
test/util/str.h \
test/util/transaction_utils.h
test/util/transaction_utils.h \
test/util/wallet.h

libtest_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
libtest_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
Expand All @@ -24,6 +25,7 @@ libtest_util_a_SOURCES = \
test/util/setup_common.cpp \
test/util/str.cpp \
test/util/transaction_utils.cpp \
test/util/wallet.cpp \
$(TEST_UTIL_H)

LIBTEST_UTIL += $(LIBBITCOIN_SERVER)
Expand Down
2 changes: 1 addition & 1 deletion src/bench/block_assemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <bench/bench.h>
#include <consensus/validation.h>
#include <crypto/sha256.h>
#include <test/util.h>
#include <test/util/mining.h>
#include <test/util/wallet.h>
#include <txmempool.h>
#include <validation.h>

Expand Down
2 changes: 1 addition & 1 deletion src/bench/wallet_balance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <interfaces/chain.h>
#include <node/context.h>
#include <optional.h>
#include <test/util.h>
#include <test/util/mining.h>
#include <test/util/wallet.h>
#include <validationinterface.h>
#include <wallet/wallet.h>

Expand Down
2 changes: 1 addition & 1 deletion src/test/util.cpp → src/test/util/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <test/util.h>
#include <test/util/wallet.h>

#include <key_io.h>
#include <outputtype.h>
Expand Down
7 changes: 4 additions & 3 deletions src/test/util.h → src/test/util/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_TEST_UTIL_H
#define BITCOIN_TEST_UTIL_H
#ifndef BITCOIN_TEST_UTIL_WALLET_H
#define BITCOIN_TEST_UTIL_WALLET_H

#include <string>

Expand All @@ -20,4 +20,5 @@ void importaddress(CWallet& wallet, const std::string& address);
/** Returns a new address from the wallet */
std::string getnewaddress(CWallet& w);

#endif // BITCOIN_TEST_UTIL_H

#endif // BITCOIN_TEST_UTIL_WALLET_H

0 comments on commit 78e283e

Please sign in to comment.