From 78e283e656bf1643944ffdb76185f3468eb25895 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Mon, 25 Nov 2019 13:57:47 +0100 Subject: [PATCH] [test] move wallet helper functions into test library --- src/Makefile.bench.include | 4 +--- src/Makefile.test_util.include | 4 +++- src/bench/block_assemble.cpp | 2 +- src/bench/wallet_balance.cpp | 2 +- src/test/{util.cpp => util/wallet.cpp} | 2 +- src/test/{util.h => util/wallet.h} | 7 ++++--- 6 files changed, 11 insertions(+), 10 deletions(-) rename src/test/{util.cpp => util/wallet.cpp} (97%) rename src/test/{util.h => util/wallet.h} (82%) diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 9e70db116b7..1c97e22de8c 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -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) diff --git a/src/Makefile.test_util.include b/src/Makefile.test_util.include index 139b7095692..505d630b7d5 100644 --- a/src/Makefile.test_util.include +++ b/src/Makefile.test_util.include @@ -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) @@ -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) diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 2ccae0c6675..184367e1e5d 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -5,8 +5,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp index bd79ddfdd6d..f39dcc0b71b 100644 --- a/src/bench/wallet_balance.cpp +++ b/src/bench/wallet_balance.cpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/test/util.cpp b/src/test/util/wallet.cpp similarity index 97% rename from src/test/util.cpp rename to src/test/util/wallet.cpp index e775ad323ba..226d2df6e40 100644 --- a/src/test/util.cpp +++ b/src/test/util/wallet.cpp @@ -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 +#include #include #include diff --git a/src/test/util.h b/src/test/util/wallet.h similarity index 82% rename from src/test/util.h rename to src/test/util/wallet.h index 7adeaea7721..565ef1756a6 100644 --- a/src/test/util.h +++ b/src/test/util/wallet.h @@ -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 @@ -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