diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs index e5b93d1d76..ff01ddcf0e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs @@ -68,7 +68,7 @@ data GovernanceActionCreateConstitutionCmdArgs era , proposalUrl :: !ProposalUrl , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , constitutionUrl :: !ConstitutionUrl - , constitutionHashSource :: !ConstitutionHashSource + , constitutionHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , outFile :: !(File () Out) } deriving Show diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs index 55de5b44d0..19487f995f 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs @@ -875,31 +875,14 @@ catCommands = \case pConstitutionUrl :: Parser ConstitutionUrl pConstitutionUrl = ConstitutionUrl - <$> pUrl "constitution-anchor-url" "Constitution anchor URL." - -pConstitutionHashSource :: Parser ConstitutionHashSource -pConstitutionHashSource = - asum - [ ConstitutionHashSourceText - <$> Opt.strOption - ( mconcat - [ Opt.long "constitution-anchor-metadata" - , Opt.metavar "TEXT" - , Opt.help "Constitution anchor contents as UTF-8 encoded text." - ] - ) - , ConstitutionHashSourceFile - <$> pFileInDirection "constitution-anchor-metadata-file" "Constitution anchor contents as a text file." - , ConstitutionHashSourceHash - <$> pConstitutionHash - ] + <$> pUrl "constitution-url" "Constitution URL." pConstitutionHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData) pConstitutionHash = Opt.option readSafeHash $ mconcat - [ Opt.long "constitution-anchor-metadata-hash" + [ Opt.long "constitution-hash" , Opt.metavar "HASH" - , Opt.help "Hash of the constitution anchor data." + , Opt.help "Hash of the constitution data (obtain it with \"cardano-cli conway governance hash ...\")." ] pUrl :: String -> String -> Parser Ledger.Url diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs index e67f2a126d..b4a7453a73 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -93,7 +93,7 @@ pGovernanceActionNewConstitutionCmd era = do <*> pAnchorUrl <*> pAnchorDataHash <*> pConstitutionUrl - <*> pConstitutionHashSource + <*> pConstitutionHash <*> pFileOutDirection "out-file" "Output filepath of the constitution." ) $ Opt.progDesc "Create a constitution." diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs index 7ac56b078b..ea6895e9c6 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -146,7 +146,7 @@ runGovernanceActionCreateConstitutionCmd , Cmd.proposalUrl , Cmd.proposalHash , Cmd.constitutionUrl - , Cmd.constitutionHashSource + , Cmd.constitutionHash , Cmd.outFile } = do @@ -157,10 +157,6 @@ runGovernanceActionCreateConstitutionCmd , Ledger.anchorDataHash = proposalHash } - constitutionHash <- - constitutionHashSourceToHash constitutionHashSource - & firstExceptT GovernanceActionsCmdConstitutionError - let prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovernanceActionId constitutionAnchor = Ledger.Anchor { Ledger.anchorUrl = unConstitutionUrl constitutionUrl