diff --git a/cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs b/cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs index 1a37290361..06e2d82cd8 100644 --- a/cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs +++ b/cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs @@ -234,7 +234,7 @@ createAnchor :: Url -> ByteString -> Anchor StandardCrypto createAnchor url anchorData = Ledger.Anchor { anchorUrl = url - , anchorDataHash = unsafeBytesToSafeHash anchorData + , anchorDataHash = hashAnchorData $ Ledger.AnchorData anchorData } -- ---------------------------------------------------------------------------- @@ -249,14 +249,4 @@ fromCommitteeMember = (. coerceKeyRole) $ \case L.KeyHashObj keyhash -> StakeKeyHash keyhash L.ScriptHashObj _scripthash -> error "TODO script committee members not yet supported" --- | TODO: I'm very unsure whether it's correct to use 'unsafeMakeSafeHash' --- here? I've asked Alexey if maybe this doesn't need to actually be a --- 'SafeHash', which would let us remove it. -unsafeBytesToSafeHash - :: Crypto.HashAlgorithm (HASH c) - => ByteString - -> SafeHash c a -unsafeBytesToSafeHash bs = case Crypto.hashFromBytes bs of - Nothing -> - error "unsafeBytesToSafeHash: input data is not a valid hash" - Just h -> unsafeMakeSafeHash h +