Skip to content

Commit

Permalink
correct deps register
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Jan 2, 2025
1 parent 9b9100a commit 318ee82
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/misc/output-impl-interfaces-gen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
7 changes: 4 additions & 3 deletions __fixtures__/v-next/outputhelperfunc/helper-func-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface QueryBuilderOptions<TReq, TRes> {
}

export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {
registerDependencies(opts.deps ?? []);

return async (request: TReq) => {
let rpc: Rpc | undefined;

Expand All @@ -33,8 +35,6 @@ export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {

if (!rpc) throw new Error("Query Rpc is not initialized");

registerDependencies(opts.deps ?? []);

const data = opts.encode(request).finish();
const response = await rpc.request(opts.service, opts.method, data);
return opts.decode(response);
Expand Down Expand Up @@ -82,6 +82,8 @@ export interface TxBuilderOptions {
}

export function buildTx<TMsg>(opts: TxBuilderOptions) {
registerDependencies(opts.deps ?? []);

return async (
signerAddress: string,
message: TMsg,
Expand All @@ -100,7 +102,6 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
//register all related encoders and converters
client.addEncoders(opts.encoders ?? []);
client.addConverters(opts.converters ?? []);
registerDependencies(opts.deps ?? []);

const data = [
{
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputhelperfunc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputicjs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputinstantrpc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputsign/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface TelescopeGeneratedCodec<
toProto?: (message: T) => Uint8Array;
fromProtoMsg?: (message: ProtoMsg) => T;
toProtoMsg?: (message: T) => Any;
registerTypeurl?: () => void;
registerTypeUrl?: () => void;
}

export type TelescopeGeneratedType<
Expand Down
7 changes: 4 additions & 3 deletions packages/telescope/src/helpers/helper-func-types-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface QueryBuilderOptions<TReq, TRes> {
}
export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {
registerDependencies(opts.deps ?? []);
return async (request: TReq) => {
let rpc: Rpc | undefined;
Expand All @@ -30,8 +32,6 @@ export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {
if (!rpc) throw new Error("Query Rpc is not initialized");
registerDependencies(opts.deps ?? []);
const data = opts.encode(request).finish();
const response = await rpc.request(opts.service, opts.method, data);
return opts.decode(response);
Expand Down Expand Up @@ -79,6 +79,8 @@ export interface TxBuilderOptions {
}
export function buildTx<TMsg>(opts: TxBuilderOptions) {
registerDependencies(opts.deps ?? []);
return async (
signerAddress: string,
message: TMsg,
Expand All @@ -97,7 +99,6 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
//register all related encoders and converters
client.addEncoders(opts.encoders ?? []);
client.addConverters(opts.converters ?? []);
registerDependencies(opts.deps ?? []);
const data = [
{
Expand Down

0 comments on commit 318ee82

Please sign in to comment.