Skip to content

Commit

Permalink
added print_fields_with_no_presence
Browse files Browse the repository at this point in the history
  • Loading branch information
lAmeR1 committed Jul 6, 2024
1 parent 59f8f81 commit 222e097
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 110 deletions.
4 changes: 2 additions & 2 deletions kaspad/KaspadThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def request(self, command, params=None, wait_for_response=True, timeout=12
try:
async for resp in self.stub.MessageStream(self.yield_cmd(command, params), timeout=120):
self.__queue.put_nowait("done")
return json_format.MessageToDict(resp)
return json_format.MessageToDict(resp, always_print_fields_with_no_presence=True)
except grpc.aio._call.AioRpcError as e:
raise KaspadCommunicationError(str(e))

Expand All @@ -65,7 +65,7 @@ async def notify(self, command, params=None, callback_func=None):
async for resp in self.stub.MessageStream(self.yield_cmd(command, params)):
# self.__queue.put_nowait("done")
if callback_func:
await callback_func(json_format.MessageToDict(resp))
await callback_func(json_format.MessageToDict(resp, always_print_fields_with_no_presence=True))

print("loop done...")

Expand Down
Loading

0 comments on commit 222e097

Please sign in to comment.