Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added print_fields_with_no_presence #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading