diff --git a/packages/core/src/contracts/upgrade-contract.test.ts b/packages/core/src/contracts/upgrade-contract.test.ts index 23192e10..4f4bc9d2 100644 --- a/packages/core/src/contracts/upgrade-contract.test.ts +++ b/packages/core/src/contracts/upgrade-contract.test.ts @@ -141,6 +141,8 @@ describe("upgradeContractInPlace", () => { }); expect(result.skipped).toBe(true); + // #85: the skip path must return the artifacts file path, not cwd. + expect(result.artifactPath).toBe(path.join(tmpDir, "caatinga.artifacts.json")); const uploadCalls = runCommand.mock.calls.filter(([, args]) => args[1] === "upload"); const invokeCalls = runCommand.mock.calls.filter(([, args]) => args[1] === "invoke"); expect(uploadCalls).toHaveLength(0); diff --git a/packages/core/src/contracts/upgrade-contract.ts b/packages/core/src/contracts/upgrade-contract.ts index 7bf0aea8..e97176c8 100644 --- a/packages/core/src/contracts/upgrade-contract.ts +++ b/packages/core/src/contracts/upgrade-contract.ts @@ -1,3 +1,4 @@ +import path from "node:path"; import { withArtifactsLock } from "../artifacts/artifacts-lock.js"; import { readArtifacts } from "../artifacts/read-artifacts.js"; import { updateArtifact } from "../artifacts/update-artifact.js"; @@ -102,7 +103,9 @@ export async function upgradeContractInPlace( wasmHash: existing.wasmHash, network, skipped: true, - artifactPath: cwd, + // Match the non-skip path (and deploy-contract), which returns the + // artifacts file path — not the working directory. + artifactPath: path.resolve(cwd, "caatinga.artifacts.json"), }; }