Skip to content

RIO propagation 2025-05-07 #1179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 15, 2025
3 changes: 0 additions & 3 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ library
Cardano.CLI.Type.Error.GenesisCmdError
Cardano.CLI.Type.Error.GovernanceActionsError
Cardano.CLI.Type.Error.GovernanceCmdError
Cardano.CLI.Type.Error.GovernanceCommitteeError
Cardano.CLI.Type.Error.GovernanceQueryError
Cardano.CLI.Type.Error.GovernanceVoteCmdError
Cardano.CLI.Type.Error.HashCmdError
Cardano.CLI.Type.Error.ItnKeyConversionError
Cardano.CLI.Type.Error.KeyCmdError
Expand Down Expand Up @@ -424,7 +422,6 @@ test-suite cardano-cli-golden
base16-bytestring,
bytestring,
cardano-api:{cardano-api, gen},
cardano-binary,
cardano-cli,
cardano-cli:cardano-cli-test-lib,
cardano-crypto-wrapper,
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ import Data.Typeable (Typeable)

runCompatibleGovernanceCmds :: Typeable era => CompatibleGovernanceCmds era -> CIO e ()
runCompatibleGovernanceCmds = \case
CreateCompatibleProtocolUpdateCmd cmd -> fromExceptTCli $ runGovernanceCmds cmd
CreateCompatibleProtocolUpdateCmd cmd -> runGovernanceCmds cmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,25 @@ import Vary.Utils ((:|))

runGenesisKeyGenGenesisCmd
:: GenesisKeyGenGenesisCmdArgs
-> ExceptT GenesisCmdError IO ()
-> CIO e ()
runGenesisKeyGenGenesisCmd
Cmd.GenesisKeyGenGenesisCmdArgs
{ Cmd.verificationKeyPath
, Cmd.signingKeyPath
} = do
skey <- generateSigningKey AsGenesisKey
let vkey = getVerificationKey skey
firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
void $ writeLazyByteStringFile signingKeyPath $ textEnvelopeToJSON (Just skeyDesc) skey
writeLazyByteStringFile verificationKeyPath $ textEnvelopeToJSON (Just Key.genesisVkeyDesc) vkey
void $ writeLazyByteStringFile signingKeyPath $ textEnvelopeToJSON (Just skeyDesc) skey
fromEitherIOCli @(FileError ()) $
writeLazyByteStringFile verificationKeyPath $
textEnvelopeToJSON (Just Key.genesisVkeyDesc) vkey
where
skeyDesc :: TextEnvelopeDescr
skeyDesc = "Genesis Signing Key"

runGenesisKeyGenDelegateCmd
:: GenesisKeyGenDelegateCmdArgs
-> ExceptT GenesisCmdError IO ()
-> CIO e ()
runGenesisKeyGenDelegateCmd
Cmd.GenesisKeyGenDelegateCmdArgs
{ Cmd.verificationKeyPath
Expand All @@ -146,7 +147,7 @@ runGenesisKeyGenDelegateCmd
} = do
skey <- generateSigningKey AsGenesisDelegateKey
let vkey = getVerificationKey skey
firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
fromEitherIOCli @(FileError ()) $ do
void $
writeLazyByteStringFile signingKeyPath $
textEnvelopeToJSON (Just skeyDesc) skey
Expand Down Expand Up @@ -188,15 +189,15 @@ runGenesisKeyGenDelegateVRF vkeyPath skeyPath = do

runGenesisKeyGenUTxOCmd
:: GenesisKeyGenUTxOCmdArgs
-> ExceptT GenesisCmdError IO ()
-> CIO e ()
runGenesisKeyGenUTxOCmd
Cmd.GenesisKeyGenUTxOCmdArgs
{ Cmd.verificationKeyPath
, Cmd.signingKeyPath
} = do
skey <- generateSigningKey AsGenesisUTxOKey
let vkey = getVerificationKey skey
firstExceptT GenesisCmdGenesisFileError . newExceptT $ do
fromEitherIOCli @(FileError ()) $ do
void $
writeLazyByteStringFile signingKeyPath $
textEnvelopeToJSON (Just skeyDesc) skey
Expand Down Expand Up @@ -289,9 +290,8 @@ runGenesisCreateTestNetDataCmd
stakeDelegatorsDirs = [stakeDelegatorsDir </> "delegator" <> show i | i <- [1 .. numOfStakeDelegators]]

