-
Notifications
You must be signed in to change notification settings - Fork 126
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
non-inline library doesn't work correctly in forge test
#382
Comments
Related to #369 |
We are aware of this issue (which came up while working on the functionality), and were able to come up with a workaround. If you would like to test your functionality before the issue is fixed, you can move away from Basically:
|
We are still working on improving this, but we lack the tools to make this as seamless as with Solidity. This is by no means the final solution, and should only be considered a workaround. The first 3 steps are the same as last time:
You will need to redo the previous steps if/when your local Finally, you can run your tests using You can use any other flag as part of your test invocation as usual, just remember to use Please note that if the node restarts you'll need to deploy the libraries again, and, if the addresses were to change, you'll also need to rebuild your contracts so they reference the updated addresses. |
Deploy-time linking has been supported in this pre-release and already tested in Hardhat.
All libraries will be applied to all bytecode files and will be ignored if they aren't expected.
Examples:
|
@tomimor ^^ worth tracking the above. Once the HH initial implementation is ready to share we can review the flow a bit better. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.0.2 (13497a5 2024-05-16T00:24:48.304138000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
I am currently trying to apply the foundry-zksync in the following repositories:
https://github.com/zkemail/ether-email-auth
I deployed non-inlinable libraries to zkSync sepolia, so forge build has been succeeded in my local.
However, some test cases that references library will cause an
EvmError: Revert
at the point of referencing library, and the test will fail.For example, the following line fails
https://github.com/zkemail/ether-email-auth/blob/feat/foundry-zksync/packages/contracts/src/EmailAuth.sol#L204
Can't we test locally when referring to a library?
Or is there any solution of that?
The text was updated successfully, but these errors were encountered: