From 0855c56fdcc85ff8f8d1f00186b810a6d06f961e Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 21 Dec 2020 00:10:35 +0100 Subject: [PATCH] Remove IpPortString --- CHANGELOG.md | 2 +- packages/tendermint-rpc/src/adaptors/v0-33/responses.ts | 5 +++-- packages/tendermint-rpc/src/index.ts | 1 - packages/tendermint-rpc/src/responses.ts | 5 +++-- packages/tendermint-rpc/src/types.ts | 2 -- packages/tendermint-rpc/types/index.d.ts | 1 - packages/tendermint-rpc/types/responses.d.ts | 5 +++-- packages/tendermint-rpc/types/types.d.ts | 1 - 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29fbad2875..053f063d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ `adaptor34`. Export the `Adaptor` type. - @cosmjs/tendermint-rpc: Export `DateTime` class. - @cosmjs/tendermint-rpc: Remove types `QueryString`, `Base64String`, - `HexString`, `IntegerString`. Use `string` instead. + `HexString`, `IntegerString` and `IpPortString`. Use `string` instead. ## 0.23.1 (2020-10-27) diff --git a/packages/tendermint-rpc/src/adaptors/v0-33/responses.ts b/packages/tendermint-rpc/src/adaptors/v0-33/responses.ts index ac05f5097e..7946826d4d 100644 --- a/packages/tendermint-rpc/src/adaptors/v0-33/responses.ts +++ b/packages/tendermint-rpc/src/adaptors/v0-33/responses.ts @@ -18,7 +18,7 @@ import { } from "../../encodings"; import * as responses from "../../responses"; import { SubscriptionEvent } from "../../rpcclients"; -import { IpPortString, TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "../../types"; +import { TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "../../types"; import { hashTx } from "./hasher"; interface AbciInfoResult { @@ -500,7 +500,8 @@ function decodeValidatorInfo(data: RpcValidatorInfo): responses.Validator { interface RpcNodeInfo { /** hex encoded */ readonly id: string; - readonly listen_addr: IpPortString; + /** IP and port */ + readonly listen_addr: string; readonly network: string; readonly version: string; readonly channels: string; // ??? diff --git a/packages/tendermint-rpc/src/index.ts b/packages/tendermint-rpc/src/index.ts index ab9e1f7403..3afb891320 100644 --- a/packages/tendermint-rpc/src/index.ts +++ b/packages/tendermint-rpc/src/index.ts @@ -74,7 +74,6 @@ export { } from "./responses"; export { HttpClient, WebsocketClient } from "./rpcclients"; // TODO: Why do we export those outside of this package? export { - IpPortString, TxBytes, TxHash, ValidatorEd25519Pubkey, diff --git a/packages/tendermint-rpc/src/responses.ts b/packages/tendermint-rpc/src/responses.ts index c3f78a8f82..4cea1c9dbd 100644 --- a/packages/tendermint-rpc/src/responses.ts +++ b/packages/tendermint-rpc/src/responses.ts @@ -1,6 +1,6 @@ import { ReadonlyDate } from "readonly-date"; -import { IpPortString, TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "./types"; +import { TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "./types"; export type Response = | AbciInfoResponse @@ -283,7 +283,8 @@ export interface Header { export interface NodeInfo { readonly id: Uint8Array; - readonly listenAddr: IpPortString; + /** IP and port */ + readonly listenAddr: string; readonly network: string; readonly version: string; readonly channels: string; // ??? diff --git a/packages/tendermint-rpc/src/types.ts b/packages/tendermint-rpc/src/types.ts index 0c259f835b..f5d55e5dbd 100644 --- a/packages/tendermint-rpc/src/types.ts +++ b/packages/tendermint-rpc/src/types.ts @@ -16,8 +16,6 @@ export type TxBytes = Uint8Array & As<"tx-bytes">; */ export type TxHash = Uint8Array & As<"tx-hash">; -export type IpPortString = string & As<"ipport">; - export interface ValidatorEd25519Pubkey { readonly algorithm: "ed25519"; readonly data: Uint8Array; diff --git a/packages/tendermint-rpc/types/index.d.ts b/packages/tendermint-rpc/types/index.d.ts index 675663bcef..7c0edb71f9 100644 --- a/packages/tendermint-rpc/types/index.d.ts +++ b/packages/tendermint-rpc/types/index.d.ts @@ -74,7 +74,6 @@ export { } from "./responses"; export { HttpClient, WebsocketClient } from "./rpcclients"; export { - IpPortString, TxBytes, TxHash, ValidatorEd25519Pubkey, diff --git a/packages/tendermint-rpc/types/responses.d.ts b/packages/tendermint-rpc/types/responses.d.ts index 09221e606d..52024db5ec 100644 --- a/packages/tendermint-rpc/types/responses.d.ts +++ b/packages/tendermint-rpc/types/responses.d.ts @@ -1,5 +1,5 @@ import { ReadonlyDate } from "readonly-date"; -import { IpPortString, TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "./types"; +import { TxBytes, TxHash, ValidatorPubkey, ValidatorSignature } from "./types"; export declare type Response = | AbciInfoResponse | AbciQueryResponse @@ -219,7 +219,8 @@ export interface Header { } export interface NodeInfo { readonly id: Uint8Array; - readonly listenAddr: IpPortString; + /** IP and port */ + readonly listenAddr: string; readonly network: string; readonly version: string; readonly channels: string; diff --git a/packages/tendermint-rpc/types/types.d.ts b/packages/tendermint-rpc/types/types.d.ts index 5129a3e7e7..412bee1545 100644 --- a/packages/tendermint-rpc/types/types.d.ts +++ b/packages/tendermint-rpc/types/types.d.ts @@ -9,7 +9,6 @@ export declare type TxBytes = Uint8Array & As<"tx-bytes">; * A raw tendermint transaction hash, currently 20 bytes */ export declare type TxHash = Uint8Array & As<"tx-hash">; -export declare type IpPortString = string & As<"ipport">; export interface ValidatorEd25519Pubkey { readonly algorithm: "ed25519"; readonly data: Uint8Array;