Skip to content

Commit fb0bf17

Browse files
committed
fix upgrade e2e test
1 parent c9f25a8 commit fb0bf17

File tree

4 files changed

+1708
-1158
lines changed

4 files changed

+1708
-1158
lines changed

tests/e2e/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"version": "1.0.0",
44
"description": "Astar end to end tests.",
55
"license": "MIT",
6+
"type": "module",
67
"scripts": {
78
"test": "LOG_LEVEL=error vitest --silent --no-color",
89
"test:runtime-upgrade-shibuya": "RUNTIME=shibuya yarn test tests/runtime-upgrade.test.ts",
910
"test:runtime-upgrade-shiden": "RUNTIME=shiden yarn test tests/runtime-upgrade.test.ts",
1011
"test:runtime-upgrade-astar": "RUNTIME=astar yarn test tests/runtime-upgrade.test.ts"
1112
},
1213
"dependencies": {
13-
"@acala-network/chopsticks-testing": "^0.6.4",
14-
"@polkadot/util-crypto": "^10.1.10",
15-
"typescript": "^4.8.4",
16-
"vitest": "^0.31.0"
14+
"@acala-network/chopsticks-testing": "^0.12.2",
15+
"@polkadot/util-crypto": "^12.6.2",
16+
"typescript": "^5.3.0",
17+
"vitest": "^1.4.0"
1718
},
1819
"prettier": {
1920
"tabWidth": 2,

tests/e2e/tests/runtime-upgrade.test.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@ describe('runtime upgrade', async () => {
1818
const { alice } = testingPairs();
1919

2020
const runtime = process.env.RUNTIME || 'shibuya';
21-
const cxt = await setupContext({ endpoint: endpoints[runtime] });
22-
const { api, dev } = cxt;
21+
const { api, dev, teardown } = await setupContext({ endpoint: endpoints[runtime] });
2322

2423
beforeAll(async () => {
2524
await dev.setStorage({
2625
Sudo: {
2726
Key: alice.address,
2827
},
2928
System: {
30-
Account: [[[alice.address], { data: { free: 100n * 10n ** 18n } }]],
29+
Account: [[[alice.address], { providers: 1, data: { free: 1000n * 10n ** 18n } }]],
3130
},
3231
});
3332
});
3433

3534
afterAll(async () => {
36-
await cxt.teardown();
35+
await teardown();
3736
});
3837

3938
// Execution hook before runtime upgrade. To test storage migrations, set up the storage items
@@ -73,12 +72,14 @@ describe('runtime upgrade', async () => {
7372
await api.tx.sudo
7473
.sudoUncheckedWeight(
7574
api.tx.system.setCode('0x' + code.toString('hex')),
76-
0
75+
{}
7776
)
7877
.signAndSend(alice);
7978

8079
// Do block production.
8180
await dev.newBlock({ count: 2 });
81+
// wait a bit for pjs/api to update
82+
await new Promise((r) => setTimeout(r, 1000));
8283

8384
// The spec version is increased.
8485
const curSpecVersion = await specVersion(api);
File renamed without changes.

0 commit comments

Comments
 (0)