forM_ [1 .. numGenesisKeys] $ \index -> do
fromExceptTCli $ createGenesisKeys (genesisDir </> ("genesis" <> show index))
fromExceptTCli $
createDelegateKeys desiredKeyOutputFormat (delegateDir </> ("delegate" <> show index))
createGenesisKeys (genesisDir </> ("genesis" <> show index))
createDelegateKeys desiredKeyOutputFormat (delegateDir </> ("delegate" <> show index))

when (0 < numGenesisKeys) $ do
fromExceptTCli $ writeREADME genesisDir genesisREADME
Expand All @@ -303,7 +303,7 @@ runGenesisCreateTestNetDataCmd
| index <- [1 .. numUtxoKeys]
]
forM_ [1 .. numUtxoKeys] $ \index ->
fromExceptTCli $ createUtxoKeys (utxoKeysDir </> ("utxo" <> show index))
createUtxoKeys (utxoKeysDir </> ("utxo" <> show index))

fromExceptTCli $ when (0 < numUtxoKeys) $ writeREADME utxoKeysDir utxoKeysREADME

Expand Down Expand Up @@ -337,11 +337,9 @@ runGenesisCreateTestNetDataCmd
coldArgs = CC.GovernanceCommitteeKeyGenColdCmdArgs ConwayEraOnwardsConway vkeyColdFile skeyColdFile
liftIO $ createDirectoryIfMissing True committeeDir
void $
fromExceptTCli $
CC.runGovernanceCommitteeKeyGenHot hotArgs
CC.runGovernanceCommitteeKeyGenHot hotArgs
(vColdKey, _) <-
fromExceptTCli $
CC.runGovernanceCommitteeKeyGenCold coldArgs
CC.runGovernanceCommitteeKeyGenCold coldArgs
return vColdKey

fromExceptTCli $ when (0 < numCommitteeKeys) $ writeREADME committeesDir committeeREADME
Expand All @@ -350,7 +348,7 @@ runGenesisCreateTestNetDataCmd
-- that before Conway, the number of DReps at this point is 0.
g <- Random.getStdGen

dRepKeys <- fromExceptTCli $
dRepKeys <-
case dRepCredentialGenerationMode of
OnDisk -> forM [1 .. numOfDRepCredentials] $ \index -> do
let drepDir = drepsDir </> "drep" <> show index
Expand Down Expand Up @@ -643,7 +641,7 @@ mkPaths numKeys dir segment filename =
createDelegateKeys
:: Vary [FormatBech32, FormatTextEnvelope]
-> FilePath
-> ExceptT GenesisCmdError IO ()
-> CIO e ()
createDelegateKeys fmt dir = do
liftIO $ createDirectoryIfMissing True dir
runGenesisKeyGenDelegateCmd
Expand All @@ -652,10 +650,11 @@ createDelegateKeys fmt dir = do
, Cmd.signingKeyPath = onlyOut coldSK
, Cmd.opCertCounterPath = onlyOut opCertCtr
}
runGenesisKeyGenDelegateVRF
(File @(VerificationKey ()) $ dir </> "vrf.vkey")
(File @(SigningKey ()) $ dir </> "vrf.skey")
firstExceptT GenesisCmdNodeCmdError $ do
fromExceptTCli $
runGenesisKeyGenDelegateVRF
(File @(VerificationKey ()) $ dir </> "vrf.vkey")
(File @(SigningKey ()) $ dir </> "vrf.skey")
fromExceptTCli $ do
runNodeKeyGenKesCmd $
Cmd.NodeKeyGenKESCmdArgs
fmt
Expand All @@ -673,7 +672,7 @@ createDelegateKeys fmt dir = do
coldSK = File @(SigningKey ()) $ dir </> "key.skey"
opCertCtr = File $ dir </> "opcert.counter"

createGenesisKeys :: FilePath -> ExceptT GenesisCmdError IO ()
createGenesisKeys :: FilePath -> CIO e ()
createGenesisKeys dir = do
liftIO $ createDirectoryIfMissing True dir
runGenesisKeyGenGenesisCmd
Expand Down Expand Up @@ -703,7 +702,7 @@ createStakeDelegatorCredentials dir = do
stakingVK = File @(VerificationKey ()) $ dir </> "staking.vkey"
stakingSK = File @(SigningKey ()) $ dir </> "staking.skey"

createUtxoKeys :: FilePath -> ExceptT GenesisCmdError IO ()
createUtxoKeys :: FilePath -> CIO e ()
createUtxoKeys dir = do
liftIO $ createDirectoryIfMissing True dir
runGenesisKeyGenUTxOCmd
Expand Down
Loading
Loading