From 321ab9f5aa7684209af1d681aa3c51597dbe0205 Mon Sep 17 00:00:00 2001 From: Atharva Amritkar Date: Sun, 25 Jun 2023 01:03:20 +0530 Subject: [PATCH 1/2] adding schemas Signed-off-by: Atharva Amritkar --- front/src/app/studies/page.tsx | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/front/src/app/studies/page.tsx b/front/src/app/studies/page.tsx index 48bb420..1911eb3 100644 --- a/front/src/app/studies/page.tsx +++ b/front/src/app/studies/page.tsx @@ -82,6 +82,49 @@ export default function Test() { revocable: true, data: encodedData }, + // will update the receipents soon + schema: Patient, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: address + }, + schema: Age, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: bytes32 + }, + schema: Gender, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: string + }, + schema: Disease, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: string + }, + schema: Medications, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: string + }, + schema: Smoker, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: bool + }, + schema: Additional Information, + data: { + recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", + revocable: true, + data: string + }, } ).then( (tx) => tx.wait() From 25fad95a7be5b8f9662170df5ad5e5cd619086dd Mon Sep 17 00:00:00 2001 From: Atharva Amritkar Date: Sun, 25 Jun 2023 11:15:08 +0530 Subject: [PATCH 2/2] adding schemas Signed-off-by: Atharva Amritkar --- front/src/app/studies/page.tsx | 53 +++++----------------------------- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/front/src/app/studies/page.tsx b/front/src/app/studies/page.tsx index 1911eb3..afceb61 100644 --- a/front/src/app/studies/page.tsx +++ b/front/src/app/studies/page.tsx @@ -54,7 +54,13 @@ export default function Test() { const schemaEncoder = new SchemaEncoder("string name"); const encodedData = schemaEncoder.encodeData([ - { name: "name", value: "Hal Incandenza", type: "string" } + { name: "Patient", value: "", type: "address" }, + { name: "Age", value: "", type: "bytes32" }, + { name: "Gender", value: "", type: "string" }, + { name: "Disease", value: "", type: "string" }, + { name: "Medications", value: "", type: "string" }, + { name: "Smoker", value: "", type: "bool" }, + ]); console.log('schema is', doctor); // offchain.signOffchainAttestation( @@ -81,50 +87,7 @@ export default function Test() { recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", revocable: true, data: encodedData - }, - // will update the receipents soon - schema: Patient, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: address - }, - schema: Age, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: bytes32 - }, - schema: Gender, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: string - }, - schema: Disease, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: string - }, - schema: Medications, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: string - }, - schema: Smoker, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: bool - }, - schema: Additional Information, - data: { - recipient: "0x6dC9c87776c3dD7BC362c065f1f74fc9F89E52a4", - revocable: true, - data: string - }, + } } ).then( (tx) => tx.wait()