Skip to content

Commit 9e07aec

Browse files
Gefei HouGefei Hou
authored andcommitted
Updated test
1 parent 1a945ed commit 9e07aec

File tree

80 files changed

+208
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+208
-1097
lines changed

__fixtures__/misc/enforce-null-check-true/helper-func-types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { HttpEndpoint } from "@interchainjs/types";
99
import { BinaryReader, BinaryWriter } from "./binary";
1010
import { getRpcClient } from "./extern";
1111
import { isRpc, Rpc } from "./helpers";
12-
import { TelescopeGeneratedCodec, Message, StdFee } from "./types";
13-
import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
14-
import { ISigningClient } from "@interchainjs/cosmos/types/signing-client";
12+
import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types";
13+
import { toConverters, toEncoders } from "@interchainjs/cosmos";
14+
import { ISigningClient } from "@interchainjs/cosmos";
1515

1616
export interface QueryBuilderOptions<TReq, TRes> {
1717
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -56,7 +56,7 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
5656
message: TMsg | TMsg[],
5757
fee: StdFee | 'auto',
5858
memo: string
59-
): Promise<any> => {
59+
): Promise<DeliverTxResponse> => {
6060
if (!client) throw new Error("SigningClient is not initialized");
6161

6262
//register all related encoders and converters

__fixtures__/misc/enforce-null-check-true/helpers.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,7 @@
44
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
55
*/
66

7-
declare var self: any | undefined;
8-
declare var window: any | undefined;
9-
declare var global: any | undefined;
10-
var globalThis: any = (() => {
11-
if (typeof globalThis !== 'undefined') return globalThis;
12-
if (typeof self !== 'undefined') return self;
13-
if (typeof window !== 'undefined') return window;
14-
if (typeof global !== 'undefined') return global;
15-
throw 'Unable to locate global object';
16-
})();
17-
18-
const atob: (b64: string) => string =
19-
globalThis.atob ||
20-
((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
21-
22-
export function bytesFromBase64(b64: string): Uint8Array {
23-
const bin = atob(b64);
24-
const arr = new Uint8Array(bin.length);
25-
for (let i = 0; i < bin.length; ++i) {
26-
arr[i] = bin.charCodeAt(i);
27-
}
28-
return arr;
29-
}
30-
31-
const btoa: (bin: string) => string =
32-
globalThis.btoa ||
33-
((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
34-
35-
export function base64FromBytes(arr: Uint8Array): string {
36-
const bin: string[] = [];
37-
arr.forEach((byte) => {
38-
bin.push(String.fromCharCode(byte));
39-
});
40-
return btoa(bin.join(''));
41-
}
7+
export { fromBase64 as bytesFromBase64, toBase64 as base64FromBytes } from '@interchainjs/encoding';
428

439
export interface AminoHeight {
4410
readonly revision_number?: string;

__fixtures__/misc/enforce-null-check-true/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { Any } from "./google/protobuf/any";
1010
import { HttpEndpoint } from "@interchainjs/types";
1111

1212

13-
import { Event, Attribute } from "@interchainjs/types";
14-
13+
import { DeliverTxResponse, Event, Attribute } from "@interchainjs/types";
1514

15+
export type { DeliverTxResponse }
1616

1717

1818
export type ProtoMsg = Omit<Any, "typeUrl"> & { typeUrl: any };
@@ -104,6 +104,6 @@ export interface TxRpc {
104104
messages: EncodeObject[],
105105
fee: StdFee | "auto" | number,
106106
memo: string
107-
): Promise<any>;
107+
): Promise<DeliverTxResponse>;
108108
}
109109

__fixtures__/misc/output-base64/helper-func-types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { HttpEndpoint } from "@interchainjs/types";
99
import { BinaryReader, BinaryWriter } from "./binary";
1010
import { getRpcClient } from "./extern";
1111
import { isRpc, Rpc } from "./helpers";
12-
import { TelescopeGeneratedCodec, Message, StdFee } from "./types";
13-
import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
14-
import { ISigningClient } from "@interchainjs/cosmos/types/signing-client";
12+
import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types";
13+
import { toConverters, toEncoders } from "@interchainjs/cosmos";
14+
import { ISigningClient } from "@interchainjs/cosmos";
1515

1616
export interface QueryBuilderOptions<TReq, TRes> {
1717
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -56,7 +56,7 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
5656
message: TMsg | TMsg[],
5757
fee: StdFee | 'auto',
5858
memo: string
59-
): Promise<any> => {
59+
): Promise<DeliverTxResponse> => {
6060
if (!client) throw new Error("SigningClient is not initialized");
6161

6262
//register all related encoders and converters

__fixtures__/misc/output-base64/helpers.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,7 @@
44
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
55
*/
66

7-
declare var self: any | undefined;
8-
declare var window: any | undefined;
9-
declare var global: any | undefined;
10-
var globalThis: any = (() => {
11-
if (typeof globalThis !== 'undefined') return globalThis;
12-
if (typeof self !== 'undefined') return self;
13-
if (typeof window !== 'undefined') return window;
14-
if (typeof global !== 'undefined') return global;
15-
throw 'Unable to locate global object';
16-
})();
17-
18-
const atob: (b64: string) => string =
19-
globalThis.atob ||
20-
((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
21-
22-
export function bytesFromBase64(b64: string): Uint8Array {
23-
const bin = atob(b64);
24-
const arr = new Uint8Array(bin.length);
25-
for (let i = 0; i < bin.length; ++i) {
26-
arr[i] = bin.charCodeAt(i);
27-
}
28-
return arr;
29-
}
30-
31-
const btoa: (bin: string) => string =
32-
globalThis.btoa ||
33-
((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
34-
35-
export function base64FromBytes(arr: Uint8Array): string {
36-
const bin: string[] = [];
37-
arr.forEach((byte) => {
38-
bin.push(String.fromCharCode(byte));
39-
});
40-
return btoa(bin.join(''));
41-
}
7+
export { fromBase64 as bytesFromBase64, toBase64 as base64FromBytes } from '@interchainjs/encoding';
428

439
export interface AminoHeight {
4410
readonly revision_number?: string;

__fixtures__/misc/output-base64/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { Any } from "./google/protobuf/any";
1010
import { HttpEndpoint } from "@interchainjs/types";
1111

1212

13-
import { Event, Attribute } from "@interchainjs/types";
14-
13+
import { DeliverTxResponse, Event, Attribute } from "@interchainjs/types";
1514

15+
export type { DeliverTxResponse }
1616

1717

1818
export type ProtoMsg = Omit<Any, "typeUrl"> & { typeUrl: any };
@@ -104,6 +104,6 @@ export interface TxRpc {
104104
messages: EncodeObject[],
105105
fee: StdFee | "auto" | number,
106106
memo: string
107-
): Promise<any>;
107+
): Promise<DeliverTxResponse>;
108108
}
109109

__fixtures__/misc/output-decimals/helper-func-types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { HttpEndpoint } from "@interchainjs/types";
99
import { BinaryReader, BinaryWriter } from "./binary";
1010
import { getRpcClient } from "./extern";
1111
import { isRpc, Rpc } from "./helpers";
12-
import { TelescopeGeneratedCodec, Message, StdFee } from "./types";
13-
import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
14-
import { ISigningClient } from "@interchainjs/cosmos/types/signing-client";
12+
import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types";
13+
import { toConverters, toEncoders } from "@interchainjs/cosmos";
14+
import { ISigningClient } from "@interchainjs/cosmos";
1515

1616
export interface QueryBuilderOptions<TReq, TRes> {
1717
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -56,7 +56,7 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
5656
message: TMsg | TMsg[],
5757
fee: StdFee | 'auto',
5858
memo: string
59-
): Promise<any> => {
59+
): Promise<DeliverTxResponse> => {
6060
if (!client) throw new Error("SigningClient is not initialized");
6161

6262
//register all related encoders and converters

__fixtures__/misc/output-decimals/helpers.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,7 @@
44
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
55
*/
66

7-
declare var self: any | undefined;
8-
declare var window: any | undefined;
9-
declare var global: any | undefined;
10-
var globalThis: any = (() => {
11-
if (typeof globalThis !== 'undefined') return globalThis;
12-
if (typeof self !== 'undefined') return self;
13-
if (typeof window !== 'undefined') return window;
14-
if (typeof global !== 'undefined') return global;
15-
throw 'Unable to locate global object';
16-
})();
17-
18-
const atob: (b64: string) => string =
19-
globalThis.atob ||
20-
((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
21-
22-
export function bytesFromBase64(b64: string): Uint8Array {
23-
const bin = atob(b64);
24-
const arr = new Uint8Array(bin.length);
25-
for (let i = 0; i < bin.length; ++i) {
26-
arr[i] = bin.charCodeAt(i);
27-
}
28-
return arr;
29-
}
30-
31-
const btoa: (bin: string) => string =
32-
globalThis.btoa ||
33-
((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
34-
35-
export function base64FromBytes(arr: Uint8Array): string {
36-
const bin: string[] = [];
37-
arr.forEach((byte) => {
38-
bin.push(String.fromCharCode(byte));
39-
});
40-
return btoa(bin.join(''));
41-
}
7+
export { fromBase64 as bytesFromBase64, toBase64 as base64FromBytes } from '@interchainjs/encoding';
428

439
export interface AminoHeight {
4410
readonly revision_number?: string;

__fixtures__/misc/output-decimals/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { Any } from "./google/protobuf/any";
1010
import { HttpEndpoint } from "@interchainjs/types";
1111

1212

13-
import { Event, Attribute } from "@interchainjs/types";
14-
13+
import { DeliverTxResponse, Event, Attribute } from "@interchainjs/types";
1514

15+
export type { DeliverTxResponse }
1616

1717

1818
export type ProtoMsg = Omit<Any, "typeUrl"> & { typeUrl: any };
@@ -104,6 +104,6 @@ export interface TxRpc {
104104
messages: EncodeObject[],
105105
fee: StdFee | "auto" | number,
106106
memo: string
107-
): Promise<any>;
107+
): Promise<DeliverTxResponse>;
108108
}
109109

__fixtures__/misc/output-impl-interfaces-gen/helper-func-types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { HttpEndpoint } from "@interchainjs/types";
99
import { BinaryReader, BinaryWriter } from "./binary";
1010
import { getRpcClient } from "./extern";
1111
import { isRpc, Rpc } from "./helpers";
12-
import { TelescopeGeneratedCodec, Message, StdFee } from "./types";
13-
import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
14-
import { ISigningClient } from "@interchainjs/cosmos/types/signing-client";
12+
import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types";
13+
import { toConverters, toEncoders } from "@interchainjs/cosmos";
14+
import { ISigningClient } from "@interchainjs/cosmos";
1515

1616
export interface QueryBuilderOptions<TReq, TRes> {
1717
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -63,7 +63,7 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
6363
message: TMsg | TMsg[],
6464
fee: StdFee | 'auto',
6565
memo: string
66-
): Promise<any> => {
66+
): Promise<DeliverTxResponse> => {
6767
if (!client) throw new Error("SigningClient is not initialized");
6868

6969
//register all related encoders and converters

0 commit comments

Comments
 (0)