From 7b090168ca3ea1a1f82ca95647f59995483ed388 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Oct 2024 21:02:36 +0200 Subject: [PATCH] fix code peculiarities --- packages/worker-api/src/worker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/worker-api/src/worker.ts b/packages/worker-api/src/worker.ts index 4b63e26f..2774fb4b 100644 --- a/packages/worker-api/src/worker.ts +++ b/packages/worker-api/src/worker.ts @@ -159,7 +159,7 @@ export class Worker implements IWorkerBase { 'Request', { shard, cyphertext: cyphertext } ); - const returnValue = await this.subscribe('author_submitAndWatchExtrinsic', [r.toHex()]) + const returnValue = await this.submitAndWatch([r.toHex()]) console.debug(`[sendTrustedCall] result: ${JSON.stringify(returnValue)}`); @@ -176,7 +176,7 @@ export class Worker implements IWorkerBase { return this.resultToRpcReturnValue(result); } - public async subscribe(method: string, params: unknown[]): Promise { + public async submitAndWatch(params: unknown[]): Promise { await this.isReady(); let topHash: Hash; @@ -207,8 +207,8 @@ export class Worker implements IWorkerBase { } try { - const res = await this.#ws.subscribe(method, - method, params, onStatusChange + const res = await this.#ws.subscribe('author_submitAndWatchExtrinsic', + 'author_submitAndWatchExtrinsic', params, onStatusChange ); topHash = this.createType('Hash', res); console.debug(`topHash: ${topHash}`);