From a77e6b9d80f0128083328111df92653e71fcef7d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 27 Mar 2025 20:32:45 -0700 Subject: [PATCH] Remove deprecated methods and unused types. --- src/lib/gl/index.ts | 53 +-------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/src/lib/gl/index.ts b/src/lib/gl/index.ts index fca8265..315dfd5 100644 --- a/src/lib/gl/index.ts +++ b/src/lib/gl/index.ts @@ -5,7 +5,7 @@ import { default as NanoPowGlDownsampleShader } from './gl-downsample.frag' import { default as NanoPowGlDrawShader } from './gl-draw.frag' import { default as NanoPowGlVertexShader } from './gl-vertex.vert' -import type { FBO, NanoPowExecution, NanoPowOptions, WorkGenerateRequest, WorkGenerateResponse, WorkValidateRequest, WorkValidateResponse } from '../../types.d.ts' +import type { FBO, NanoPowExecution, NanoPowOptions, WorkGenerateResponse, WorkValidateResponse } from '#types' /** * Nano proof-of-work using WebGL 2.0. @@ -351,30 +351,6 @@ export class NanoPowGl { throw new Error('Query reported result but nonce value not found') } - /** - * Finds a nonce that satisfies the Nano proof-of-work requirements. - * - * @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts - * @param {NanoPowOptions} options - Used to configure search execution - */ - static async search (hash: string, options?: NanoPowOptions): Promise { - if (options?.threshold != null) { - options.threshold = BigInt(`0x${options.threshold.toString(16) ?? '0'}00000000`) - } - this.#call = { - method: 'search', - hash, - options - } - let result - try { - result = await this.work_generate(hash, options) - } finally { - this.#call = null - } - return result.work - } - /** * Finds a nonce that satisfies the Nano proof-of-work requirements. * @@ -478,33 +454,6 @@ export class NanoPowGl { } } - /** - * Validates that a nonce satisfies Nano proof-of-work requirements. - * - * @param {string} work - Hexadecimal proof-of-work value to validate - * @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts - * @param {NanoPowOptions} options - Options used to configure search execution - */ - static async validate (work: string, hash: string, options?: NanoPowOptions): Promise { - if (options?.threshold != null) { - options.threshold = BigInt(`0x${options.threshold.toString(16) ?? '0'}00000000`) - } - this.#call = { - method: 'search', - hash, - options - } - let result - try { - result = await this.work_validate(work, hash, options) - } finally { - this.#call = null - } - return (options?.threshold != null) - ? result.valid === '1' - : result.valid_all === '1' - } - /** * Validates that a nonce satisfies Nano proof-of-work requirements. * -- 2.34.1