-
Notifications
You must be signed in to change notification settings - Fork 46
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
fix: foundry root imports #308
Conversation
Codecov Report
@@ Coverage Diff @@
## development #308 +/- ##
===============================================
+ Coverage 57.22% 57.63% +0.41%
===============================================
Files 174 174
Lines 4320 4329 +9
Branches 704 706 +2
===============================================
+ Hits 2472 2495 +23
+ Misses 1618 1603 -15
- Partials 230 231 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
a1ebfd6
to
a9a162f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put tests in to cover this change in logic?
ac1bff7
to
da66e42
Compare
da66e42
to
859f397
Compare
* fix: foundry root imports * add tests for foundry's resolveImport
This change fixes imports on foundry projects where they use paths relative to project root (i.e.
import 'src/MyContract.sol'
). It changes both the import resolution and the solc input as well. For foundry projects,solcInput.sources
keys are not absolute paths, but paths relative to project root. (i.e.'/home/user/myProject/src/Contract.sol' => 'src/Contract.sol'
). This is the only way I found for json-interfaced solc to deal with circular dependencies that use root-relative imports.