From 264645b381cb2dcb15be3ddf6e581b5062738599 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 23 Sep 2023 09:44:51 +0200 Subject: [PATCH] feat: add verification result validation function --- src/claim.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/claim.js b/src/claim.js index c091d6b..3318f01 100644 --- a/src/claim.js +++ b/src/claim.js @@ -267,8 +267,15 @@ export class Claim { viaProxy: proofData.viaProxy } - // Post process the data + // Validate the result const def = _data[claimData.about.id] + if (def.functions?.validate && verificationResult.completed && verificationResult.result) { + try { + (verificationResult.result = await def.functions.validate(claimData, proofData, verificationResult, opts)) + } catch (_) {} + } + + // Post process the data if (def.functions?.postprocess) { try { ({ claimData, proofData } = await def.functions.postprocess(claimData, proofData, opts))