-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unify ports for all tests suites/each job runs in its own machine; modify e2e workflow to run upgrade-chain test * Upgrade test chain infra * Integrate zombie tests and chopsticks tests in one workflow each; rm chopsticks-configs/laos as not needed anymore * Add WS provider to describeWithExistingNode as we need to advance blocks in chopsticks * npm fmt * Fix CI typo * Update setups and use chopsticks for upgrade chain test * test upgrade chain finds wasm * fmt * Fix CI * Ugrade chain test * Remove custom IPs for XCM suite
- Loading branch information
1 parent
12e981c
commit 6c7708e
Showing
8 changed files
with
98 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { expect } from "chai"; | ||
import path from "path"; | ||
import { existsSync, readFileSync } from "fs"; | ||
import { step } from "mocha-steps"; | ||
import { describeWithExistingNode } from "@utils/setups"; | ||
import { CHOPSTICKS_LAOS_NODE_IP, RUNTIME_SPEC_VERSION, TARGET_PATH } from "@utils/constants"; | ||
import { sendTxAndWaitForFinalization } from "@utils/transactions"; | ||
|
||
describeWithExistingNode( | ||
"Runtime upgrade", | ||
function () { | ||
step("Runtime spec increases", async function () { | ||
const runtimePath = path.join( | ||
TARGET_PATH, | ||
"release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm" | ||
); | ||
|
||
if (!existsSync(runtimePath)) { | ||
throw new Error(`Unable to find LAOS wasm at ${runtimePath}`); | ||
} | ||
|
||
const wasmFile = readFileSync(runtimePath).toString("hex"); | ||
|
||
const liveSpecVersion = this.chains.laos.consts.system.version.specVersion.toNumber(); | ||
|
||
// The runtime version in LAOS is at most the latest in the repo | ||
expect( | ||
liveSpecVersion <= RUNTIME_SPEC_VERSION, | ||
"live runtime version is greater than developed version" | ||
).to.be.true; | ||
|
||
// Upgrade only if the live spec version isn't the latest in the repo | ||
if (liveSpecVersion !== RUNTIME_SPEC_VERSION) { | ||
const tx = this.chains.laos.tx.sudo.sudo(this.chains.laos.tx.system.setCode(`0x${wasmFile}`)); | ||
|
||
await sendTxAndWaitForFinalization(this.chains.laos, tx, this.ethereumPairs.alith); | ||
|
||
// Advance a block so the upgrade takes place | ||
await this.wsProvider.send("dev_newBlock", [{ count: 1 }]); | ||
|
||
const liveSpecVersion = this.chains.laos.consts.system.version.specVersion.toNumber(); | ||
|
||
expect(liveSpecVersion === RUNTIME_SPEC_VERSION, "Runtime version wasn't upgraded").to.be.true; | ||
} | ||
}); | ||
}, | ||
// Override LAOS node ip as this test is run with chopsticks | ||
CHOPSTICKS_LAOS_NODE_IP | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters