-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Description:
Hello, and thank you for providing this excellent boilerplate for working with Chainlink Functions.
I am currently developing a Smart Contract and utilizing your provided localFunctionsTestnet for testing. However, I've encountered an issue related to testing environments. Specifically, the need to manually run localFunctionsTestnet prevents me from taking full advantage of Hardhat's loadFixture utility, which is instrumental for snapshotting test states.
Problem:
The localFunctionsTestnet, as part of the functions-toolkit, uses Ganache under the hood. This setup conflicts with Hardhat's default behavior, particularly with the loadFixture utility, which relies on Hardhat's in-memory network for snapshotting and reverting state between tests. The result is an inability to efficiently manage test state, leading to more complex and time-consuming test setups.
Expected Behavior:
Ideally, I would like to seamlessly integrate the localFunctionsTestnet with Hardhat's testing environment, enabling me to use loadFixture for efficient test state management. This integration would greatly enhance the development workflow and testing efficiency.
Steps to Reproduce:
- Set up a Smart Contract project using the Chainlink Functions boilerplate.
- Implement unit tests using Hardhat's testing framework.
- Attempt to use Hardhat's
loadFixtureutility whilelocalFunctionsTestnetis running.
Possible Solutions:
I'm unsure of the best way to resolve this issue but have considered a few options:
- Adapting
localFunctionsTestnetfor Compatibility: ModifylocalFunctionsTestnetto work seamlessly with Hardhat's in-memory network, allowing us to useloadFixtureeffectively. - Guidance on Managing Test States: Provide instructions or best practices for handling test states when using
localFunctionsTestnetalongside Hardhat. - Script to Replicate
localFunctionsTestnetSetup in Hardhat: Develop a script to configure Hardhat's test environment similar tolocalFunctionsTestnet, ensuring consistency across testing platforms.
Thank you for your attention to this issue. Any guidance or updates to improve this integration would be greatly appreciated!