]> git.codecow.com Git - nano-pow.git/commitdiff
Fix debug output on test webpage.
authorChris Duncan <chris@codecow.com>
Fri, 10 Jul 2026 14:00:55 +0000 (07:00 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 10 Jul 2026 14:00:55 +0000 (07:00 -0700)
test/index.html

index c5f3d1c028a500a690d878fb62a8c1088df13b43..34a62c1ec6989840b9ff99f2a27e25bab9c8a227 100644 (file)
@@ -178,7 +178,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        document.getElementById('status').innerHTML = `TESTING IN PROGRESS 0/${size}<br/>`
                        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 += '<br/>'
@@ -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`