-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdf911d
commit 91eedaf
Showing
5 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use client'; | ||
|
||
import { ProofData } from '@noir-lang/types'; | ||
import { useEffect } from 'react'; | ||
import { toast } from 'react-toastify'; | ||
import { BarretenbergBackend } from '@noir-lang/backend_barretenberg'; | ||
import { Noir } from '@noir-lang/noir_js'; | ||
|
||
export function useOffChainVerification(noir?: Noir, proofData?: ProofData) { | ||
useEffect(() => { | ||
if (!proofData || !noir) return; | ||
|
||
toast.promise(noir.verifyFinalProof(proofData), { | ||
pending: 'Verifying proof off-chain', | ||
success: 'Proof verified off-chain', | ||
error: 'Error verifying proof off-chain', | ||
}); | ||
}, [proofData]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"chainId":31337,"verifier":"0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1"} | ||
{"chainId":31337,"verifier":"0x322813fd9a801c5507c9de605d63cea4f2ce6c44"} |