From: Chris Duncan Date: Fri, 10 Jul 2026 14:00:55 +0000 (-0700) Subject: Fix debug output on test webpage. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=abcf066ea18f0f645d8ee8d681dc4dbbde4c3e8d;p=nano-pow.git Fix debug output on test webpage. --- diff --git a/test/index.html b/test/index.html index c5f3d1c..34a62c1 100644 --- a/test/index.html +++ b/test/index.html @@ -178,7 +178,7 @@ SPDX-License-Identifier: GPL-3.0-or-later document.getElementById('status').innerHTML = `TESTING IN PROGRESS 0/${size}
` let times try { - times = await execute(size, difficulty, effort, api, isOutputShown) + times = await execute(size, difficulty, effort, api, isOutputShown, isDebug) } catch (err) { output.textContent += `Error: ${err.message}` output.innerHTML += '
' @@ -219,7 +219,7 @@ SPDX-License-Identifier: GPL-3.0-or-later console.log('%cSCORING COMPLETE', 'color:orange;font-weight:bold') } - async function execute (size, difficulty, effort, api, isOutputShown = false, isDebug = false) { + async function execute (size, difficulty, effort, api, isOutputShown = false, debug = false) { Cache.clear() const output = document.getElementById('output') const status = document.getElementById('status') @@ -231,10 +231,10 @@ SPDX-License-Identifier: GPL-3.0-or-later status.textContent = status.textContent.replace(prev, next) hash = random() start = performance.now() - result = await NanoPow.work_generate(hash, { difficulty, effort, api }) + result = await NanoPow.work_generate(hash, { difficulty, effort, api, debug }) end = performance.now() times.push(end - start) - check = await NanoPow.work_validate(result.work, result.hash, { difficulty, debug: isDebug }) + check = await NanoPow.work_validate(result.work, result.hash, { difficulty, debug }) isValid = (result.hash === hash && check.hash === hash && check.valid === '1') if (isOutputShown) { output.textContent += `${isValid ? 'VALID' : 'INVALID'} (${end - start} ms)\n${JSON.stringify(result, ' ', 2)}\n`