Skip to content

Commit

Permalink
Fix cairo1 compiler (#393)
Browse files Browse the repository at this point in the history
* [skip ci] - just passed on the side branch
  • Loading branch information
FabijanC authored Jun 22, 2023
1 parent f62049b commit 13940c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/task-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export async function starknetCompileCairo1Action(
args: TaskArguments,
hre: HardhatRuntimeEnvironment
) {
const binDirPath = getCompilerBinDir(hre.config.starknet, args);
const binDirPath = getCompilerBinDir(args, hre.config.starknet);

const root = hre.config.paths.root;
const rootRegex = new RegExp("^" + root);
Expand Down
4 changes: 2 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ export class StarknetContractFactory {
}

const casmJson = JSON.parse(fs.readFileSync(this.casmPath, "utf-8"));
if (casmJson?.compiler_version.split(".")[0] !== "1") {
const msg = ".CASM json has to contain compiler_version '1.*.*'";
if (casmJson?.compiler_version.split(".")[0] === "0") {
const msg = ".CASM json should have been generated with a compiler version >= 1";
throw new StarknetPluginError(msg);
}

Expand Down

0 comments on commit 13940c1

Please sign in to comment.