Skip to content

Commit 6861f95

Browse files
committed
util: move util/message to common/signmessage
Move util/message to common/signmessage so it is named more clearly, and because the util library is not supposed to depend on other libraries besides the crypto library. The signmessage functions use CKey, CPubKey, PKHash, and DecodeDestination functions in the consensus and common libraries.
1 parent cc5f29f commit 6861f95

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ BITCOIN_CORE_H = \
144144
compat/cpuid.h \
145145
compat/endian.h \
146146
common/settings.h \
147+
common/signmessage.h \
147148
common/system.h \
148149
compressor.h \
149150
consensus/consensus.h \
@@ -308,7 +309,6 @@ BITCOIN_CORE_H = \
308309
util/hasher.h \
309310
util/insert.h \
310311
util/macros.h \
311-
util/message.h \
312312
util/moneystr.h \
313313
util/overflow.h \
314314
util/overloaded.h \
@@ -680,6 +680,7 @@ libbitcoin_common_a_SOURCES = \
680680
common/interfaces.cpp \
681681
common/run_command.cpp \
682682
common/settings.cpp \
683+
common/signmessage.cpp \
683684
common/system.cpp \
684685
common/url.cpp \
685686
compressor.cpp \
@@ -742,7 +743,6 @@ libbitcoin_util_a_SOURCES = \
742743
util/hasher.cpp \
743744
util/sock.cpp \
744745
util/syserror.cpp \
745-
util/message.cpp \
746746
util/moneystr.cpp \
747747
util/rbf.cpp \
748748
util/readwritefile.cpp \

src/util/message.cpp renamed to src/common/signmessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6+
#include <common/signmessage.h>
67
#include <hash.h>
78
#include <key.h>
89
#include <key_io.h>
910
#include <pubkey.h>
1011
#include <uint256.h>
11-
#include <util/message.h>
1212
#include <util/strencodings.h>
1313

1414
#include <cassert>

src/util/message.h renamed to src/common/signmessage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
#ifndef BITCOIN_UTIL_MESSAGE_H
7-
#define BITCOIN_UTIL_MESSAGE_H
6+
#ifndef BITCOIN_COMMON_SIGNMESSAGE_H
7+
#define BITCOIN_COMMON_SIGNMESSAGE_H
88

99
#include <uint256.h>
1010

@@ -74,4 +74,4 @@ uint256 MessageHash(const std::string& message);
7474

7575
std::string SigningResultString(const SigningResult res);
7676

77-
#endif // BITCOIN_UTIL_MESSAGE_H
77+
#endif // BITCOIN_COMMON_SIGNMESSAGE_H

src/interfaces/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#define BITCOIN_INTERFACES_WALLET_H
77

88
#include <addresstype.h>
9+
#include <common/signmessage.h>
910
#include <consensus/amount.h>
1011
#include <interfaces/chain.h>
1112
#include <pubkey.h>
1213
#include <script/script.h>
1314
#include <support/allocators/secure.h>
1415
#include <util/fs.h>
15-
#include <util/message.h>
1616
#include <util/result.h>
1717
#include <util/ui_change_type.h>
1818

src/qt/signverifymessagedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <qt/platformstyle.h>
1111
#include <qt/walletmodel.h>
1212

13+
#include <common/signmessage.h> // For MessageSign(), MessageVerify()
1314
#include <config/bitcoin-config.h> // IWYU pragma: keep
1415
#include <key_io.h>
15-
#include <util/message.h> // For MessageSign(), MessageVerify()
1616
#include <wallet/wallet.h>
1717

1818
#include <vector>

src/rpc/signmessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6+
#include <common/signmessage.h>
67
#include <key.h>
78
#include <key_io.h>
89
#include <rpc/protocol.h>
910
#include <rpc/request.h>
1011
#include <rpc/server.h>
1112
#include <rpc/util.h>
1213
#include <univalue.h>
13-
#include <util/message.h>
1414

1515
#include <string>
1616

src/test/fuzz/message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <chainparams.h>
6+
#include <common/signmessage.h>
67
#include <key_io.h>
78
#include <test/fuzz/FuzzedDataProvider.h>
89
#include <test/fuzz/fuzz.h>
910
#include <test/fuzz/util.h>
1011
#include <util/chaintype.h>
11-
#include <util/message.h>
1212
#include <util/strencodings.h>
1313

1414
#include <cassert>

src/test/util_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <clientversion.h>
6+
#include <common/signmessage.h> // For MessageSign(), MessageVerify(), MESSAGE_MAGIC
67
#include <hash.h> // For Hash()
78
#include <key.h> // For CKey
89
#include <sync.h>
@@ -12,7 +13,6 @@
1213
#include <util/bitdeque.h>
1314
#include <util/fs.h>
1415
#include <util/fs_helpers.h>
15-
#include <util/message.h> // For MessageSign(), MessageVerify(), MESSAGE_MAGIC
1616
#include <util/moneystr.h>
1717
#include <util/overflow.h>
1818
#include <util/readwritefile.h>

src/wallet/rpc/signmessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <common/signmessage.h>
56
#include <key_io.h>
67
#include <rpc/util.h>
7-
#include <util/message.h>
88
#include <wallet/rpc/util.h>
99
#include <wallet/wallet.h>
1010

src/wallet/scriptpubkeyman.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#define BITCOIN_WALLET_SCRIPTPUBKEYMAN_H
77

88
#include <addresstype.h>
9+
#include <common/signmessage.h>
910
#include <logging.h>
1011
#include <psbt.h>
1112
#include <script/descriptor.h>
1213
#include <script/script.h>
1314
#include <script/signingprovider.h>
1415
#include <util/error.h>
15-
#include <util/message.h>
1616
#include <util/result.h>
1717
#include <util/time.h>
1818
#include <wallet/crypter.h>

0 commit comments

Comments
 (0)