Skip to content
Merged
Changes from 2 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
5 changes: 5 additions & 0 deletions cardano_clusterlib/query_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,5 +709,10 @@ def get_treasury(self) -> int:
"""Get the treasury value."""
return int(self.query_cli(["treasury"]))

def get_future_pparams(self) -> dict[str, tp.Any]:
"""Get the future protocol parameters that will apply at the next epoch."""
out: dict[str, tp.Any] = json.loads(self.query_cli(["future-pparams"]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be

out: dict[str, tp.Any] = json.loads(self.query_cli(["future-pparams"])) or {}

to ensure we always return dict, as we stated in function definition. The command returns null when there are no future pparams.

return out

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