Skip to content

Improve CatalystSignedDocumentValidationRule interface #800

@Mr-Leshiy

Description

@Mr-Leshiy

Summary

Modify the current CatalystSignedDocumentValidationRule::check interface to the following one

pub trait CatalystSignedDocumentValidationRule {
    /// Validates `CatalystSignedDocument`, properly fill the problem report if
    /// `CatalystSignedDocument` violates some validation rules.
    /// So `doc.report().is_problematic()` would return `false`.
    ///
    /// # Errors
    /// If `provider` returns error, fails fast throwing that error.
    fn check(
        &self,
        doc: &CatalystSignedDocument,
        provider: &dyn Provider,
    ) -> anyhow::Result<()>;
}

Such improvement would reduce implementation complexity and as a result maintainability, because by properly filling the document's problem report already solves the problem to identifying is the document valid or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    squad: gatekeepersCatalyst App Backend, System Development & Integration Team

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions