Skip to content

Commit 6fc3c30

Browse files
authored
Merge pull request #330 from input-output-hk/get_stake_pool_default
Include get stake pool vote
2 parents 93e95ef + 2873d9f commit 6fc3c30

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cardano_clusterlib/query_group.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,5 +719,25 @@ def get_ratify_state(self) -> dict[str, tp.Any]:
719719
out: dict[str, tp.Any] = json.loads(self.query_cli(["ratify-state"]))
720720
return out
721721

722+
def get_stake_pool_default_vote(
723+
self,
724+
spo_vkey: str = "",
725+
spo_vkey_file: itp.FileType | None = None,
726+
spo_key_hash: str = "",
727+
) -> str:
728+
"""Get the stake pool default vote."""
729+
if spo_vkey:
730+
cred_args = ["--spo-verification-key", str(spo_vkey)]
731+
elif spo_vkey_file:
732+
cred_args = ["--spo-verification-key-file", str(spo_vkey_file)]
733+
elif spo_key_hash:
734+
cred_args = ["--spo-key-hash", str(spo_key_hash)]
735+
else:
736+
msg = "Must provide one of spo_vkey, spo_vkey_file, or spo_key_hash"
737+
raise ValueError(msg)
738+
739+
raw_output: str = self.query_cli(["stake-pool-default-vote", *cred_args]).strip().strip('"')
740+
return raw_output
741+
722742
def __repr__(self) -> str:
723743
return f"<{self.__class__.__name__}: clusterlib_obj={id(self._clusterlib_obj)}>"

0 commit comments

Comments
 (0)