Skip to content

feat(query_group): update CLI commands for output format #294

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

Merged
merged 1 commit into from
Apr 17, 2025
Merged
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
7 changes: 4 additions & 3 deletions cardano_clusterlib/query_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_utxo(
Returns:
List[structs.UTXOData]: A list of UTxO data.
"""
cli_args = ["utxo", "--out-file", "/dev/stdout"]
cli_args = ["utxo", "--output-json"]

address_single = ""
sort_results = False
Expand Down Expand Up @@ -300,7 +300,7 @@ def get_gov_action_deposit(self, pparams: dict[str, tp.Any] | None = None) -> in
def get_stake_distribution(self) -> dict[str, float]:
"""Return current aggregated stake distribution per stake pool."""
# Stake pool values are displayed starting with line 2 of the command output
result = self.query_cli(["stake-distribution"]).splitlines()[2:]
result = self.query_cli(["stake-distribution", "--output-text"]).splitlines()[2:]
stake_distribution: dict[str, float] = {}
for pool in result:
pool_id, stake = pool.split()
Expand All @@ -309,7 +309,7 @@ def get_stake_distribution(self) -> dict[str, float]:

def get_stake_pools(self) -> list[str]:
"""Return the node's current set of stake pool ids."""
stake_pools = self.query_cli(["stake-pools"]).splitlines()
stake_pools = self.query_cli(["stake-pools", "--output-text"]).splitlines()
return stake_pools

def get_leadership_schedule(
Expand Down Expand Up @@ -366,6 +366,7 @@ def get_leadership_schedule(
unparsed = self.query_cli(
[
"leadership-schedule",
"--output-text",
"--genesis",
str(self._clusterlib_obj.genesis_json),
"--vrf-signing-key-file",
Expand Down
Loading