-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Hardhat-truffle5 test fixtures fail with: "{FixtureName} has no network configuration for its current network id (31337)." #1253
Comments
I don't know a lot about the truffle plugin, but I did some modifications to your diff --git a/test/truffle-fixture.js b/test/truffle-fixture.js
index b12dd4a..e2f0cde 100644
--- a/test/truffle-fixture.js
+++ b/test/truffle-fixture.js
@@ -35,14 +35,16 @@ module.exports = async () => {
DiamondCutFacet.setAsDeployed(cutFacet)
const loupeFacet = await DiamondLoupeFacet.new()
DiamondLoupeFacet.setAsDeployed(loupeFacet)
+ const ownershipFacet = await OwnershipFacet.new()
+ OwnershipFacet.setAsDeployed(ownershipFacet)
const diamondCut = [
- [DiamondCutFacet.address, FacetCutAction.Add, getSelectors(DiamondCutFacet)],
- [DiamondLoupeFacet.address, FacetCutAction.Add, getSelectors(DiamondLoupeFacet)],
- [OwnershipFacet.address, FacetCutAction.Add, getSelectors(OwnershipFacet)]
+ [cutFacet.address, FacetCutAction.Add, getSelectors(DiamondCutFacet)],
+ [loupeFacet.address, FacetCutAction.Add, getSelectors(DiamondLoupeFacet)],
+ [ownershipFacet.address, FacetCutAction.Add, getSelectors(OwnershipFacet)]
]
- const diamond = await Diamond.new(diamondCut, admin)
+ const diamond = await Diamond.new(diamondCut, [admin.address])
Diamond.setAsDeployed(diamond)
const test1Facet = await Test1Facet.new() Maybe this helps, but I'm playing it by ear here, so take it with a grain of salt. |
Thank you very much @fvictorio for taking the time to help out with the fixture, I was able to fix most test suites here: mudgen/diamond-3@1b35d2a |
Glad to hear that. I don't know if there's something on our side to fix here, but I will leave the issue open because I think something could be improved on those docs. |
Closing this since it's on our docs pipeline. |
After following the instructions outlined here for adapting existing Truffle migrations referenced in original Truffle test suites I get the following error if I try to run the test files with the hardhat-truffle5 plugin, no matter what networks config is specified in either the hardhat-config or truffle-config files (is the latter still needed by the plugin?):
You can find the project here: https://github.com/lepidotteri/diamond-3/tree/feat/hardhat%2Bsolc-0.8
The text was updated successfully, but these errors were encountered: