From 6861f954f8ff42c87ad638037adae86a5bd89600 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Fri, 10 May 2024 15:45:07 -0400 Subject: [PATCH] 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. --- src/Makefile.am | 4 ++-- src/{util/message.cpp => common/signmessage.cpp} | 2 +- src/{util/message.h => common/signmessage.h} | 6 +++--- src/interfaces/wallet.h | 2 +- src/qt/signverifymessagedialog.cpp | 2 +- src/rpc/signmessage.cpp | 2 +- src/test/fuzz/message.cpp | 2 +- src/test/util_tests.cpp | 2 +- src/wallet/rpc/signmessage.cpp | 2 +- src/wallet/scriptpubkeyman.h | 2 +- src/wallet/wallet.cpp | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) rename src/{util/message.cpp => common/signmessage.cpp} (98%) rename src/{util/message.h => common/signmessage.h} (95%) diff --git a/src/Makefile.am b/src/Makefile.am index bb61f2d0276..54000a7eb19 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -144,6 +144,7 @@ BITCOIN_CORE_H = \ compat/cpuid.h \ compat/endian.h \ common/settings.h \ + common/signmessage.h \ common/system.h \ compressor.h \ consensus/consensus.h \ @@ -308,7 +309,6 @@ BITCOIN_CORE_H = \ util/hasher.h \ util/insert.h \ util/macros.h \ - util/message.h \ util/moneystr.h \ util/overflow.h \ util/overloaded.h \ @@ -680,6 +680,7 @@ libbitcoin_common_a_SOURCES = \ common/interfaces.cpp \ common/run_command.cpp \ common/settings.cpp \ + common/signmessage.cpp \ common/system.cpp \ common/url.cpp \ compressor.cpp \ @@ -742,7 +743,6 @@ libbitcoin_util_a_SOURCES = \ util/hasher.cpp \ util/sock.cpp \ util/syserror.cpp \ - util/message.cpp \ util/moneystr.cpp \ util/rbf.cpp \ util/readwritefile.cpp \ diff --git a/src/util/message.cpp b/src/common/signmessage.cpp similarity index 98% rename from src/util/message.cpp rename to src/common/signmessage.cpp index 1afb28cc10d..1612751e44d 100644 --- a/src/util/message.cpp +++ b/src/common/signmessage.cpp @@ -3,12 +3,12 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include #include #include #include #include -#include #include #include diff --git a/src/util/message.h b/src/common/signmessage.h similarity index 95% rename from src/util/message.h rename to src/common/signmessage.h index d0e2422574b..215b563bbb2 100644 --- a/src/util/message.h +++ b/src/common/signmessage.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_UTIL_MESSAGE_H -#define BITCOIN_UTIL_MESSAGE_H +#ifndef BITCOIN_COMMON_SIGNMESSAGE_H +#define BITCOIN_COMMON_SIGNMESSAGE_H #include @@ -74,4 +74,4 @@ uint256 MessageHash(const std::string& message); std::string SigningResultString(const SigningResult res); -#endif // BITCOIN_UTIL_MESSAGE_H +#endif // BITCOIN_COMMON_SIGNMESSAGE_H diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index c41f35829d7..f1bfffa7d46 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -6,13 +6,13 @@ #define BITCOIN_INTERFACES_WALLET_H #include +#include #include #include #include #include