celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
697 stars 370 forks source link

Include tests that depend on linked libraries in Foundry devchain integration test #11016

Open arthurgousset opened 3 months ago

arthurgousset commented 3 months ago

In Foundry integration tests (for the devchain), we cannot test contracts that depend on linked libraries because vm.getDeployedCode() cannot fetch bytecode of contracts that depend on linked libraries. This is a known limitation of Foundry at the moment.

They merged a PR that fixes this:

Unfortunately, we can't use the latest version, because of a regression it has in finding artifacts, which is a known issue:

As soon we can bump the version, it might be good to include contracts that depend on linked libraries in the tests.

Practically, this would simply involve removing this if-clause:

https://github.com/celo-org/celo-monorepo/blob/c27a53eaf1cd5729e1b785e90051eac3fb821184/packages/protocol/test-sol/integration/Integration.t.sol#L47-L58

Originally encountered this limitation in this PR:

arthurgousset commented 3 months ago

This is is blocked by a regression introduce in the latest foundry version. As a next step, I'd like to make sure a bug is filed or add a comment to an existing but report, so this can be fixed in a future release)