Skip to content

Commit

Permalink
smaller fixes based on PR's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDedominici committed Apr 8, 2024
1 parent d466a56 commit 2f1dafe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/hardhat-vyper/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ function getOptimize(
compilerVersion: string,
optimize: string | boolean | undefined
): string {
if (compilerVersion === "" && optimize !== undefined) {
if (optimize === undefined) {
return "";
}

if (compilerVersion === "") {
throw new VyperPluginError(
"The 'compilerVersion' parameter must be set when the setting 'optimize' is set."
);
}

if (optimize === undefined) {
return "";
}

if (typeof optimize === "boolean") {
if (optimize) {
if (
Expand Down Expand Up @@ -105,6 +105,6 @@ function getOptimize(
}

throw new VyperPluginError(
`The 'optimize' setting has an invalid type value. Type is: ${typeof optimize}.`
`The 'optimize' setting has an invalid type value: ${typeof optimize}. Type should be either string or boolean.`
);
}
2 changes: 1 addition & 1 deletion packages/hardhat-vyper/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe("Vyper plugin", function () {
it("should fail the compilation", async function () {
await expect(this.env.run(TASK_COMPILE)).to.be.rejectedWith(
Error,
"The 'optimize' setting has an invalid type value. Type is: number."
"The 'optimize' setting has an invalid type value: number. Type should be either string or boolean."
);
});
});
Expand Down

0 comments on commit 2f1dafe

Please sign in to comment.