Fix manifest error when connecting to an Anvil dev network #950
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.
When handling network manifest files, we use the RPC method
hardhat_metadata
to determine if the connected network is a Hardhat development network, in which case we write the manifest to the temp dir instead of.openzeppelin
.Furthermore, if this method has a
forkedNetwork
field in its response, we treat this as a network fork and make a copy of the origin networks's manifest file, so that we can write to it for the fork without affecting the original version.In recent versions of Anvil, Anvil also supports the
hardhat_metadata
RPC method, but has"forkedNetwork": null
in its response as seen here.This PR does two things:
anvil_metadata
to determine if Anvil, and if so, useanvil
for the manifest file prefix to more accurately reflect the network type.forkedNetwork
is null or undefined, in which case we determine that it is not a network fork.Fixes #943