mirror of
https://github.com/selfxyz/self.git
synced 2026-01-22 21:17:59 -05:00
Merge branch 'dev' into black-ui
This commit is contained in:
@@ -61,15 +61,14 @@ export const prove = async ({
|
||||
await generateProof(inputs, setProofTime, setProof, setGeneratingProof, setStep, path);
|
||||
const end = Date.now();
|
||||
console.log('Total proof time from frontend:', end - start);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.show('Error', {
|
||||
message: "Pubkey not found in the registry",
|
||||
message: error.message,
|
||||
customData: {
|
||||
type: "error",
|
||||
},
|
||||
})
|
||||
|
||||
setStep(Steps.NFC_SCAN_COMPLETED);
|
||||
setGeneratingProof(false);
|
||||
}
|
||||
|
||||
@@ -52,12 +52,17 @@ export function generateCircuitInputs(
|
||||
const index = tree.indexOf(leaf) // this index is not the index in public_keys_parsed.json, but the index in the tree
|
||||
console.log(`Index of pubkey in the registry: ${index}`)
|
||||
if (index === -1) {
|
||||
throw new Error("Pubkey not found in the registry");
|
||||
throw new Error("Your public key was not found in the registry");
|
||||
}
|
||||
|
||||
const proof = tree.createProof(index)
|
||||
console.log("verifyProof", tree.verifyProof(proof))
|
||||
|
||||
if (passportData.dataGroupHashes.length > MAX_DATAHASHES_LEN) {
|
||||
console.log(`Data hashes too long. Max length is ${MAX_DATAHASHES_LEN} bytes.`);
|
||||
throw new Error(`This number of datagroups is currently unsupported. Please contact us so we add support!`);
|
||||
}
|
||||
|
||||
const [messagePadded, messagePaddedLen] = sha256Pad(
|
||||
new Uint8Array(passportData.dataGroupHashes),
|
||||
MAX_DATAHASHES_LEN
|
||||
|
||||
Reference in New Issue
Block a user