Skip to content

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

vlopes11
Copy link
Contributor

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

  • Removal of signed docs attr rules category_id, election_id, campaign_id, brand_id
  • Add a centralized parameters signed docs attr rules

Screenshots

N/A

Related Pull Requests

N/A

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

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
@vlopes11 vlopes11 force-pushed the refactor/rust/signed_doc branch from 7039acf to 6c98077 Compare May 13, 2025 10:46
@vlopes11 vlopes11 changed the title refactor(rust/signed_doc): add parameters field refactor(rust/signed-doc): add parameters field May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

Test Report | ${\color{lightgreen}Pass: 320/320}$ | ${\color{red}Fail: 0/320}$ |

@Mr-Leshiy Mr-Leshiy force-pushed the refactor/rust/signed_doc branch from 341593f to 00b92fa Compare May 15, 2025 03:23
@Mr-Leshiy Mr-Leshiy added the review me PR is ready for review label May 15, 2025
@@ -1,180 +0,0 @@
//! `content-type` rule type impl.
Copy link
Collaborator

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?

Copy link
Contributor

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| {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catalyst Signed Docs parameters field.
4 participants