Repository navigation
Conversation
Use the message text proposed by the Hardhat team in NomicFoundation#7122.
🦋 Changeset detectedLatest commit: 2be926e 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 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7122
This PR applies the change the Hardhat team asked for in the issue. In this comment, the team decided to keep the current config loading logic and make
HHE15explain that a valid config is needed for every task. The comment also gives the exact new message. This PR uses that text as written. The only edit is dropping a trailing space after the first line.Users hit this when the config is invalid and they run a task that looks unrelated to it, like
npx hardhat keystore set. Before, they only sawInvalid config:, with nothing saying whykeystoreneeds the config at all.Before:
After:
Changes
packages/hardhat-errors/src/descriptors.ts: newmessageTemplateforCORE.GENERAL.INVALID_CONFIG(HHE15). The error number, title and arguments are unchanged.packages/hardhat-errors/test/errors.ts: a test that checks the full HHE15 message.@nomicfoundation/hardhat-errors.The other tests that check
INVALID_CONFIGbuild the expected message from the descriptor, so they did not need changes.Testing
pnpm test:file packages/hardhat-errors/test/errors.ts: the new test failed before the change (it gotHHE15: Invalid config:). After the change, 39 passing.pnpm lintinpackages/hardhat-errors: passes.pnpm test:fileon the other tests that useINVALID_CONFIG, all passing:packages/hardhat/test/internal/core/config-validation.ts,packages/hardhat/test/internal/core/tasks/task-manager.ts,packages/hardhat/test/internal/builtin-plugins/solidity-test/config-validation.ts(185 passing)packages/hardhat-ledger/test/config-validation.ts(7 passing)packages/hardhat-typechain/test/config-validation.ts(3 passing)packages/hardhat-node-test-runner/test/index.ts(7 passing)packages/hardhat-mocha/test/index.ts(9 passing)