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 loadFixture utility while localFunctionsTestnet is running.
Possible Solutions:
I'm unsure of the best way to resolve this issue but have considered a few options:
Adapting localFunctionsTestnet for Compatibility: Modify localFunctionsTestnet to work seamlessly with Hardhat's in-memory network, allowing us to use loadFixture effectively.
Guidance on Managing Test States: Provide instructions or best practices for handling test states when using localFunctionsTestnet alongside Hardhat.
Script to Replicate localFunctionsTestnet Setup in Hardhat: Develop a script to configure Hardhat's test environment similar to localFunctionsTestnet, 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!
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 runlocalFunctionsTestnet
prevents me from taking full advantage of Hardhat'sloadFixture
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 theloadFixture
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 useloadFixture
for efficient test state management. This integration would greatly enhance the development workflow and testing efficiency.Steps to Reproduce:
loadFixture
utility whilelocalFunctionsTestnet
is running.Possible Solutions: I'm unsure of the best way to resolve this issue but have considered a few options:
localFunctionsTestnet
for Compatibility: ModifylocalFunctionsTestnet
to work seamlessly with Hardhat's in-memory network, allowing us to useloadFixture
effectively.localFunctionsTestnet
alongside Hardhat.localFunctionsTestnet
Setup 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!