You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @kushdave95 for your support in DM, as requested an issue with details on my testing questions.
Is your feature request related to a problem? Please describe.
When building an LZ OFT contract and wanting to test it locally with hardhat/foundry, the OFT contract requires an LZ endpoint to be deployed (or perhaps mocked).
I would appreciate guidance on how to best do this. Note that this example in this repository does NOT show how to do this. It only tests a mock OFT contract.
Describe the solution you'd like
A clear example (or docs) on how to test an OFT contract locally in hardhat. I assume this means having a clear mock of an LZ endpoint (and how to implement it in a testing context).
Describe alternatives you've considered
I tried this repo's examples but as #399 indicates, this did not actually show how to test the contract, only the mock.
Additional context
From a DX perspective this would be very appreciated, as testing only on live testnets is suboptimal at best.
The text was updated successfully, but these errors were encountered:
At the moment there indeed is no easy, out-of-the-box solution for a local E2E test. It's something we are considering exposing to external developers since it's something that we have available in this repo - we deploy our own EndpointV2 contracts to test the wiring scripts.
The bad news is that I can't give you a timeline for this. We will keep you in the loop once we get a rough estimate of how and when this should be available.
What would it take to convince you to prioritise this?
Local testing is not a luxury for many devs. Even if you don't subscribe to test-driven development, it's an integral part of writing good contracts (as evidenced by your own doing of this).
I understand that there is always unlimited work and limited people to do the work, but I'd like to strongly advocate for this. Both to help your devs, and to signal to the dev community that you care about testing.
Not sure if this will completely solve your problem, but it should at least be a step forward. We merged #442 which contains a TestHelper contract for testing contracts using foundry.
We'll see how much work it takes to provide functionality that emulates a LayerZero environment completely, with the off-chain bits as well. As always, will keep you updated!
Thanks @kushdave95 for your support in DM, as requested an issue with details on my testing questions.
Is your feature request related to a problem? Please describe.
When building an LZ OFT contract and wanting to test it locally with hardhat/foundry, the OFT contract requires an LZ endpoint to be deployed (or perhaps mocked).
I would appreciate guidance on how to best do this. Note that this example in this repository does NOT show how to do this. It only tests a mock OFT contract.
Describe the solution you'd like
A clear example (or docs) on how to test an OFT contract locally in hardhat. I assume this means having a clear mock of an LZ endpoint (and how to implement it in a testing context).
Describe alternatives you've considered
I tried this repo's examples but as #399 indicates, this did not actually show how to test the contract, only the mock.
Additional context
From a DX perspective this would be very appreciated, as testing only on live testnets is suboptimal at best.
The text was updated successfully, but these errors were encountered: