From e895c8c4e4d6182ce12b87bd06f5fcebd651a036 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Wed, 28 Oct 2026 13:09:20 +0530 Subject: [PATCH] fix: ignore already-deployed oz-renamed-from in storage layout check --- scripts/checkStorageLayout.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/checkStorageLayout.ts b/scripts/checkStorageLayout.ts index 7e5a9993f..ea3a6e8d5 100644 --- a/scripts/checkStorageLayout.ts +++ b/scripts/checkStorageLayout.ts @@ -308,13 +308,32 @@ function hasContract(output: { contracts?: Record item.slot === old.slot && item.offset === old.offset && item.label === old.label, + ); + if (same) old.renamedFrom = same.renamedFrom; + } +} + /** Compares one deployed layout against the current source, returning undefined when they are * compatible. A contract missing from build-info is a failure rather than a skip, so a source * that was renamed or deleted cannot drop out of the check unnoticed. */ function check(target: Target, current: Map): string | undefined { const updated = target.fqName ? current.get(target.fqName) : undefined; if (!updated) return `${target.fqName} was not found in artifacts/build-info`; - const report = getStorageUpgradeReport(target.deployed as Layout, updated, withValidationDefaults({})); + const deployed = target.deployed as Layout; + restoreDeployedRenames(deployed, updated); + const report = getStorageUpgradeReport(deployed, updated, withValidationDefaults({})); return report.ok ? undefined : report.explain(false); }