Skip to content

Commit d422e94

Browse files
authored
Merge pull request #317 from input-output-hk/add_reward_account_key_pair
feat(stake-pool): add reward account key pair support
2 parents 32e30d6 + 2c5a197 commit d422e94

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cardano_clusterlib/stake_pool_group.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ def create_stake_pool(
177177
pool_data: structs.PoolData,
178178
pool_owners: list[structs.PoolUser],
179179
tx_name: str,
180+
reward_account_key_pair: structs.KeyPair | structs.AddressRecord | None = None,
180181
destination_dir: itp.FileType = ".",
181182
) -> structs.PoolCreationOutput:
182183
"""Create and register a stake pool.
@@ -186,6 +187,7 @@ def create_stake_pool(
186187
pool_owners: A list of `structs.PoolUser` structures containing pool user addresses
187188
and keys.
188189
tx_name: A name of the transaction.
190+
reward_account_key_pair: A data container containing reward account key pair (optional).
189191
destination_dir: A path to directory for storing artifacts (optional).
190192
191193
Returns:
@@ -221,6 +223,9 @@ def create_stake_pool(
221223
vrf_vkey_file=node_vrf.vkey_file,
222224
cold_key_pair=node_cold,
223225
tx_name=tx_name,
226+
reward_account_vkey_file=reward_account_key_pair.vkey_file
227+
if reward_account_key_pair
228+
else None,
224229
destination_dir=destination_dir,
225230
)
226231

@@ -231,6 +236,7 @@ def create_stake_pool(
231236
pool_reg_cert_file=pool_reg_cert_file,
232237
pool_data=pool_data,
233238
pool_owners=pool_owners,
239+
reward_account_key_pair=reward_account_key_pair or pool_owners[0].stake,
234240
tx_raw_output=tx_raw_output,
235241
kes_key_pair=node_kes,
236242
)

cardano_clusterlib/structs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ class PoolCreationOutput:
270270
pool_reg_cert_file: pl.Path
271271
pool_data: PoolData
272272
pool_owners: list[PoolUser]
273+
reward_account_key_pair: KeyPair | AddressRecord
273274
tx_raw_output: TxRawOutput
274275
kes_key_pair: KeyPair | None = None
275276

0 commit comments

Comments
 (0)