refactor: Replace all old instances of Config with New Config (#1627)

Fixes #1184 
Previous PR's found [here](https://github.com/XRPLF/clio/pull/1593) and
[here](https://github.com/XRPLF/clio/pull/1544)
This commit is contained in:
Peter Chen
2024-12-16 15:33:32 -08:00
committed by GitHub
parent b53cfd0ec1
commit 3c4903a339
103 changed files with 1624 additions and 898 deletions

View File

@@ -26,7 +26,8 @@
#include "etl/impl/SourceImpl.hpp"
#include "etl/impl/SubscriptionSource.hpp"
#include "feed/SubscriptionManagerInterface.hpp"
#include "util/config/Config.hpp"
#include "util/newconfig/ConfigDefinition.hpp"
#include "util/newconfig/ObjectView.hpp"
#include <boost/asio/io_context.hpp>
@@ -39,7 +40,7 @@ namespace etl {
SourcePtr
make_Source(
util::Config const& config,
util::config::ObjectView const& config,
boost::asio::io_context& ioc,
std::shared_ptr<BackendInterface> backend,
std::shared_ptr<feed::SubscriptionManagerInterface> subscriptions,
@@ -50,9 +51,9 @@ make_Source(
SourceBase::OnLedgerClosedHook onLedgerClosed
)
{
auto const ip = config.valueOr<std::string>("ip", {});
auto const wsPort = config.valueOr<std::string>("ws_port", {});
auto const grpcPort = config.valueOr<std::string>("grpc_port", {});
auto const ip = config.get<std::string>("ip");
auto const wsPort = config.get<std::string>("ws_port");
auto const grpcPort = config.get<std::string>("grpc_port");
impl::ForwardingSource forwardingSource{ip, wsPort, forwardingTimeout};
impl::GrpcSource grpcSource{ip, grpcPort, std::move(backend)};