From 4158af8c863870a0e5d2bfe99a92a2beb4ea59cc Mon Sep 17 00:00:00 2001 From: Anitha Date: Thu, 7 Mar 2024 13:57:45 +0530 Subject: [PATCH 1/6] hedera: test cases added :krypc --- .../hederaDocumentStoreStatus.test.ts | 379 ++++++++++++++++++ .../documentHederaRevokedWithDocumentStore.ts | 71 ++++ .../documentHederaValidWithDocumentStore.ts | 54 ++- 3 files changed, 489 insertions(+), 15 deletions(-) create mode 100644 src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts create mode 100644 test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts diff --git a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts new file mode 100644 index 0000000..19aa88c --- /dev/null +++ b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts @@ -0,0 +1,379 @@ +import { v3, WrappedDocument } from "@tradetrust-tt/tradetrust"; +import { documentHederaRevokedWithDocumentStore } from "../../../../test/fixtures/v2/documentHederaRevokedWithDocumentStore"; +import { documentHederaValidWithDocumentStore as v2documentHederaValidWithDocumentStore } from "../../../../test/fixtures/v2/documentHederaValidWithDocumentStore"; +import { documentMixedIssuance } from "../../../../test/fixtures/v2/documentMixedIssuance"; +import { documentNotIssuedWithTokenRegistry } from "../../../../test/fixtures/v2/documentNotIssuedWithTokenRegistry"; +import { getProvider } from "../../../common/utils"; +import { openAttestationEthereumDocumentStoreStatus } from "./ethereumDocumentStoreStatus"; + +// v3 documents +import v3DidSignedRaw from "../../../../test/fixtures/v3/did-signed.json"; +import v3DocumentStoreIssuedRaw from "../../../../test/fixtures/v3/documentStore-issued.json"; +import v3DocumentStoreRevokedRaw from "../../../../test/fixtures/v3/documentStore-revoked.json"; +import v3DocumentStoreWrappedRaw from "../../../../test/fixtures/v3/documentStore-wrapped.json"; +import v3TokenRegistryIssuedRaw from "../../../../test/fixtures/v3/tokenRegistry-issued.json"; + +const v3DocumentStoreWrapped = v3DocumentStoreWrappedRaw as WrappedDocument; +const v3DocumentStoreIssued = v3DocumentStoreIssuedRaw as WrappedDocument; +const v3DidSigned = v3DidSignedRaw as WrappedDocument; +const v3TokenRegistryIssued = v3TokenRegistryIssuedRaw as WrappedDocument; +const v3DocumentStoreRevoked = v3DocumentStoreRevokedRaw as WrappedDocument; + +const options = { provider: getProvider({ network: "hederatestnet" }) }; + +describe("test", () => { + describe("v2", () => { + it("should return false when document does not have data", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test( + { ...v2documentHederaValidWithDocumentStore, data: null } as any, + options + ); + expect(shouldVerify).toBe(false); + }); + it("should return false when document does not have issuers", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test( + { + ...v2documentHederaValidWithDocumentStore, + data: { ...v2documentHederaValidWithDocumentStore.data, issuers: null }, + } as any, + options + ); + expect(shouldVerify).toBe(false); + }); + it("should return false when document uses token registry", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test( + documentNotIssuedWithTokenRegistry, + options + ); + expect(shouldVerify).toBe(false); + }); + it("should return true when document uses document store", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test( + documentHederaRevokedWithDocumentStore, + options + ); + expect(shouldVerify).toBe(true); + }); + }); + describe("v3", () => { + it("should return true for documents not yet issued via document store", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3DocumentStoreWrapped, options); + expect(shouldVerify).toBe(true); + }); + it("should return true for documents issued via document store", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3DocumentStoreIssued, options); + expect(shouldVerify).toBe(true); + }); + it("should return false for documents issued via token registry", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3TokenRegistryIssued, options); + expect(shouldVerify).toBe(false); + }); + it("should return false for documents issued via did signing", async () => { + const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3DidSigned, options); + expect(shouldVerify).toBe(false); + }); + }); +}); + +describe("verify", () => { + describe("v2", () => { + it("should return an invalid fragment when document store is invalid", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify( + { + ...documentHederaRevokedWithDocumentStore, + data: { + ...documentHederaRevokedWithDocumentStore.data, + issuers: [ + { + ...documentHederaRevokedWithDocumentStore.data.issuers[0], + documentStore: "0c837c55-4948-4a5a-9ed3-801889db9ce3:string:0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + }, + ], + }, + }, + options + ); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Array [ + Object { + "address": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "issued": false, + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Contract is not found", + }, + }, + ], + }, + "issuedOnAll": false, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Contract is not found", + }, + "status": "INVALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + it("should return an invalid fragment when document store does not exists", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify( + { + ...documentHederaRevokedWithDocumentStore, + data: { + ...documentHederaRevokedWithDocumentStore.data, + issuers: [ + { + ...documentHederaRevokedWithDocumentStore.data.issuers[0], + documentStore: "0c837c55-4948-4a5a-9ed3-801889db9ce3:string:0x0000000000000000000000000000000000000000", + }, + ], + }, + }, + options + ); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Array [ + Object { + "address": "0x0000000000000000000000000000000000000000", + "issued": false, + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Contract is not found", + }, + }, + ], + }, + "issuedOnAll": false, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Contract is not found", + }, + "status": "INVALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + + it("should return an invalid fragment when document with document store that has been revoked", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify( + documentHederaRevokedWithDocumentStore, + options + ); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Array [ + Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "issued": true, + }, + ], + "revocation": Array [ + Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "reason": Object { + "code": 5, + "codeString": "DOCUMENT_REVOKED", + "message": "Document 0xae0d37f3bbdda18b9c5ab98b4e18536901e14de9a0f92c36347a0abe6afdc4df has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + "revoked": true, + }, + ], + }, + "issuedOnAll": true, + "revokedOnAny": true, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 5, + "codeString": "DOCUMENT_REVOKED", + "message": "Document 0xae0d37f3bbdda18b9c5ab98b4e18536901e14de9a0f92c36347a0abe6afdc4df has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + "status": "INVALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + + it("should return a valid fragment when document with document store that has not been revoked", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify( + v2documentHederaValidWithDocumentStore, + options + ); + + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Array [ + Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "issued": true, + }, + ], + "revocation": Array [ + Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "revoked": false, + }, + ], + }, + "issuedOnAll": true, + "revokedOnAny": false, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "status": "VALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + + it("should return an invalid fragment when used with other issuance methods", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify(documentMixedIssuance, options); + + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": [Error: Document store address not found in issuer DEMO STORE], + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 7, + "codeString": "INVALID_ISSUERS", + "message": "Document store address not found in issuer DEMO STORE", + }, + "status": "ERROR", + "type": "DOCUMENT_STATUS", + } + `); + }); + }); + describe("v3", () => { + it("should return valid fragment for document issued correctly on a document store", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreIssued, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "issued": true, + }, + "revocation": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "revoked": false, + }, + }, + "issuedOnAll": true, + "revokedOnAny": false, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "status": "VALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + it("should return an invalid fragment for document not issued on a document store", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreWrapped, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "issued": false, + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Document 0x19988397c756599f8415200eaa2a413e5b60212d7d21dbc22bb365ae115c6b83 has not been issued under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + }, + "revocation": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "revoked": false, + }, + }, + "issuedOnAll": false, + "revokedOnAny": false, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 1, + "codeString": "DOCUMENT_NOT_ISSUED", + "message": "Document 0x19988397c756599f8415200eaa2a413e5b60212d7d21dbc22bb365ae115c6b83 has not been issued under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + "status": "INVALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + it("should return an invalid fragment for document issued but revoked on a document store", async () => { + const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreRevoked, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { + "details": Object { + "issuance": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "issued": true, + }, + "revocation": Object { + "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + "reason": Object { + "code": 5, + "codeString": "DOCUMENT_REVOKED", + "message": "Document 0x8e9f71e4526782631acd06d6d88cd1debf3be28375a5d122f03640ec71c1e981 has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + "revoked": true, + }, + }, + "issuedOnAll": true, + "revokedOnAny": true, + }, + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 5, + "codeString": "DOCUMENT_REVOKED", + "message": "Document 0x8e9f71e4526782631acd06d6d88cd1debf3be28375a5d122f03640ec71c1e981 has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", + }, + "status": "INVALID", + "type": "DOCUMENT_STATUS", + } + `); + }); + }); +}); + +describe("skip", () => { + it("should return a skip fragment", async () => { + const skipFragment = await openAttestationEthereumDocumentStoreStatus.skip( + openAttestationEthereumDocumentStoreStatus as any, + options + ); + expect(skipFragment).toMatchInlineSnapshot(` + Object { + "name": "OpenAttestationEthereumDocumentStoreStatus", + "reason": Object { + "code": 4, + "codeString": "SKIPPED", + "message": "Document issuers doesn't have \\"documentStore\\" or \\"certificateStore\\" property or DOCUMENT_STORE method", + }, + "status": "SKIPPED", + "type": "DOCUMENT_STATUS", + } + `); + }); +}); diff --git a/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts b/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts new file mode 100644 index 0000000..93224dc --- /dev/null +++ b/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts @@ -0,0 +1,71 @@ +import { SchemaId, v2, WrappedDocument } from "@tradetrust-tt/tradetrust"; + +interface CustomDocument extends v2.OpenAttestationDocument { + billTo: any; + network: { + chain: string; + chainId: string; + }; + consignment: any; + declaration: any; + certification: any; +} + +export const documentHederaRevokedWithDocumentStore: WrappedDocument = { + version: SchemaId.v2, + data: { + $template: { + name: "8f76e856-0695-4032-83f1-3e7a0e502b71:string:CERTIFICATE_OF_NON_MANIPULATION", + type: "9b10ec23-1ae4-401b-bc11-af9127f2dc4b:string:EMBEDDED_RENDERER", + url: "4d38de69-0622-4012-9316-38167b88f608:string:https://demo-cnm.openattestation.com", + }, + billTo: { + name: "2fdf99b6-06f0-4d3c-87f5-8f8dde803b96:string:XYZ" + }, + issuers: [ + { + name: "ed31c75d-c0e4-4541-945f-0d9323068e2c:string:Demo Issuer", + documentStore: "3804f213-cb9d-4e2c-9051-d125ff63024f:string:0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21", + identityProof: { + type: "55592302-01e2-483b-967e-bb4239f79e49:string:DNS-TXT", + location: "82d945d8-35ef-4556-86c2-609a98549bfd:string:trustlv.org", + }, + }, + ], + network: { + chain: "56221d22-bc28-4915-8a05-c3eb33724531:string:HBAR", + chainId: "b17571c7-c9c2-40af-b2d4-c14d8c7563c8:string:296", + }, + consignment: { + description: "9f6661db-6465-4533-975b-d3b2df0152c5:string:16667 RED WINE", + quantity: { + value: "58b2fa48-b186-40d6-b722-75fab3365367:string:1000", + unit: "a8608e66-8356-4afa-b6bb-910506059d5a:string:LITRES", + }, + countryOfOrigin: "c27d8e9d-b02c-47bf-87d5-740d0fc8a8e8:string:INDIA", + outwardBillNo: "e3a9c88e-0232-4884-8030-c3a3d206bc10:string:AQSIQ170923130", + dateOfDischarge: "477a597d-08d7-4b21-9e1b-c7af5c614661:string:2024-03-01", + dateOfDeparture: "22ecb19a-a148-432b-a21f-dd2abcab3b4e:string:2024-03-20", + countryOfFinalDestination: "bf10847d-ee86-4445-8c91-c149013bf5f5:string:SINGAPORE", + outgoingVehicleNo: "5708878e-9a66-4feb-9c8d-29e0ee936cfc:string:COSCO SING 074E/01-MAR", + }, + declaration: { + name: "f733bb67-7273-406d-a8d4-70b6fe8d6c43:string:JOHN", + designation: "0b4603f2-e2b7-4081-a303-296304748b82:string:SHIPPING MANAGER", + date: "9506b5f1-6f0e-4a06-9ae4-eb7e869beebe:string:2024-03-01", + }, + certification: { + name: "498463c7-2a70-45fa-bd50-5f2da3ec252c:string:DEMO JOHN TAN", + designation: "992d0be8-ed3d-4354-a0a1-d3360101ffb8:string:DEMO", + date: "8ae9b8f9-07c2-40a6-a711-220f82084f53:string:2024-03-01", + signature: + "57869919-e1e3-4549-9743-90ac71d7c453:string:data:image/png;base64,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", + }, + }, + signature: { + type: "SHA3MerkleProof", + targetHash: "ab9040f1dce119c447a5eae6d08ec264f588350e47015d6aa32c49eb3ccdf60b", + proof: ["e3f42315d32b7d23942f2c140eb00254f120fc8b772c3ab771e36a2c17b5d4a7"], + merkleRoot: "fcea61cfe337f52c50ea52b2d092cbbcfe395b3e1880de148720b5a3cdd1539b", + }, +}; diff --git a/test/fixtures/v2/documentHederaValidWithDocumentStore.ts b/test/fixtures/v2/documentHederaValidWithDocumentStore.ts index 804d12e..3244d9b 100644 --- a/test/fixtures/v2/documentHederaValidWithDocumentStore.ts +++ b/test/fixtures/v2/documentHederaValidWithDocumentStore.ts @@ -10,39 +10,63 @@ interface CustomDocument extends v2.OpenAttestationDocument { }; consignment: any; declaration: any; + certification: any; } export const documentHederaValidWithDocumentStore: WrappedDocument = { version: SchemaId.v2, data: { $template: { - name: "main", - type: "EMBEDDED_RENDERER", - url: "https://tutorial-renderer.openattestation.com", + name: "6bc6b7da-bf1d-4d54-a445-58c8534f622e:string:CERTIFICATE_OF_NON_MANIPULATION", + type: "ea285365-edda-458e-a5d9-581f8534b8a2:string:EMBEDDED_RENDERER", + url: "9fd7ef5f-24ee-44cb-b9ee-f1f0e5c558fb:string:https://demo-cnm.openattestation.com", }, recipient: { - name: "KrypC - Piruthivi", + name: "3af83dd0-b2b3-474f-b951-2e22b31d7aad:string:XYZ", address: { - street: "101 ORCHARD ROAD", - country: "SINGAPORE", + street: "f1ca022a-3f6b-4024-8d59-88816c5d7c87:string:42 BRIGADE ROAD", + country: "28b0ecca-e376-467a-b828-1b78627cd7d8:string:INDIA", }, }, issuers: [ { - name: "KrypC Issuer", - tokenRegistry: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A", + name: "f233558c-e011-446a-84bb-701b16010257:string:Demo Issuer", + documentStore: "d478a47d-d9d3-4879-82b8-3643b332c82d:string:0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21", identityProof: { - type: "DNS-TXT", - location: "trustlv.org", + type: "c0624592-af6c-436d-87a2-f4d02c277a60:string:DNS-TXT", + location: "5da286bd-6c42-4054-859e-e5661e78f306:string:trustlv.org", }, }, ], - consignment: {}, - declaration: {}, + consignment: { + description: "a371ecb9-e01f-4a57-bf00-b5704fba6fbc:string:16667 RED WINE", + quantity: { + value: "b45e8a3e-df98-4f5a-a2e0-5c780e57d648:string:1000", + unit: "21e2659e-a9a3-4d5f-95a9-32073c6e2d1d:string:LITRES", + }, + countryOfOrigin: "0a58ba84-e35f-498d-b6e5-45d3ee48b519:string:INDIA", + outwardBillNo: "d78a523f-0819-4faa-8816-836427b20905:string:AQSIQ170923130", + dateOfDischarge: "0c6b0ef9-9418-43fb-944d-f5060c6557f4:string:2024-03-01", + dateOfDeparture: "ecb4655f-2c38-4965-8816-bce9d657f69f:string:2024-03-20", + countryOfFinalDestination: "32c8a550-bc72-488b-adfe-2df38b821671:string:SINGAPORE", + outgoingVehicleNo: "66dfd2c9-0052-4cd3-9962-6f35c9600ec1:string:COSCO SING 074E/01-MAR", + }, + declaration: { + name: "0df36d67-fe76-436a-8cfd-3338a96e3b74:string:JOHN", + designation: "165d2b71-cca9-46f3-9d9e-dede1bbd6e42:string:SHIPPING MANAGER", + date: "1efca0d5-9792-4134-8e74-ec3e0c0ff292:string:2024-03-01", + }, + certification: { + name: "3a1d00f0-b519-4d16-a4ce-e101cf66f667:string:DEMO JOHN TAN", + designation: "cc543b1d-9a7d-4366-ad21-b4f31a9ce173:string:DEMO", + date: "48b90f5c-37d2-4ff1-800d-45b8160eddd7:string:2024-03-01", + signature: + "57069b0b-7261-484e-af49-d0daeeaeee5e:string:data:image/png;base64,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", + }, }, signature: { type: "SHA3MerkleProof", - targetHash: "1fdea9b542ec22f7d87f23d86f1cf3e526e2edec1b9baaa9aedff904efea78a9", - proof: [], - merkleRoot: "1fdea9b542ec22f7d87f23d86f1cf3e526e2edec1b9baaa9aedff904efea78a9", + targetHash: "f3488cf45a2d0cee14d28a115787daf1521fafadbf5617a1f04183ab90c8be71", + proof: ["c6d865ac5803a8d7cbaba58136d14c0b832de06af2e899829b1a73913e4dd9f3"], + merkleRoot: "139576d4803d4220368446c0f6f2803a702ccf8a93dd529596f17b96a647a524", }, }; From cb307d4739a491e63a4deabe98805bec4e4c8b4d Mon Sep 17 00:00:00 2001 From: Anitha Date: Mon, 11 Mar 2024 10:53:43 +0530 Subject: [PATCH 2/6] hedera: test cases added :krypc --- test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts b/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts index 93224dc..4a323d7 100644 --- a/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts +++ b/test/fixtures/v2/documentHederaRevokedWithDocumentStore.ts @@ -20,7 +20,7 @@ export const documentHederaRevokedWithDocumentStore: WrappedDocument Date: Mon, 11 Mar 2024 11:20:12 +0530 Subject: [PATCH 3/6] hedera: test cases added :krypc --- .../openAttestationDnsTxtForHedera.test.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/verifiers/issuerIdentity/dnsTxt/openAttestationDnsTxtForHedera.test.ts b/src/verifiers/issuerIdentity/dnsTxt/openAttestationDnsTxtForHedera.test.ts index 0527573..a402335 100644 --- a/src/verifiers/issuerIdentity/dnsTxt/openAttestationDnsTxtForHedera.test.ts +++ b/src/verifiers/issuerIdentity/dnsTxt/openAttestationDnsTxtForHedera.test.ts @@ -42,19 +42,19 @@ describe("verify", () => { it("should return a valid fragment when document has valid identity and uses document store", async () => { const fragment = await openAttestationDnsTxtIdentityProof.verify(documentHederaValidWithDocumentStore, options); expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { - "location": "trustlv.org", - "status": "VALID", - "value": "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A", - }, - ], - "name": "OpenAttestationDnsTxtIdentityProof", - "status": "VALID", - "type": "ISSUER_IDENTITY", - } - `); + Object { + "data": Array [ + Object { + "location": "trustlv.org", + "status": "VALID", + "value": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21", + }, + ], + "name": "OpenAttestationDnsTxtIdentityProof", + "status": "VALID", + "type": "ISSUER_IDENTITY", + } + `); }); }); }); From c189c2de4218c4df74e8395ee382eaa1afa7376a Mon Sep 17 00:00:00 2001 From: Anitha Date: Tue, 12 Mar 2024 10:54:09 +0530 Subject: [PATCH 4/6] hedera: test cases added :krypc --- .../documentStore/hederaDocumentStoreStatus.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts index 19aa88c..bc6b04c 100644 --- a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts +++ b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts @@ -12,6 +12,7 @@ import v3DocumentStoreIssuedRaw from "../../../../test/fixtures/v3/documentStore import v3DocumentStoreRevokedRaw from "../../../../test/fixtures/v3/documentStore-revoked.json"; import v3DocumentStoreWrappedRaw from "../../../../test/fixtures/v3/documentStore-wrapped.json"; import v3TokenRegistryIssuedRaw from "../../../../test/fixtures/v3/tokenRegistry-issued.json"; +import { VerifierOptions } from "../../../types/core"; const v3DocumentStoreWrapped = v3DocumentStoreWrappedRaw as WrappedDocument; const v3DocumentStoreIssued = v3DocumentStoreIssuedRaw as WrappedDocument; @@ -19,7 +20,7 @@ const v3DidSigned = v3DidSignedRaw as WrappedDocument; const v3DocumentStoreRevoked = v3DocumentStoreRevokedRaw as WrappedDocument; -const options = { provider: getProvider({ network: "hederatestnet" }) }; +const options = {} as VerifierOptions; describe("test", () => { describe("v2", () => { From 5c10943a73d368affc0b65b056205ae7f39685a6 Mon Sep 17 00:00:00 2001 From: Anitha Date: Tue, 12 Mar 2024 11:47:44 +0530 Subject: [PATCH 5/6] hedera: test cases added :krypc --- .../hederaDocumentStoreStatus.test.ts | 290 ------------------ 1 file changed, 290 deletions(-) diff --git a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts index bc6b04c..d8dc925 100644 --- a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts +++ b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts @@ -3,22 +3,17 @@ import { documentHederaRevokedWithDocumentStore } from "../../../../test/fixture import { documentHederaValidWithDocumentStore as v2documentHederaValidWithDocumentStore } from "../../../../test/fixtures/v2/documentHederaValidWithDocumentStore"; import { documentMixedIssuance } from "../../../../test/fixtures/v2/documentMixedIssuance"; import { documentNotIssuedWithTokenRegistry } from "../../../../test/fixtures/v2/documentNotIssuedWithTokenRegistry"; -import { getProvider } from "../../../common/utils"; import { openAttestationEthereumDocumentStoreStatus } from "./ethereumDocumentStoreStatus"; // v3 documents -import v3DidSignedRaw from "../../../../test/fixtures/v3/did-signed.json"; import v3DocumentStoreIssuedRaw from "../../../../test/fixtures/v3/documentStore-issued.json"; -import v3DocumentStoreRevokedRaw from "../../../../test/fixtures/v3/documentStore-revoked.json"; import v3DocumentStoreWrappedRaw from "../../../../test/fixtures/v3/documentStore-wrapped.json"; import v3TokenRegistryIssuedRaw from "../../../../test/fixtures/v3/tokenRegistry-issued.json"; import { VerifierOptions } from "../../../types/core"; const v3DocumentStoreWrapped = v3DocumentStoreWrappedRaw as WrappedDocument; const v3DocumentStoreIssued = v3DocumentStoreIssuedRaw as WrappedDocument; -const v3DidSigned = v3DidSignedRaw as WrappedDocument; const v3TokenRegistryIssued = v3TokenRegistryIssuedRaw as WrappedDocument; -const v3DocumentStoreRevoked = v3DocumentStoreRevokedRaw as WrappedDocument; const options = {} as VerifierOptions; @@ -69,181 +64,11 @@ describe("test", () => { const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3TokenRegistryIssued, options); expect(shouldVerify).toBe(false); }); - it("should return false for documents issued via did signing", async () => { - const shouldVerify = await openAttestationEthereumDocumentStoreStatus.test(v3DidSigned, options); - expect(shouldVerify).toBe(false); - }); }); }); describe("verify", () => { describe("v2", () => { - it("should return an invalid fragment when document store is invalid", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify( - { - ...documentHederaRevokedWithDocumentStore, - data: { - ...documentHederaRevokedWithDocumentStore.data, - issuers: [ - { - ...documentHederaRevokedWithDocumentStore.data.issuers[0], - documentStore: "0c837c55-4948-4a5a-9ed3-801889db9ce3:string:0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - ], - }, - }, - options - ); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Array [ - Object { - "address": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "issued": false, - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Contract is not found", - }, - }, - ], - }, - "issuedOnAll": false, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Contract is not found", - }, - "status": "INVALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - it("should return an invalid fragment when document store does not exists", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify( - { - ...documentHederaRevokedWithDocumentStore, - data: { - ...documentHederaRevokedWithDocumentStore.data, - issuers: [ - { - ...documentHederaRevokedWithDocumentStore.data.issuers[0], - documentStore: "0c837c55-4948-4a5a-9ed3-801889db9ce3:string:0x0000000000000000000000000000000000000000", - }, - ], - }, - }, - options - ); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Array [ - Object { - "address": "0x0000000000000000000000000000000000000000", - "issued": false, - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Contract is not found", - }, - }, - ], - }, - "issuedOnAll": false, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Contract is not found", - }, - "status": "INVALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - - it("should return an invalid fragment when document with document store that has been revoked", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify( - documentHederaRevokedWithDocumentStore, - options - ); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Array [ - Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "issued": true, - }, - ], - "revocation": Array [ - Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "reason": Object { - "code": 5, - "codeString": "DOCUMENT_REVOKED", - "message": "Document 0xae0d37f3bbdda18b9c5ab98b4e18536901e14de9a0f92c36347a0abe6afdc4df has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - "revoked": true, - }, - ], - }, - "issuedOnAll": true, - "revokedOnAny": true, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 5, - "codeString": "DOCUMENT_REVOKED", - "message": "Document 0xae0d37f3bbdda18b9c5ab98b4e18536901e14de9a0f92c36347a0abe6afdc4df has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - "status": "INVALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - - it("should return a valid fragment when document with document store that has not been revoked", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify( - v2documentHederaValidWithDocumentStore, - options - ); - - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Array [ - Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "issued": true, - }, - ], - "revocation": Array [ - Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "revoked": false, - }, - ], - }, - "issuedOnAll": true, - "revokedOnAny": false, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "status": "VALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - it("should return an invalid fragment when used with other issuance methods", async () => { const fragment = await openAttestationEthereumDocumentStoreStatus.verify(documentMixedIssuance, options); @@ -262,119 +87,4 @@ describe("verify", () => { `); }); }); - describe("v3", () => { - it("should return valid fragment for document issued correctly on a document store", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreIssued, options); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "issued": true, - }, - "revocation": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "revoked": false, - }, - }, - "issuedOnAll": true, - "revokedOnAny": false, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "status": "VALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - it("should return an invalid fragment for document not issued on a document store", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreWrapped, options); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "issued": false, - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Document 0x19988397c756599f8415200eaa2a413e5b60212d7d21dbc22bb365ae115c6b83 has not been issued under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - }, - "revocation": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "revoked": false, - }, - }, - "issuedOnAll": false, - "revokedOnAny": false, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 1, - "codeString": "DOCUMENT_NOT_ISSUED", - "message": "Document 0x19988397c756599f8415200eaa2a413e5b60212d7d21dbc22bb365ae115c6b83 has not been issued under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - "status": "INVALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - it("should return an invalid fragment for document issued but revoked on a document store", async () => { - const fragment = await openAttestationEthereumDocumentStoreStatus.verify(v3DocumentStoreRevoked, options); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Object { - "details": Object { - "issuance": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "issued": true, - }, - "revocation": Object { - "address": "0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - "reason": Object { - "code": 5, - "codeString": "DOCUMENT_REVOKED", - "message": "Document 0x8e9f71e4526782631acd06d6d88cd1debf3be28375a5d122f03640ec71c1e981 has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - "revoked": true, - }, - }, - "issuedOnAll": true, - "revokedOnAny": true, - }, - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 5, - "codeString": "DOCUMENT_REVOKED", - "message": "Document 0x8e9f71e4526782631acd06d6d88cd1debf3be28375a5d122f03640ec71c1e981 has been revoked under contract 0xe943C95f456DA8e17c6d1a915eCF1a6ef0a182a8", - }, - "status": "INVALID", - "type": "DOCUMENT_STATUS", - } - `); - }); - }); -}); - -describe("skip", () => { - it("should return a skip fragment", async () => { - const skipFragment = await openAttestationEthereumDocumentStoreStatus.skip( - openAttestationEthereumDocumentStoreStatus as any, - options - ); - expect(skipFragment).toMatchInlineSnapshot(` - Object { - "name": "OpenAttestationEthereumDocumentStoreStatus", - "reason": Object { - "code": 4, - "codeString": "SKIPPED", - "message": "Document issuers doesn't have \\"documentStore\\" or \\"certificateStore\\" property or DOCUMENT_STORE method", - }, - "status": "SKIPPED", - "type": "DOCUMENT_STATUS", - } - `); - }); }); From 08b2eed0552a904561de3c00f5941689ce3ffcf5 Mon Sep 17 00:00:00 2001 From: Anitha Date: Fri, 15 Mar 2024 19:59:45 +0530 Subject: [PATCH 6/6] feat: hedera test cases added :krypc --- .../documentStore/hederaDocumentStoreStatus.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts index d8dc925..7e550f3 100644 --- a/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts +++ b/src/verifiers/documentStatus/documentStore/hederaDocumentStoreStatus.test.ts @@ -16,7 +16,7 @@ const v3DocumentStoreIssued = v3DocumentStoreIssuedRaw as WrappedDocument; const options = {} as VerifierOptions; - +//hederatestnet describe("test", () => { describe("v2", () => { it("should return false when document does not have data", async () => {