-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Settings (a.k.a. Input JSON Description) in @nomiclabs/hardhat-vyper #4872
Support Settings (a.k.a. Input JSON Description) in @nomiclabs/hardhat-vyper #4872
Conversation
🦋 Changeset detectedLatest commit: 598acb2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…omicFoundation/hardhat into feature/4566-support-settings-in-vyper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm trying several combinations of versions and settings. This is what I got:
So mostly good. We should just fix that combination that produces a compiler error. |
…e/4566-support-settings-in-vyper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | ||
useEnvironment(); | ||
|
||
it("should compile successfully", async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it("should compile successfully", async function () { | |
it("should fail to compile", async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other test descriptions below like this one that don't match what the test does.
semver.lt(compilerVersion, "0.3.1") | ||
) { | ||
throw new VyperPluginError( | ||
`The 'optimize' setting with value 'true' is not supported for versions of the Vyper compiler older than 0.3.1 or newer than 0.3.10. You are currently using version ${compilerVersion}.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message has an off-by-one error, right? You should either say newer than 0.3.9
or newer than or equal to 0.3.10
. (I prefer the former.)
semver.lte(compilerVersion, "0.3.0") | ||
) { | ||
throw new VyperPluginError( | ||
`The 'optimize' setting with value 'true' is not supported for versions of the Vyper compiler older than or equal to 0.3.0 or newer than or equal to 0.3.10. You are currently using version ${compilerVersion}.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's just me, but I find that error message a bit too verbose, how about something like: "The 'optimize' setting with value 'true' is supported only for Vyper versions >0.3.0 and <0.3.10. You are currently using version ${compilerVersion}."
Feel free to ignore it if you think the current message is better 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same for the rest of the error messages)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included a few minor suggestions, but none are merge blockers.
@@ -7,10 +10,18 @@ export class Compiler { | |||
* | |||
* @param inputPaths array of paths to contracts to be compiled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the new parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one small comment on some missing param docs, but pre-approving. Looks good!
See issue here
Added properties evmVersion and optimize.
Follow this issue to track additional settings properties that we might consider adding.