Use consistent types for forking.blockNumber in config#8114
Merged
alcuadrado merged 8 commits intomainfrom Apr 10, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: aac60e3 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 |
…tent-type-config-fork-number
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses hardhat#7701 by making forking.blockNumber accept consistent input types across simulated network config and Solidity test config, allowing both number and bigint and normalizing to bigint in resolved configs.
Changes:
- Extend config typings to allow
forking.blockNumberasnumber | bigintin both network and Solidity test user configs. - Update Zod validation schemas to accept
numberorbigintforforking.blockNumberand provide a unified validation error message. - Add/adjust tests to cover bigint acceptance (network forking) and number-to-bigint conversion (solidity test forking).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| v-next/hardhat/test/internal/builtin-plugins/solidity-test/helpers.ts | Adds a test ensuring numeric blockNumber is accepted and converted to bigint for solidity test runner args. |
| v-next/hardhat/test/internal/builtin-plugins/network-manager/network-manager.ts | Updates expected validation error message for invalid forking.blockNumber type. |
| v-next/hardhat/test/internal/builtin-plugins/network-manager/config-resolution.ts | Adds a test ensuring bigint blockNumber is resolved correctly for network forking config. |
| v-next/hardhat/src/internal/builtin-plugins/solidity-test/type-extensions.ts | Updates Solidity test user config typing to allow `blockNumber?: number |
| v-next/hardhat/src/internal/builtin-plugins/solidity-test/config.ts | Updates solidity test Zod schema to accept number/bigint blockNumber and normalizes to bigint in resolution. |
| v-next/hardhat/src/internal/builtin-plugins/network-manager/type-validation.ts | Updates network manager Zod validation to accept number/bigint for forking.blockNumber. |
| v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts | Updates network forking user config typing to allow `blockNumber?: number |
…Foundation/hardhat into consistent-type-config-fork-number
schaable
approved these changes
Apr 10, 2026
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 #7701