Skip to content

Use consistent types for forking.blockNumber in config#8114

Merged
alcuadrado merged 8 commits intomainfrom
consistent-type-config-fork-number
Apr 10, 2026
Merged

Use consistent types for forking.blockNumber in config#8114
alcuadrado merged 8 commits intomainfrom
consistent-type-config-fork-number

Conversation

@ChristopherDedominici
Copy link
Copy Markdown
Contributor

Fixes #7701

Copilot AI review requested due to automatic review settings April 8, 2026 11:01
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 8, 2026

🦋 Changeset detected

Latest commit: aac60e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hardhat Patch

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.blockNumber as number | bigint in both network and Solidity test user configs.
  • Update Zod validation schemas to accept number or bigint for forking.blockNumber and 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

@ChristopherDedominici ChristopherDedominici self-assigned this Apr 8, 2026
@ChristopherDedominici ChristopherDedominici added the no docs needed This PR doesn't require links to documentation label Apr 8, 2026
Copilot AI review requested due to automatic review settings April 8, 2026 12:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread packages/hardhat/src/internal/builtin-plugins/solidity-test/config.ts Outdated
Comment thread packages/hardhat/src/internal/builtin-plugins/network-manager/type-validation.ts Outdated
Copilot AI review requested due to automatic review settings April 8, 2026 12:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

@ChristopherDedominici ChristopherDedominici moved this from In Progress to In Review in Hardhat Apr 8, 2026
@alcuadrado alcuadrado added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit a9f3bb7 Apr 10, 2026
222 checks passed
@alcuadrado alcuadrado deleted the consistent-type-config-fork-number branch April 10, 2026 17:44
@github-project-automation github-project-automation Bot moved this from In Review to Done in Hardhat Apr 10, 2026
@github-actions github-actions Bot mentioned this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no docs needed This PR doesn't require links to documentation no peer bump needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Use consistent types for forking.blockNumber in config

5 participants