From 3d74e7865391bfb642d3169f1a5d3620c4ed0a25 Mon Sep 17 00:00:00 2001 From: Phan Shi Yu Date: Tue, 23 Apr 2024 00:06:25 +0800 Subject: [PATCH] chore: use new interface and show malformed as an example --- example/application/app.tsx | 3 ++- example/application/fixtures/v2/svgDemoV2.ts | 28 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/example/application/app.tsx b/example/application/app.tsx index 8d803a7..8440e86 100644 --- a/example/application/app.tsx +++ b/example/application/app.tsx @@ -2,7 +2,7 @@ import ReactDOM from "react-dom"; import { rawOpencerts } from "./fixtures/v2/opencerts"; import { certWithBadTemplateName, certWithNoTemplate } from "./fixtures/v2/certs-to-test-default-renderer"; import { driverLicense } from "./fixtures/v3/driverLicense"; -import { svgEmbeddedDemoV2, svgHostedDemoV2 } from "./fixtures/v2/svgDemoV2"; +import { malformSvgDemoV2, svgEmbeddedDemoV2, svgHostedDemoV2 } from "./fixtures/v2/svgDemoV2"; import React from "react"; import { AppContainer } from "./container"; @@ -24,6 +24,7 @@ export const App: React.FunctionComponent = (): React.ReactElement => { { name: "Driver License (V3)", document: driverLicense, frameSource: "http://localhost:9000" }, { name: "Legacy (Penpal V4)", document: { id: "legacy" }, frameSource: "http://localhost:8080" }, { name: "SVG Embedded Demo (V2)", document: svgEmbeddedDemoV2, frameSource: "" }, + { name: "Malformed SVG (V2)", document: malformSvgDemoV2, frameSource: "" }, { name: "SVG Hosted Demo (V2)", document: svgHostedDemoV2, frameSource: "" }, ]} /> diff --git a/example/application/fixtures/v2/svgDemoV2.ts b/example/application/fixtures/v2/svgDemoV2.ts index 0212984..b4cf2d3 100644 --- a/example/application/fixtures/v2/svgDemoV2.ts +++ b/example/application/fixtures/v2/svgDemoV2.ts @@ -32,6 +32,34 @@ export const svgEmbeddedDemoV2 = { }, }; +export const malformSvgDemoV2 = { + issuers: [ + { + id: "did:ethr:0xB26B4941941C51a4885E5B7D3A1B861E54405f90", + name: "Government Technology Agency of Singapore (GovTech)", + revocation: { + type: v2.RevocationType.None, + }, + identityProof: { + type: v2.IdentityProofType.DNSDid, + location: "example.openattestation.com", + key: "did:ethr:0xB26B4941941C51a4885E5B7D3A1B861E54405f90#controller", + }, + }, + ], + renderMethod: [ + { + id: `