From 4d287019301cca5ba4d7838e349ee12eed1a0988 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 7 Jul 2020 07:15:50 +0200 Subject: [PATCH] Rename type to LcdApiArray --- packages/sdk38/src/lcdclient.spec.ts | 8 ++++---- packages/sdk38/src/lcdclient.ts | 4 ++-- packages/sdk38/types/lcdclient.d.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/sdk38/src/lcdclient.spec.ts b/packages/sdk38/src/lcdclient.spec.ts index 93d7aab0..a5f13cb9 100644 --- a/packages/sdk38/src/lcdclient.spec.ts +++ b/packages/sdk38/src/lcdclient.spec.ts @@ -5,7 +5,7 @@ import { rawSecp256k1PubkeyToAddress } from "./address"; import { Coin } from "./coins"; import { isPostTxFailure } from "./cosmosclient"; import { makeSignBytes } from "./encoding"; -import { CosmosSdkArray, LcdClient, normalizeArray } from "./lcdclient"; +import { LcdApiArray, LcdClient, normalizeArray } from "./lcdclient"; import { parseLogs } from "./logs"; import { Msg, MsgSend } from "./msgs"; import { makeCosmoshubPath, Secp256k1Pen } from "./pen"; @@ -104,7 +104,7 @@ describe("LcdClient", () => { return { listCodeInfo: async (): Promise => { const path = `/wasm/code`; - const responseData = (await base.get(path)) as WasmResponse>; + const responseData = (await base.get(path)) as WasmResponse>; return normalizeArray(unwrapWasmResponse(responseData)); }, }; @@ -125,7 +125,7 @@ describe("LcdClient", () => { return { listCodeInfo: async (): Promise => { const path = `/wasm/code`; - const responseData = (await base.get(path)) as WasmResponse>; + const responseData = (await base.get(path)) as WasmResponse>; return normalizeArray(unwrapWasmResponse(responseData)); }, }; @@ -133,7 +133,7 @@ describe("LcdClient", () => { interface TotalSupplyReponse { readonly height: string; - readonly result: CosmosSdkArray; + readonly result: LcdApiArray; } // eslint-disable-next-line @typescript-eslint/explicit-function-return-type diff --git a/packages/sdk38/src/lcdclient.ts b/packages/sdk38/src/lcdclient.ts index 6fb8a86f..c7a7e9b2 100644 --- a/packages/sdk38/src/lcdclient.ts +++ b/packages/sdk38/src/lcdclient.ts @@ -15,9 +15,9 @@ import { import { CosmosSdkTx, StdTx } from "./types"; /** Unfortunately, Cosmos SDK encodes empty arrays as null */ -export type CosmosSdkArray = ReadonlyArray | null; +export type LcdApiArray = ReadonlyArray | null; -export function normalizeArray(backend: CosmosSdkArray): ReadonlyArray { +export function normalizeArray(backend: LcdApiArray): ReadonlyArray { return backend || []; } diff --git a/packages/sdk38/types/lcdclient.d.ts b/packages/sdk38/types/lcdclient.d.ts index 5003d833..92459f03 100644 --- a/packages/sdk38/types/lcdclient.d.ts +++ b/packages/sdk38/types/lcdclient.d.ts @@ -10,8 +10,8 @@ import { } from "./restclient"; import { CosmosSdkTx, StdTx } from "./types"; /** Unfortunately, Cosmos SDK encodes empty arrays as null */ -export declare type CosmosSdkArray = ReadonlyArray | null; -export declare function normalizeArray(backend: CosmosSdkArray): ReadonlyArray; +export declare type LcdApiArray = ReadonlyArray | null; +export declare function normalizeArray(backend: LcdApiArray): ReadonlyArray; declare type LcdClientModule = Record any>; declare type LcdClientModuleRegisterer = (base: LcdClient) => M; export declare class LcdClient {