Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade chain test fails if LAOS live version equals developed version #916

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,22 @@ describeWithExistingNode(

const liveSpecVersion = this.chains.laos.consts.system.version.specVersion.toNumber();

// The runtime version in LAOS is at most the latest in the repo
// The runtime version in LAOS is at smaller than the development version
expect(
liveSpecVersion <= RUNTIME_SPEC_VERSION,
"live runtime version is greater than developed version"
liveSpecVersion < RUNTIME_SPEC_VERSION,
"developed runtime version is not greater than the live chain 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}`));
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);
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 }]);
// Advance some blocks so the upgrade takes place
await this.wsProvider.send("dev_newBlock", [{ count: 5 }]);

const liveSpecVersion = this.chains.laos.consts.system.version.specVersion.toNumber();
const updatedSpecVersion = this.chains.laos.consts.system.version.specVersion.toNumber();

expect(liveSpecVersion === RUNTIME_SPEC_VERSION, "Runtime version wasn't upgraded").to.be.true;
}
expect(updatedSpecVersion === RUNTIME_SPEC_VERSION, "Runtime version wasn't upgraded").to.be.true;
});
},
// Override LAOS node ip as this test is run with chopsticks
Expand Down
Loading