aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-08-19 11:13:41 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-11-21 17:30:00 -0300
commitee7a984f85015b610be4929b7c35cb501c1fbf7c (patch)
tree5524e76c9617f91641a2c29a25312379618bacfb /src/test
parentcc5a5e81217506ec6f9fff34056290f8f40a7396 (diff)
downloadbitcoin-ee7a984f85015b610be4929b7c35cb501c1fbf7c.tar.xz
refactor: unify test/util/wallet.h with wallet/test/util.h
files share the same purpose, and we shouldn't have wallet code inside the test directory. This later is needed to use wallet util functions in the bench and test binaries without be forced to duplicate them.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/util/wallet.cpp32
-rw-r--r--src/test/util/wallet.h29
2 files changed, 0 insertions, 61 deletions
diff --git a/src/test/util/wallet.cpp b/src/test/util/wallet.cpp
deleted file mode 100644
index 2dadffafb4..0000000000
--- a/src/test/util/wallet.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2019-2021 The Bitcoin Core developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-#include <test/util/wallet.h>
-
-#include <key_io.h>
-#include <outputtype.h>
-#include <script/standard.h>
-#ifdef ENABLE_WALLET
-#include <util/check.h>
-#include <util/translation.h>
-#include <wallet/wallet.h>
-#endif
-
-using wallet::CWallet;
-
-const std::string ADDRESS_BCRT1_UNSPENDABLE = "bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj";
-
-#ifdef ENABLE_WALLET
-std::string getnewaddress(CWallet& w)
-{
- constexpr auto output_type = OutputType::BECH32;
- return EncodeDestination(getNewDestination(w, output_type));
-}
-
-CTxDestination getNewDestination(CWallet& w, OutputType output_type)
-{
- return *Assert(w.GetNewDestination(output_type, ""));
-}
-
-#endif // ENABLE_WALLET
diff --git a/src/test/util/wallet.h b/src/test/util/wallet.h
deleted file mode 100644
index d8f1db3fd7..0000000000
--- a/src/test/util/wallet.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2019 The Bitcoin Core developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-#ifndef BITCOIN_TEST_UTIL_WALLET_H
-#define BITCOIN_TEST_UTIL_WALLET_H
-
-#include <outputtype.h>
-#include <string>
-
-namespace wallet {
-class CWallet;
-} // namespace wallet
-
-// Constants //
-
-extern const std::string ADDRESS_BCRT1_UNSPENDABLE;
-
-// RPC-like //
-
-/** Import the address to the wallet */
-void importaddress(wallet::CWallet& wallet, const std::string& address);
-/** Returns a new encoded destination from the wallet (hardcoded to BECH32) */
-std::string getnewaddress(wallet::CWallet& w);
-/** Returns a new destination, of an specific type, from the wallet */
-CTxDestination getNewDestination(wallet::CWallet& w, OutputType output_type);
-
-
-#endif // BITCOIN_TEST_UTIL_WALLET_H