Skip to content

Commit

Permalink
Use hashDrepMetadata from cardano-api
Browse files Browse the repository at this point in the history
The simplified hashDRepMetadata no longer checks for the size of the DRep metadata, instead it only return the hash of the file given by the user.

Remove no longer needed errors.
  • Loading branch information
CarlosLopezDeLara committed Jul 4, 2024
1 parent 63d53ac commit 26540e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 1 addition & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ runGovernanceDRepMetadataHashCmd
, mOutFile
} = do
metadataBytes <- firstExceptT ReadFileError $ newExceptT (readByteStringFile metadataFile)
(_metadata, metadataHash) <-
firstExceptT GovernanceCmdDRepMetadataValidationError
. hoistEither
$ validateAndHashDRepMetadata metadataBytes
let (_metadata, metadataHash) = hashDRepMetadata metadataBytes
firstExceptT WriteFileError
. newExceptT
. writeByteStringOutput mOutFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ data GovernanceCmdError
| GovernanceCmdDecoderError !DecoderError
| GovernanceCmdVerifyPollError !GovernancePollError
| GovernanceCmdWriteFileError !(FileError ())
| GovernanceCmdDRepMetadataValidationError !DRepMetadataValidationError
-- Legacy - remove me after cardano-cli transitions to new era based structure
| GovernanceCmdMIRCertNotSupportedInConway
| GovernanceCmdGenesisDelegationNotSupportedInConway
Expand Down Expand Up @@ -108,8 +107,6 @@ instance Error GovernanceCmdError where
pretty $ renderGovernancePollError pollError
GovernanceCmdWriteFileError fileError ->
"Cannot write file: " <> prettyError fileError
GovernanceCmdDRepMetadataValidationError e ->
"DRep metadata validation error: " <> prettyError e
GovernanceCmdMIRCertNotSupportedInConway ->
"MIR certificates are not supported in Conway era onwards."
GovernanceCmdGenesisDelegationNotSupportedInConway ->
Expand Down

0 comments on commit 26540e5

Please sign in to comment.