fixed verifier

This commit is contained in:
2023-08-22 13:18:34 -04:00
parent 9407b2cd9a
commit 0ce3ceb8f9

View File

@@ -38,14 +38,6 @@ async function verifyProof(msg: MessageI, room: RoomI, epochErrorRange = 5): Pro
// Check that the message hash is correct
let proof: RLNFullProof;
if (typeof msg.proof === 'string') {
proof = JSON.parse(msg.proof) as RLNFullProof;
} else {
proof = msg.proof;
}
if (msgHash !== proof.snarkProof.publicSignals.x) {
console.warn(
'Message hash incorrect:',
@@ -65,7 +57,7 @@ async function verifyProof(msg: MessageI, room: RoomI, epochErrorRange = 5): Pro
}
// Check that the proof is correct
return v.verifyProof(rlnIdentifier, msg.proof as RLNFullProof);
return v.verifyProof(rlnIdentifier, proof);
}
export default verifyProof;