From d460d386561673657a96da717c36e336564e23b7 Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Mon, 10 Oct 2022 10:27:49 -0500 Subject: [PATCH] feat(rln-js): use proof verify no roots --- rln-js/index.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rln-js/index.html b/rln-js/index.html index 825f64d..d6ef819 100644 --- a/rln-js/index.html +++ b/rln-js/index.html @@ -118,7 +118,7 @@ MembershipKey, RLNDecoder, RLNEncoder - } from "https://unpkg.com/@waku/rln@0.0.12-ccac829/bundle/index.js"; + } from "https://unpkg.com/@waku/rln@0.0.12-6875952/bundle/index.js"; import {ethers} from "https://unpkg.com/ethers@5.0.7/dist/ethers-all.esm.min.js" @@ -354,11 +354,11 @@ if (msg.proofState === "verifying...") { try { - console.log("Verifying proof") + console.log("Verifying proof without roots") console.time("proof_verify_timer") - const res = msg.verify() + const res = msg.verifyNoRoot() console.timeEnd("proof_verify_timer") - console.log("proof verified!", res) + console.log("proof verified without roots", res) if (res === undefined) { msg.proofState = "no proof attached" } else if (res) { @@ -371,6 +371,7 @@ console.error("Error verifying proof:", e) } updateMessages() + console.log("Verifying proof with roots", msg.verify()) } }) messagesDiv.innerHTML += "" @@ -381,12 +382,13 @@ const time = new Date(); time.setTime(Number(timestamp) * 1000); - let proofState, verify; + let proofState, verify, verifyNoRoot; if (typeof wakuMessage.rateLimitProof === "undefined") { proofState = "no proof attached"; } else { console.log("Proof received:", wakuMessage.rateLimitProof) verify = wakuMessage.verify.bind(wakuMessage); + verifyNoRoot = wakuMessage.verifyNoRoot.bind(wakuMessage); proofState = "verifying..."; } @@ -394,6 +396,7 @@ msg: `(${nick}) ${utils.bytesToUtf8(text)} [${time.toISOString()}]`, epoch: wakuMessage.epoch, verify, + verifyNoRoot, proofState }); updateMessages()