Skip to content

Commit

Permalink
feat: use the 'legacy' group for 'genesis' and 'governance'
Browse files Browse the repository at this point in the history
Use the 'legacy' CLI group for commands that no longer work in Conway
era.
  • Loading branch information
mkoura committed Sep 24, 2024
1 parent a643bfb commit 84ef16f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
11 changes: 7 additions & 4 deletions cardano_clusterlib/genesis_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, clusterlib_obj: "itp.ClusterLib") -> None:

self._genesis_keys: tp.Optional[structs.GenesisKeys] = None
self._genesis_utxo_addr: str = ""
self._cli_args = ("cardano-cli", "legacy", "genesis")

@property
def genesis_keys(self) -> structs.GenesisKeys:
Expand Down Expand Up @@ -94,14 +95,15 @@ def gen_genesis_addr(

self._clusterlib_obj.cli(
[
"genesis",
*self._cli_args,
"initial-addr",
*self._clusterlib_obj.magic_args,
"--verification-key-file",
str(vkey_file),
"--out-file",
str(out_file),
]
],
add_default_args=False,
)

helpers._check_outfiles(out_file)
Expand All @@ -118,11 +120,12 @@ def get_genesis_vkey_hash(self, vkey_file: itp.FileType) -> str:
"""
cli_out = self._clusterlib_obj.cli(
[
"genesis",
*self._cli_args,
"key-hash",
"--verification-key-file",
str(vkey_file),
]
],
add_default_args=False,
)

return cli_out.stdout.rstrip().decode("ascii")
Expand Down
21 changes: 13 additions & 8 deletions cardano_clusterlib/governance_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
class GovernanceGroup:
def __init__(self, clusterlib_obj: "itp.ClusterLib") -> None:
self._clusterlib_obj = clusterlib_obj
self._cli_args = ("cardano-cli", "legacy", "governance")

def gen_update_proposal(
self,
Expand All @@ -40,7 +41,7 @@ def gen_update_proposal(

self._clusterlib_obj.cli(
[
"governance",
*self._cli_args,
"create-update-proposal",
*cli_args,
"--out-file",
Expand All @@ -51,7 +52,8 @@ def gen_update_proposal(
"--genesis-verification-key-file",
self._clusterlib_obj.g_genesis.genesis_keys.genesis_vkeys,
),
]
],
add_default_args=False,
)

helpers._check_outfiles(out_file)
Expand Down Expand Up @@ -79,14 +81,15 @@ def gen_mir_cert_to_treasury(

self._clusterlib_obj.cli(
[
"governance",
*self._cli_args,
"create-mir-certificate",
"transfer-to-treasury",
"--transfer",
str(transfer),
"--out-file",
str(out_file),
]
],
add_default_args=False,
)

helpers._check_outfiles(out_file)
Expand Down Expand Up @@ -114,14 +117,15 @@ def gen_mir_cert_to_rewards(

self._clusterlib_obj.cli(
[
"governance",
*self._cli_args,
"create-mir-certificate",
"transfer-to-rewards",
"--transfer",
str(transfer),
"--out-file",
str(out_file),
]
],
add_default_args=False,
)

helpers._check_outfiles(out_file)
Expand Down Expand Up @@ -154,7 +158,7 @@ def gen_mir_cert_stake_addr(

self._clusterlib_obj.cli(
[
"governance",
*self._cli_args,
"create-mir-certificate",
"stake-addresses",
f"--{funds_src}",
Expand All @@ -164,7 +168,8 @@ def gen_mir_cert_stake_addr(
str(reward),
"--out-file",
str(out_file),
]
],
add_default_args=False,
)

helpers._check_outfiles(out_file)
Expand Down

0 comments on commit 84ef16f

Please sign in to comment.