From 78d2b70eaca2beb99667cb07fa6dcd6a2231ec94 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 24 Jan 2025 23:12:43 -0800 Subject: [PATCH] Validate work on test page with pizzazz. --- test.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test.html b/test.html index cec3854..e016fd2 100644 --- a/test.html +++ b/test.html @@ -107,6 +107,7 @@ SPDX-License-Identifier: GPL-3.0-or-later } function startValidation (event) { + console.log('validating') const threshold = document.getElementById('threshold') const work = document.getElementById('work') const hash = document.getElementById('hash') @@ -115,15 +116,16 @@ SPDX-License-Identifier: GPL-3.0-or-later NanoPow.validate(work.value, hash.value, { threshold: `0x${+threshold.value}` }) .then(result => { validation.innerText = result - ? 'Valid' - : 'INVALID' + ? '✔️' + : '❌' }) .catch(err => { - console.error(err) - validation.innerText = err.message + validation.innerText = '⏳' }) } - document.getElementById('btnStartValidation').addEventListener('click', startValidation) + document.getElementById('threshold').addEventListener('input', startValidation) + document.getElementById('work').addEventListener('input', startValidation) + document.getElementById('hash').addEventListener('input', startValidation) function startTest (event) { const threshold = document.getElementById('threshold') @@ -151,11 +153,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
- + -
-- 2.34.1