Skip to content

Commit

Permalink
Reupdate to match with API refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Jan 16, 2025
1 parent 295040a commit b33d89f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ carryHashChecksWrapper
carryHashChecksWrapper checkHash anchor checkType =
firstExceptT (GovernanceActionsHashCheckError checkType) $
carryHashChecks
(validateGovActionAnchorData CIP108)
(validateGovActionAnchorData BaseGovActionMetadata)
( PotentiallyCheckedAnchor
{ pcaMustCheck = checkHash
, pcaAnchor = anchor
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ runGovernanceDRepRegistrationCertificateCmd

mapM_
( withExceptT RegistrationDRepHashCheckError
. carryHashChecks (validateGovActionAnchorData CIP119)
. carryHashChecks (validateGovActionAnchorData DrepRegistrationMetadata)
)
mAnchor

Expand Down Expand Up @@ -167,7 +167,7 @@ runGovernanceDRepUpdateCertificateCmd
conwayEraOnwardsConstraints w $ do
mapM_
( withExceptT GovernanceDRepHashCheckError
. carryHashChecks (validateGovActionAnchorData CIP119)
. carryHashChecks (validateGovActionAnchorData DrepRegistrationMetadata)
)
mAnchor
drepCredential <- modifyError GovernanceCmdKeyReadError $ readDRepCredential drepHashSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ runGovernanceVoteCreateCmd

mapM_
( withExceptT GovernanceVoteCmdResignationCertHashCheckError
. carryHashChecks (validateGovActionAnchorData CIP108)
. carryHashChecks (validateGovActionAnchorData BaseGovActionMetadata)
)
mAnchor'

Expand Down
8 changes: 4 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Transaction/HashCheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ checkCertificateHashes cert = do
(return mempty)
( checkAnchorMetadataHash
( if isDRepRegOrUpdateCert cert
then validateGovActionAnchorData Shelley.CIP119
then validateGovActionAnchorData Shelley.DrepRegistrationMetadata
else const $ return ()
)
)
Expand All @@ -57,7 +57,7 @@ checkVotingProcedureHashes eon (Shelley.VotingProcedures (L.VotingProcedures vot
forM_
voterMap
( mapM $ \(L.VotingProcedure _ mAnchor) ->
forM_ mAnchor $ checkAnchorMetadataHash $ validateGovActionAnchorData Shelley.CIP108
forM_ mAnchor $ checkAnchorMetadataHash $ validateGovActionAnchorData Shelley.BaseGovActionMetadata
)

-- | Find references to anchor data in proposals and check the hashes are valid
Expand All @@ -74,10 +74,10 @@ checkProposalHashes
)
) =
Shelley.shelleyBasedEraConstraints eon $ do
checkAnchorMetadataHash (validateGovActionAnchorData Shelley.CIP108) anchor
checkAnchorMetadataHash (validateGovActionAnchorData Shelley.BaseGovActionMetadata) anchor
maybe
(return ())
(checkAnchorMetadataHash $ validateGovActionAnchorData Shelley.CIP108)
(checkAnchorMetadataHash $ validateGovActionAnchorData Shelley.BaseGovActionMetadata)
(getAnchorDataFromGovernanceAction govAction)

-- Only the `NewConstitution` governance action contains a checkable hash with a corresponding URL.

0 comments on commit b33d89f

Please sign in to comment.