Skip to content

Commit 398b3ae

Browse files
Compatible group... Include group.
1 parent 71fa3da commit 398b3ae

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

cardano_clusterlib/compat_common.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,34 @@ def gen_registration_cert(
211211

212212
return out_file
213213

214+
def gen_dereg_cert(
215+
self,
216+
*,
217+
name: str,
218+
params: structs.CompatPoolDeregParams,
219+
destination_dir: itp.FileType = ".",
220+
) -> pl.Path:
221+
"""Generate a compatible stake pool deregistration certificate."""
222+
destination_dir_path = pl.Path(destination_dir).expanduser()
223+
out_file = destination_dir_path / f"{name}_pool_dereg.cert"
224+
clusterlib_helpers._check_files_exist(out_file, clusterlib_obj=self._clusterlib_obj)
225+
226+
cmd = [
227+
*self._base,
228+
"deregistration-certificate",
229+
"--cold-verification-key-file",
230+
str(params.cold_vkey_file),
231+
"--epoch",
232+
str(params.epoch),
233+
"--out-file",
234+
str(out_file),
235+
]
236+
237+
self._clusterlib_obj.cli(cmd, add_default_args=False)
238+
helpers._check_outfiles(out_file)
239+
240+
return out_file
241+
214242

215243
class GovernanceActionGroup:
216244
"""Governance action subcommands for compatible eras."""

cardano_clusterlib/structs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ class CompatPoolParams:
244244
check_metadata_hash: bool = False
245245

246246

247+
@dataclasses.dataclass(frozen=True)
248+
class CompatPoolDeregParams:
249+
cold_vkey_file: itp.FileType
250+
epoch: int
251+
252+
247253
@dataclasses.dataclass(frozen=True, order=True)
248254
class TxRawOutput:
249255
txins: list[UTXOData] # UTXOs used as inputs

0 commit comments

Comments
 (0)