From c0dafc48f5ca9ad9cd8ba16e9ad203cf58d838cb Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 14 Jan 2025 07:21:17 -0800 Subject: [PATCH] Cancel test if validate is not working. --- test.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test.html b/test.html index 95b77de..b5d0d88 100644 --- a/test.html +++ b/test.html @@ -71,6 +71,15 @@ SPDX-License-Identifier: GPL-3.0-or-later const expectTrue = await NanoPow.validate('47c83266398728cf', '92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D') console.log(`validate() output for good nonce is ${expectTrue === true ? 'correct' : 'incorrect'}`) const type = (NanoPow === NanoPowGpu) ? 'WebGPU' : (NanoPow === NanoPowGl) ? 'WebGL' : 'unknown API' + + try { + if (expectFalse || !expectTrue) throw new Error(`Validation is not working`) + } catch (err) { + document.getElementById('output').innerHTML += `Error: ${err.message}
` + console.error(err) + return + } + console.log(`%cNanoPow (${type})`, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`) const times = [] document.getElementById('output').innerHTML += `Now testing: NanoPow (${type})
` @@ -115,7 +124,7 @@ SPDX-License-Identifier: GPL-3.0-or-later

NanoPow uses WebGL 2.0 as a fallback option if WebGPU is not detected.

Times below are in milliseconds and summarized by various averaging methods.


- +

WAITING


-- 2.34.1