feat: display error if proof verify throws, log proof
This commit is contained in:
parent
a8b8fb1513
commit
e7e61c67b8
|
@ -324,8 +324,11 @@
|
|||
messagesDiv.innerHTML += `<li>${msg.msg} - [epoch: ${msg.epoch}, proof: ${msg.proofState} ]</li>`
|
||||
|
||||
if (msg.proofState === "verifying...") {
|
||||
try {
|
||||
console.log("Verifying proof")
|
||||
console.time("proof_verify_timer")
|
||||
const res = msg.verify()
|
||||
console.time("proof_verify_timer")
|
||||
console.log("proof verified!", res)
|
||||
if (res === undefined) {
|
||||
msg.proofState = "no proof attached"
|
||||
|
@ -334,6 +337,10 @@
|
|||
} else {
|
||||
msg.proofState = "invalid!"
|
||||
}
|
||||
} catch (e) {
|
||||
msg.proofState = "Error encountered, check console"
|
||||
console.error("Error verifying proof:", e)
|
||||
}
|
||||
updateMessages()
|
||||
}
|
||||
})
|
||||
|
@ -346,9 +353,10 @@
|
|||
time.setTime(Number(timestamp));
|
||||
|
||||
let proofState, verify;
|
||||
if (typeof wakuMessage.verify === "undefined") {
|
||||
if (typeof wakuMessage.rateLimitProof === "undefined") {
|
||||
proofState = "no proof attached";
|
||||
} else {
|
||||
console.log("Proof received:", wakuMessage.rateLimitProof)
|
||||
verify = wakuMessage.verify.bind(wakuMessage);
|
||||
proofState = "verifying...";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue