Fix some more tests for 0.46
This commit is contained in:
parent
2f3033b5cb
commit
cad4352775
@ -92,7 +92,7 @@ describe("SigningCosmWasmClient", () => {
|
||||
const memo = "Go go go";
|
||||
const gasUsed = await client.simulate(alice.address0, [executeContractMsg], memo);
|
||||
expect(gasUsed).toBeGreaterThanOrEqual(101_000);
|
||||
expect(gasUsed).toBeLessThanOrEqual(150_000);
|
||||
expect(gasUsed).toBeLessThanOrEqual(200_000);
|
||||
client.disconnect();
|
||||
});
|
||||
});
|
||||
|
||||
@ -47,7 +47,7 @@ async function createTransport(): Promise<Transport> {
|
||||
|
||||
describe("LedgerSigner", () => {
|
||||
const defaultChainId = "testing";
|
||||
const defaultFee = calculateFee(80_000, "0.025ucosm");
|
||||
const defaultFee = calculateFee(100_000, "0.025ucosm");
|
||||
const defaultMemo = "Some memo";
|
||||
const defaultSequence = "0";
|
||||
const defaultAccountNumber = "42";
|
||||
|
||||
@ -14,6 +14,7 @@ import {
|
||||
pendingWithoutSimapp44Or46,
|
||||
simapp,
|
||||
simapp44Enabled,
|
||||
simapp46Enabled,
|
||||
} from "../../testutils.spec";
|
||||
import { AuthzExtension, setupAuthzExtension } from "./queries";
|
||||
|
||||
@ -35,7 +36,7 @@ describe("AuthzExtension", () => {
|
||||
const grantedMsg = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
||||
|
||||
beforeAll(async () => {
|
||||
if (simapp44Enabled()) {
|
||||
if (simapp44Enabled() || simapp46Enabled()) {
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, {
|
||||
// Use address 1 and 2 instead of 0 to avoid conflicts with other delegation tests
|
||||
// This must match `voterAddress` above.
|
||||
|
||||
@ -397,7 +397,7 @@ describe("GovExtension", () => {
|
||||
Vote.fromPartial({
|
||||
voter: voter1Address,
|
||||
proposalId: longify(proposalId),
|
||||
option: VoteOption.VOTE_OPTION_YES,
|
||||
option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED,
|
||||
options: [
|
||||
WeightedVoteOption.fromPartial({
|
||||
option: VoteOption.VOTE_OPTION_YES,
|
||||
|
||||
@ -4,7 +4,7 @@ import { assertDefined, sleep } from "@cosmjs/utils";
|
||||
import { MsgDelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
||||
import Long from "long";
|
||||
|
||||
import { longify, QueryClient } from "../../queryclient";
|
||||
import { QueryClient } from "../../queryclient";
|
||||
import { defaultRegistryTypes, SigningStargateClient } from "../../signingstargateclient";
|
||||
import { assertIsDeliverTxSuccess, StargateClient } from "../../stargateclient";
|
||||
import {
|
||||
@ -13,6 +13,8 @@ import {
|
||||
makeRandomAddress,
|
||||
pendingWithoutSimapp,
|
||||
simapp,
|
||||
simapp42Enabled,
|
||||
simapp44Enabled,
|
||||
simappEnabled,
|
||||
validator,
|
||||
} from "../../testutils.spec";
|
||||
@ -94,8 +96,11 @@ describe("TxExtension", () => {
|
||||
const { sequence } = await sequenceClient.getSequence(faucet.address0);
|
||||
const response = await client.tx.simulate([msgAny], "foo", faucet.pubkey0, sequence);
|
||||
expect(response.gasInfo?.gasUsed.toNumber()).toBeGreaterThanOrEqual(101_000);
|
||||
expect(response.gasInfo?.gasUsed.toNumber()).toBeLessThanOrEqual(150_000);
|
||||
expect(response.gasInfo?.gasWanted).toEqual(longify(Long.UZERO));
|
||||
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,
|
||||
);
|
||||
|
||||
tmClient.disconnect();
|
||||
});
|
||||
|
||||
@ -63,7 +63,7 @@ describe("SigningStargateClient", () => {
|
||||
const memo = "Use your power wisely";
|
||||
const gasUsed = await client.simulate(faucet.address0, [msgAny], memo);
|
||||
expect(gasUsed).toBeGreaterThanOrEqual(101_000);
|
||||
expect(gasUsed).toBeLessThanOrEqual(150_000);
|
||||
expect(gasUsed).toBeLessThanOrEqual(200_000);
|
||||
|
||||
client.disconnect();
|
||||
});
|
||||
|
||||
@ -28,6 +28,8 @@ import {
|
||||
pendingWithoutSimapp,
|
||||
pendingWithoutSlowSimapp,
|
||||
simapp,
|
||||
simapp42Enabled,
|
||||
simapp44Enabled,
|
||||
slowSimapp,
|
||||
tendermintIdMatcher,
|
||||
unused,
|
||||
@ -431,7 +433,11 @@ describe("StargateClient", () => {
|
||||
});
|
||||
const txRawBytes = Uint8Array.from(TxRaw.encode(txRaw).finish());
|
||||
|
||||
await expectAsync(client.broadcastTx(txRawBytes)).toBeRejectedWithError(/invalid recipient address/i);
|
||||
await expectAsync(client.broadcastTx(txRawBytes)).toBeRejectedWithError(
|
||||
simapp42Enabled() || simapp44Enabled()
|
||||
? /invalid recipient address/i
|
||||
: /Broadcasting transaction failed with code 7/i,
|
||||
);
|
||||
|
||||
client.disconnect();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user