Skip to content

Commit

Permalink
better type for submitAndWatch
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Oct 25, 2024
1 parent 41ff9a8 commit af1075c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/worker-api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
EnclaveFingerprint,
RpcReturnValue, ShardIdentifier,
TrustedOperationStatus,
Vault
Vault, Request
} from '@encointer/types';

import {
Expand Down Expand Up @@ -159,7 +159,7 @@ export class Worker implements IWorkerBase {
'Request', { shard, cyphertext: cyphertext }
);

const returnValue = await this.submitAndWatch([r.toHex()])
const returnValue = await this.submitAndWatch(r)

console.debug(`[sendTrustedCall] result: ${JSON.stringify(returnValue)}`);

Expand All @@ -176,7 +176,7 @@ export class Worker implements IWorkerBase {
return this.resultToRpcReturnValue(result);
}

public async submitAndWatch(params: unknown[]): Promise<TrustedCallResult> {
public async submitAndWatch(request: Request): Promise<TrustedCallResult> {
await this.isReady();

let topHash: Hash;
Expand Down Expand Up @@ -208,7 +208,7 @@ export class Worker implements IWorkerBase {

try {
const res = await this.#ws.subscribe('author_submitAndWatchExtrinsic',
'author_submitAndWatchExtrinsic', params, onStatusChange
'author_submitAndWatchExtrinsic', [request.toHex()], onStatusChange
);
topHash = this.createType('Hash', res);
console.debug(`topHash: ${topHash}`);
Expand Down

0 comments on commit af1075c

Please sign in to comment.