Skip to content

Commit 0c5d4ab

Browse files
authored
Merge pull request #1653 from cosmos/use-simapp-50-for-tests-native
Use simapp version 50 for most of the CI tests
2 parents 0d9181d + 92b04ea commit 0c5d4ab

File tree

88 files changed

+62
-6406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+62
-6406
lines changed

.circleci/config.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ workflows:
2828
- build
2929
matrix:
3030
parameters:
31-
simapp: ["simapp44", "simapp46", "simapp47", "simapp50"]
31+
simapp: ["simapp47", "simapp50"]
3232
- test-node:
3333
requires:
3434
- build
@@ -170,8 +170,6 @@ jobs:
170170
SKIP_BUILD: 1
171171
WASMD_ENABLED: 1
172172
command: |
173-
[ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1
174-
[ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1
175173
[ "<< parameters.simapp >>" = "simapp47" ] && export SIMAPP47_ENABLED=1 SLOW_SIMAPP47_ENABLED=1
176174
[ "<< parameters.simapp >>" = "simapp50" ] && export SIMAPP50_ENABLED=1 SLOW_SIMAPP50_ENABLED=1
177175
yarn test --stream
@@ -191,8 +189,6 @@ jobs:
191189
SKIP_BUILD: 1
192190
WASMD_ENABLED: 1
193191
command: |
194-
[ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1
195-
[ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1
196192
[ "<< parameters.simapp >>" = "simapp47" ] && export SIMAPP47_ENABLED=1 SLOW_SIMAPP47_ENABLED=1
197193
[ "<< parameters.simapp >>" = "simapp50" ] && export SIMAPP50_ENABLED=1 SLOW_SIMAPP50_ENABLED=1
198194
./run_examples.sh
@@ -234,11 +230,11 @@ jobs:
234230
background: true
235231
- run:
236232
name: Start simapp
237-
command: ./scripts/simapp44/start.sh
233+
command: ./scripts/simapp50/start.sh
238234
background: true
239235
- run:
240236
name: Start slow simapp
241-
command: ./scripts/simapp44/slow_start.sh
237+
command: ./scripts/simapp50/slow_start.sh
242238
background: true
243239
- run:
244240
name: Start Tendermint blockchains
@@ -305,8 +301,8 @@ jobs:
305301
- run:
306302
environment:
307303
HTTPSERVER_ENABLED: 1
308-
SIMAPP44_ENABLED: 1
309-
SLOW_SIMAPP44_ENABLED: 1
304+
SIMAPP50_ENABLED: 1
305+
SLOW_SIMAPP50_ENABLED: 1
310306
TENDERMINT_ENABLED: 1
311307
SOCKETSERVER_ENABLED: 1
312308
SKIP_BUILD: 1
@@ -325,8 +321,8 @@ jobs:
325321
working_directory: packages/cli
326322
environment:
327323
HTTPSERVER_ENABLED: 1
328-
SIMAPP44_ENABLED: 1
329-
SLOW_SIMAPP44_ENABLED: 1
324+
SIMAPP50_ENABLED: 1
325+
SLOW_SIMAPP50_ENABLED: 1
330326
TENDERMINT_ENABLED: 1
331327
SOCKETSERVER_ENABLED: 1
332328
SKIP_BUILD: 1
@@ -338,8 +334,8 @@ jobs:
338334
./scripts/httpserver/stop.sh
339335
./scripts/socketserver/stop.sh
340336
./scripts/tendermint/all_stop.sh
341-
./scripts/simapp44/stop.sh
342-
./scripts/simapp44/slow_stop.sh
337+
./scripts/simapp50/stop.sh
338+
./scripts/simapp50/slow_stop.sh
343339
./scripts/wasmd/stop.sh
344340
test-chrome:
345341
machine:
@@ -368,11 +364,11 @@ jobs:
368364
background: true
369365
- run:
370366
name: Start simapp
371-
command: ./scripts/simapp44/start.sh
367+
command: ./scripts/simapp50/start.sh
372368
background: true
373369
- run:
374370
name: Start slow simapp
375-
command: ./scripts/simapp44/slow_start.sh
371+
command: ./scripts/simapp50/slow_start.sh
376372
background: true
377373
- run:
378374
name: Start Tendermint blockchains
@@ -435,8 +431,8 @@ jobs:
435431
- run:
436432
environment:
437433
HTTPSERVER_ENABLED: 1
438-
SIMAPP44_ENABLED: 1
439-
SLOW_SIMAPP44_ENABLED: 1
434+
SIMAPP50_ENABLED: 1
435+
SLOW_SIMAPP50_ENABLED: 1
440436
TENDERMINT_ENABLED: 1
441437
SOCKETSERVER_ENABLED: 1
442438
SKIP_BUILD: 1
@@ -448,8 +444,8 @@ jobs:
448444
./scripts/httpserver/stop.sh
449445
./scripts/socketserver/stop.sh
450446
./scripts/tendermint/all_stop.sh
451-
./scripts/simapp44/stop.sh
452-
./scripts/simapp44/slow_stop.sh
447+
./scripts/simapp50/stop.sh
448+
./scripts/simapp50/slow_stop.sh
453449
./scripts/wasmd/stop.sh
454450
coverage:
455451
machine:
@@ -477,11 +473,11 @@ jobs:
477473
background: true
478474
- run:
479475
name: Start simapp
480-
command: ./scripts/simapp44/start.sh
476+
command: ./scripts/simapp50/start.sh
481477
background: true
482478
- run:
483479
name: Start slow simapp
484-
command: ./scripts/simapp44/slow_start.sh
480+
command: ./scripts/simapp50/slow_start.sh
485481
background: true
486482
- run:
487483
name: Start Tendermint blockchains
@@ -544,8 +540,8 @@ jobs:
544540
- run:
545541
environment:
546542
HTTPSERVER_ENABLED: 1
547-
SIMAPP44_ENABLED: 1
548-
SLOW_SIMAPP44_ENABLED: 1
543+
SIMAPP50_ENABLED: 1
544+
SLOW_SIMAPP50_ENABLED: 1
549545
TENDERMINT_ENABLED: 1
550546
SOCKETSERVER_ENABLED: 1
551547
SKIP_BUILD: 1
@@ -560,8 +556,8 @@ jobs:
560556
./scripts/httpserver/stop.sh
561557
./scripts/socketserver/stop.sh
562558
./scripts/tendermint/all_stop.sh
563-
./scripts/simapp44/stop.sh
564-
./scripts/simapp44/slow_stop.sh
559+
./scripts/simapp50/stop.sh
560+
./scripts/simapp50/slow_stop.sh
565561
./scripts/wasmd/stop.sh
566562
docs-build:
567563
docker:

HACKING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ raw Tendermint and a basic WebSocket server.
5757
export WASMD_ENABLED=1
5858

5959
# Start simapp
60-
./scripts/simapp44/start.sh
61-
export SIMAPP44_ENABLED=1
60+
./scripts/simapp50/start.sh
61+
export SIMAPP50_ENABLED=1
6262

6363
# Start Tendermint
6464
./scripts/tendermint/all_start.sh
@@ -79,7 +79,7 @@ yarn test
7979
unset HTTPSERVER_ENABLED
8080
unset SOCKETSERVER_ENABLED
8181
unset TENDERMINT_ENABLED
82-
unset SIMAPP44_ENABLED
82+
unset SIMAPP50_ENABLED
8383
unset WASMD_ENABLED
8484
./scripts/httpserver/stop.sh
8585
./scripts/socketserver/stop.sh

packages/cli/examples/delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const msg: MsgDelegateEncodeObject = {
2727
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
2828
value: {
2929
delegatorAddress: signerAddress,
30-
// To get the proper validator address, start the demo chain (./scripts/simapp44/start.sh), then run:
30+
// To get the proper validator address, start the demo chain (./scripts/simapp50/start.sh), then run:
3131
// curl http://localhost:1318/staking/validators | jq '.result[0].operator_address'
3232
validatorAddress: "cosmosvaloper12nt2hqjps8r065wc02qks88tvqzdeua06e982h",
3333
amount: coin(300000, "ustake"),

packages/cli/examples/simulate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, wallet
3939
const recipient = "cosmos1xv9tklw7d82sezh9haa573wufgy59vmwe6xxe5";
4040
const amount = coins(1234567, "ucosm");
4141
const memo = "With simulate";
42-
const result = await client.sendTokens(account.address, recipient, amount, 1.2, memo);
42+
const result = await client.sendTokens(account.address, recipient, amount, 1.5, memo);
4343
assertIsDeliverTxSuccess(result);
4444
console.log("Successfully broadcasted:", result);
4545
}
@@ -58,7 +58,7 @@ const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, wallet
5858
};
5959
const memo = "With simulate";
6060
const gasEstimation = await client.simulate(account.address, [sendMsg], memo);
61-
const fee = calculateFee(Math.round(gasEstimation * 1.3), gasPrice);
61+
const fee = calculateFee(Math.round(gasEstimation * 1.5), gasPrice);
6262
const result = await client.sendTokens(account.address, recipient, amount, fee, memo);
6363
assertIsDeliverTxSuccess(result);
6464
console.log("Successfully broadcasted:", result);
@@ -114,7 +114,7 @@ const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, wallet
114114
};
115115
const memo = "With simulate";
116116
const gasEstimation = await client.simulate(account.address, [sendMsg], memo);
117-
const fee = calculateFee(Math.round(gasEstimation * 1.3), gasPrice);
117+
const fee = calculateFee(Math.round(gasEstimation * 1.5), gasPrice);
118118
const result = await client.signAndBroadcast(account.address, [sendMsg], fee, memo);
119119
assertIsDeliverTxSuccess(result);
120120
console.log("Successfully broadcasted:", result);

packages/cli/run_examples.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ command -v shellcheck >/dev/null && shellcheck "$0"
55
if [ -n "${WASMD_ENABLED:-}" ]; then
66
yarn node ./bin/cosmjs-cli --init examples/cosmwasm.ts --code "process.exit(0)"
77
fi
8-
if [ -n "${SIMAPP44_ENABLED:-}" ]; then
8+
if [ -n "${SIMAPP50_ENABLED:-}" ]; then
99
yarn node ./bin/cosmjs-cli --init examples/delegate.ts --code "process.exit(0)"
1010
fi
1111
yarn node ./bin/cosmjs-cli --init examples/faucet_addresses.ts --code "process.exit(0)"
1212
yarn node ./bin/cosmjs-cli --init examples/generate_address.ts --code "process.exit(0)"
13-
yarn node ./bin/cosmjs-cli --init examples/instantiate2_addresses.ts --code "process.exit(0)"
13+
yarn node ./bin/cosmjs-cli --init examples/instantiate2_addresses.ts --code "process.exit(0)"
1414
yarn node ./bin/cosmjs-cli --init examples/local_faucet.ts --code "process.exit(0)"
1515
yarn node ./bin/cosmjs-cli --init examples/mask.ts --code "process.exit(0)"
1616
yarn node ./bin/cosmjs-cli --init examples/multisig_address.ts --code "process.exit(0)"
17-
if [ -n "${SIMAPP44_ENABLED:-}" ]; then
17+
if [ -n "${SIMAPP50_ENABLED:-}" ]; then
1818
yarn node ./bin/cosmjs-cli --init examples/stargate.ts --code "process.exit(0)"
1919
yarn node ./bin/cosmjs-cli --init examples/simulate.ts --code "process.exit(0)"
2020
fi

packages/faucet/src/faucet.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ import { Faucet } from "./faucet";
77
import { TokenConfiguration } from "./tokenmanager";
88

99
function pendingWithoutSimapp(): void {
10-
if (
11-
!process.env.SIMAPP44_ENABLED &&
12-
!process.env.SIMAPP46_ENABLED &&
13-
!process.env.SIMAPP47_ENABLED &&
14-
!process.env.SIMAPP50_ENABLED
15-
) {
16-
return pending("Set SIMAPP{44,46,47,50}_ENABLED to enabled Stargate node-based tests");
10+
if (!process.env.SIMAPP47_ENABLED && !process.env.SIMAPP50_ENABLED) {
11+
return pending("Set SIMAPP{47,50}_ENABLED to enabled Stargate node-based tests");
1712
}
1813
}
1914

packages/ledger-amino/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ transactions.
5656
### Stargate tests
5757

5858
Start a local Stargate blockchain as described in
59-
[scripts/simapp44/README.md](https://github.com/cosmos/cosmjs/blob/main/scripts/simapp44/README.md)
59+
[scripts/simapp50/README.md](https://github.com/cosmos/cosmjs/blob/main/scripts/simapp50/README.md)
6060
and execute:
6161

6262
```sh
6363
export LEDGER_ENABLED=1
64-
export SIMAPP44_ENABLED=1
64+
export SIMAPP50_ENABLED=1
6565
yarn test
6666
```
6767

packages/ledger-amino/src/testutils.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,12 @@ export function pendingWithoutLedger(): void {
1919
}
2020

2121
export function simappEnabled(): boolean {
22-
return (
23-
!!process.env.SIMAPP44_ENABLED ||
24-
!!process.env.SIMAPP46_ENABLED ||
25-
!!process.env.SIMAPP47_ENABLED ||
26-
!!process.env.SIMAPP50_ENABLED
27-
);
22+
return !!process.env.SIMAPP47_ENABLED || !!process.env.SIMAPP50_ENABLED;
2823
}
2924

3025
export function pendingWithoutSimapp(): void {
3126
if (!simappEnabled()) {
32-
return pending("Set SIMAPP{44,46,47,50}_ENABLED to enable Simapp-based tests");
27+
return pending("Set SIMAPP{47,50}_ENABLED to enable Simapp-based tests");
3328
}
3429
}
3530

packages/stargate/src/modules/authz/queries.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
faucet,
1313
makeRandomAddress,
1414
pendingWithoutSimapp,
15-
pendingWithoutSimapp46OrHigher,
1615
simapp,
1716
simappEnabled,
1817
} from "../../testutils.spec";
@@ -102,7 +101,6 @@ describe("AuthzExtension", () => {
102101

103102
describe("granter grants", () => {
104103
it("works", async () => {
105-
pendingWithoutSimapp46OrHigher();
106104
const [client, cometClient] = await makeClientWithAuthz(simapp.tendermintUrlHttp);
107105
const response = await client.authz.granterGrants(granter1Address);
108106
expect(response.grants.length).toBeGreaterThanOrEqual(1);
@@ -133,7 +131,6 @@ describe("AuthzExtension", () => {
133131

134132
describe("grantee grants", () => {
135133
it("works", async () => {
136-
pendingWithoutSimapp46OrHigher();
137134
const [client, cometClient] = await makeClientWithAuthz(simapp.tendermintUrlHttp);
138135
const response = await client.authz.granteeGrants(grantee1Address);
139136
expect(response.grants.length).toEqual(1);

packages/stargate/src/modules/gov/queries.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
nonNegativeIntegerMatcher,
2222
pendingWithoutSimapp,
2323
simapp,
24-
simapp44Enabled,
2524
simappEnabled,
2625
validator,
2726
} from "../../testutils.spec";
@@ -334,9 +333,7 @@ describe("GovExtension", () => {
334333
Vote.fromPartial({
335334
proposalId: longify(proposalId),
336335
voter: voter2Address,
337-
option: simapp44Enabled()
338-
? VoteOption.VOTE_OPTION_NO_WITH_VETO
339-
: VoteOption.VOTE_OPTION_UNSPECIFIED,
336+
option: VoteOption.VOTE_OPTION_UNSPECIFIED,
340337
options: [
341338
WeightedVoteOption.fromPartial({
342339
option: VoteOption.VOTE_OPTION_NO_WITH_VETO,
@@ -347,7 +344,7 @@ describe("GovExtension", () => {
347344
Vote.fromPartial({
348345
proposalId: longify(proposalId),
349346
voter: voter1Address,
350-
option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED,
347+
option: VoteOption.VOTE_OPTION_UNSPECIFIED,
351348
options: [
352349
WeightedVoteOption.fromPartial({
353350
option: VoteOption.VOTE_OPTION_YES,
@@ -372,7 +369,7 @@ describe("GovExtension", () => {
372369
Vote.fromPartial({
373370
voter: voter1Address,
374371
proposalId: longify(proposalId),
375-
option: simapp44Enabled() ? VoteOption.VOTE_OPTION_YES : VoteOption.VOTE_OPTION_UNSPECIFIED,
372+
option: VoteOption.VOTE_OPTION_UNSPECIFIED,
376373
options: [
377374
WeightedVoteOption.fromPartial({
378375
option: VoteOption.VOTE_OPTION_YES,

packages/stargate/src/modules/tx/queries.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
makeRandomAddress,
1313
pendingWithoutSimapp,
1414
simapp,
15-
simapp44Enabled,
1615
simappEnabled,
1716
validator,
1817
} from "../../testutils.spec";
@@ -97,7 +96,7 @@ describe("TxExtension", () => {
9796
expect(response.gasInfo?.gasUsed).toBeLessThanOrEqual(200_000);
9897
expect(response.gasInfo?.gasWanted).toEqual(
9998
// Some dummy value. Value does not matter for regular users.
100-
simapp44Enabled() ? BigInt(0) : BigInt("0xffffffffffffffff"),
99+
BigInt("0xffffffffffffffff"),
101100
);
102101

103102
cometClient.disconnect();

packages/stargate/src/modules/vesting/messages.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
faucet,
1010
makeRandomAddress,
1111
pendingWithoutSimapp,
12-
pendingWithoutSimapp46OrHigher,
1312
simapp,
1413
} from "../../testutils.spec";
1514

@@ -46,7 +45,6 @@ describe("vesting messages", () => {
4645
});
4746

4847
it("works with Amino JSON signer", async () => {
49-
pendingWithoutSimapp46OrHigher(); // Amino JSON broken on chain before Cosmos SDK 0.46
5048
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic);
5149
const client = await SigningStargateClient.connectWithSigner(
5250
simapp.tendermintUrlHttp,

0 commit comments

Comments
 (0)