From: Chris Duncan Date: Sat, 25 Jan 2025 07:12:43 +0000 (-0800) Subject: Validate work on test page with pizzazz. X-Git-Tag: v3.0.0~74 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=78d2b70eaca2beb99667cb07fa6dcd6a2231ec94;p=nano-pow.git Validate work on test page with pizzazz. --- 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
- + -