fix wasm bigint progress handler

This commit is contained in:
mitallast 2024-03-05 13:13:47 +03:00
parent f67fdf917e
commit cba056aba6
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ export const solveCaptchaRunner = async (e: Event): Promise<void> => {
}
if (resp.type === "progress") {
if (width < 80) {
width = Number(resp.nonce / max_recorded_nonce) * 100;
width = resp.nonce / max_recorded_nonce * 100;
setWidth(width);
}
console.log(`received nonce ${resp.nonce}`);

View File

@ -30,7 +30,7 @@ const prove = async (
config.string,
config.difficulty_factor,
STEPS,
progress
(nonce: BigInt | number) => progress(Number(nonce))
);
const t1 = performance.now();
time = t1 - t0;