@@ -52,10 +52,10 @@ checkStakePoolRegistered
5252 :: (MonadTest m , MonadCatch m , MonadIO m , HasCallStack )
5353 => TmpAbsolutePath
5454 -> ExecConfig
55- -> FilePath -- ^ Stake pool cold verification key file
55+ -> File ( VKey StakeKey ) In -- ^ Stake pool cold verification key file
5656 -> FilePath -- ^ Output file path of stake pool info
5757 -> m String -- ^ Stake pool ID
58- checkStakePoolRegistered tempAbsP execConfig poolColdVkeyFp outputFp =
58+ checkStakePoolRegistered tempAbsP execConfig ( File poolColdVkeyFp) outputFp =
5959 GHC. withFrozenCallStack $ do
6060 let tempAbsPath' = unTmpAbsPath tempAbsP
6161 oFpAbs = tempAbsPath' </> outputFp
@@ -160,11 +160,11 @@ createStakeDelegationCertificate
160160 :: (MonadTest m , MonadCatch m , MonadIO m , HasCallStack )
161161 => TmpAbsolutePath
162162 -> ShelleyBasedEra era
163- -> FilePath -- ^ Delegate stake verification key file
163+ -> File ( VKey StakeKey ) In -- ^ Delegate stake verification key file
164164 -> String -- ^ Pool id
165165 -> FilePath
166166 -> m ()
167- createStakeDelegationCertificate tempAbsP sbe delegatorStakeVerKey poolId outputFp =
167+ createStakeDelegationCertificate tempAbsP sbe ( File delegatorStakeVerKey) poolId outputFp =
168168 GHC. withFrozenCallStack $ do
169169 let tempAbsPath' = unTmpAbsPath tempAbsP
170170 execCli_
@@ -179,11 +179,11 @@ createStakeKeyRegistrationCertificate
179179 :: (MonadTest m , MonadCatch m , MonadIO m , HasCallStack )
180180 => TmpAbsolutePath
181181 -> AnyShelleyBasedEra
182- -> FilePath -- ^ Stake verification key file
182+ -> File ( VKey StakeKey ) In -- ^ Stake verification key file
183183 -> Int -- ^ deposit amount used only in Conway
184184 -> FilePath -- ^ Output file path
185185 -> m ()
186- createStakeKeyRegistrationCertificate tempAbsP asbe stakeVerKey deposit outputFp = GHC. withFrozenCallStack $ do
186+ createStakeKeyRegistrationCertificate tempAbsP asbe ( File stakeVerKey) deposit outputFp = GHC. withFrozenCallStack $ do
187187 AnyShelleyBasedEra sbe <- return asbe
188188 let tempAbsPath' = unTmpAbsPath tempAbsP
189189 extraArgs = monoidForEraInEon @ ConwayEraOnwards (toCardanoEra sbe) $
@@ -251,16 +251,12 @@ registerSingleSpo
251251 -> ExecConfig
252252 -> (TxIn , FilePath , String )
253253 -> m ( String
254- , FilePath
255- , FilePath
256- , FilePath
257- , FilePath
254+ , KeyPair StakeKey
255+ , KeyPair VrfKey
258256 ) -- ^ Result tuple:
259257 -- 1. String: Registered stake pool ID
260- -- 2. FilePath: Stake pool cold signing key
261- -- 3. FilePath: Stake pool cold verification key
262- -- 4. FilePath: Stake pool VRF signing key
263- -- 5. FilePath: Stake pool VRF verification key
258+ -- 2. Stake pool cold keys
259+ -- 3. Stake pool VRF keys
264260registerSingleSpo asbe identifier tap@ (TmpAbsolutePath tempAbsPath') nodeConfigFile socketPath termEpoch testnetMag execConfig
265261 (fundingInput, fundingSigninKey, changeAddr) = GHC. withFrozenCallStack $ do
266262 workDir <- H. note tempAbsPath'
@@ -276,48 +272,53 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
276272 let spoReqDir = workDir </> " spo-" <> show identifier <> " -requirements"
277273
278274 H. createDirectoryIfMissing_ spoReqDir
279- let poolOwnerstakeVkeyFp = spoReqDir </> " pool-owner-stake.vkey"
280- poolOwnerstakeSKeyFp = spoReqDir </> " pool-owner-stake.skey"
275+ let poolOwnerStakeKeys = KeyPair
276+ { verificationKey = File $ spoReqDir </> " pool-owner-stake.vkey"
277+ , signingKey = File $ spoReqDir </> " pool-owner-stake.skey"
278+ }
281279
282- cliStakeAddressKeyGen
283- $ KeyPair (File poolOwnerstakeVkeyFp) (File poolOwnerstakeSKeyFp)
280+ cliStakeAddressKeyGen poolOwnerStakeKeys
284281
285282 poolownerstakeaddr <- filter (/= ' \n ' )
286283 <$> execCli
287284 [ " latest" , " stake-address" , " build"
288- , " --stake-verification-key-file" , poolOwnerstakeVkeyFp
285+ , " --stake-verification-key-file" , verificationKeyFp poolOwnerStakeKeys
289286 , " --testnet-magic" , show @ Int testnetMag
290287 ]
291288
292289 -- 2. Generate stake pool owner payment key pair
293- let poolOwnerPaymentVkeyFp = spoReqDir </> " pool-owner-payment.vkey"
294- poolOwnerPaymentSkeyFp = spoReqDir </> " pool-owner-payment.skey"
295- cliAddressKeyGen
296- $ KeyPair (File poolOwnerPaymentVkeyFp) (File poolOwnerPaymentSkeyFp)
290+ let poolOwnerPaymentKeys = KeyPair
291+ { verificationKey = File $ spoReqDir </> " pool-owner-payment.vkey"
292+ , signingKey = File $ spoReqDir </> " pool-owner-payment.skey"
293+ }
294+ cliAddressKeyGen poolOwnerPaymentKeys
297295
298296 poolowneraddresswstakecred <-
299297 execCli [ " latest" , " address" , " build"
300- , " --payment-verification-key-file" , poolOwnerPaymentVkeyFp
301- , " --stake-verification-key-file" , poolOwnerstakeVkeyFp
298+ , " --payment-verification-key-file" , verificationKeyFp poolOwnerPaymentKeys
299+ , " --stake-verification-key-file" , verificationKeyFp poolOwnerStakeKeys
302300 , " --testnet-magic" , show @ Int testnetMag
303301 ]
304302
305303 -- 3. Generate pool cold keys
306- let poolColdVkeyFp = spoReqDir </> " pool-cold.vkey"
307- poolColdSkeyFp = spoReqDir </> " pool-cold.skey"
304+ let poolColdKeys = KeyPair
305+ { verificationKey = File $ spoReqDir </> " pool-cold.vkey"
306+ , signingKey = File $ spoReqDir </> " pool-cold.skey"
307+ }
308308
309309 execCli_
310310 [ " latest" , " node" , " key-gen"
311- , " --cold-verification-key-file" , poolColdVkeyFp
312- , " --cold-signing-key-file" , poolColdSkeyFp
311+ , " --cold-verification-key-file" , verificationKeyFp poolColdKeys
312+ , " --cold-signing-key-file" , signingKeyFp poolColdKeys
313313 , " --operational-certificate-issue-counter-file" , spoReqDir </> " operator.counter"
314314 ]
315315
316316 -- 4. Generate VRF keys
317- let vrfVkeyFp = spoReqDir </> " pool-vrf.vkey"
318- vrfSkeyFp = spoReqDir </> " pool-vrf.skey"
319- cliNodeKeyGenVrf
320- $ KeyPair (File vrfVkeyFp) (File vrfSkeyFp)
317+ let vrfKeys = KeyPair
318+ { verificationKey = File $ spoReqDir </> " pool-vrf.vkey"
319+ , signingKey = File $ spoReqDir </> " pool-vrf.skey"
320+ }
321+ cliNodeKeyGenVrf vrfKeys
321322
322323 -- 5. Create registration certificate
323324 let poolRegCertFp = spoReqDir </> " registration.cert"
@@ -330,10 +331,10 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
330331 , " --pool-pledge" , " 0"
331332 , " --pool-cost" , " 0"
332333 , " --pool-margin" , " 0"
333- , " --cold-verification-key-file" , poolColdVkeyFp
334- , " --vrf-verification-key-file" , vrfVkeyFp
335- , " --reward-account-verification-key-file" , poolOwnerstakeVkeyFp
336- , " --pool-owner-stake-verification-key-file" , poolOwnerstakeVkeyFp
334+ , " --cold-verification-key-file" , verificationKeyFp poolColdKeys
335+ , " --vrf-verification-key-file" , verificationKeyFp vrfKeys
336+ , " --reward-account-verification-key-file" , verificationKeyFp poolOwnerStakeKeys
337+ , " --pool-owner-stake-verification-key-file" , verificationKeyFp poolOwnerStakeKeys
337338 , " --out-file" , poolRegCertFp
338339 ]
339340
@@ -342,7 +343,7 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
342343
343344 -- Create pledger registration certificate
344345 createStakeKeyRegistrationCertificate tap asbe
345- poolOwnerstakeVkeyFp
346+ (verificationKey poolOwnerStakeKeys)
346347 400_000
347348 (workDir </> " pledger.regcert" )
348349
@@ -365,8 +366,8 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
365366 , " --tx-body-file" , workDir </> " pledge-registration-cert.txbody"
366367 , " --testnet-magic" , show @ Int testnetMag
367368 , " --signing-key-file" , fundingSigninKey
368- , " --signing-key-file" , poolOwnerstakeSKeyFp
369- , " --signing-key-file" , poolColdSkeyFp
369+ , " --signing-key-file" , signingKeyFp poolOwnerStakeKeys
370+ , " --signing-key-file" , signingKeyFp poolColdKeys
370371 , " --out-file" , pledgeAndPoolRegistrationTx
371372 ]
372373
@@ -397,9 +398,9 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
397398 poolId <- checkStakePoolRegistered
398399 tap
399400 execConfig
400- poolColdVkeyFp
401+ (verificationKey poolColdKeys)
401402 currentRegistedPoolsJson
402- return (poolId, poolColdSkeyFp, poolColdVkeyFp, vrfSkeyFp, vrfVkeyFp )
403+ return (poolId, poolColdKeys, vrfKeys )
403404
404405-- | Generates Stake Pool Operator (SPO) voting files, using @cardano-cli@.
405406--
0 commit comments