@@ -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,12 +179,11 @@ createStakeKeyRegistrationCertificate
179179 :: (MonadTest m , MonadCatch m , MonadIO m , HasCallStack )
180180 => TmpAbsolutePath
181181 -> AnyShelleyBasedEra
182- -> FilePath -- ^ Stake verification key file
183- -> Int -- ^ deposit amount used only in Conway
182+ -> File ( VKey StakeKey ) In -- ^ Stake verification key file
183+ -> L. Coin -- ^ deposit amount used only in Conway
184184 -> FilePath -- ^ Output file path
185185 -> m ()
186- createStakeKeyRegistrationCertificate tempAbsP asbe stakeVerKey deposit outputFp = GHC. withFrozenCallStack $ do
187- AnyShelleyBasedEra sbe <- return asbe
186+ createStakeKeyRegistrationCertificate tempAbsP (AnyShelleyBasedEra sbe) (File stakeVerKey) (L. Coin deposit) outputFp = GHC. withFrozenCallStack $ do
188187 let tempAbsPath' = unTmpAbsPath tempAbsP
189188 extraArgs = monoidForEraInEon @ ConwayEraOnwards (toCardanoEra sbe) $
190189 const [" --key-reg-deposit-amt" , show deposit]
@@ -201,10 +200,10 @@ createScriptStakeRegistrationCertificate
201200 => TmpAbsolutePath
202201 -> AnyCardanoEra
203202 -> FilePath -- ^ Script file
204- -> Int -- ^ Registration deposit amount used only in Conway
203+ -> L. Coin -- ^ Registration deposit amount used only in Conway
205204 -> FilePath -- ^ Output file path
206205 -> m ()
207- createScriptStakeRegistrationCertificate tempAbsP (AnyCardanoEra cEra) scriptFile deposit outputFp =
206+ createScriptStakeRegistrationCertificate tempAbsP (AnyCardanoEra cEra) scriptFile ( L. Coin deposit) outputFp =
208207 GHC. withFrozenCallStack $ do
209208 let tempAbsPath' = unTmpAbsPath tempAbsP
210209 extraArgs = monoidForEraInEon @ ConwayEraOnwards cEra $
@@ -221,11 +220,11 @@ createStakeKeyDeregistrationCertificate
221220 :: (MonadTest m , MonadCatch m , MonadIO m , HasCallStack )
222221 => TmpAbsolutePath
223222 -> ShelleyBasedEra era
224- -> FilePath -- ^ Stake verification key file
225- -> Int -- ^ deposit amount used only in Conway
223+ -> File ( VKey StakeKey ) In -- ^ Stake verification key file
224+ -> L. Coin -- ^ deposit amount used only in Conway
226225 -> FilePath -- ^ Output file path
227226 -> m ()
228- createStakeKeyDeregistrationCertificate tempAbsP sbe stakeVerKey deposit outputFp =
227+ createStakeKeyDeregistrationCertificate tempAbsP sbe ( File stakeVerKey) ( L. Coin deposit) outputFp =
229228 GHC. withFrozenCallStack $ do
230229 let tempAbsPath' = unTmpAbsPath tempAbsP
231230 extraArgs = monoidForEraInEon @ ConwayEraOnwards (toCardanoEra sbe) $
@@ -248,21 +247,18 @@ registerSingleSpo
248247 -> SocketPath
249248 -> EpochNo -- ^ Termination epoch
250249 -> Int -- ^ Testnet magic
250+ -> L. Coin -- ^ key deposit
251251 -> ExecConfig
252- -> (TxIn , FilePath , String )
252+ -> (TxIn , File ( SKey PaymentKey ) In , 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
264- registerSingleSpo asbe identifier tap@ (TmpAbsolutePath tempAbsPath') nodeConfigFile socketPath termEpoch testnetMag execConfig
265- (fundingInput, fundingSigninKey, changeAddr) = GHC. withFrozenCallStack $ do
258+ -- 2. Stake pool cold keys
259+ -- 3. Stake pool VRF keys
260+ registerSingleSpo asbe identifier tap@ (TmpAbsolutePath tempAbsPath') nodeConfigFile socketPath termEpoch testnetMag keyDeposit execConfig
261+ (fundingInput, File fundingSigninKey, changeAddr) = GHC. withFrozenCallStack $ do
266262 workDir <- H. note tempAbsPath'
267263
268264 -- In order to register a stake pool we need two certificates:
@@ -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,21 +331,20 @@ 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
340341 -- Create pledge delegation certificate
341342 -- NB: Pledger and owner can be the same
342343
343344 -- Create pledger registration certificate
344-
345345 createStakeKeyRegistrationCertificate tap asbe
346- poolOwnerstakeVkeyFp
347- 0
346+ (verificationKey poolOwnerStakeKeys)
347+ keyDeposit
348348 (workDir </> " pledger.regcert" )
349349
350350 void $ execCli' execConfig
@@ -366,8 +366,8 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
366366 , " --tx-body-file" , workDir </> " pledge-registration-cert.txbody"
367367 , " --testnet-magic" , show @ Int testnetMag
368368 , " --signing-key-file" , fundingSigninKey
369- , " --signing-key-file" , poolOwnerstakeSKeyFp
370- , " --signing-key-file" , poolColdSkeyFp
369+ , " --signing-key-file" , signingKeyFp poolOwnerStakeKeys
370+ , " --signing-key-file" , signingKeyFp poolColdKeys
371371 , " --out-file" , pledgeAndPoolRegistrationTx
372372 ]
373373
@@ -398,9 +398,9 @@ registerSingleSpo asbe identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigF
398398 poolId <- checkStakePoolRegistered
399399 tap
400400 execConfig
401- poolColdVkeyFp
401+ (verificationKey poolColdKeys)
402402 currentRegistedPoolsJson
403- return (poolId, poolColdSkeyFp, poolColdVkeyFp, vrfSkeyFp, vrfVkeyFp )
403+ return (poolId, poolColdKeys, vrfKeys )
404404
405405-- | Generates Stake Pool Operator (SPO) voting files, using @cardano-cli@.
406406--
0 commit comments