| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: take `include_tests` into account for module AST cache (#5137) ## Description closes #5136. We build contract projects twice, once without tests to get contract bytecode for forc-test's deployment step. (Since contract project's unit tests needs to make contract calls, we need the contract deployed to local vm instance.) And once with the tests included if the user executes `forc test`. This is only needed for contract projects as we only need to deploy them for testing. Module cache addition in 255350ec5018a4a5cea9f0a2280a62830262201a only takes path into account for key. But same source file with and without tests enabled creates different AST's and thus we should also take `include_tests` variable into account. We were missing contract tests because we could not build them with tests. 1st run were building them correctly without the tests and populated the cache, only taking `Path` into account. Second time, although we passed `include_tests = true`, (thus the resulting AST is going to be different for the same file) rather than creating the AST with the tests, we were using the cached version. This was causing contract's to lose tests entries. | 2 年前 |