Skip to content

Commit

Permalink
Add helper function to 'query slot-number'
Browse files Browse the repository at this point in the history
  • Loading branch information
saratomaz committed May 31, 2023
1 parent a2cff94 commit c31dc75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cardano_clusterlib/query_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,11 @@ def get_mempool_tx_exists(self, txid: str) -> Dict[str, Any]:
)
return tx_mempool

def get_slot_number(self, timestamp: str) -> int:
"""Return slot number for UTC timestamp."""
slot_number: int = json.loads(self.query_cli(["slot-number", timestamp]))

return slot_number

def __repr__(self) -> str:
return f"<{self.__class__.__name__}: clusterlib_obj={id(self._clusterlib_obj)}>"

0 comments on commit c31dc75

Please sign in to comment.