Skip to content

Commit

Permalink
E2E test upgrade chain updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenovilla committed Feb 28, 2025
1 parent 04cace3 commit 2a51181
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository = "https://github.com/freeverseio/laos.git"
homepage = "https://www.laosfoundation.io"
authors = ["Freeverse"]
edition = "2021"
version = "0.29.0"
version = "0.29.90"

[workspace]
resolver = "2"
Expand Down
9 changes: 6 additions & 3 deletions e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from "chai";
import path from "path";
import { blake2AsHex } from "@polkadot/util-crypto";
import { existsSync, readFileSync } from "fs";
import { step } from "mocha-steps";
import { describeWithExistingNode } from "@utils/setups";
Expand All @@ -26,8 +27,6 @@ describeWithExistingNode(
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 smaller than the development version
Expand All @@ -36,7 +35,11 @@ describeWithExistingNode(
"developed runtime version is not greater than the live chain version"
).to.be.true;

const tx = this.chains.laos.tx.sudo.sudo(this.chains.laos.tx.system.setCode(`0x${wasmFile}`));
const wasmFile = readFileSync(runtimePath).toString("hex");
const wasmHex = `0x${wasmFile}`;
const wasmHash = blake2AsHex(wasmHex);
this.wsProvider.send("dev_setStorage", [{ ["system"]: { ["authorizedUpgrade"]: `${wasmHash}01` } }]);
const tx = this.chains.laos.tx.system.applyAuthorizedUpgrade(wasmHex);

const upgradeCooldowns = await this.chains.polkadot.query.paras.upgradeCooldowns();

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ParachainStaking from "../build/contracts/ParachainStaking.sol/ParachainS

// Runtime specs
export const RUNTIME_SPEC_NAME = "laos";
export const RUNTIME_SPEC_VERSION = 2900;
export const RUNTIME_SPEC_VERSION = 2990;
export const RUNTIME_IMPL_VERSION = 0;

// Zombienet endpoints
Expand Down
2 changes: 1 addition & 1 deletion runtime/laos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("laos"),
impl_name: create_runtime_str!("laos"),
authoring_version: 1,
spec_version: 2900,
spec_version: 2990,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
4 changes: 2 additions & 2 deletions runtime/laos/src/tests/metadata15.golden
Original file line number Diff line number Diff line change
Expand Up @@ -38752,7 +38752,7 @@
0,
0,
0,
84,
174,
11,
0,
0,
Expand Down Expand Up @@ -45716,4 +45716,4 @@
}
}
}
]
]

0 comments on commit 2a51181

Please # to comment.