tFinish basic JSON-RPC implementation. - obelisk - Electrum server using libbitcoin as its backend (HTM) git clone https://git.parazyd.org/obelisk (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 8ee2b00cd3f6c9b315098fdf6b5dea091f2f76e5 (DIR) parent e078c2c4ef52875ee4c0233a83640d75a711fa3c (HTM) Author: parazyd <parazyd@dyne.org> Date: Wed, 7 Apr 2021 16:10:44 +0200 Finish basic JSON-RPC implementation. Diffstat: M electrumobelisk/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- (DIR) diff --git a/electrumobelisk/protocol.py b/electrumobelisk/protocol.py t@@ -72,13 +72,13 @@ class ElectrumProtocol(asyncio.Protocol): async def _send_response(self, writer, result, nid): response = {"jsonrpc": "2.0", "result": result, "id": nid} - writer.write(response) + writer.write(json.dumps(response).encode("utf-8")) await writer.drain() # writer.close() async def _send_error(self, writer, error, nid): response = {"jsonrpc": "2.0", "error": error, "id": nid} - writer.write(response) + writer.write(json.dumps(response).encode("utf-8")) await writer.drain() # writer.close()