-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add JSON schema checking functionality for validating gov action metadata #713
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
palas
requested review from
dcoutts,
Jimbo4350,
erikd,
newhoggy,
carbolymer and
smelc
as code owners
December 20, 2024 15:11
palas
requested review from
kevinhammond,
CarlosLopezDeLara and
disassembler
as code owners
December 20, 2024 15:11
palas
force-pushed
the
gov-action-schema-checking
branch
2 times, most recently
from
December 20, 2024 15:34
4c6424e
to
4168561
Compare
But the CIPs 0119 and 0108 are in proposed state. Shouldn't we wait till they get accepted? |
cardano-api/internal/Cardano/Api/Governance/Metadata/DrepRegistration.hs
Fixed
Show fixed
Hide fixed
palas
force-pushed
the
gov-action-schema-checking
branch
4 times, most recently
from
January 13, 2025 14:36
a447f80
to
504575e
Compare
Jimbo4350
reviewed
Jan 13, 2025
Jimbo4350
reviewed
Jan 13, 2025
cardano-api/test/cardano-api-test/Test/Cardano/Api/GovAnchorValidation.hs
Show resolved
Hide resolved
Jimbo4350
approved these changes
Jan 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can you clean up the commit history and add links to the CIPs at the top of the modules?
Jimbo4350
reviewed
Jan 13, 2025
palas
force-pushed
the
gov-action-schema-checking
branch
2 times, most recently
from
January 14, 2025 15:40
9ddff13
to
dade8b3
Compare
palas
changed the title
Add JSON schema checking functionality for DRep and Gov action metadata
Add JSON schema checking functionality for validating gov action metadata
Jan 14, 2025
palas
force-pushed
the
gov-action-schema-checking
branch
from
January 14, 2025 15:46
dade8b3
to
2922689
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Context
The objective is addressing this issue: IntersectMBO/cardano-cli#906
This PR adds 3 functions to the API that should be the only ones needed by the
cardano-cli
in order to implement this functionality:isDRepRegOrUpdateCert
- Checks whether a certificate is for DRep registration or DRep update.validateDRepAnchorData
- Checks whether aByteString
is valid JSON and conforms to CIP-0119.validateGovActionAnchorData
- Checks whether aByteString
is valid JSON and conforms to CIP-0108This PR is a requirement from PR #995 that implements the checking in
cardano-cli
and is based of the version ofcardano-api
in this PR.Related PRs in
CIPs
repo:@
beforetype
field nameCIP-0008
is in capital lettersHow to trust this PR
Tests should give some assurance. They are taken from the CIPs repo, with some adaptations that I have already created PRs in
CIPs
repo for (see above).The main thing to check here is the accuracy of the checks (are they enough, are they too much, are they right).
Could be useful to check the
cardano-cli
PR together with this one.Checklist