From 11194722d591c2ad6fba209237a13204ea554b35 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Fri, 28 Feb 2020 07:38:40 +0100 Subject: [PATCH] changed damn api because react native promise resolver is not willing to work with long --- src/wallet/plain_wallet_api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/plain_wallet_api.cpp b/src/wallet/plain_wallet_api.cpp index 44832c1f..189dad3b 100644 --- a/src/wallet/plain_wallet_api.cpp +++ b/src/wallet/plain_wallet_api.cpp @@ -211,7 +211,7 @@ namespace plain_wallet } - uint64_t async_call(const std::string& method_name, uint64_t instance_id, const std::string& params) + std::string async_call(const std::string& method_name, uint64_t instance_id, const std::string& params) { std::function async_callback; @@ -268,7 +268,7 @@ namespace plain_wallet std::thread t([async_callback]() {async_callback(); }); t.detach(); LOG_PRINT_L0("[ASYNC_CALL]: started " << method_name << ", job id: " << job_id); - return job_id; + return std::string("{ \"job_id\": ") + std::to_string(job_id) + "}"; } std::string try_pull_result(uint64_t job_id) { @@ -279,7 +279,7 @@ namespace plain_wallet { return "{delivered: false}"; } - std::string res = "{delivered: true, result: "; + std::string res = "{\"delivered\": true, \"result\": "; res += it->second; res += " }"; gjobs.erase(it);