-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ignition: port hardhat-ignition-viem to Hardhat 3 #6260
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
hardhatTotal size of the bundle: List of dependencies (sorted by size)
|
82bb051
to
c9a3934
Compare
c9a3934
to
bddd229
Compare
bddd229
to
c3ea8f9
Compare
c3ea8f9
to
8f8e9ba
Compare
0bb409c
to
23ccc26
Compare
f794457
to
e5dd73f
Compare
23ccc26
to
acafcce
Compare
The v-next packages are built if a full Hardhat build is triggered. `hardhat-ignition-viem` runs a prebuild step that compiles contracts in fixture projects. This requires at least Node 20 as it involves Hardhat 3. We are removing the old packages, so this change to the build should not be an issue.
Before building `hardhat-ignition-viem` we need to build `hardhat-viem` and through it `hardhat` itself. This is so we can leverage them in the scripts that compile the contracts in the fixture projects. These generate the types which are required to enforce type checks within the tests that are part of the `hardhat-ignition-viem` build.
This package has now been released, hence the pre-release tag.
The issue is that the `useIgnitionProject` test helper for setting up hre/connection was not reading the Hardhat config from file for the project. The pattern is being pulled from the `ignition-plugin` setup helpers.
Both companion plugins check to ensure there is only one companion plugin installed. If the other plugin has already been loaded, we throw a HardhatError.
For the general deployment failure exception, we now throw a specific HardhatError that captures a deployment error. As before the message is derived from the result object, then passed into the exception.
Switch the Ignition object in the type extension of NetworkConnection to the interface rather than the impl, so the impl can move to internal.
Add the plugin and a script to show deploying via `connection.ignition.deploy(...)` and the type safety of the returned contracts.
Somehow the Helper was in the middle of the complex type convertors. It is now at the top, so the file can be read top to bottom.
`hardhat-ignition-viem` and now the `example-project` require prebuild steps. We should revisit this. The underlying issue is the type checks in the `hardhat-ignition-viem` build which assumes a precompilation step on the fixture projects contracts.
This is to meet the requirements of the script check in the CI.
Network config can be overriden at different points. We want to ensure we are using the resolved config for that particular connection.
73e109b
to
84cc6cd
Compare
Migrate
hardhat-ignition-viem
to Hardhat 3.Preview
Review Questions
./packages
build matrix to allow prebuild scripts to use Hardhat 3. Those scripts are used for generating types in the fixture projects.ViemIgnitionHelper
interface with the impl moved to internalToContractType
bringing through the newContractAbis
type fromhardhat-viem
ignition
/ignition-core
/hardhat-viem
Manual run through
The
hardhat-ignition-viem
plugin has been added to the./v-next/example-project
. There is a script showing the usage, much the preview above. To run the script:TODO
connection.ignition
based on Hook systemFollow up tasks