Skip to content

Commit

Permalink
fix: interfaces can't be used as fields
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Oct 3, 2024
1 parent 8a4f680 commit db299a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/worker-api/src/integriteeWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import type {
import {
type CallOptions,
type ISubmittableGetter,
type IWorker,
Request,
type JsonRpcRequest,
} from './interface.js';
import {Worker} from "./worker.js";
import {callGetter, sendTrustedCall, sendWorkerRequest} from './sendRequest.js';
import {createGetterRpc, createTrustedCall, signTrustedCall, submittableGetter} from "./requests.js";
import {Worker} from "./worker.js";
import bs58 from "bs58";
import type {Signer} from "@polkadot/types/types";
import type {AddressOrPair} from "@polkadot/api-base/types/submittable";
Expand Down Expand Up @@ -96,7 +95,7 @@ export class IntegriteeWorker extends Worker {
}
}

export class SubmittableGetter<W extends IWorker, Type> implements ISubmittableGetter<W, Type> {
export class SubmittableGetter<W extends Worker, Type> implements ISubmittableGetter<W, Type> {
worker: W;
shard: ShardIdentifier;
getter: IntegriteeGetter;
Expand Down
5 changes: 3 additions & 2 deletions packages/worker-api/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import {Keyring} from "@polkadot/keyring";
import type {u8} from "@polkadot/types-codec";
import type {TypeRegistry, Vec} from "@polkadot/types";
import type {RegistryTypes, Signer} from "@polkadot/types/types";
import type {IntegriteeGetter, ShardIdentifier} from "@encointer/types";
import type {AddressOrPair} from "@polkadot/api-base/types/submittable";
import {Worker} from "./worker.js";
import type {IntegriteeGetter, ShardIdentifier} from "@encointer/types";

export interface IWorker extends WebSocketAsPromised {
rsCount: number;
Expand All @@ -16,7 +17,7 @@ export interface IWorker extends WebSocketAsPromised {
registry: () => TypeRegistry
}

export interface ISubmittableGetter<W extends IWorker, Type> {
export interface ISubmittableGetter<W extends Worker, Type> {

worker: W;

Expand Down
3 changes: 2 additions & 1 deletion packages/worker-api/src/requests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createJsonRpcRequest, type IWorker, type PublicGetterArgs, type TrustedGetterArgs} from "./interface.js";
import {SubmittableGetter} from "./integriteeWorker.js";
import {Worker} from "./worker.js";
import type {
BalanceTransferArgs,
BalanceUnshieldArgs,
Expand Down Expand Up @@ -32,7 +33,7 @@ export const clientRequestGetterRpc = (self: IWorker, request: string, args: Pub
return createGetterRpc(self, g, shardT);
}

export const submittableGetter = async <W extends IWorker, T>(self: W, request: string, args: TrustedGetterArgs, returnType: string)=> {
export const submittableGetter = async <W extends Worker, T>(self: W, request: string, args: TrustedGetterArgs, returnType: string)=> {
const {shard, account} = args;
const shardT = self.createType('ShardIdentifier', bs58.decode(shard));
const signedGetter = await createSignedGetter(self, request, account)
Expand Down

0 comments on commit db299a3

Please sign in to comment.