-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rust/signed-doc): Add chain
field metadata validation rule
#573
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
base: main
Are you sure you want to change the base?
Conversation
✅ Test Report | |
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.
Dont forget to also implement ChainRule::new
method for initialisation of the ChainRule
from the DocSpecs
} | ||
} | ||
|
||
if doc.report().is_problematic() { |
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.
No no no, we cannot rely on the CatalystSignedDoc
internal report
status as a success of this validation rule or not, because it could be the case that some other validation rule wasn't successful and so this one become returning false automatically, even if its ok.
// chain doc must not be negative | ||
if chained_height < 0 { | ||
doc.report().functional_validation( | ||
"The height of the document being chained to must not be negative", |
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.
"The height of the document being chained to must not be negative", | |
"The height of the document being chained to must be positive number", |
} | ||
|
||
// have parameters match. | ||
if chained_doc.doc_meta().parameters() != doc.doc_meta().parameters() { |
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.
Let's move this validation logic as a part of the parameters
validation rule. Look how used and performed link_check
.
Description
Thanks for contributing to the project!
Please fill out this template to help us review your changes.
Related Issue(s)
Closes #539
Please confirm the following checks