From 1e58715e0b208bc394224b58ac73d0e5526efccc Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 2 Feb 2021 13:16:34 -0500 Subject: [PATCH] fix pybind layer --- llarp/tooling/hive_context.cpp | 4 ++-- llarp/tooling/hive_context.hpp | 2 +- llarp/tooling/hive_router.cpp | 4 ++-- llarp/tooling/hive_router.hpp | 2 +- llarp/tooling/router_hive.cpp | 2 +- pybind/llarp/config.cpp | 2 +- pybind/llarp/router_id.cpp | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llarp/tooling/hive_context.cpp b/llarp/tooling/hive_context.cpp index 3574913dd..963407018 100644 --- a/llarp/tooling/hive_context.cpp +++ b/llarp/tooling/hive_context.cpp @@ -7,10 +7,10 @@ namespace tooling HiveContext::HiveContext(RouterHive* hive) : m_hive(hive) {} - std::unique_ptr + std::shared_ptr HiveContext::makeRouter(llarp_ev_loop_ptr netloop, std::shared_ptr logic) { - return std::make_unique(netloop, logic, makeVPNPlatform(), m_hive); + return std::make_shared(netloop, logic, makeVPNPlatform(), m_hive); } HiveRouter* diff --git a/llarp/tooling/hive_context.hpp b/llarp/tooling/hive_context.hpp index 60870245d..875c6f96d 100644 --- a/llarp/tooling/hive_context.hpp +++ b/llarp/tooling/hive_context.hpp @@ -11,7 +11,7 @@ namespace tooling { HiveContext(RouterHive* hive); - std::unique_ptr + std::shared_ptr makeRouter(llarp_ev_loop_ptr netloop, std::shared_ptr logic) override; /// Get this context's router as a HiveRouter. diff --git a/llarp/tooling/hive_router.cpp b/llarp/tooling/hive_router.cpp index defe7d77a..ffa161814 100644 --- a/llarp/tooling/hive_router.cpp +++ b/llarp/tooling/hive_router.cpp @@ -7,9 +7,9 @@ namespace tooling HiveRouter::HiveRouter( llarp_ev_loop_ptr netloop, std::shared_ptr logic, - std::unique_ptr plat, + std::shared_ptr plat, RouterHive* hive) - : Router(netloop, logic, std::move(plat)), m_hive(hive) + : Router(netloop, logic, plat), m_hive(hive) {} bool diff --git a/llarp/tooling/hive_router.hpp b/llarp/tooling/hive_router.hpp index 343576595..221cf6308 100644 --- a/llarp/tooling/hive_router.hpp +++ b/llarp/tooling/hive_router.hpp @@ -13,7 +13,7 @@ namespace tooling explicit HiveRouter( llarp_ev_loop_ptr netloop, std::shared_ptr logic, - std::unique_ptr vpnPlatform, + std::shared_ptr vpnPlatform, RouterHive* hive); virtual ~HiveRouter() = default; diff --git a/llarp/tooling/router_hive.cpp b/llarp/tooling/router_hive.cpp index c85fc06a2..520d67600 100644 --- a/llarp/tooling/router_hive.cpp +++ b/llarp/tooling/router_hive.cpp @@ -23,7 +23,7 @@ namespace tooling opts.isRouter = isRouter; Context_ptr context = std::make_shared(this); - context->Configure(*config); + context->Configure(config); context->Setup(opts); auto routerId = llarp::RouterID(context->router->pubkey()); diff --git a/pybind/llarp/config.cpp b/pybind/llarp/config.cpp index fea0688a9..782d164fa 100644 --- a/pybind/llarp/config.cpp +++ b/pybind/llarp/config.cpp @@ -99,7 +99,7 @@ namespace llarp .def_property( "lokidRPCAddr", [](LokidConfig& self) { return self.lokidRPCAddr.full_address().c_str(); }, - [](LokidConfig& self, std::string arg) { self.lokidRPCAddr = lokimq::address(arg); }); + [](LokidConfig& self, std::string arg) { self.lokidRPCAddr = oxenmq::address(arg); }); py::class_(mod, "BootstrapConfig") .def(py::init<>()) diff --git a/pybind/llarp/router_id.cpp b/pybind/llarp/router_id.cpp index a04784d52..5e6cc63bf 100644 --- a/pybind/llarp/router_id.cpp +++ b/pybind/llarp/router_id.cpp @@ -11,9 +11,9 @@ namespace llarp .def( "FromHex", [](RouterID* r, const std::string& hex) { - if (hex.size() != 2 * r->size() || !lokimq::is_hex(hex)) + if (hex.size() != 2 * r->size() || !oxenmq::is_hex(hex)) throw std::runtime_error("FromHex requires a 64-digit hex string"); - lokimq::from_hex(hex.begin(), hex.end(), r->data()); + oxenmq::from_hex(hex.begin(), hex.end(), r->data()); }) .def("__repr__", &RouterID::ToString) .def("__str__", &RouterID::ToString)