Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More renamings and refactorings from Tendermint -> Comet #1494

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cosmwasm-stargate/src/testutils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
setupAuthExtension,
setupBankExtension,
} from "@cosmjs/stargate";
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { connectComet } from "@cosmjs/tendermint-rpc";
import { assertDefinedAndNotNull } from "@cosmjs/utils";
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
import { AuthInfo, SignDoc, TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx";
Expand Down Expand Up @@ -170,7 +170,7 @@ export function fromOneElementArray<T>(elements: ArrayLike<T>): T {
export async function makeWasmClient(
endpoint: string,
): Promise<QueryClient & AuthExtension & BankExtension & WasmExtension> {
const cometClient = await Tendermint34Client.connect(endpoint);
const cometClient = await connectComet(endpoint);
return QueryClient.withExtensions(cometClient, setupAuthExtension, setupBankExtension, setupWasmExtension);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/auth/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { encodePubkey } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { assert } from "@cosmjs/utils";
import { BaseAccount } from "cosmjs-types/cosmos/auth/v1beta1/auth";
import { Any } from "cosmjs-types/google/protobuf/any";
Expand All @@ -10,7 +10,7 @@ import { nonExistentAddress, pendingWithoutSimapp, simapp, unused, validator } f
import { AuthExtension, setupAuthExtension } from "./queries";

async function makeClientWithAuth(rpcUrl: string): Promise<[QueryClient & AuthExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupAuthExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/authz/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makeCosmoshubPath } from "@cosmjs/amino";
import { coins, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { assertDefined, sleep } from "@cosmjs/utils";
import { GenericAuthorization } from "cosmjs-types/cosmos/authz/v1beta1/authz";

Expand All @@ -19,7 +19,7 @@ import {
import { AuthzExtension, setupAuthzExtension } from "./queries";

async function makeClientWithAuthz(rpcUrl: string): Promise<[QueryClient & AuthzExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupAuthzExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/bank/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";

import { QueryClient } from "../../queryclient";
import {
Expand All @@ -11,7 +11,7 @@ import {
import { BankExtension, setupBankExtension } from "./queries";

async function makeClientWithBank(rpcUrl: string): Promise<[QueryClient & BankExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupBankExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/distribution/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { coin, coins, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { sleep } from "@cosmjs/utils";
import { MsgDelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";

Expand All @@ -21,7 +21,7 @@ import { DistributionExtension, setupDistributionExtension } from "./queries";
async function makeClientWithDistribution(
rpcUrl: string,
): Promise<[QueryClient & DistributionExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupDistributionExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/gov/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { coin, coins, makeCosmoshubPath } from "@cosmjs/amino";
import { toAscii } from "@cosmjs/encoding";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { assert, sleep } from "@cosmjs/utils";
import {
ProposalStatus,
Expand Down Expand Up @@ -29,7 +29,7 @@ import { MsgDelegateEncodeObject, MsgSubmitProposalEncodeObject, MsgVoteEncodeOb
import { GovExtension, setupGovExtension } from "./queries";

async function makeClientWithGov(rpcUrl: string): Promise<[QueryClient & GovExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupGovExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/ibc/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";

import { QueryClient } from "../../queryclient";
import { simapp } from "../../testutils.spec";
import * as ibcTest from "./ibctestdata.spec";
import { IbcExtension, setupIbcExtension } from "./queries";

async function makeClientWithIbc(rpcUrl: string): Promise<[QueryClient & IbcExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupIbcExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/mint/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";

import { QueryClient } from "../../queryclient";
import { pendingWithoutSimapp, simapp } from "../../testutils.spec";
import { MintExtension, setupMintExtension } from "./queries";

async function makeClientWithMint(rpcUrl: string): Promise<[QueryClient & MintExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupMintExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/slashing/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";

import { QueryClient } from "../../queryclient";
import { pendingWithoutSimapp, simapp } from "../../testutils.spec";
Expand All @@ -8,7 +8,7 @@ import { setupSlashingExtension, SlashingExtension } from "./queries";
async function makeClientWithSlashing(
rpcUrl: string,
): Promise<[QueryClient & SlashingExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupSlashingExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/staking/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { coin, coins, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { sleep } from "@cosmjs/utils";
import { MsgDelegate, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";

Expand All @@ -19,7 +19,7 @@ import { MsgDelegateEncodeObject, MsgUndelegateEncodeObject } from "./messages";
import { setupStakingExtension, StakingExtension } from "./queries";

async function makeClientWithStaking(rpcUrl: string): Promise<[QueryClient & StakingExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupStakingExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/modules/tx/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { coin, coins, DirectSecp256k1HdWallet, Registry } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { assertDefined, sleep } from "@cosmjs/utils";
import { MsgDelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";

Expand All @@ -19,7 +19,7 @@ import {
import { setupTxExtension, TxExtension } from "./queries";

async function makeClientWithTx(rpcUrl: string): Promise<[QueryClient & TxExtension, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient, setupTxExtension), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/queryclient/queryclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { coin } from "@cosmjs/amino";
import { toAscii } from "@cosmjs/encoding";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { CometClient, Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { CometClient, connectComet } from "@cosmjs/tendermint-rpc";
import { assert } from "@cosmjs/utils";
import { Metadata } from "cosmjs-types/cosmos/bank/v1beta1/bank";
import {
Expand All @@ -25,7 +25,7 @@ import {
import { QueryClient } from "./queryclient";

async function makeClient(rpcUrl: string): Promise<[QueryClient, CometClient]> {
const cometClient = await Tendermint34Client.connect(rpcUrl);
const cometClient = await connectComet(rpcUrl);
return [QueryClient.withExtensions(cometClient), cometClient];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/stargate/src/signingstargateclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
makeCosmoshubPath,
Registry,
} from "@cosmjs/proto-signing";
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { connectComet } from "@cosmjs/tendermint-rpc";
import { assert, sleep } from "@cosmjs/utils";
import { DeepPartial } from "cosmjs-types";
import { BinaryWriter } from "cosmjs-types/binary";
Expand Down Expand Up @@ -174,7 +174,7 @@ describe("SigningStargateClient", () => {
defaultSigningClientOptions,
);

const cometClient = await Tendermint34Client.connect(simapp.tendermintUrl);
const cometClient = await connectComet(simapp.tendermintUrl);
const queryClient = QueryClient.withExtensions(cometClient, setupFeegrantExtension);
let allowanceExists: boolean;
try {
Expand Down