From 87d75584e8df95ff53a354438760088e061a6de5 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 15 Apr 2020 13:22:46 -0400 Subject: Allow wallet2.h to run in WebAssembly - Add abstract_http_client.h which http_client.h extends. - Replace simple_http_client with abstract_http_client in wallet2, message_store, message_transporter, and node_rpc_proxy. - Import and export wallet data in wallet2. - Use #if defined __EMSCRIPTEN__ directives to skip incompatible code. --- src/wallet/message_transporter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wallet/message_transporter.h') diff --git a/src/wallet/message_transporter.h b/src/wallet/message_transporter.h index 28c099d87..84a2e9bae 100644 --- a/src/wallet/message_transporter.h +++ b/src/wallet/message_transporter.h @@ -34,9 +34,9 @@ #include "cryptonote_basic/cryptonote_basic.h" #include "net/http_server_impl_base.h" #include "net/http_client.h" +#include "net/abstract_http_client.h" #include "common/util.h" #include "wipeable_string.h" -#include "serialization/keyvalue_serialization.h" #include namespace mms @@ -83,7 +83,7 @@ typedef epee::misc_utils::struct_init transport_message; class message_transporter { public: - message_transporter(); + message_transporter(std::unique_ptr http_client); void set_options(const std::string &bitmessage_address, const epee::wipeable_string &bitmessage_login); bool send_message(const transport_message &message); bool receive_messages(const std::vector &destination_transport_addresses, @@ -94,7 +94,7 @@ public: bool delete_transport_address(const std::string &transport_address); private: - epee::net_utils::http::http_simple_client m_http_client; + const std::unique_ptr m_http_client; std::string m_bitmessage_url; epee::wipeable_string m_bitmessage_login; std::atomic m_run; -- cgit v1.2.3