Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/contracts/upgrade-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/contracts/upgrade-contract.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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"),
};
}

Expand Down