diff --git a/.circleci/config.yml b/.circleci/config.yml index 5fd6a76c..23ae5c75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ workflows: - build matrix: parameters: - simapp: ["simapp42", "simapp44", "simapp46"] + simapp: ["simapp44", "simapp46"] - test-node: requires: - build @@ -157,7 +157,6 @@ jobs: SKIP_BUILD: 1 WASMD_ENABLED: 1 command: | - [ "<< parameters.simapp >>" = "simapp42" ] && export SIMAPP42_ENABLED=1 SLOW_SIMAPP42_ENABLED=1 [ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1 [ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1 yarn test --stream @@ -177,7 +176,6 @@ jobs: SKIP_BUILD: 1 WASMD_ENABLED: 1 command: | - [ "<< parameters.simapp >>" = "simapp42" ] && export SIMAPP42_ENABLED=1 SLOW_SIMAPP42_ENABLED=1 [ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1 [ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1 ./run_examples.sh diff --git a/packages/cli/examples/delegate.ts b/packages/cli/examples/delegate.ts index 7e473703..a3604a5a 100644 --- a/packages/cli/examples/delegate.ts +++ b/packages/cli/examples/delegate.ts @@ -27,7 +27,7 @@ const msg: MsgDelegateEncodeObject = { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: { delegatorAddress: signerAddress, - // To get the proper validator address, start the demo chain (./scripts/simapp42/start.sh), then run: + // To get the proper validator address, start the demo chain (./scripts/simapp44/start.sh), then run: // curl http://localhost:1318/staking/validators | jq '.result[0].operator_address' validatorAddress: "cosmosvaloper1urk9gy7cfws0ak9x5nu7lx4un9n6gqkrp230jk", amount: coin(300000, "ustake"), diff --git a/packages/cli/run_examples.sh b/packages/cli/run_examples.sh index 5e301bca..f4edba23 100755 --- a/packages/cli/run_examples.sh +++ b/packages/cli/run_examples.sh @@ -5,7 +5,7 @@ command -v shellcheck >/dev/null && shellcheck "$0" if [ -n "${WASMD_ENABLED:-}" ]; then yarn node ./bin/cosmjs-cli --init examples/cosmwasm.ts --code "process.exit(0)" fi -if [ -n "${SIMAPP42_ENABLED:-}" ]; then +if [ -n "${SIMAPP44_ENABLED:-}" ]; then yarn node ./bin/cosmjs-cli --init examples/delegate.ts --code "process.exit(0)" fi yarn node ./bin/cosmjs-cli --init examples/faucet_addresses.ts --code "process.exit(0)" @@ -13,7 +13,7 @@ yarn node ./bin/cosmjs-cli --init examples/generate_address.ts --code "process.e yarn node ./bin/cosmjs-cli --init examples/local_faucet.ts --code "process.exit(0)" yarn node ./bin/cosmjs-cli --init examples/mask.ts --code "process.exit(0)" yarn node ./bin/cosmjs-cli --init examples/multisig_address.ts --code "process.exit(0)" -if [ -n "${SIMAPP42_ENABLED:-}" ]; then +if [ -n "${SIMAPP44_ENABLED:-}" ]; then yarn node ./bin/cosmjs-cli --init examples/stargate.ts --code "process.exit(0)" yarn node ./bin/cosmjs-cli --init examples/simulate.ts --code "process.exit(0)" fi diff --git a/packages/faucet/src/faucet.spec.ts b/packages/faucet/src/faucet.spec.ts index 5d2748ae..dea04ba9 100644 --- a/packages/faucet/src/faucet.spec.ts +++ b/packages/faucet/src/faucet.spec.ts @@ -7,8 +7,8 @@ import { Faucet } from "./faucet"; import { TokenConfiguration } from "./tokenmanager"; function pendingWithoutSimapp(): void { - if (!process.env.SIMAPP42_ENABLED && !process.env.SIMAPP44_ENABLED && !process.env.SIMAPP46_ENABLED) { - return pending("Set SIMAPP{42,44,46}_ENABLED to enabled Stargate node-based tests"); + if (!process.env.SIMAPP44_ENABLED && !process.env.SIMAPP46_ENABLED) { + return pending("Set SIMAPP{44,46}_ENABLED to enabled Stargate node-based tests"); } } diff --git a/packages/ledger-amino/README.md b/packages/ledger-amino/README.md index ce61d8eb..35479f8c 100644 --- a/packages/ledger-amino/README.md +++ b/packages/ledger-amino/README.md @@ -56,12 +56,12 @@ transactions. ### Stargate tests Start a local Stargate blockchain as described in -[scripts/simapp42/README.md](https://github.com/cosmos/cosmjs/blob/main/scripts/simapp42/README.md) +[scripts/simapp44/README.md](https://github.com/cosmos/cosmjs/blob/main/scripts/simapp44/README.md) and execute: ```sh export LEDGER_ENABLED=1 -export SIMAPP42_ENABLED=1 +export SIMAPP44_ENABLED=1 yarn test ``` diff --git a/packages/ledger-amino/src/testutils.spec.ts b/packages/ledger-amino/src/testutils.spec.ts index 5a689c14..d6c3fdf9 100644 --- a/packages/ledger-amino/src/testutils.spec.ts +++ b/packages/ledger-amino/src/testutils.spec.ts @@ -19,12 +19,12 @@ export function pendingWithoutLedger(): void { } export function simappEnabled(): boolean { - return !!process.env.SIMAPP42_ENABLED || !!process.env.SIMAPP44_ENABLED || !!process.env.SIMAPP46_ENABLED; + return !!process.env.SIMAPP44_ENABLED || !!process.env.SIMAPP46_ENABLED; } export function pendingWithoutSimapp(): void { if (!simappEnabled()) { - return pending("Set SIMAPP{42,44,46}_ENABLED to enable Simapp-based tests"); + return pending("Set SIMAPP{44,46}_ENABLED to enable Simapp-based tests"); } } diff --git a/packages/stargate/src/modules/gov/queries.spec.ts b/packages/stargate/src/modules/gov/queries.spec.ts index 93ff788b..80de9d86 100644 --- a/packages/stargate/src/modules/gov/queries.spec.ts +++ b/packages/stargate/src/modules/gov/queries.spec.ts @@ -22,7 +22,6 @@ import { nonNegativeIntegerMatcher, pendingWithoutSimapp, simapp, - simapp42Enabled, simapp44Enabled, simappEnabled, validator, @@ -329,49 +328,34 @@ describe("GovExtension", () => { const [client, tmClient] = await makeClientWithGov(simapp.tendermintUrl); const response = await client.gov.votes(proposalId); - if (simapp42Enabled()) { - expect(response.votes).toEqual([ - // why is vote 2 first? - Vote.fromPartial({ - proposalId: longify(proposalId), - voter: voter2Address, - option: VoteOption.VOTE_OPTION_NO_WITH_VETO, - }), - Vote.fromPartial({ - proposalId: longify(proposalId), - voter: voter1Address, - option: VoteOption.VOTE_OPTION_YES, - }), - ]); - } else { - expect(response.votes).toEqual([ - // why is vote 2 first? - Vote.fromPartial({ - proposalId: longify(proposalId), - voter: voter2Address, - option: simapp44Enabled() - ? VoteOption.VOTE_OPTION_NO_WITH_VETO - : VoteOption.VOTE_OPTION_UNSPECIFIED, - options: [ - WeightedVoteOption.fromPartial({ - option: VoteOption.VOTE_OPTION_NO_WITH_VETO, - weight: "1000000000000000000", - }), - ], - }), - Vote.fromPartial({ - proposalId: longify(proposalId), - voter: voter1Address, - option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED, - options: [ - WeightedVoteOption.fromPartial({ - option: VoteOption.VOTE_OPTION_YES, - weight: "1000000000000000000", - }), - ], - }), - ]); - } + + expect(response.votes).toEqual([ + // why is vote 2 first? + Vote.fromPartial({ + proposalId: longify(proposalId), + voter: voter2Address, + option: simapp44Enabled() + ? VoteOption.VOTE_OPTION_NO_WITH_VETO + : VoteOption.VOTE_OPTION_UNSPECIFIED, + options: [ + WeightedVoteOption.fromPartial({ + option: VoteOption.VOTE_OPTION_NO_WITH_VETO, + weight: "1000000000000000000", + }), + ], + }), + Vote.fromPartial({ + proposalId: longify(proposalId), + voter: voter1Address, + option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED, + options: [ + WeightedVoteOption.fromPartial({ + option: VoteOption.VOTE_OPTION_YES, + weight: "1000000000000000000", + }), + ], + }), + ]); tmClient.disconnect(); }); @@ -384,29 +368,19 @@ describe("GovExtension", () => { const [client, tmClient] = await makeClientWithGov(simapp.tendermintUrl); const response = await client.gov.vote(proposalId, voter1Address); - if (simapp42Enabled()) { - expect(response.vote).toEqual( - Vote.fromPartial({ - voter: voter1Address, - proposalId: longify(proposalId), - option: VoteOption.VOTE_OPTION_YES, - }), - ); - } else { - expect(response.vote).toEqual( - Vote.fromPartial({ - voter: voter1Address, - proposalId: longify(proposalId), - option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED, - options: [ - WeightedVoteOption.fromPartial({ - option: VoteOption.VOTE_OPTION_YES, - weight: "1000000000000000000", - }), - ], - }), - ); - } + expect(response.vote).toEqual( + Vote.fromPartial({ + voter: voter1Address, + proposalId: longify(proposalId), + option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED, + options: [ + WeightedVoteOption.fromPartial({ + option: VoteOption.VOTE_OPTION_YES, + weight: "1000000000000000000", + }), + ], + }), + ); tmClient.disconnect(); }); diff --git a/packages/stargate/src/modules/ibc/queries.spec.ts b/packages/stargate/src/modules/ibc/queries.spec.ts index 7455fe19..5c6e5449 100644 --- a/packages/stargate/src/modules/ibc/queries.spec.ts +++ b/packages/stargate/src/modules/ibc/queries.spec.ts @@ -2,7 +2,7 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; import Long from "long"; import { QueryClient } from "../../queryclient"; -import { pendingWithoutSimapp42, simapp } from "../../testutils.spec"; +import { simapp } from "../../testutils.spec"; import * as ibcTest from "./ibctestdata.spec"; import { IbcExtension, setupIbcExtension } from "./queries"; @@ -15,7 +15,7 @@ describe("IbcExtension", () => { describe("channel", () => { describe("channel", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.channel(ibcTest.portId, ibcTest.channelId); @@ -29,7 +29,7 @@ describe("IbcExtension", () => { describe("channels", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.channels(); @@ -43,7 +43,7 @@ describe("IbcExtension", () => { describe("allChannels", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.allChannels(); @@ -55,7 +55,7 @@ describe("IbcExtension", () => { describe("connectionChannels", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.connectionChannels(ibcTest.connectionId); @@ -69,7 +69,7 @@ describe("IbcExtension", () => { describe("allConnectionChannels", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.allConnectionChannels(ibcTest.connectionId); @@ -81,7 +81,7 @@ describe("IbcExtension", () => { describe("clientState", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.clientState(ibcTest.portId, ibcTest.channelId); @@ -99,7 +99,7 @@ describe("IbcExtension", () => { describe("consensusState", () => { xit("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.consensusState( @@ -121,7 +121,7 @@ describe("IbcExtension", () => { describe("packetCommitment", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.packetCommitment( @@ -139,7 +139,7 @@ describe("IbcExtension", () => { describe("packetCommitments", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.packetCommitments(ibcTest.portId, ibcTest.channelId); @@ -153,7 +153,7 @@ describe("IbcExtension", () => { describe("allPacketCommitments", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.allPacketCommitments(ibcTest.portId, ibcTest.channelId); @@ -165,7 +165,7 @@ describe("IbcExtension", () => { describe("packetReceipt", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.packetReceipt(ibcTest.portId, ibcTest.channelId, 1); @@ -178,7 +178,7 @@ describe("IbcExtension", () => { describe("packetAcknowledgement", () => { it("works", async () => { pending("We don't have an acknowledgement for testing at the moment"); - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.packetAcknowledgement( @@ -196,7 +196,7 @@ describe("IbcExtension", () => { describe("packetAcknowledgements", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.packetAcknowledgements(ibcTest.portId, ibcTest.channelId); @@ -210,7 +210,7 @@ describe("IbcExtension", () => { describe("allPacketAcknowledgements", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.allPacketAcknowledgements( @@ -225,7 +225,7 @@ describe("IbcExtension", () => { describe("unreceivedPackets", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.unreceivedPackets( @@ -242,7 +242,7 @@ describe("IbcExtension", () => { describe("unreceivedAcks", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.unreceivedAcks( @@ -259,7 +259,7 @@ describe("IbcExtension", () => { describe("nextSequenceReceive", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.channel.nextSequenceReceive(ibcTest.portId, ibcTest.channelId); @@ -275,7 +275,7 @@ describe("IbcExtension", () => { describe("client", () => { describe("state", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.state(ibcTest.clientId); @@ -290,7 +290,7 @@ describe("IbcExtension", () => { describe("states", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.states(); @@ -311,7 +311,7 @@ describe("IbcExtension", () => { describe("allStates", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.allStates(); @@ -331,7 +331,7 @@ describe("IbcExtension", () => { describe("consensusState", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.consensusState(ibcTest.clientId); @@ -346,7 +346,7 @@ describe("IbcExtension", () => { describe("consensusStates", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.consensusStates(ibcTest.clientId); @@ -368,7 +368,7 @@ describe("IbcExtension", () => { describe("allConsensusStates", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.allConsensusStates(ibcTest.clientId); @@ -390,7 +390,7 @@ describe("IbcExtension", () => { describe("params", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.params(); @@ -404,7 +404,7 @@ describe("IbcExtension", () => { describe("stateTm", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.stateTm(ibcTest.clientId); @@ -417,7 +417,7 @@ describe("IbcExtension", () => { describe("statesTm", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.statesTm(); @@ -435,7 +435,7 @@ describe("IbcExtension", () => { describe("allStatesTm", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.allStatesTm(); @@ -453,7 +453,7 @@ describe("IbcExtension", () => { describe("consensusStateTm", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.client.consensusStateTm(ibcTest.clientId); @@ -468,7 +468,7 @@ describe("IbcExtension", () => { describe("connection", () => { describe("connection", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.connection.connection(ibcTest.connectionId); @@ -482,7 +482,7 @@ describe("IbcExtension", () => { describe("connections", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.connection.connections(); @@ -496,7 +496,7 @@ describe("IbcExtension", () => { describe("allConnections", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.connection.allConnections(); @@ -508,7 +508,7 @@ describe("IbcExtension", () => { describe("clientConnections", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.connection.clientConnections(ibcTest.clientId); @@ -522,7 +522,7 @@ describe("IbcExtension", () => { describe("clientState", () => { it("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); const response = await client.ibc.connection.clientState(ibcTest.connectionId); @@ -540,7 +540,7 @@ describe("IbcExtension", () => { describe("consensusState", () => { xit("works", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); // TODO: Find valid values diff --git a/packages/stargate/src/modules/tx/queries.spec.ts b/packages/stargate/src/modules/tx/queries.spec.ts index a14a5c74..e521183a 100644 --- a/packages/stargate/src/modules/tx/queries.spec.ts +++ b/packages/stargate/src/modules/tx/queries.spec.ts @@ -13,7 +13,6 @@ import { makeRandomAddress, pendingWithoutSimapp, simapp, - simapp42Enabled, simapp44Enabled, simappEnabled, validator, @@ -99,7 +98,7 @@ describe("TxExtension", () => { expect(response.gasInfo?.gasUsed.toNumber()).toBeLessThanOrEqual(200_000); expect(response.gasInfo?.gasWanted).toEqual( // Some dummy value. Value does not matter for regular users. - simapp42Enabled() || simapp44Enabled() ? Long.UZERO : Long.MAX_UNSIGNED_VALUE, + simapp44Enabled() ? Long.UZERO : Long.MAX_UNSIGNED_VALUE, ); tmClient.disconnect(); diff --git a/packages/stargate/src/queryclient/queryclient.spec.ts b/packages/stargate/src/queryclient/queryclient.spec.ts index f915bde5..0f93b0b9 100644 --- a/packages/stargate/src/queryclient/queryclient.spec.ts +++ b/packages/stargate/src/queryclient/queryclient.spec.ts @@ -4,7 +4,7 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; import { Metadata } from "cosmjs-types/cosmos/bank/v1beta1/bank"; import { QueryAllBalancesRequest, QueryAllBalancesResponse } from "cosmjs-types/cosmos/bank/v1beta1/query"; -import { pendingWithoutSimapp, simapp, simapp42Enabled, simapp44Enabled, unused } from "../testutils.spec"; +import { pendingWithoutSimapp, simapp, simapp44Enabled, unused } from "../testutils.spec"; import { QueryClient } from "./queryclient"; async function makeClient(rpcUrl: string): Promise<[QueryClient, Tendermint34Client]> { @@ -28,7 +28,7 @@ describe("QueryClient", () => { // "keys before 0.45 had denom two times in the key" // https://github.com/cosmos/cosmos-sdk/blob/10ad61a4dd/x/bank/migrations/v045/store_test.go#L91 let key: Uint8Array; - if (simapp42Enabled() || simapp44Enabled()) { + if (simapp44Enabled()) { key = Uint8Array.from([ ...denomMetadataPrefix, ...toAscii(simapp.denomFee), @@ -53,7 +53,7 @@ describe("QueryClient", () => { // "keys before 0.45 had denom two times in the key" // https://github.com/cosmos/cosmos-sdk/blob/10ad61a4dd/x/bank/migrations/v045/store_test.go#L91 let key: Uint8Array; - if (simapp42Enabled() || simapp44Enabled()) { + if (simapp44Enabled()) { key = Uint8Array.from([ ...denomMetadataPrefix, ...toAscii(simapp.denomFee), diff --git a/packages/stargate/src/signingstargateclient.spec.ts b/packages/stargate/src/signingstargateclient.spec.ts index 352bf6b6..96789b34 100644 --- a/packages/stargate/src/signingstargateclient.spec.ts +++ b/packages/stargate/src/signingstargateclient.spec.ts @@ -22,7 +22,6 @@ import { ModifyingDirectSecp256k1HdWallet, ModifyingSecp256k1HdWallet, pendingWithoutSimapp, - pendingWithoutSimapp42, simapp, validator, } from "./testutils.spec"; @@ -145,7 +144,7 @@ describe("SigningStargateClient", () => { describe("sendIbcTokens", () => { it("works with direct signing", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner( simapp.tendermintUrl, @@ -194,7 +193,7 @@ describe("SigningStargateClient", () => { }); it("works with Amino signing", async () => { - pendingWithoutSimapp42(); + pending("We cannot test this easily anymore since the IBC module was removed from simapp"); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner( simapp.tendermintUrl, diff --git a/packages/stargate/src/stargateclient.spec.ts b/packages/stargate/src/stargateclient.spec.ts index c0306d21..6c14a73a 100644 --- a/packages/stargate/src/stargateclient.spec.ts +++ b/packages/stargate/src/stargateclient.spec.ts @@ -28,7 +28,6 @@ import { pendingWithoutSimapp, pendingWithoutSlowSimapp, simapp, - simapp42Enabled, simapp44Enabled, slowSimapp, tendermintIdMatcher, @@ -434,9 +433,7 @@ describe("StargateClient", () => { const txRawBytes = Uint8Array.from(TxRaw.encode(txRaw).finish()); await expectAsync(client.broadcastTx(txRawBytes)).toBeRejectedWithError( - simapp42Enabled() || simapp44Enabled() - ? /invalid recipient address/i - : /Broadcasting transaction failed with code 7/i, + simapp44Enabled() ? /invalid recipient address/i : /Broadcasting transaction failed with code 7/i, ); client.disconnect(); diff --git a/packages/stargate/src/testutils.spec.ts b/packages/stargate/src/testutils.spec.ts index e6f67454..e6dc00a4 100644 --- a/packages/stargate/src/testutils.spec.ts +++ b/packages/stargate/src/testutils.spec.ts @@ -15,10 +15,6 @@ import { AuthInfo, SignDoc, TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx"; import { calculateFee, GasPrice } from "./fee"; import { SigningStargateClientOptions } from "./signingstargateclient"; -export function simapp42Enabled(): boolean { - return !!process.env.SIMAPP42_ENABLED; -} - export function simapp44Enabled(): boolean { return !!process.env.SIMAPP44_ENABLED; } @@ -28,7 +24,7 @@ export function simapp46Enabled(): boolean { } export function simappEnabled(): boolean { - return simapp42Enabled() || simapp44Enabled() || simapp46Enabled(); + return simapp44Enabled() || simapp46Enabled(); } export function pendingWithoutSimapp44Or46(): void { @@ -37,29 +33,19 @@ export function pendingWithoutSimapp44Or46(): void { } } -export function pendingWithoutSimapp42(): void { - if (!simapp42Enabled()) { - return pending("Set SIMAPP42_ENABLED to enable Simapp based tests"); - } -} - export function pendingWithoutSimapp(): void { if (!simappEnabled()) { - return pending("Set SIMAPP{42,44,46}_ENABLED to enable Simapp based tests"); + return pending("Set SIMAPP{44,46}_ENABLED to enable Simapp based tests"); } } export function slowSimappEnabled(): boolean { - return ( - !!process.env.SLOW_SIMAPP42_ENABLED || - !!process.env.SLOW_SIMAPP44_ENABLED || - !!process.env.SLOW_SIMAPP46_ENABLED - ); + return !!process.env.SLOW_SIMAPP44_ENABLED || !!process.env.SLOW_SIMAPP46_ENABLED; } export function pendingWithoutSlowSimapp(): void { if (!slowSimappEnabled()) { - return pending("Set SLOW_SIMAPP{42,44,46}_ENABLED to enable slow Simapp based tests"); + return pending("Set SLOW_SIMAPP{44,46}_ENABLED to enable slow Simapp based tests"); } } @@ -155,10 +141,10 @@ export const unused = { export const validator = { /** - * From first gentx's auth_info.signer_infos in scripts/simapp42/template/.simapp/config/genesis.json + * From first gentx's auth_info.signer_infos in scripts/simapp44/template/.simapp/config/genesis.json * * ``` - * jq ".app_state.genutil.gen_txs[0].auth_info.signer_infos[0].public_key" scripts/simapp42/template/.simapp/config/genesis.json + * jq ".app_state.genutil.gen_txs[0].auth_info.signer_infos[0].public_key" scripts/simapp44/template/.simapp/config/genesis.json * ``` */ pubkey: { @@ -166,18 +152,18 @@ export const validator = { value: "AtDcuH4cX1eaxZrJ5shheLG3tXPAoV4awoIZmNQtQxmf", }, /** - * delegator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/simapp42/template/.simapp/config/genesis.json + * delegator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/simapp44/template/.simapp/config/genesis.json * * ``` - * jq ".app_state.genutil.gen_txs[0].body.messages[0].delegator_address" scripts/simapp42/template/.simapp/config/genesis.json + * jq ".app_state.genutil.gen_txs[0].body.messages[0].delegator_address" scripts/simapp44/template/.simapp/config/genesis.json * ``` */ delegatorAddress: "cosmos1urk9gy7cfws0ak9x5nu7lx4un9n6gqkry79679", /** - * validator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/simapp42/template/.simapp/config/genesis.json + * validator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/simapp44/template/.simapp/config/genesis.json * * ``` - * jq ".app_state.genutil.gen_txs[0].body.messages[0].validator_address" scripts/simapp42/template/.simapp/config/genesis.json + * jq ".app_state.genutil.gen_txs[0].body.messages[0].validator_address" scripts/simapp44/template/.simapp/config/genesis.json * ``` */ validatorAddress: "cosmosvaloper1urk9gy7cfws0ak9x5nu7lx4un9n6gqkrp230jk", diff --git a/packages/stargate/webpack.web.config.js b/packages/stargate/webpack.web.config.js index 6791d453..4497154c 100644 --- a/packages/stargate/webpack.web.config.js +++ b/packages/stargate/webpack.web.config.js @@ -17,8 +17,6 @@ module.exports = [ }, plugins: [ new webpack.EnvironmentPlugin({ - SIMAPP42_ENABLED: "", - SLOW_SIMAPP42_ENABLED: "", SIMAPP44_ENABLED: "", SLOW_SIMAPP44_ENABLED: "", SIMAPP46_ENABLED: "",