commit 8ee2b00cd3f6c9b315098fdf6b5dea091f2f76e5
parent e078c2c4ef52875ee4c0233a83640d75a711fa3c
Author: parazyd <parazyd@dyne.org>
Date: Wed, 7 Apr 2021 16:10:44 +0200
Finish basic JSON-RPC implementation.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/electrumobelisk/protocol.py b/electrumobelisk/protocol.py
@@ -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()