From 318ee82781695f0b59afa479c1938cd5f889b059 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Thu, 2 Jan 2025 16:25:08 +0800 Subject: [PATCH] correct deps register --- __fixtures__/misc/output-impl-interfaces-gen/types.ts | 2 +- .../amino-interface-proto-optionality/types.ts | 2 +- .../misc/output-proto-amino/amino-interface/types.ts | 2 +- __fixtures__/v-next/outputhelperfunc/helper-func-types.ts | 7 ++++--- __fixtures__/v-next/outputhelperfunc/types.ts | 2 +- __fixtures__/v-next/outputicjs/types.ts | 2 +- __fixtures__/v-next/outputinstantrpc/types.ts | 2 +- __fixtures__/v-next/outputsign/types.ts | 2 +- .../telescope/src/helpers/helper-func-types-interface.ts | 7 ++++--- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/__fixtures__/misc/output-impl-interfaces-gen/types.ts b/__fixtures__/misc/output-impl-interfaces-gen/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/misc/output-impl-interfaces-gen/types.ts +++ b/__fixtures__/misc/output-impl-interfaces-gen/types.ts @@ -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< diff --git a/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/types.ts b/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/types.ts +++ b/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/types.ts @@ -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< diff --git a/__fixtures__/misc/output-proto-amino/amino-interface/types.ts b/__fixtures__/misc/output-proto-amino/amino-interface/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/misc/output-proto-amino/amino-interface/types.ts +++ b/__fixtures__/misc/output-proto-amino/amino-interface/types.ts @@ -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< diff --git a/__fixtures__/v-next/outputhelperfunc/helper-func-types.ts b/__fixtures__/v-next/outputhelperfunc/helper-func-types.ts index 0f0452575..2297a710d 100644 --- a/__fixtures__/v-next/outputhelperfunc/helper-func-types.ts +++ b/__fixtures__/v-next/outputhelperfunc/helper-func-types.ts @@ -22,6 +22,8 @@ export interface QueryBuilderOptions { } export function buildQuery(opts: QueryBuilderOptions) { + registerDependencies(opts.deps ?? []); + return async (request: TReq) => { let rpc: Rpc | undefined; @@ -33,8 +35,6 @@ export function buildQuery(opts: QueryBuilderOptions) { 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); @@ -82,6 +82,8 @@ export interface TxBuilderOptions { } export function buildTx(opts: TxBuilderOptions) { + registerDependencies(opts.deps ?? []); + return async ( signerAddress: string, message: TMsg, @@ -100,7 +102,6 @@ export function buildTx(opts: TxBuilderOptions) { //register all related encoders and converters client.addEncoders(opts.encoders ?? []); client.addConverters(opts.converters ?? []); - registerDependencies(opts.deps ?? []); const data = [ { diff --git a/__fixtures__/v-next/outputhelperfunc/types.ts b/__fixtures__/v-next/outputhelperfunc/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/v-next/outputhelperfunc/types.ts +++ b/__fixtures__/v-next/outputhelperfunc/types.ts @@ -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< diff --git a/__fixtures__/v-next/outputicjs/types.ts b/__fixtures__/v-next/outputicjs/types.ts index 28510b528..58eddba1d 100644 --- a/__fixtures__/v-next/outputicjs/types.ts +++ b/__fixtures__/v-next/outputicjs/types.ts @@ -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< diff --git a/__fixtures__/v-next/outputinstantrpc/types.ts b/__fixtures__/v-next/outputinstantrpc/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/v-next/outputinstantrpc/types.ts +++ b/__fixtures__/v-next/outputinstantrpc/types.ts @@ -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< diff --git a/__fixtures__/v-next/outputsign/types.ts b/__fixtures__/v-next/outputsign/types.ts index e95ca4c42..3beeefb49 100644 --- a/__fixtures__/v-next/outputsign/types.ts +++ b/__fixtures__/v-next/outputsign/types.ts @@ -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< diff --git a/packages/telescope/src/helpers/helper-func-types-interface.ts b/packages/telescope/src/helpers/helper-func-types-interface.ts index 708ba902c..b6c782b3d 100644 --- a/packages/telescope/src/helpers/helper-func-types-interface.ts +++ b/packages/telescope/src/helpers/helper-func-types-interface.ts @@ -19,6 +19,8 @@ export interface QueryBuilderOptions { } export function buildQuery(opts: QueryBuilderOptions) { + registerDependencies(opts.deps ?? []); + return async (request: TReq) => { let rpc: Rpc | undefined; @@ -30,8 +32,6 @@ export function buildQuery(opts: QueryBuilderOptions) { 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); @@ -79,6 +79,8 @@ export interface TxBuilderOptions { } export function buildTx(opts: TxBuilderOptions) { + registerDependencies(opts.deps ?? []); + return async ( signerAddress: string, message: TMsg, @@ -97,7 +99,6 @@ export function buildTx(opts: TxBuilderOptions) { //register all related encoders and converters client.addEncoders(opts.encoders ?? []); client.addConverters(opts.converters ?? []); - registerDependencies(opts.deps ?? []); const data = [ {