diff --git a/.changeset/silly-impalas-suffer.md b/.changeset/silly-impalas-suffer.md new file mode 100644 index 00000000..d1ff34bc --- /dev/null +++ b/.changeset/silly-impalas-suffer.md @@ -0,0 +1,5 @@ +--- +"@moonwall/cli": patch +--- + +Fix upgrades diff --git a/packages/cli/src/lib/upgradeProcedures.ts b/packages/cli/src/lib/upgradeProcedures.ts index 4f74da9e..58cac288 100644 --- a/packages/cli/src/lib/upgradeProcedures.ts +++ b/packages/cli/src/lib/upgradeProcedures.ts @@ -75,7 +75,7 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer log("Using governance..."); // TODO: remove support for old style after all chains upgraded to 2400+ const proposal = - parseInt(((api.consts.system.version as any).specVersion as u32).toString()) >= 2400 + api.consts.system.version.specVersion.toNumber() >= 2400 ? (api.tx.parachainSystem as any).authorizeUpgrade(blake2AsHex(code), false) : (api.tx.parachainSystem as any).authorizeUpgrade(blake2AsHex(code)); const encodedProposal = proposal.method.toHex(); @@ -123,7 +123,7 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer ref[1].unwrap().asOngoing.proposal.asLookup.hash.toHex() == encodedHash ) .map((ref) => - parseInt(api.registry.createType("u32", ref[0].toU8a().slice(-4)).toString()) + api.registry.createType("u32", ref[0].toU8a().slice(-4)).toNumber() )?.[0] : referendum .filter( @@ -132,7 +132,7 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer (ref[1].unwrap().asOngoing as any).proposalHash.toHex() == encodedHash ) .map((ref) => - parseInt(api.registry.createType("u32", ref[0].toU8a().slice(-4)).toString()) + api.registry.createType("u32", ref[0].toU8a().slice(-4)).toNumber() )?.[0]; if (referendaIndex !== null && referendaIndex !== undefined) {