/ concept-collection / proofery-web
Sign in
concept-collection / proofery-web
proofery-web / src / utils / verification.ts
33 lines · 793 BCodeBlameHistory
c1bee11initialJeremy Magland 1// Verification logic using proofery library
3import { parseContent, verifyFile } from 'proofery';
5export interface VerificationResult {
6 success: boolean;
7 message: string;
8 error?: string;
9}
11export const verifyProofContent = (content: string): VerificationResult => {
12 if (!content.trim()) {
13 return {
14 success: false,
15 message: 'No content to verify',
16 };
17 }
19 try {
20 const blocks = parseContent(content);
21 verifyFile(blocks, false); // false for non-verbose mode
22 return {
23 success: true,
4958346update verification messageJeremy Magland 24 message: '✓ Proofs verified! (however, this is a WIP implementation)',
c1bee11initialJeremy Magland 25 };
26 } catch (error) {
27 return {
28 success: false,
29 message: 'Verification failed',
30 error: error instanceof Error ? error.message : String(error),
31 };
32 }
33};
moveopenescclose