refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a

These belong in libbitcoin_common.a, not libbitcoin_util.a, because they aren't
general-purpose utilities, they just contain common code that is used by both
the node and the wallet. Another reason to reason to not include these in
libbitcoin_util.a is to prevent them from being used by the kernel library.
This commit is contained in:
Ryan Ofsky
2022-10-11 23:35:28 -04:00
parent a035b6a0c4
commit 82e272a109
5 changed files with 35 additions and 63 deletions

View File

@@ -5,6 +5,11 @@
#ifndef BITCOIN_INTERFACES_INIT_H
#define BITCOIN_INTERFACES_INIT_H
#include <interfaces/chain.h>
#include <interfaces/echo.h>
#include <interfaces/node.h>
#include <interfaces/wallet.h>
#include <memory>
namespace node {
@@ -12,11 +17,7 @@ struct NodeContext;
} // namespace node
namespace interfaces {
class Chain;
class Echo;
class Ipc;
class Node;
class WalletLoader;
//! Initial interface created when a process is first started, and used to give
//! and get access to other interfaces (Node, Chain, Wallet, etc).
@@ -29,11 +30,11 @@ class Init
{
public:
virtual ~Init() = default;
virtual std::unique_ptr<Node> makeNode();
virtual std::unique_ptr<Chain> makeChain();
virtual std::unique_ptr<WalletLoader> makeWalletLoader(Chain& chain);
virtual std::unique_ptr<Echo> makeEcho();
virtual Ipc* ipc();
virtual std::unique_ptr<Node> makeNode() { return nullptr; }
virtual std::unique_ptr<Chain> makeChain() { return nullptr; }
virtual std::unique_ptr<WalletLoader> makeWalletLoader(Chain& chain) { return nullptr; }
virtual std::unique_ptr<Echo> makeEcho() { return nullptr; }
virtual Ipc* ipc() { return nullptr; }
};
//! Return implementation of Init interface for the node process. If the argv