Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move HD code from CWallet to LegacyScriptPubKeyMan #5854

Merged
merged 15 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ BITCOIN_CORE_H = \
base58.h \
batchedlogger.h \
bech32.h \
bip39.h \
bip39_english.h \
blockencodings.h \
bloom.h \
cachemap.h \
Expand Down Expand Up @@ -203,7 +201,6 @@ BITCOIN_CORE_H = \
gsl/assert.h \
gsl/pointers.h \
flat-database.h \
hdchain.h \
flatfile.h \
fs.h \
httprpc.h \
Expand Down Expand Up @@ -365,12 +362,15 @@ BITCOIN_CORE_H = \
validationinterface.h \
versionbits.h \
wallet/bdb.h \
wallet/bip39.h \
wallet/bip39_english.h \
wallet/coincontrol.h \
wallet/coinselection.h \
wallet/context.h \
wallet/crypter.h \
wallet/db.h \
wallet/fees.h \
wallet/hdchain.h \
wallet/ismine.h \
wallet/load.h \
wallet/rpcwallet.h \
Expand Down Expand Up @@ -540,12 +540,13 @@ libbitcoin_wallet_a_SOURCES = \
coinjoin/client.cpp \
coinjoin/interfaces.cpp \
coinjoin/util.cpp \
hdchain.cpp \
wallet/bip39.cpp \
wallet/coincontrol.cpp \
wallet/context.cpp \
wallet/crypter.cpp \
wallet/db.cpp \
wallet/fees.cpp \
wallet/hdchain.cpp \
wallet/interfaces.cpp \
wallet/load.cpp \
wallet/rpcdump.cpp \
Expand Down Expand Up @@ -708,7 +709,6 @@ libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
base58.cpp \
bech32.cpp \
bip39.cpp \
bloom.cpp \
chainparams.cpp \
coins.cpp \
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ FUZZ_SUITE_LD_COMMON = \
$(LIBTEST_FUZZ) \
$(LIBTEST_UTIL) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CLI) \
$(LIBDASHBLS) \
$(BDB_LIBS) \
Expand Down Expand Up @@ -83,7 +83,6 @@ BITCOIN_TESTS =\
test/base64_tests.cpp \
test/bech32_tests.cpp \
test/bip32_tests.cpp \
test/bip39_tests.cpp \
test/block_reward_reallocation_tests.cpp \
test/blockchain_tests.cpp \
test/blockencodings_tests.cpp \
Expand Down Expand Up @@ -181,6 +180,7 @@ BITCOIN_TESTS =\

if ENABLE_WALLET
BITCOIN_TESTS += \
wallet/test/bip39_tests.cpp \
wallet/test/coinjoin_tests.cpp \
wallet/test/psbt_wallet_tests.cpp \
wallet/test/wallet_tests.cpp \
Expand Down
1 change: 0 additions & 1 deletion src/script/signingprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#ifndef BITCOIN_SCRIPT_SIGNINGPROVIDER_H
#define BITCOIN_SCRIPT_SIGNINGPROVIDER_H

#include <hdchain.h>
#include <key.h>
#include <pubkey.h>
#include <script/script.h>
Expand Down
4 changes: 2 additions & 2 deletions src/bip39.cpp → src/wallet/bip39.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
// Source:
// https://github.com/trezor/trezor-crypto

#include <bip39.h>
#include <bip39_english.h>
#include <wallet/bip39.h>
#include <wallet/bip39_english.h>
#include <crypto/pkcs5_pbkdf2_hmac_sha512.h>
#include <crypto/sha256.h>
#include <random.h>
Expand Down
6 changes: 3 additions & 3 deletions src/bip39.h → src/wallet/bip39.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef BITCOIN_BIP39_H
#define BITCOIN_BIP39_H
#ifndef BITCOIN_WALLET_BIP39_H
#define BITCOIN_WALLET_BIP39_H

#include <support/allocators/secure.h>

Expand All @@ -36,4 +36,4 @@ class CMnemonic
static void ToSeed(SecureString mnemonic, SecureString passphrase, SecureVector& seedRet);
};

#endif // BITCOIN_BIP39_H
#endif // BITCOIN_WALLET_BIP39_H
6 changes: 3 additions & 3 deletions src/bip39_english.h → src/wallet/bip39_english.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef BITCOIN_BIP39_ENGLISH_H
#define BITCOIN_BIP39_ENGLISH_H
#ifndef BITCOIN_WALLET_BIP39_ENGLISH_H
#define BITCOIN_WALLET_BIP39_ENGLISH_H

const char * const wordlist[] = {
"abandon",
Expand Down Expand Up @@ -2076,4 +2076,4 @@ const char * const wordlist[] = {
0,
};

#endif // BITCOIN_BIP39_ENGLISH_H
#endif // BITCOIN_WALLET_BIP39_ENGLISH_H
5 changes: 3 additions & 2 deletions src/hdchain.cpp → src/wallet/hdchain.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright (c) 2014-2023 The Dash Core developers
// Distributed under the MIT software license, see the accompanying

#include <bip39.h>
#include <wallet/hdchain.h>

#include <wallet/bip39.h>
#include <chainparams.h>
#include <hdchain.h>
#include <key_io.h>
#include <tinyformat.h>
#include <util/system.h>
Expand Down
6 changes: 3 additions & 3 deletions src/hdchain.h → src/wallet/hdchain.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2014-2023 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
#ifndef BITCOIN_HDCHAIN_H
#define BITCOIN_HDCHAIN_H
#ifndef BITCOIN_WALLET_HDCHAIN_H
#define BITCOIN_WALLET_HDCHAIN_H

#include <key.h>
#include <script/keyorigin.h>
Expand Down Expand Up @@ -142,4 +142,4 @@ class CHDPubKey
std::string GetKeyPath() const;
};

#endif // BITCOIN_HDCHAIN_H
#endif // BITCOIN_WALLET_HDCHAIN_H
4 changes: 2 additions & 2 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#ifdef USE_BDB
#include <wallet/bdb.h>
#endif
#include <wallet/bip39.h>
#include <wallet/coincontrol.h>
#include <wallet/hdchain.h>
#include <wallet/wallet.h>
#include <walletinitinterface.h>

#include <bip39.h>
#include <coinjoin/client.h>
#include <coinjoin/options.h>
#include <hdchain.h>

class WalletInit : public WalletInitInterface
{
Expand Down
Loading
Loading