Summary
Implement a Rep Nomination specific validation according to the specification.
Details
- Add a new
RepNominationRule with the corresponding CatalystSignedDocumentValidationRule trait implementation.
- Add a constructor
pub async fn new<Provider>(
doc: &CatalystSignedDocument,
provider: &Provider,
) -> anyhow::Result<Self>
where
Provider: CatalystSignedDocumentProvider,
{
if doc.report().is_problematic() {
anyhow::bail!("Provided document is not valid {:?}", doc.report())
}
anyhow::ensure!(
doc.doc_type()? == &REP_NOMINATION,
"Document must be Contest Ballot type"
);
// perform the same set of validation as for the `CatalystSignedDocumentValidationRule`
...
}
- Add a corresponding test cases
Summary
Implement a
Rep Nominationspecific validation according to the specification.Details
RepNominationRulewith the correspondingCatalystSignedDocumentValidationRuletrait implementation.