Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
frolic committed Aug 13, 2024
1 parent b522dbf commit 86aa271
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/utils/getContractArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const artifactSchema = z.object({
abi: abiSchema,
});

export function getContractArtifact(importedArtifact: unknown): GetContractArtifactResult {
export function getContractArtifact(artifactJson: unknown): GetContractArtifactResult {
// TODO: improve errors or replace with arktype?
const artifact = artifactSchema.parse(importedArtifact);
const artifact = artifactSchema.parse(artifactJson);
const placeholders = findPlaceholders(artifact.bytecode.linkReferences);

return {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/utils/importContractArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ export async function importContractArtifact({
packageJsonPath,
artifactPath,
}: ImportContractArtifactOptions): Promise<GetContractArtifactResult> {
let importedArtifact;
let artfactJson;
try {
const requirePath = packageJsonPath ?? (await findUp("package.json", { cwd: process.cwd() }));
if (!requirePath) throw new Error("Could not find package.json to import relative to.");

const require = createRequire(requirePath);
importedArtifact = require(artifactPath);
artfactJson = require(artifactPath);
} catch (error) {
console.error();
console.error("Could not import contract artifact at", artifactPath);
console.error();
throw error;
}

return getContractArtifact(importedArtifact);
return getContractArtifact(artfactJson);
}

0 comments on commit 86aa271

Please sign in to comment.