-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(rust/signed-doc): add parameters field #317
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
This commit replaces the ad-hoc attributes (category_id, election_id, campaign_id, brand_id) for a single `parameters` field, that is expected to hold document-specific validation rules. It is in accordance to the architecture specs https://input-output-hk.github.io/catalyst-libs/architecture/08_concepts/signed_doc/spec/ Closes #307
7039acf
to
6c98077
Compare
✅ Test Report | |
341593f
to
00b92fa
Compare
@@ -1,180 +0,0 @@ | |||
//! `content-type` rule type impl. |
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.
Why have we eliminated this document type?
Its a valid document type and we would have to just reintroduce it later?
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, we have not removed the category document type.
Here what you are looking into is an old category_id
field validation rule.
Which becomes a parameters
validation rule inside its own mod.
error_report.duplicate_field( | ||
) | ||
}) | ||
.fold((None, 0_u32), |(res, count), v| { |
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.
Nitpick -> #327
Couldn't make a classic gh suggestion, because the code spans deleted lines.
Description
This commit replaces the ad-hoc attributes (category_id, election_id, campaign_id, brand_id) for a single
parameters
field, that is expected to hold document-specific validation rules.It is in accordance to the architecture specs
https://input-output-hk.github.io/catalyst-libs/architecture/08_concepts/signed_doc/spec/
Related Issue(s)
Closes #307
Description of Changes
Ad-hoc rules are anti-pattern and they must be document-specific instead of enforced by static definitions.
Breaking Changes
Screenshots
N/A
Related Pull Requests
N/A
Please confirm the following checks