Skip to content
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

Fix hre initialization #5485

Merged
merged 5 commits into from
Jul 5, 2024
Merged

Fix hre initialization #5485

merged 5 commits into from
Jul 5, 2024

Conversation

alcuadrado
Copy link
Member

@alcuadrado alcuadrado commented Jul 4, 2024

This PR fixes a bug I found, that prevented the builtin plugins from being loaded when a user was initializing the HRE with import "hardhat". This PR fixes that by ensuring that the HRE is always initialized using hardhat/hre.

The changes introduced here are, in order:

  • Introduced a failing test, showing the bug.
  • Refactor the initialization process to always use the hardhat/hre module.
  • Fix some unrelated failing test after the refactor.
  • Added an eslint rule to hardhat to avoid repeating that mistake.

@alcuadrado alcuadrado added the v-next A Hardhat v3 development task label Jul 4, 2024
@alcuadrado alcuadrado requested a review from schaable July 4, 2024 22:59
Copy link

vercel bot commented Jul 4, 2024

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 Jul 4, 2024 11:08pm

Copy link

changeset-bot bot commented Jul 4, 2024

⚠️ No Changeset found

Latest commit: c9a7d4d

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

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Jul 4, 2024
@alcuadrado alcuadrado force-pushed the fix-hre-initialization branch from f7369dc to c9a7d4d Compare July 4, 2024 23:07
@alcuadrado alcuadrado changed the title Fix hre initialization Fix hre initialization Jul 5, 2024
@alcuadrado alcuadrado requested review from schaable and a team and removed request for schaable and a team July 5, 2024 00:30
@alcuadrado alcuadrado merged commit 023b195 into v-next Jul 5, 2024
49 checks passed
@alcuadrado alcuadrado deleted the fix-hre-initialization branch July 5, 2024 15:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants