@@ -120,24 +120,25 @@ import Vary.Utils ((:|))
120
120
121
121
runGenesisKeyGenGenesisCmd
122
122
:: GenesisKeyGenGenesisCmdArgs
123
- -> ExceptT GenesisCmdError IO ()
123
+ -> CIO e ()
124
124
runGenesisKeyGenGenesisCmd
125
125
Cmd. GenesisKeyGenGenesisCmdArgs
126
126
{ Cmd. verificationKeyPath
127
127
, Cmd. signingKeyPath
128
128
} = do
129
129
skey <- generateSigningKey AsGenesisKey
130
130
let vkey = getVerificationKey skey
131
- firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
132
- void $ writeLazyByteStringFile signingKeyPath $ textEnvelopeToJSON (Just skeyDesc) skey
133
- writeLazyByteStringFile verificationKeyPath $ textEnvelopeToJSON (Just Key. genesisVkeyDesc) vkey
131
+ void $ writeLazyByteStringFile signingKeyPath $ textEnvelopeToJSON (Just skeyDesc) skey
132
+ fromEitherIOCli @ (FileError () ) $
133
+ writeLazyByteStringFile verificationKeyPath $
134
+ textEnvelopeToJSON (Just Key. genesisVkeyDesc) vkey
134
135
where
135
136
skeyDesc :: TextEnvelopeDescr
136
137
skeyDesc = " Genesis Signing Key"
137
138
138
139
runGenesisKeyGenDelegateCmd
139
140
:: GenesisKeyGenDelegateCmdArgs
140
- -> ExceptT GenesisCmdError IO ()
141
+ -> CIO e ()
141
142
runGenesisKeyGenDelegateCmd
142
143
Cmd. GenesisKeyGenDelegateCmdArgs
143
144
{ Cmd. verificationKeyPath
@@ -146,7 +147,7 @@ runGenesisKeyGenDelegateCmd
146
147
} = do
147
148
skey <- generateSigningKey AsGenesisDelegateKey
148
149
let vkey = getVerificationKey skey
149
- firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
150
+ fromEitherIOCli @ ( FileError () ) $ do
150
151
void $
151
152
writeLazyByteStringFile signingKeyPath $
152
153
textEnvelopeToJSON (Just skeyDesc) skey
@@ -188,15 +189,15 @@ runGenesisKeyGenDelegateVRF vkeyPath skeyPath = do
188
189
189
190
runGenesisKeyGenUTxOCmd
190
191
:: GenesisKeyGenUTxOCmdArgs
191
- -> ExceptT GenesisCmdError IO ()
192
+ -> CIO e ()
192
193
runGenesisKeyGenUTxOCmd
193
194
Cmd. GenesisKeyGenUTxOCmdArgs
194
195
{ Cmd. verificationKeyPath
195
196
, Cmd. signingKeyPath
196
197
} = do
197
198
skey <- generateSigningKey AsGenesisUTxOKey
198
199
let vkey = getVerificationKey skey
199
- firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
200
+ fromEitherIOCli @ ( FileError () ) $ do
200
201
void $
201
202
writeLazyByteStringFile signingKeyPath $
202
203
textEnvelopeToJSON (Just skeyDesc) skey
@@ -289,9 +290,8 @@ runGenesisCreateTestNetDataCmd
289
290
stakeDelegatorsDirs = [stakeDelegatorsDir </> " delegator" <> show i | i <- [1 .. numOfStakeDelegators]]
290
291
291
292
forM_ [1 .. numGenesisKeys] $ \ index -> do
292
- fromExceptTCli $ createGenesisKeys (genesisDir </> (" genesis" <> show index))
293
- fromExceptTCli $
294
- createDelegateKeys desiredKeyOutputFormat (delegateDir </> (" delegate" <> show index))
293
+ createGenesisKeys (genesisDir </> (" genesis" <> show index))
294
+ createDelegateKeys desiredKeyOutputFormat (delegateDir </> (" delegate" <> show index))
295
295
296
296
when (0 < numGenesisKeys) $ do
297
297
fromExceptTCli $ writeREADME genesisDir genesisREADME
@@ -303,7 +303,7 @@ runGenesisCreateTestNetDataCmd
303
303
| index <- [1 .. numUtxoKeys]
304
304
]
305
305
forM_ [1 .. numUtxoKeys] $ \ index ->
306
- fromExceptTCli $ createUtxoKeys (utxoKeysDir </> (" utxo" <> show index))
306
+ createUtxoKeys (utxoKeysDir </> (" utxo" <> show index))
307
307
308
308
fromExceptTCli $ when (0 < numUtxoKeys) $ writeREADME utxoKeysDir utxoKeysREADME
309
309
@@ -337,11 +337,9 @@ runGenesisCreateTestNetDataCmd
337
337
coldArgs = CC. GovernanceCommitteeKeyGenColdCmdArgs ConwayEraOnwardsConway vkeyColdFile skeyColdFile
338
338
liftIO $ createDirectoryIfMissing True committeeDir
339
339
void $
340
- fromExceptTCli $
341
- CC. runGovernanceCommitteeKeyGenHot hotArgs
340
+ CC. runGovernanceCommitteeKeyGenHot hotArgs
342
341
(vColdKey, _) <-
343
- fromExceptTCli $
344
- CC. runGovernanceCommitteeKeyGenCold coldArgs
342
+ CC. runGovernanceCommitteeKeyGenCold coldArgs
345
343
return vColdKey
346
344
347
345
fromExceptTCli $ when (0 < numCommitteeKeys) $ writeREADME committeesDir committeeREADME
@@ -350,7 +348,7 @@ runGenesisCreateTestNetDataCmd
350
348
-- that before Conway, the number of DReps at this point is 0.
351
349
g <- Random. getStdGen
352
350
353
- dRepKeys <- fromExceptTCli $
351
+ dRepKeys <-
354
352
case dRepCredentialGenerationMode of
355
353
OnDisk -> forM [1 .. numOfDRepCredentials] $ \ index -> do
356
354
let drepDir = drepsDir </> " drep" <> show index
@@ -643,7 +641,7 @@ mkPaths numKeys dir segment filename =
643
641
createDelegateKeys
644
642
:: Vary [FormatBech32 , FormatTextEnvelope ]
645
643
-> FilePath
646
- -> ExceptT GenesisCmdError IO ()
644
+ -> CIO e ()
647
645
createDelegateKeys fmt dir = do
648
646
liftIO $ createDirectoryIfMissing True dir
649
647
runGenesisKeyGenDelegateCmd
@@ -652,10 +650,11 @@ createDelegateKeys fmt dir = do
652
650
, Cmd. signingKeyPath = onlyOut coldSK
653
651
, Cmd. opCertCounterPath = onlyOut opCertCtr
654
652
}
655
- runGenesisKeyGenDelegateVRF
656
- (File @ (VerificationKey () ) $ dir </> " vrf.vkey" )
657
- (File @ (SigningKey () ) $ dir </> " vrf.skey" )
658
- firstExceptT GenesisCmdNodeCmdError $ do
653
+ fromExceptTCli $
654
+ runGenesisKeyGenDelegateVRF
655
+ (File @ (VerificationKey () ) $ dir </> " vrf.vkey" )
656
+ (File @ (SigningKey () ) $ dir </> " vrf.skey" )
657
+ fromExceptTCli $ do
659
658
runNodeKeyGenKesCmd $
660
659
Cmd. NodeKeyGenKESCmdArgs
661
660
fmt
@@ -673,7 +672,7 @@ createDelegateKeys fmt dir = do
673
672
coldSK = File @ (SigningKey () ) $ dir </> " key.skey"
674
673
opCertCtr = File $ dir </> " opcert.counter"
675
674
676
- createGenesisKeys :: FilePath -> ExceptT GenesisCmdError IO ()
675
+ createGenesisKeys :: FilePath -> CIO e ()
677
676
createGenesisKeys dir = do
678
677
liftIO $ createDirectoryIfMissing True dir
679
678
runGenesisKeyGenGenesisCmd
@@ -703,7 +702,7 @@ createStakeDelegatorCredentials dir = do
703
702
stakingVK = File @ (VerificationKey () ) $ dir </> " staking.vkey"
704
703
stakingSK = File @ (SigningKey () ) $ dir </> " staking.skey"
705
704
706
- createUtxoKeys :: FilePath -> ExceptT GenesisCmdError IO ()
705
+ createUtxoKeys :: FilePath -> CIO e ()
707
706
createUtxoKeys dir = do
708
707
liftIO $ createDirectoryIfMissing True dir
709
708
runGenesisKeyGenUTxOCmd
0 commit comments