Skip to content

Commit

Permalink
refactor: add GetStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Nov 8, 2023
1 parent 59b6516 commit 57f4413
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions massa_test_framework/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def query_state(self, query_state_request: QueryStateRequest) -> QueryStateRespo
return query_state_response

def grpc_get_stakers(self) -> GetStakersResponse:
"""Queries the execution state of the node.
"""gRPC GetStakers.
Example::
res = node.grpc_get_stakers()
Expand All @@ -501,7 +501,24 @@ def grpc_get_stakers(self) -> GetStakersResponse:
)

return get_stakers_response
#

def grpc_get_status(self) -> GetStatusResponse:
"""gRPC GetStatus.
Example::
res = node.grpc_get_status()
print(res.status)
"""

get_status_response: GetStatusResponse = asyncio.run(
self._public_grpc_call(
self.grpc_host, self.pub_grpc_port, "get_status", GetStatusRequest()
)
)

return get_status_response

def wait_ready(self, timeout=20) -> None:
"""Wait for node to be ready
Expand Down

0 comments on commit 57f4413

Please sign in to comment.