From 43b8777dc3e63f4a1b20a3cb23e44c1b9e32862b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 4 Oct 2022 18:15:53 +0000 Subject: [PATCH] refactor: move run_command from util to common Quoting ryanofsky: "util can be the library for things included in the kernel which the kernel can depend on, and common can be the library for other code that needs to be shared internally, but should not be part of the kernel or shared externally." --- src/Makefile.am | 6 +++--- src/{util => common}/run_command.cpp | 2 +- src/{util => common}/run_command.h | 6 +++--- src/external_signer.cpp | 2 +- src/test/system_tests.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename src/{util => common}/run_command.cpp (98%) rename src/{util => common}/run_command.h (82%) diff --git a/src/Makefile.am b/src/Makefile.am index f5cf8cbca52..592f06aec6f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -133,6 +133,7 @@ BITCOIN_CORE_H = \ clientversion.h \ coins.h \ common/bloom.h \ + common/run_command.h \ compat/assumptions.h \ compat/byteswap.h \ compat/compat.h \ @@ -284,7 +285,6 @@ BITCOIN_CORE_H = \ util/rbf.h \ util/readwritefile.h \ util/result.h \ - util/run_command.h \ util/serfloat.h \ util/settings.h \ util/sock.h \ @@ -617,7 +617,7 @@ libbitcoin_consensus_a_SOURCES = \ version.h # common: shared between bitcoind, and bitcoin-qt and non-server tools -libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_common_a_SOURCES = \ base58.cpp \ @@ -625,6 +625,7 @@ libbitcoin_common_a_SOURCES = \ chainparams.cpp \ coins.cpp \ common/bloom.cpp \ + common/run_command.cpp \ compressor.cpp \ core_read.cpp \ core_write.cpp \ @@ -681,7 +682,6 @@ libbitcoin_util_a_SOURCES = \ util/fees.cpp \ util/getuniquepath.cpp \ util/hasher.cpp \ - util/run_command.cpp \ util/sock.cpp \ util/syserror.cpp \ util/system.cpp \ diff --git a/src/util/run_command.cpp b/src/common/run_command.cpp similarity index 98% rename from src/util/run_command.cpp rename to src/common/run_command.cpp index 90d677f5128..6ad9f75b5d9 100644 --- a/src/util/run_command.cpp +++ b/src/common/run_command.cpp @@ -6,7 +6,7 @@ #include #endif -#include +#include #include #include diff --git a/src/util/run_command.h b/src/common/run_command.h similarity index 82% rename from src/util/run_command.h rename to src/common/run_command.h index afe5d831c65..2fbdc071eec 100644 --- a/src/util/run_command.h +++ b/src/common/run_command.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_UTIL_RUN_COMMAND_H -#define BITCOIN_UTIL_RUN_COMMAND_H +#ifndef BITCOIN_COMMON_RUN_COMMAND_H +#define BITCOIN_COMMON_RUN_COMMAND_H #include @@ -18,4 +18,4 @@ class UniValue; */ UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in=""); -#endif // BITCOIN_UTIL_RUN_COMMAND_H +#endif // BITCOIN_COMMON_RUN_COMMAND_H diff --git a/src/external_signer.cpp b/src/external_signer.cpp index d1eec2fd617..0e582629f74 100644 --- a/src/external_signer.cpp +++ b/src/external_signer.cpp @@ -3,9 +3,9 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include -#include #include #include diff --git a/src/test/system_tests.cpp b/src/test/system_tests.cpp index ae6800c67c9..11f4be7fef6 100644 --- a/src/test/system_tests.cpp +++ b/src/test/system_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. // #include -#include +#include #include #ifdef ENABLE_EXTERNAL_SIGNER