Skip to content

Commit

Permalink
Remove unused includes (#4349)
Browse files Browse the repository at this point in the history
* Remove unused includes

* Convert boost::make_shared to std::make_shared

* Remove needless boost/filesystem.hpp

* Remove needless flatbuffers forward class  declaration

---------

Co-authored-by: Dimitrios Siganos <[email protected]>
  • Loading branch information
RickiNano and dsiganos authored Jan 10, 2024
1 parent a7d2b4c commit d0418ba
Show file tree
Hide file tree
Showing 36 changed files with 1 addition and 60 deletions.
2 changes: 0 additions & 2 deletions nano/core_test/confirmation_height.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <gtest/gtest.h>

#include <boost/format.hpp>

using namespace std::chrono_literals;

namespace
Expand Down
2 changes: 0 additions & 2 deletions nano/core_test/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <gtest/gtest.h>

#include <boost/filesystem.hpp>

#include <chrono>
#include <regex>
#include <thread>
Expand Down
2 changes: 0 additions & 2 deletions nano/core_test/message_deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include <gtest/gtest.h>

#include <boost/none.hpp>

#include <memory>
#include <vector>

Expand Down
6 changes: 1 addition & 5 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

#include <gtest/gtest.h>

#include <boost/filesystem.hpp>
#include <boost/make_shared.hpp>
#include <boost/optional.hpp>

#include <fstream>
#include <numeric>

Expand Down Expand Up @@ -69,7 +65,7 @@ TEST (node, work_generate)
TEST (node, block_store_path_failure)
{
nano::test::system system;
auto service (boost::make_shared<boost::asio::io_context> ());
auto service (std::make_shared<boost::asio::io_context> ());
auto path (nano::unique_path ());
nano::logging logging;
logging.init (path);
Expand Down
2 changes: 0 additions & 2 deletions nano/core_test/signal_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

#include <gtest/gtest.h>

#include <boost/format.hpp>

#include <csignal>
#include <iostream>
#include <thread>
Expand Down
1 change: 0 additions & 1 deletion nano/core_test/socket.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <nano/boost/asio/ip/address_v6.hpp>
#include <nano/boost/asio/ip/network_v6.hpp>
#include <nano/lib/thread_runner.hpp>
#include <nano/lib/threading.hpp>
#include <nano/node/transport/socket.hpp>
#include <nano/test_common/system.hpp>
#include <nano/test_common/testutil.hpp>
Expand Down
3 changes: 0 additions & 3 deletions nano/core_test/wallet.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#include <nano/crypto_lib/random_pool.hpp>
#include <nano/lib/thread_runner.hpp>
#include <nano/lib/threading.hpp>
#include <nano/store/lmdb/wallet_value.hpp>
#include <nano/test_common/system.hpp>
#include <nano/test_common/testutil.hpp>

#include <gtest/gtest.h>

#include <boost/filesystem.hpp>

using namespace std::chrono_literals;
unsigned constexpr nano::wallet_store::version_current;

Expand Down
1 change: 0 additions & 1 deletion nano/node/active_transactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index_container.hpp>

#include <atomic>
#include <condition_variable>
#include <deque>
#include <memory>
Expand Down
1 change: 0 additions & 1 deletion nano/node/backlog_population.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <nano/lib/observer_set.hpp>
#include <nano/secure/common.hpp>

#include <atomic>
#include <condition_variable>
#include <thread>

Expand Down
1 change: 0 additions & 1 deletion nano/node/bootstrap/bootstrap.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <nano/lib/threading.hpp>
#include <nano/node/bootstrap/bootstrap.hpp>
#include <nano/node/bootstrap/bootstrap_lazy.hpp>
#include <nano/node/bootstrap/bootstrap_legacy.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/bootstrap/bootstrap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <boost/thread/thread.hpp>

#include <atomic>
#include <queue>

namespace mi = boost::multi_index;

Expand Down
2 changes: 0 additions & 2 deletions nano/node/bootstrap/bootstrap_frontier.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <nano/node/common.hpp>

#include <deque>
#include <future>

Expand Down
2 changes: 0 additions & 2 deletions nano/node/bootstrap_ascending/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include <nano/crypto_lib/random_pool.hpp>

#include <cstdlib>

namespace nano::bootstrap_ascending
{
using id_t = uint64_t;
Expand Down
2 changes: 0 additions & 2 deletions nano/node/bootstrap_ascending/peer_scoring.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <nano/node/common.hpp>

#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/election.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <atomic>
#include <chrono>
#include <memory>
#include <unordered_set>

namespace nano
{
Expand Down
1 change: 0 additions & 1 deletion nano/node/gap_cache.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <nano/node/gap_cache.hpp>
#include <nano/node/node.hpp>
#include <nano/store/component.hpp>

#include <boost/format.hpp>

Expand Down
5 changes: 0 additions & 5 deletions nano/node/ipc/ipc_server.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <nano/ipc_flatbuffers_lib/generated/flatbuffers/nanoapi_generated.h>
#include <nano/lib/errors.hpp>
#include <nano/lib/ipc.hpp>
#include <nano/node/ipc/ipc_access_config.hpp>
Expand All @@ -10,10 +9,6 @@
#include <atomic>
#include <memory>

namespace flatbuffers
{
class Parser;
}
namespace nano
{
class node;
Expand Down
1 change: 0 additions & 1 deletion nano/node/messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <nano/lib/config.hpp>
#include <nano/lib/errors.hpp>
#include <nano/lib/jsonconfig.hpp>
#include <nano/lib/memory.hpp>
#include <nano/lib/numbers.hpp>
#include <nano/lib/stats_enums.hpp>
#include <nano/lib/stream.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/node.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <nano/lib/stream.hpp>
#include <nano/lib/threading.hpp>
#include <nano/lib/tomlconfig.hpp>
#include <nano/lib/utility.hpp>
#include <nano/node/common.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/online_reps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <nano/lib/numbers.hpp>
#include <nano/lib/utility.hpp>
#include <nano/secure/common.hpp>

#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/request_aggregator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <nano/lib/stats.hpp>
#include <nano/lib/threading.hpp>
#include <nano/node/active_transactions.hpp>
#include <nano/node/common.hpp>
#include <nano/node/network.hpp>
Expand Down
2 changes: 0 additions & 2 deletions nano/node/scheduler/component.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <nano/lib/locks.hpp>

#include <memory>
#include <string>

Expand Down
1 change: 0 additions & 1 deletion nano/node/scheduler/hinted.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <chrono>
#include <condition_variable>
#include <thread>
#include <unordered_map>

namespace mi = boost::multi_index;

Expand Down
1 change: 0 additions & 1 deletion nano/node/transport/socket.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <nano/boost/asio/bind_executor.hpp>
#include <nano/boost/asio/ip/address_v6.hpp>
#include <nano/boost/asio/read.hpp>
#include <nano/node/node.hpp>
#include <nano/node/transport/socket.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/transport/transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <boost/asio/ip/address.hpp>
#include <boost/asio/ip/address_v4.hpp>
#include <boost/asio/ip/address_v6.hpp>
#include <boost/format.hpp>

nano::endpoint nano::transport::map_endpoint_to_v6 (nano::endpoint const & endpoint_a)
{
Expand Down
1 change: 0 additions & 1 deletion nano/node/vote_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index_container.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/vote_processor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <nano/lib/logger_mt.hpp>
#include <nano/lib/stats.hpp>
#include <nano/lib/threading.hpp>
#include <nano/lib/timer.hpp>
#include <nano/node/active_transactions.hpp>
#include <nano/node/node_observers.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/voting.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <nano/lib/stats.hpp>
#include <nano/lib/threading.hpp>
#include <nano/lib/utility.hpp>
#include <nano/node/network.hpp>
#include <nano/node/nodeconfig.hpp>
Expand Down
1 change: 0 additions & 1 deletion nano/node/websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <nano/lib/work.hpp>
#include <nano/node/node_observers.hpp>
#include <nano/node/transport/channel.hpp>
#include <nano/node/transport/transport.hpp>
#include <nano/node/wallet.hpp>
#include <nano/node/websocket.hpp>

Expand Down
2 changes: 0 additions & 2 deletions nano/secure/network_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include <nano/lib/numbers.hpp>

#include <mutex>

#include <cryptopp/seckey.h>
#include <cryptopp/siphash.h>

Expand Down
3 changes: 0 additions & 3 deletions nano/slow_test/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

#include <gtest/gtest.h>

#include <boost/format.hpp>

#include <map>
#include <thread>

using namespace std::chrono_literals;
Expand Down
2 changes: 0 additions & 2 deletions nano/slow_test/node.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <nano/crypto_lib/random_pool.hpp>
#include <nano/lib/thread_runner.hpp>
#include <nano/lib/threading.hpp>
#include <nano/node/election.hpp>
#include <nano/node/make_store.hpp>
#include <nano/node/scheduler/component.hpp>
Expand All @@ -17,7 +16,6 @@
#include <boost/format.hpp>
#include <boost/unordered_set.hpp>

#include <numeric>
#include <random>

using namespace std::chrono_literals;
Expand Down
1 change: 0 additions & 1 deletion nano/test_common/ledger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <nano/lib/logger_mt.hpp>
#include <nano/lib/stats.hpp>
#include <nano/node/common.hpp>
#include <nano/secure/ledger.hpp>

namespace nano
Expand Down
1 change: 0 additions & 1 deletion nano/test_common/rate_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <chrono>
#include <string>
#include <thread>
#include <utility>
#include <vector>

namespace nano::test
Expand Down
2 changes: 0 additions & 2 deletions nano/test_common/telemetry.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <cstdint>

namespace nano
{
class node;
Expand Down
2 changes: 0 additions & 2 deletions nano/test_common/testutil.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#pragma once

#include <nano/lib/errors.hpp>
#include <nano/lib/locks.hpp>
#include <nano/lib/timer.hpp>
#include <nano/node/transport/channel.hpp>
#include <nano/node/transport/transport.hpp>

#include <gtest/gtest.h>

Expand Down

0 comments on commit d0418ba

Please sign in to comment.