Skip to content

Commit 697c97c

Browse files
rongquan1claude
andauthored
chore: add OpenAttestation v2 + W3C VC verification e2e suites (#71)
Adds read-only verification e2e coverage (no MetaMask) for issuer identity, document status, and document integrity across OA v2 (DNS-TXT document store / token registry, DNS-DID, OCSP, revocation store) and W3C VCs (ecdsa-sd-2023, bbs-2023, BitstringStatusList, TransferableRecords), with happy + error cases. - Local Hardhat fixtures + setup scripts (separate document-store deployer; token-registry mints) and DNS/OCSP route mocks - Dedicated Playwright config + GitHub Actions workflow (kept separate from the existing transferable-record e2e suite) - App: skip network-select for OCSP/DID-signed docs, use embedded chainId, clean error classification, and surface W3C TransferableRecords reasons verbatim in the error card; renderer test ids - package.json e2e:verify script; trustvc ^2.14.1 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d7e7214 commit 697c97c

42 files changed

Lines changed: 2115 additions & 243 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e-verify.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: E2E Verification Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
workflow_dispatch:
7+
8+
# Read-only document verification suite (OA + W3C VC). No MetaMask, runs headless.
9+
jobs:
10+
e2e-verify:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Install Playwright browsers
28+
run: npx playwright install chromium --with-deps
29+
30+
# ── Local chain + contracts ──────────────────────────────────────────
31+
- name: Start Hardhat node
32+
run: npx hardhat node &
33+
env:
34+
NODE_OPTIONS: --max-old-space-size=4096
35+
36+
- name: Wait for Hardhat node
37+
run: npx wait-on http://127.0.0.1:8545 --timeout 180000
38+
39+
# Token registry (token-registry fixtures) + document store (doc-store fixtures)
40+
- name: Deploy contracts and mint tokens
41+
run: node e2e/setup-contracts.cjs
42+
43+
- name: Deploy document store
44+
run: node e2e/setup-document-store.cjs
45+
46+
# ── Dev server ───────────────────────────────────────────────────────
47+
- name: Start dev server
48+
run: npm run dev &
49+
env:
50+
VITE_APP_NETWORK: local
51+
VITE_NETWORK_TYPE: testnet
52+
VITE_RPC_URL_1337: http://127.0.0.1:8545
53+
54+
- name: Wait for dev server
55+
run: npx wait-on http://localhost:5173 --timeout 180000
56+
57+
# ── Verification tests (headless, no MetaMask) ───────────────────────
58+
- name: Run verification E2E tests
59+
run: npm run e2e:verify
60+
env:
61+
CI: 'true'
62+
63+
- name: Upload Playwright report
64+
if: always()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: playwright-report-verify
68+
path: playwright-report-verify/
69+
retention-days: 7
70+
71+
- name: Upload screenshots on failure
72+
if: failure()
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: verify-test-results
76+
path: test-results/
77+
retention-days: 7
78+
if-no-files-found: ignore

.github/workflows/e2e.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: E2E Tests
22

33
on:
4-
push:
5-
branches: [main, develop]
64
pull_request:
75
branches: [main, develop]
86
workflow_dispatch: # allow manual trigger
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "1b342155-ae58-460d-8f41-8dea520a2126:string:EMBEDDED_RENDERER",
6+
"name": "0c7723fd-b370-4e05-951c-fd79a4bce3a6:string:CHAFTA_COO",
7+
"url": "c642e700-25af-48d2-a84a-316d3a866489:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "08c78bbc-2bc4-4ba3-a2a3-b1818613a639:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "4ff2f582-363b-463f-a3a3-bceb62124600:string:My Test Issuer",
13+
"revocation": {
14+
"type": "9fa71f1e-58fe-490f-ba97-27cb1edacb0a:string:NONE"
15+
},
16+
"identityProof": {
17+
"type": "903996ec-0287-452b-8695-03413955f1ea:string:DNS-DID",
18+
"location": "5e5a824c-2167-4964-a7ff-2fc959e0274f:string:demo-invalid-identity.tradetrust.io",
19+
"key": "638f054c-b2bc-4f90-991b-f9ff854bff89:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
20+
}
21+
}
22+
],
23+
"recipient": {
24+
"name": "d2e13886-5e36-4f72-8e93-ca75c3fe6958:string:TrustVC E2E Test"
25+
}
26+
},
27+
"signature": {
28+
"type": "SHA3MerkleProof",
29+
"targetHash": "87ba72e7e1047c1e3b177ade8f8066f9c20ad1a67922ab13127cc7d6c6cbb4e2",
30+
"proof": [],
31+
"merkleRoot": "87ba72e7e1047c1e3b177ade8f8066f9c20ad1a67922ab13127cc7d6c6cbb4e2"
32+
},
33+
"proof": [
34+
{
35+
"type": "OpenAttestationSignature2018",
36+
"created": "2026-06-10T07:20:50.260Z",
37+
"proofPurpose": "assertionMethod",
38+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
39+
"signature": "0xda86a67b0217bb162d2d1f8003b42231c89df3b924c8aab410cee9089516321826aeff00d516f3024af96f87bd30361f111b85e0b8b62537e01ba2a1225c5f2e1c"
40+
}
41+
]
42+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "8b65fbfd-95fe-43da-83ea-166651b0d42e:string:EMBEDDED_RENDERER",
6+
"name": "11390281-0707-416f-8dff-9bf2affc0502:string:CHAFTA_COO",
7+
"url": "215657ae-6c5a-4486-8348-36876ee6048a:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "35b4a5e9-43a9-4726-9110-8bd5dc1a1bcb:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "d045c76b-c85b-4d30-b700-1e319016973d:string:My Test Issuer",
13+
"revocation": {
14+
"type": "2d5e29c4-1708-4363-9975-254988772f0a:string:OCSP_RESPONDER",
15+
"location": "7f65a7a9-aa58-4fcf-9258-96e03317b892:string:https://ocsp.example.com"
16+
},
17+
"identityProof": {
18+
"type": "a83ea305-ab4e-4a14-9e90-f85f74b1ab54:string:DNS-DID",
19+
"location": "980fdfcd-323e-4285-81a5-a2325dc1e061:string:example.tradetrust.io",
20+
"key": "06855d31-09d6-455a-8675-e61a773a1ccd:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
21+
}
22+
}
23+
],
24+
"recipient": {
25+
"name": "74539e12-f986-4f44-b4ab-f9a8b066fdb7:string:TrustVC E2E Test"
26+
}
27+
},
28+
"signature": {
29+
"type": "SHA3MerkleProof",
30+
"targetHash": "b2c5fb52c6f2a85638c0ebf488fab92453e22e5728a5ea0e3d8d5076f39279b4",
31+
"proof": [],
32+
"merkleRoot": "b2c5fb52c6f2a85638c0ebf488fab92453e22e5728a5ea0e3d8d5076f39279b4"
33+
},
34+
"proof": [
35+
{
36+
"type": "OpenAttestationSignature2018",
37+
"created": "2026-06-10T07:21:02.257Z",
38+
"proofPurpose": "assertionMethod",
39+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
40+
"signature": "0x41d751c6da151a8d215b957a09d112cf7afa686559695cdeb9e10b4efaceb153619be2ffc2dcd4f6a7665478d74a21ae254198b57fc10d6d2877557e9f4707c91b"
41+
}
42+
]
43+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "24b31182-8fc5-42b5-bd3a-682406a275bd:string:EMBEDDED_RENDERER",
6+
"name": "aae74ca8-98ea-4350-91cb-b22422bd9c88:string:CHAFTA_COO",
7+
"url": "52e15512-769e-4aa0-a237-28cc8fedfbe1:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "2a8696cf-5fac-470b-b060-d4abe482c996:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "a84fbd45-0dec-4f4c-a81f-58b363609ecd:string:X",
13+
"revocation": {
14+
"type": "36ae7a9f-c426-409c-9932-447e6ae15e36:string:REVOCATION_STORE",
15+
"location": "7cd4e446-bd9c-47f0-8ce7-b01a29d027d0:string:0x000000000000000000000000000000000000bEEF"
16+
},
17+
"identityProof": {
18+
"type": "74616d86-0f3b-4db1-b84c-e0ee60ecfffe:string:DNS-DID",
19+
"location": "eeae5cd8-f674-489c-a117-ad89b5c64c84:string:example.tradetrust.io",
20+
"key": "bbf3c814-3a34-4779-becb-888adbf507bd:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
21+
}
22+
}
23+
],
24+
"network": {
25+
"chain": "964da269-6bd6-4417-9b87-35838851e5e5:string:ETH",
26+
"chainId": "6af3d1a2-ce8f-4dcb-8f85-a45e58a0891a:string:1337"
27+
},
28+
"recipient": {
29+
"name": "2429d6b5-09a4-41a2-b07a-3c9800d051f2:string:x"
30+
}
31+
},
32+
"signature": {
33+
"type": "SHA3MerkleProof",
34+
"targetHash": "88b79390bcb1386a5beae170c39c68ce6b8112459e41c60829289169507b4c23",
35+
"proof": [],
36+
"merkleRoot": "88b79390bcb1386a5beae170c39c68ce6b8112459e41c60829289169507b4c23"
37+
},
38+
"proof": [
39+
{
40+
"type": "OpenAttestationSignature2018",
41+
"created": "2026-06-15T09:17:59.589Z",
42+
"proofPurpose": "assertionMethod",
43+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
44+
"signature": "0x795fab7fa9090837ad0eced7c5854bd90a91f8bfe999c90d4fee287c1861766931e44e6042017c4bc7c1dc09617affc06b0921dceb3db4402292f8ae3dc81a1f1b"
45+
}
46+
]
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "ce7bdb69-539e-428c-8528-d6ad178dbc51:string:EMBEDDED_RENDERER",
6+
"name": "6d3a8381-f4ba-4be9-8c36-fa175cf67e21:string:CHAFTA_COO",
7+
"url": "86779cea-34d0-4d91-ae3a-ed2c9240ef86:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "cfe068a5-ee6c-4611-9827-d94ba8a1f43a:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "ae235687-1dec-4f7d-b305-bf02b12ab6b4:string:X",
13+
"revocation": {
14+
"type": "51756339-e828-4d18-8104-cc7f683ea070:string:REVOCATION_STORE",
15+
"location": "60a92a70-2dea-494c-ae03-30209af13611:string:0x057ef64E23666F000b34aE31332854aCBd1c8544"
16+
},
17+
"identityProof": {
18+
"type": "3605b23e-12d9-4962-a71d-4963b68b152a:string:DNS-DID",
19+
"location": "117c957e-1d1f-4d96-a19b-d97bfc510952:string:example.tradetrust.io",
20+
"key": "385ce41f-7300-4c2a-ab77-d2330b947714:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
21+
}
22+
}
23+
],
24+
"network": {
25+
"chain": "ebf5a03e-999d-4af5-ae34-1f08abbcf57d:string:ETH",
26+
"chainId": "13dfc1be-dc7a-44eb-a13d-85356e4a4160:string:1337"
27+
},
28+
"recipient": {
29+
"name": "35cda349-7e04-497a-a0da-059d40e06198:string:REVSTORE-NOT-REVOKED"
30+
}
31+
},
32+
"signature": {
33+
"type": "SHA3MerkleProof",
34+
"targetHash": "ebf9daa3ba4bb4c497a30e765e63fa37d2c234eedd9a30c23b1d84763f39e046",
35+
"proof": [],
36+
"merkleRoot": "ebf9daa3ba4bb4c497a30e765e63fa37d2c234eedd9a30c23b1d84763f39e046"
37+
},
38+
"proof": [
39+
{
40+
"type": "OpenAttestationSignature2018",
41+
"created": "2026-06-15T08:46:03.121Z",
42+
"proofPurpose": "assertionMethod",
43+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
44+
"signature": "0x593dee6b3cbbc29113c838b76e40b2dcbe2891c6f8f3b70c8dc3f76771c558597ff9916a54d731af9f3d68120678ea952ee86a8fc623e757b1279ba0690a5d801b"
45+
}
46+
]
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "00163bbe-aca5-4bcb-b8c9-38f5b0ca30f2:string:EMBEDDED_RENDERER",
6+
"name": "6628b470-fd0e-4671-b0d7-75e3b26021e8:string:CHAFTA_COO",
7+
"url": "58d993f1-7cd9-46dc-9fa7-dfd693e578d4:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "4493dbcd-4631-4840-84d9-ba309a6785ff:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "488158b6-9e24-4a3e-ba1b-1819c641c2f6:string:X",
13+
"revocation": {
14+
"type": "99bf29b8-8fa3-4b32-b446-fe49868086ad:string:REVOCATION_STORE",
15+
"location": "f42022c2-12f5-4e13-8f04-885cb7d78e43:string:0x057ef64E23666F000b34aE31332854aCBd1c8544"
16+
},
17+
"identityProof": {
18+
"type": "9b6163a7-8449-4228-a247-4a8b659dff18:string:DNS-DID",
19+
"location": "34cdf779-3daf-469b-a18a-b83ba847f057:string:example.tradetrust.io",
20+
"key": "ee0e0350-b723-4de4-be6c-5b35516daa07:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
21+
}
22+
}
23+
],
24+
"network": {
25+
"chain": "8ecf5849-a5e6-4ceb-abad-b4e1f4ad452a:string:ETH",
26+
"chainId": "7f360e4a-7c44-4ac7-871a-72b38dbe42d6:string:1337"
27+
},
28+
"recipient": {
29+
"name": "48f79c7e-2f15-4ec6-815a-e3d3b34fa462:string:REVSTORE-REVOKED"
30+
}
31+
},
32+
"signature": {
33+
"type": "SHA3MerkleProof",
34+
"targetHash": "1edea2001ccb702ed3484b3cbd07366c79c870c803bbf379b96486bca9e97ff6",
35+
"proof": [],
36+
"merkleRoot": "1edea2001ccb702ed3484b3cbd07366c79c870c803bbf379b96486bca9e97ff6"
37+
},
38+
"proof": [
39+
{
40+
"type": "OpenAttestationSignature2018",
41+
"created": "2026-06-15T08:46:03.114Z",
42+
"proofPurpose": "assertionMethod",
43+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
44+
"signature": "0x9370c759347ea6acd2837daf7fb69f538dfc4c6b8ac08d6ce273920b5b8670f25c57e0bbdd08cc3e43d8cc5f56d4870bcc6a251325b9dc22d09e9eb2deeceb4a1b"
45+
}
46+
]
47+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "https://schema.openattestation.com/2.0/schema.json",
3+
"data": {
4+
"$template": {
5+
"type": "234694b2-4d93-46ab-8ae0-2c4eaf58576b:string:EMBEDDED_RENDERER",
6+
"name": "326e60c5-26bc-4cb3-90a7-fedd88d0a405:string:CHAFTA_COO",
7+
"url": "3b4bdcb0-fa82-4ed9-99c1-4c228d7e8a07:string:https://generic-templates.tradetrust.io"
8+
},
9+
"issuers": [
10+
{
11+
"id": "80627005-ef95-4433-9713-8a5e096f5ccd:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89",
12+
"name": "ddca0c96-faa9-4f5c-8256-7422b36df1fe:string:My Test Issuer",
13+
"revocation": {
14+
"type": "2511ad28-b5e2-472a-883f-76f7bb5acba2:string:NONE"
15+
},
16+
"identityProof": {
17+
"type": "3e3a43f9-d70c-4a8e-ab7a-811a185c61b7:string:DNS-DID",
18+
"location": "eb845f4f-e7b7-4811-af9a-3dcbcdb922fd:string:example.tradetrust.io",
19+
"key": "11cf1638-fd0f-464b-921d-a2c4ce0cc7d3:string:did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller"
20+
}
21+
}
22+
],
23+
"recipient": {
24+
"name": "7ad580a1-79d4-41aa-83f2-88715703f9d6:string:TAMPERED VALUE"
25+
}
26+
},
27+
"signature": {
28+
"type": "SHA3MerkleProof",
29+
"targetHash": "226d0b680a1140241f5cc10039a295c4ad84719c61e9dfa3431e82fd30de5caa",
30+
"proof": [],
31+
"merkleRoot": "226d0b680a1140241f5cc10039a295c4ad84719c61e9dfa3431e82fd30de5caa"
32+
},
33+
"proof": [
34+
{
35+
"type": "OpenAttestationSignature2018",
36+
"created": "2026-06-10T08:57:04.774Z",
37+
"proofPurpose": "assertionMethod",
38+
"verificationMethod": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
39+
"signature": "0xf6a6c35491b64064addf912e77192b7b02bdf414746497064c17f39f36fa1aba4367b691de25afa8195b78e37d505bf87c24ceff00024a95cfe543fe0127a30a1c"
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)