From c4d083c0b535bf9ea13c8dd8d341fb306182a797 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 16 Feb 2024 15:33:35 -0500 Subject: [PATCH 1/4] Clean up chaser start/stop and error handling. --- include/bitcoin/node/chasers/chaser.hpp | 9 +++++--- .../bitcoin/node/chasers/chaser_candidate.hpp | 2 +- include/bitcoin/node/chasers/chaser_check.hpp | 2 +- .../bitcoin/node/chasers/chaser_confirm.hpp | 2 +- .../bitcoin/node/chasers/chaser_connect.hpp | 2 +- .../bitcoin/node/chasers/chaser_header.hpp | 3 +-- .../node/chasers/chaser_transaction.hpp | 2 +- src/chasers/chaser.cpp | 23 ++++++++----------- src/chasers/chaser_candidate.cpp | 15 ++++++------ src/chasers/chaser_check.cpp | 18 ++++++++------- src/chasers/chaser_confirm.cpp | 15 ++++++------ src/chasers/chaser_connect.cpp | 15 ++++++------ src/chasers/chaser_header.cpp | 17 +++++++------- src/chasers/chaser_transaction.cpp | 15 ++++++------ src/full_node.cpp | 17 +++++++------- 15 files changed, 82 insertions(+), 75 deletions(-) diff --git a/include/bitcoin/node/chasers/chaser.hpp b/include/bitcoin/node/chasers/chaser.hpp index 4f689f38..d241cb4d 100644 --- a/include/bitcoin/node/chasers/chaser.hpp +++ b/include/bitcoin/node/chasers/chaser.hpp @@ -84,7 +84,7 @@ class BCN_API chaser DELETE_COPY_MOVE(chaser); /// Synchronously subscribe to notify and asynchronously initialize state. - virtual bool start() NOEXCEPT = 0; + virtual code start() NOEXCEPT = 0; protected: chaser(full_node& node) NOEXCEPT; @@ -99,13 +99,16 @@ class BCN_API chaser /// True if the current thread is on the chaser strand. bool stranded() const NOEXCEPT; + /// True if the current thread is on the node strand. + bool node_stranded() const NOEXCEPT; + /// Subscribe to chaser events. - bool subscribe(event_handler&& handler) NOEXCEPT; + code subscribe(event_handler&& handler) NOEXCEPT; /// Set chaser event (does not require network strand). void notify(const code& ec, chase event_, link value) NOEXCEPT; - /// Close the node. + /// Close the node in case of failure. void stop(const code& ec) NOEXCEPT; private: diff --git a/include/bitcoin/node/chasers/chaser_candidate.hpp b/include/bitcoin/node/chasers/chaser_candidate.hpp index afd5ce24..bbfc00cc 100644 --- a/include/bitcoin/node/chasers/chaser_candidate.hpp +++ b/include/bitcoin/node/chasers/chaser_candidate.hpp @@ -36,7 +36,7 @@ class BCN_API chaser_candidate public: chaser_candidate(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + virtual code start() NOEXCEPT; protected: virtual void handle_transaction(transaction_t value) NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_check.hpp b/include/bitcoin/node/chasers/chaser_check.hpp index 00b9a1ef..cb141298 100644 --- a/include/bitcoin/node/chasers/chaser_check.hpp +++ b/include/bitcoin/node/chasers/chaser_check.hpp @@ -36,7 +36,7 @@ class BCN_API chaser_check public: chaser_check(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + virtual code start() NOEXCEPT; virtual void checked(const system::chain::block::cptr& block) NOEXCEPT; protected: diff --git a/include/bitcoin/node/chasers/chaser_confirm.hpp b/include/bitcoin/node/chasers/chaser_confirm.hpp index 9638a28f..d6ca4c3b 100644 --- a/include/bitcoin/node/chasers/chaser_confirm.hpp +++ b/include/bitcoin/node/chasers/chaser_confirm.hpp @@ -36,7 +36,7 @@ class BCN_API chaser_confirm public: chaser_confirm(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + virtual code start() NOEXCEPT; protected: virtual void handle_connected(header_t block) NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_connect.hpp b/include/bitcoin/node/chasers/chaser_connect.hpp index 4442237e..dd8c3aab 100644 --- a/include/bitcoin/node/chasers/chaser_connect.hpp +++ b/include/bitcoin/node/chasers/chaser_connect.hpp @@ -36,7 +36,7 @@ class BCN_API chaser_connect public: chaser_connect(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + virtual code start() NOEXCEPT; protected: virtual void handle_checked(header_t block) NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_header.hpp b/include/bitcoin/node/chasers/chaser_header.hpp index 034b5948..79f16297 100644 --- a/include/bitcoin/node/chasers/chaser_header.hpp +++ b/include/bitcoin/node/chasers/chaser_header.hpp @@ -19,7 +19,6 @@ #ifndef LIBBITCOIN_NODE_CHASERS_CHASER_HEADER_HPP #define LIBBITCOIN_NODE_CHASERS_CHASER_HEADER_HPP -#include #include #include #include @@ -40,7 +39,7 @@ class BCN_API chaser_header public: chaser_header(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + virtual code start() NOEXCEPT; /// Organize the next header in sequence, relative to caller's peer. /// Causes a fault/stop if preceding headers have not been stored. diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp index 6ebf7f5d..6f982e81 100644 --- a/include/bitcoin/node/chasers/chaser_transaction.hpp +++ b/include/bitcoin/node/chasers/chaser_transaction.hpp @@ -36,7 +36,7 @@ class BCN_API chaser_transaction public: chaser_transaction(full_node& node) NOEXCEPT; - virtual bool start() NOEXCEPT; + code start() NOEXCEPT override; virtual void store(const system::chain::transaction::cptr& block) NOEXCEPT; protected: diff --git a/src/chasers/chaser.cpp b/src/chasers/chaser.cpp index dbba211e..332c6790 100644 --- a/src/chasers/chaser.cpp +++ b/src/chasers/chaser.cpp @@ -58,18 +58,15 @@ bool chaser::stranded() const NOEXCEPT return strand_.running_in_this_thread(); } -bool chaser::subscribe(event_handler&& handler) NOEXCEPT +bool chaser::node_stranded() const NOEXCEPT { - BC_ASSERT_MSG(node_.stranded(), "chaser"); - const auto ec = subscriber_.subscribe(std::move(handler)); - - if (ec) - { - LOGF("Chaser subscribe fault, " << ec.message()); - return false; - } + return node_.stranded(); +} - return true; +code chaser::subscribe(event_handler&& handler) NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser"); + return subscriber_.subscribe(std::move(handler)); } // Posts to network strand (call from chaser strands). @@ -82,13 +79,13 @@ void chaser::notify(const code& ec, chase event_, link value) NOEXCEPT // Executed on network strand (handler should bounce to chaser strand). void chaser::do_notify(const code& ec, chase event_, link value) NOEXCEPT { - BC_ASSERT_MSG(node_.stranded(), "chaser"); + BC_ASSERT_MSG(node_stranded(), "chaser"); subscriber_.notify(ec, event_, value); } -void chaser::stop(const code&) NOEXCEPT +void chaser::stop(const code& ec) NOEXCEPT { - ////LOGF("Chaser fault, " << ec.message()); + LOGF("Chaser fault, " << ec.message()); node_.close(); } diff --git a/src/chasers/chaser_candidate.cpp b/src/chasers/chaser_candidate.cpp index 26e8ca4a..0d0cb81e 100644 --- a/src/chasers/chaser_candidate.cpp +++ b/src/chasers/chaser_candidate.cpp @@ -38,6 +38,14 @@ chaser_candidate::chaser_candidate(full_node& node) NOEXCEPT { } +// TODO: initialize candidate state. +code chaser_candidate::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_check"); + return subscribe(std::bind(&chaser_candidate::handle_event, + this, _1, _2, _3)); +} + void chaser_candidate::handle_event(const code& ec, chase event_, link value) NOEXCEPT { @@ -66,13 +74,6 @@ void chaser_candidate::do_handle_event(const code& ec, chase event_, } } -// TODO: initialize candidate state. -bool chaser_candidate::start() NOEXCEPT -{ - return subscribe(std::bind(&chaser_candidate::handle_event, - this, _1, _2, _3)); -} - // TODO: handle transaction graph change (may issue 'candidate'). void chaser_candidate::handle_transaction(transaction_t tx) NOEXCEPT { diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 03d39dfc..c3b979f7 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -39,6 +39,16 @@ chaser_check::chaser_check(full_node& node) NOEXCEPT { } +// TODO: initialize check state. +code chaser_check::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_check"); + + // get_all_unassociated_above(0) + return subscribe(std::bind(&chaser_check::handle_event, + this, _1, _2, _3)); +} + void chaser_check::handle_event(const code& ec, chase event_, link value) NOEXCEPT { @@ -67,14 +77,6 @@ void chaser_check::do_handle_event(const code& ec, chase event_, } } -// TODO: initialize check state. -bool chaser_check::start() NOEXCEPT -{ - // get_all_unassociated_above(0) - return subscribe(std::bind(&chaser_check::handle_event, - this, _1, _2, _3)); -} - // TODO: handle the new strong branch (may issue 'checked'). void chaser_check::handle_header(height_t branch_point) NOEXCEPT { diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 1171e73f..c6254a0b 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -37,6 +37,14 @@ chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT { } +// TODO: initialize confirm state. +code chaser_confirm::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_confirm"); + return subscribe(std::bind(&chaser_confirm::handle_event, + this, _1, _2, _3)); +} + void chaser_confirm::handle_event(const code& ec, chase event_, link value) NOEXCEPT { @@ -65,13 +73,6 @@ void chaser_confirm::do_handle_event(const code& ec, chase event_, } } -// TODO: initialize confirm state. -bool chaser_confirm::start() NOEXCEPT -{ - return subscribe(std::bind(&chaser_confirm::handle_event, - this, _1, _2, _3)); -} - // TODO: handle new strong connected branch (may issue 'confirmed'). void chaser_confirm::handle_connected(header_t block) NOEXCEPT { diff --git a/src/chasers/chaser_connect.cpp b/src/chasers/chaser_connect.cpp index c7a3f4fa..8e1a3463 100644 --- a/src/chasers/chaser_connect.cpp +++ b/src/chasers/chaser_connect.cpp @@ -37,6 +37,14 @@ chaser_connect::chaser_connect(full_node& node) NOEXCEPT { } +// TODO: initialize connect state. +code chaser_connect::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_connect"); + return subscribe(std::bind(&chaser_connect::handle_event, + this, _1, _2, _3)); +} + void chaser_connect::handle_event(const code& ec, chase event_, link value) NOEXCEPT { @@ -65,13 +73,6 @@ void chaser_connect::do_handle_event(const code& ec, chase event_, } } -// TODO: initialize connect state. -bool chaser_connect::start() NOEXCEPT -{ - return subscribe(std::bind(&chaser_connect::handle_event, - this, _1, _2, _3)); -} - // TODO: handle the new checked blocks (may issue 'connected'). void chaser_connect::handle_checked(header_t block) NOEXCEPT { diff --git a/src/chasers/chaser_header.cpp b/src/chasers/chaser_header.cpp index 363fba6c..d1abae02 100644 --- a/src/chasers/chaser_header.cpp +++ b/src/chasers/chaser_header.cpp @@ -34,7 +34,6 @@ using namespace std::placeholders; BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) -// Requires subscriber_ protection (call from node construct or node.strand). chaser_header::chaser_header(full_node& node) NOEXCEPT : chaser(node), currency_window_(node.node_settings().currency_window()), @@ -42,6 +41,14 @@ chaser_header::chaser_header(full_node& node) NOEXCEPT { } +// protected +code chaser_header::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_header"); + return subscribe(std::bind(&chaser_header::handle_event, + this, _1, _2, _3)); +} + // protected void chaser_header::handle_event(const code& ec, chase event_, link value) NOEXCEPT @@ -57,13 +64,6 @@ void chaser_header::do_handle_event(const code&, chase, link) NOEXCEPT BC_ASSERT_MSG(stranded(), "chaser_header"); } -// protected -bool chaser_header::start() NOEXCEPT -{ - return subscribe(std::bind(&chaser_header::handle_event, - this, _1, _2, _3)); -} - void chaser_header::organize(const chain::header::cptr& header, chain::context&& context) NOEXCEPT { @@ -258,6 +258,7 @@ bool chaser_header::get_is_strong(bool& strong, const uint256_t& work, return true; } +// protected void chaser_header::save(const chain::header::cptr& header, const chain::context& context) NOEXCEPT { diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index 757eaa81..ee068cb3 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -38,6 +38,14 @@ chaser_transaction::chaser_transaction(full_node& node) NOEXCEPT { } +// TODO: initialize tx graph from store, log and stop on error. +code chaser_transaction::start() NOEXCEPT +{ + BC_ASSERT_MSG(node_stranded(), "chaser_transaction"); + return subscribe(std::bind(&chaser_transaction::handle_event, + this, _1, _2, _3)); +} + void chaser_transaction::handle_event(const code& ec, chase event_, link value) NOEXCEPT { @@ -65,13 +73,6 @@ void chaser_transaction::do_handle_event(const code& ec, chase event_, } } -// TODO: initialize tx graph from store, log and stop on error. -bool chaser_transaction::start() NOEXCEPT -{ - return subscribe(std::bind(&chaser_transaction::handle_event, - this, _1, _2, _3)); -} - // TODO: handle the new confirmed blocks (may issue 'transaction'). void chaser_transaction::handle_confirmed() NOEXCEPT { diff --git a/src/full_node.cpp b/src/full_node.cpp index a709a999..ed644f88 100644 --- a/src/full_node.cpp +++ b/src/full_node.cpp @@ -72,15 +72,16 @@ void full_node::start(result_handler&& handler) NOEXCEPT void full_node::do_start(const result_handler& handler) NOEXCEPT { BC_ASSERT_MSG(stranded(), "full_node"); - - if (!chaser_header_.start() || - !chaser_check_.start() || - !chaser_connect_.start() || - !chaser_confirm_.start() || - !chaser_transaction_.start() || - !chaser_candidate_.start()) + code ec; + + if (((ec = chaser_header_.start())) || + ((ec = chaser_check_.start())) || + ((ec = chaser_connect_.start())) || + ((ec = chaser_confirm_.start())) || + ((ec = chaser_transaction_.start())) || + ((ec = chaser_candidate_.start()))) { - handler(error::unknown); + handler(ec); return; } From 525416eeb61270ec0a58d998bd7c15b880c9985f Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 16 Feb 2024 16:01:00 -0500 Subject: [PATCH 2/4] Comments. --- include/bitcoin/node/chasers/chaser.hpp | 2 +- src/chasers/chaser_header.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/bitcoin/node/chasers/chaser.hpp b/include/bitcoin/node/chasers/chaser.hpp index d241cb4d..4d372e15 100644 --- a/include/bitcoin/node/chasers/chaser.hpp +++ b/include/bitcoin/node/chasers/chaser.hpp @@ -29,7 +29,7 @@ namespace node { class full_node; -/// Abstract base chaser. +/// Abstract base chaser for thread safe chain state management classes. /// Chasers impose order on blockchain/pool construction as necessary. /// Each chaser operates on its own strand, implemented here, allowing /// concurrent chaser operations to the extent that threads are available. diff --git a/src/chasers/chaser_header.cpp b/src/chasers/chaser_header.cpp index d1abae02..59db43ac 100644 --- a/src/chasers/chaser_header.cpp +++ b/src/chasers/chaser_header.cpp @@ -78,6 +78,9 @@ void chaser_header::do_organize(const chain::header::cptr& header, { BC_ASSERT_MSG(stranded(), "chaser_header"); + // Determine if work should be computed. + // ------------------------------------------------------------------------ + auto& query = archive(); const auto hash = header->hash(); if (tree_.contains(hash) || query.is_header(hash)) @@ -101,6 +104,9 @@ void chaser_header::do_organize(const chain::header::cptr& header, return; } + // Compute relative work. + // ------------------------------------------------------------------------ + size_t point{}; uint256_t work{}; hashes tree_branch{}; @@ -125,7 +131,7 @@ void chaser_header::do_organize(const chain::header::cptr& header, return; } - // Candidate chain reorganization + // Reorganize candidate chain. // ------------------------------------------------------------------------ // Obtain the top height. @@ -174,9 +180,9 @@ void chaser_header::do_organize(const chain::header::cptr& header, return; } + // Notify reorganization with branch point. // ------------------------------------------------------------------------ - // Notify of candidate reorganization with branch point. notify(error::success, chase::header, { possible_narrow_cast(point) }); } From ca2d033a47b3c555831a195d102e9ec1a50551e2 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 16 Feb 2024 16:01:33 -0500 Subject: [PATCH 3/4] Move header chaser tree_ to protected, for test. --- .../bitcoin/node/chasers/chaser_header.hpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/bitcoin/node/chasers/chaser_header.hpp b/include/bitcoin/node/chasers/chaser_header.hpp index 79f16297..980d512b 100644 --- a/include/bitcoin/node/chasers/chaser_header.hpp +++ b/include/bitcoin/node/chasers/chaser_header.hpp @@ -31,7 +31,7 @@ namespace node { class full_node; /// Chase down stronger header branches for the candidate chain. -/// Weak branches are retained in a hash table unless already store populated. +/// Weak branches are retained in a hash table if not store populated. /// Strong branches reorganize the candidate chain and fire the 'header' event. class BCN_API chaser_header : public chaser @@ -48,8 +48,16 @@ class BCN_API chaser_header system::chain::context&& context) NOEXCEPT; protected: + struct proposed_header + { + database::context context; + system::chain::header::cptr header; + }; typedef std::vector header_links; + // This is protected by strand. + std::unordered_map tree_{}; + /// Handlers. virtual void handle_event(const code& ec, chase event_, link value) NOEXCEPT; @@ -81,18 +89,11 @@ class BCN_API chaser_header virtual bool push(const system::hash_digest& key) NOEXCEPT; private: - struct proposed_header - { - database::context context; - system::chain::header::cptr header; - }; - void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_organize(const system::chain::header::cptr& header, const system::chain::context& context) NOEXCEPT; - // These are protected by strand. - std::unordered_map tree_{}; + // These are thread safe. const network::wall_clock::duration currency_window_; const bool use_currency_window_; }; From 4e6a808b0272a7f2606231e3b808365d8aa80bf7 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 16 Feb 2024 16:15:53 -0500 Subject: [PATCH 4/4] Stub in tests. --- Makefile.am | 11 +++++- builds/cmake/CMakeLists.txt | 11 +++++- .../libbitcoin-node-test.vcxproj | 9 +++++ .../libbitcoin-node-test.vcxproj.filters | 36 +++++++++++++++++++ test/chasers/chaser.cpp | 28 +++++++++++++++ test/chasers/chaser_candidate.cpp | 28 +++++++++++++++ test/chasers/chaser_check.cpp | 28 +++++++++++++++ test/chasers/chaser_confirm.cpp | 28 +++++++++++++++ test/chasers/chaser_connect.cpp | 28 +++++++++++++++ test/chasers/chaser_header.cpp | 28 +++++++++++++++ test/chasers/chaser_transaction.cpp | 28 +++++++++++++++ test/protocols/protocol.cpp | 28 +++++++++++++++ test/sessions/session.cpp | 28 +++++++++++++++ 13 files changed, 317 insertions(+), 2 deletions(-) create mode 100644 test/chasers/chaser.cpp create mode 100644 test/chasers/chaser_candidate.cpp create mode 100644 test/chasers/chaser_check.cpp create mode 100644 test/chasers/chaser_confirm.cpp create mode 100644 test/chasers/chaser_connect.cpp create mode 100644 test/chasers/chaser_header.cpp create mode 100644 test/chasers/chaser_transaction.cpp create mode 100644 test/protocols/protocol.cpp create mode 100644 test/sessions/session.cpp diff --git a/Makefile.am b/Makefile.am index a362b1b2..4313a3ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,7 +77,16 @@ test_libbitcoin_node_test_SOURCES = \ test/node.cpp \ test/settings.cpp \ test/test.cpp \ - test/test.hpp + test/test.hpp \ + test/chasers/chaser.cpp \ + test/chasers/chaser_candidate.cpp \ + test/chasers/chaser_check.cpp \ + test/chasers/chaser_confirm.cpp \ + test/chasers/chaser_connect.cpp \ + test/chasers/chaser_header.cpp \ + test/chasers/chaser_transaction.cpp \ + test/protocols/protocol.cpp \ + test/sessions/session.cpp endif WITH_TESTS diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 60077502..5ef8261f 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -346,7 +346,16 @@ if (with-tests) "../../test/node.cpp" "../../test/settings.cpp" "../../test/test.cpp" - "../../test/test.hpp" ) + "../../test/test.hpp" + "../../test/chasers/chaser.cpp" + "../../test/chasers/chaser_candidate.cpp" + "../../test/chasers/chaser_check.cpp" + "../../test/chasers/chaser_confirm.cpp" + "../../test/chasers/chaser_connect.cpp" + "../../test/chasers/chaser_header.cpp" + "../../test/chasers/chaser_transaction.cpp" + "../../test/protocols/protocol.cpp" + "../../test/sessions/session.cpp" ) add_test( NAME libbitcoin-node-test COMMAND libbitcoin-node-test --run_test=* diff --git a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj index 798dedcd..b7680fdc 100644 --- a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj @@ -70,10 +70,19 @@ + + + + + + + + + diff --git a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj.filters index dd2ed145..3f1647d1 100644 --- a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj.filters +++ b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.vcxproj.filters @@ -10,8 +10,38 @@ {4BD50864-D3BC-4F64-0000-000000000000} + + {4BD50864-D3BC-4F64-0000-000000000001} + + + {4BD50864-D3BC-4F64-0000-000000000002} + + + {4BD50864-D3BC-4F64-0000-000000000003} + + + src\chasers + + + src\chasers + + + src\chasers + + + src\chasers + + + src\chasers + + + src\chasers + + + src\chasers + src @@ -24,6 +54,12 @@ src + + src\protocols + + + src\sessions + src diff --git a/test/chasers/chaser.cpp b/test/chasers/chaser.cpp new file mode 100644 index 00000000..8094d70d --- /dev/null +++ b/test/chasers/chaser.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_tests) + +BOOST_AUTO_TEST_CASE(chaser_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_candidate.cpp b/test/chasers/chaser_candidate.cpp new file mode 100644 index 00000000..8ed789ab --- /dev/null +++ b/test/chasers/chaser_candidate.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_candidate_tests) + +BOOST_AUTO_TEST_CASE(chaser_candidate_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_check.cpp b/test/chasers/chaser_check.cpp new file mode 100644 index 00000000..5257ce86 --- /dev/null +++ b/test/chasers/chaser_check.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_check_tests) + +BOOST_AUTO_TEST_CASE(chaser_check_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_confirm.cpp b/test/chasers/chaser_confirm.cpp new file mode 100644 index 00000000..53c56bf3 --- /dev/null +++ b/test/chasers/chaser_confirm.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_confirm_tests) + +BOOST_AUTO_TEST_CASE(chaser_confirm_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_connect.cpp b/test/chasers/chaser_connect.cpp new file mode 100644 index 00000000..bfbbcc7d --- /dev/null +++ b/test/chasers/chaser_connect.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_connect_tests) + +BOOST_AUTO_TEST_CASE(chaser_connect_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_header.cpp b/test/chasers/chaser_header.cpp new file mode 100644 index 00000000..8829f11f --- /dev/null +++ b/test/chasers/chaser_header.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_header_tests) + +BOOST_AUTO_TEST_CASE(chaser_header_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/chasers/chaser_transaction.cpp b/test/chasers/chaser_transaction.cpp new file mode 100644 index 00000000..17dcaf80 --- /dev/null +++ b/test/chasers/chaser_transaction.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(chaser_transaction_tests) + +BOOST_AUTO_TEST_CASE(chaser_transaction_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/protocols/protocol.cpp b/test/protocols/protocol.cpp new file mode 100644 index 00000000..f2b81e01 --- /dev/null +++ b/test/protocols/protocol.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(protocol_tests) + +BOOST_AUTO_TEST_CASE(protocol_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/sessions/session.cpp b/test/sessions/session.cpp new file mode 100644 index 00000000..c061eabb --- /dev/null +++ b/test/sessions/session.cpp @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS) + * + * This file is part of libbitcoin. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "../test.hpp" + +BOOST_AUTO_TEST_SUITE(session_tests) + +BOOST_AUTO_TEST_CASE(session_test) +{ + BOOST_REQUIRE(true); +} + +BOOST_AUTO_TEST_SUITE_END()