-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add revocation store fragment #94
base: master
Are you sure you want to change the base?
Conversation
| UNEXPECTED_ERROR = 0, | ||
| DOCUMENT_REVOKED = 1, | ||
| CONTRACT_ADDRESS_INVALID = 2, | ||
| ETHERS_UNHANDLED_ERROR = 3, |
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.
What does this mean?
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.
iirc there are some ethers error correctly handled some not, this is in the case it's an unknown error from ethers
| DOCUMENT_REVOKED = 1, | ||
| CONTRACT_ADDRESS_INVALID = 2, | ||
| ETHERS_UNHANDLED_ERROR = 3, | ||
| SKIPPED = 4, |
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 is skipped in the revocation code?
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 not ? I dont understand ?
| }, | ||
| ]); | ||
| }); | ||
| it("should return a invalid fragment when revocation store is used and the document is not revoked", async () => { |
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.
| it("should return a invalid fragment when revocation store is used and the document is not revoked", async () => { | |
| it("should return a invalid fragment when revocation store is used and the document is revoked", async () => { |
| code: 1, | ||
| codeString: "DOCUMENT_REVOKED", | ||
| message: | ||
| "Certificate 0x856924fa2cf3374bf64697eb0dcf38d0251ff18aedae2bbc193398e8bb11fbd1 has been revoked under contract 0x8Fc57204c35fb9317D91285eF52D6b892EC08cD3", |
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.
| "Certificate 0x856924fa2cf3374bf64697eb0dcf38d0251ff18aedae2bbc193398e8bb11fbd1 has been revoked under contract 0x8Fc57204c35fb9317D91285eF52D6b892EC08cD3", | |
| "Document 0x856924fa2cf3374bf64697eb0dcf38d0251ff18aedae2bbc193398e8bb11fbd1 has been revoked under contract 0x8Fc57204c35fb9317D91285eF52D6b892EC08cD3", |
Can we change reference of certificate to document
| const type: VerificationFragmentType = "DOCUMENT_STATUS"; | ||
| export const openAttestationRevocationStore: Verifier<WrappedDocument<v2.OpenAttestationDocument>> = { | ||
| skip: () => { | ||
| return Promise.resolve({ |
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.
wont this resolve be redundant? or can just add async to the function
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.
could, just coding style :p (both are equivalent)
| test: (document) => { | ||
| if (utils.isWrappedV2Document(document)) { | ||
| const documentData = getData(document); | ||
| return documentData.issuers.every((issuer) => "revocationStore" in issuer); |
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.
Shouldnt this be any? Any failure should fail it?
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.
hum indeed used .some everywhere but for revoke 🤔
will change both 🙈
depends on Open-Attestation/open-attestation#108