NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.04k stars 1.36k forks source link

Task parameters are treated as unrecognized global parameters #5373

Closed ChristopherDedominici closed 1 month ago

ChristopherDedominici commented 1 month ago

This PR fixes this bug.

PROBLEM To parse global and task parameters, the same function was used. However, the logic should have been slightly different. If a parameter is not found in the global parameters map when parsing the CLI arguments, no error should be thrown because it might be a task parameter. But when a parameter is not found in the task parameters map when parsing the CLI arguments, an error must be thrown because, at this point, everything should be parsed. The old logic was throwing an error when not finding a match for a global parameter.

SOLUTION Add a flag in the function definition (default to false) to specify global parameter behavior (do not throw if missing) or task parameter behavior (throw if missing).

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 0:09am
changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: d299a671705ff843a5b1717e09b0760f1abde339

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR