tendermint-rpc: Rearrange adaptor code

This commit is contained in:
willclarktech 2021-06-08 16:49:55 +02:00
parent a31c6f0f34
commit 351e5e6563
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
14 changed files with 38 additions and 40 deletions

View File

@ -1,10 +1,12 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Adaptor } from "../../adaptor";
import { hashBlock, hashTx } from "../../hasher";
import { hashBlock, hashTx } from "../hasher";
import { Params } from "./requests";
import { Responses } from "./responses";
import { Adaptor } from "./types";
export const v0_33: Adaptor = {
export { Decoder, Encoder, Params, Responses } from "./types";
export const adaptor33: Adaptor = {
params: Params,
responses: Responses,
hashTx: hashTx,

View File

@ -2,9 +2,9 @@
import { toBase64, toHex } from "@cosmjs/encoding";
import { JsonRpcRequest } from "@cosmjs/json-rpc";
import { createJsonRpcRequest } from "../../../jsonrpc";
import { assertNotEmpty, Integer, may } from "../../encodings";
import * as requests from "../../requests";
import { createJsonRpcRequest } from "../../jsonrpc";
import { assertNotEmpty, Integer, may } from "../encodings";
import * as requests from "../requests";
interface HeightParam {
readonly height?: number;

View File

@ -3,9 +3,9 @@ import { fromBase64, fromHex } from "@cosmjs/encoding";
import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
import { assert } from "@cosmjs/utils";
import { fromRfc3339WithNanoseconds } from "../../../dates";
import { SubscriptionEvent } from "../../../rpcclients";
import { BlockIdFlag, CommitSignature, ValidatorPubkey } from "../../../types";
import { fromRfc3339WithNanoseconds } from "../../dates";
import { SubscriptionEvent } from "../../rpcclients";
import { BlockIdFlag, CommitSignature, ValidatorPubkey } from "../../types";
import {
assertArray,
assertBoolean,
@ -18,9 +18,9 @@ import {
Integer,
may,
optional,
} from "../../encodings";
import { hashTx } from "../../hasher";
import * as responses from "../../responses";
} from "../encodings";
import { hashTx } from "../hasher";
import * as responses from "../responses";
interface AbciInfoResult {
readonly response: RpcAbciInfoResponse;

View File

@ -1,8 +1,8 @@
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
import { SubscriptionEvent } from "../rpcclients";
import * as requests from "./requests";
import * as responses from "./responses";
import { SubscriptionEvent } from "../../rpcclients";
import * as requests from "../requests";
import * as responses from "../responses";
export interface Adaptor {
readonly params: Params;

View File

@ -1,2 +0,0 @@
/* eslint-disable @typescript-eslint/naming-convention */
export { v0_33 as adaptor33 } from "./v0-33";

View File

@ -16,7 +16,7 @@ import {
tendermintInstances,
tendermintSearchIndexUpdated,
} from "../testutil.spec";
import { adaptor33 } from "./adaptors";
import { adaptor33 } from "./adaptor";
import { Tendermint33Client } from "./tendermint33client";
import { buildQuery } from "./requests";
import * as responses from "./responses";

View File

@ -9,8 +9,7 @@ import {
SubscriptionEvent,
WebsocketClient,
} from "../rpcclients";
import { Decoder, Encoder, Params, Responses } from "./adaptor";
import { adaptor33 } from "./adaptors";
import { adaptor33, Decoder, Encoder, Params, Responses } from "./adaptor";
import * as requests from "./requests";
import * as responses from "./responses";

View File

@ -1,10 +1,12 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Adaptor } from "../../adaptor";
import { hashBlock, hashTx } from "../../hasher";
import { hashBlock, hashTx } from "../hasher";
import { Params } from "./requests";
import { Responses } from "./responses";
import { Adaptor } from "./types";
export const v0_34: Adaptor = {
export { Decoder, Encoder, Params, Responses } from "./types";
export const adaptor34: Adaptor = {
params: Params,
responses: Responses,
hashTx: hashTx,

View File

@ -2,9 +2,9 @@
import { toBase64, toHex } from "@cosmjs/encoding";
import { JsonRpcRequest } from "@cosmjs/json-rpc";
import { createJsonRpcRequest } from "../../../jsonrpc";
import { assertNotEmpty, Integer, may } from "../../encodings";
import * as requests from "../../requests";
import { createJsonRpcRequest } from "../../jsonrpc";
import { assertNotEmpty, Integer, may } from "../encodings";
import * as requests from "../requests";
interface HeightParam {
readonly height?: number;

View File

@ -3,9 +3,9 @@ import { fromBase64, fromHex } from "@cosmjs/encoding";
import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
import { assert } from "@cosmjs/utils";
import { DateWithNanoseconds, fromRfc3339WithNanoseconds } from "../../../dates";
import { SubscriptionEvent } from "../../../rpcclients";
import { BlockIdFlag, CommitSignature, ValidatorPubkey } from "../../../types";
import { DateWithNanoseconds, fromRfc3339WithNanoseconds } from "../../dates";
import { SubscriptionEvent } from "../../rpcclients";
import { BlockIdFlag, CommitSignature, ValidatorPubkey } from "../../types";
import {
assertArray,
assertBoolean,
@ -18,9 +18,9 @@ import {
Integer,
may,
optional,
} from "../../encodings";
import { hashTx } from "../../hasher";
import * as responses from "../../responses";
} from "../encodings";
import { hashTx } from "../hasher";
import * as responses from "../responses";
interface AbciInfoResult {
readonly response: RpcAbciInfoResponse;

View File

@ -1,8 +1,8 @@
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
import { SubscriptionEvent } from "../rpcclients";
import * as requests from "./requests";
import * as responses from "./responses";
import { SubscriptionEvent } from "../../rpcclients";
import * as requests from "../requests";
import * as responses from "../responses";
export interface Adaptor {
readonly params: Params;

View File

@ -1,2 +0,0 @@
/* eslint-disable @typescript-eslint/naming-convention */
export { v0_34 as adaptor34 } from "./v0-34";

View File

@ -16,7 +16,7 @@ import {
tendermintInstances,
tendermintSearchIndexUpdated,
} from "../testutil.spec";
import { adaptor34 } from "./adaptors";
import { adaptor34 } from "./adaptor";
import { buildQuery } from "./requests";
import * as responses from "./responses";
import { Tendermint34Client } from "./tendermint34client";

View File

@ -9,8 +9,7 @@ import {
SubscriptionEvent,
WebsocketClient,
} from "../rpcclients";
import { Decoder, Encoder, Params, Responses } from "./adaptor";
import { adaptor34 } from "./adaptors";
import { adaptor34, Decoder, Encoder, Params, Responses } from "./adaptor";
import * as requests from "./requests";
import * as responses from "./responses";