From c90c992f4f8a82c70fdc16b291fe9e71c8492bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Senovilla=20Polo?= Date: Fri, 13 Dec 2024 12:57:46 +0100 Subject: [PATCH 1/2] Upgrade chain test fails if LAOS live version equals developed version --- .../tests/upgrade-chain/test-upgrade-chain.ts | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts b/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts index 4831fef15..520f08ea6 100644 --- a/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts +++ b/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts @@ -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 equals 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 From f44cc5e767e46821036ef6cdee90cd597a3e9611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Senovilla=20Polo?= <117524919+tsenovilla@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:35:38 +0100 Subject: [PATCH 2/2] Update e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts Co-authored-by: Luigi di Girolamo <17044119+luispdm@users.noreply.github.com> --- e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts b/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts index 520f08ea6..5e03afd72 100644 --- a/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts +++ b/e2e-tests/tests/upgrade-chain/test-upgrade-chain.ts @@ -26,7 +26,7 @@ describeWithExistingNode( // The runtime version in LAOS is at smaller than the development version expect( liveSpecVersion < RUNTIME_SPEC_VERSION, - "developed runtime version equals live chain version" + "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}`));