-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Handle contract name not matching file name. #39
Conversation
…eir corresponding file names, e.g. fooBar.sol contains a contract called 'FooBar'.
Thanks @vishakh. This is a good change. I wonder if since we're able to detect the problem, we might as well return the correct result. Also, there's one issue here. The first result from compile_solidity (i.e., |
Thanks for the feedback, @tcoulter. I definitely need to add support for code with multiple contracts. Before I made the change, I thought about whether to simply detect the problem or to also fix it. When two contracts with the same name but mixed cases (e.g. Foo and fOO) are submitted together, it's not clear what should be done. Do you want me to return the correct result on a best effort basis, i.e. return a result where possible and throw an error in boundary cases like the one above? Another option would be simply to warn the user since mismatches between contract and file names will likely cause them issues down the line anyway. |
I did not see this before I submitted my pull request: #86 Please see my solution although it does not handle the lowercase instance. It actually ignores what the filename is altogether. |
Compile-common: Streamline compiler pkgs using a helper lib
Compile-common: Streamline compiler pkgs using a helper lib
- Revert "Merge pull request #39 from CruzMolina/commonizeCompile" This reverts commit 32f3d18, reversing changes made to 93bbf79. - Revert "swap out Profiler.updated for Common.updatedFiles (core/lib/test)" This reverts commit c822135. - Revert "swap out Profiler.updated for Commmon.updatedFiles (compile-solidity/new/index)" This reverts commit 5ad70e1. - Revert "pass Common.display to compile.display (compile-solidity/new/index)" This reverts commit a9d7cd1. - Revert "mv Profiler.updated & assoc helpers into (compile-common/utils)" This reverts commit 6a09f61. - Undo misc changes to keep code WET - Update yarn.lock & pkg deps
- Revert "Merge pull request #39 from CruzMolina/commonizeCompile" This reverts commit 32f3d18, reversing changes made to 93bbf79. - Revert "swap out Profiler.updated for Common.updatedFiles (core/lib/test)" This reverts commit c822135. - Revert "swap out Profiler.updated for Commmon.updatedFiles (compile-solidity/new/index)" This reverts commit 5ad70e1. - Revert "pass Common.display to compile.display (compile-solidity/new/index)" This reverts commit a9d7cd1. - Revert "mv Profiler.updated & assoc helpers into (compile-common/utils)" This reverts commit 6a09f61. - Undo misc changes to keep code WET - Update yarn.lock & pkg deps
- Revert "Merge pull request #39 from CruzMolina/commonizeCompile" This reverts commit 32f3d18, reversing changes made to 93bbf79. - Revert "swap out Profiler.updated for Common.updatedFiles (core/lib/test)" This reverts commit c822135. - Revert "swap out Profiler.updated for Commmon.updatedFiles (compile-solidity/new/index)" This reverts commit 5ad70e1. - Revert "pass Common.display to compile.display (compile-solidity/new/index)" This reverts commit a9d7cd1. - Revert "mv Profiler.updated & assoc helpers into (compile-common/utils)" This reverts commit 6a09f61. - Undo misc changes to keep code WET - Update yarn.lock & pkg deps
- Revert "Merge pull request #39 from CruzMolina/commonizeCompile" This reverts commit 32f3d18, reversing changes made to 93bbf79. - Revert "swap out Profiler.updated for Common.updatedFiles (core/lib/test)" This reverts commit c822135. - Revert "swap out Profiler.updated for Commmon.updatedFiles (compile-solidity/new/index)" This reverts commit 5ad70e1. - Revert "pass Common.display to compile.display (compile-solidity/new/index)" This reverts commit a9d7cd1. - Revert "mv Profiler.updated & assoc helpers into (compile-common/utils)" This reverts commit 6a09f61. - Undo misc changes to keep code WET - Update yarn.lock & pkg deps
- Revert "Merge pull request #39 from CruzMolina/commonizeCompile" This reverts commit 32f3d18, reversing changes made to 93bbf79. - Revert "swap out Profiler.updated for Common.updatedFiles (core/lib/test)" This reverts commit c822135. - Revert "swap out Profiler.updated for Commmon.updatedFiles (compile-solidity/new/index)" This reverts commit 5ad70e1. - Revert "pass Common.display to compile.display (compile-solidity/new/index)" This reverts commit a9d7cd1. - Revert "mv Profiler.updated & assoc helpers into (compile-common/utils)" This reverts commit 6a09f61. - Undo misc changes to keep code WET - Update yarn.lock & pkg deps
Added handling for cases where contract names are not case-sensitive identical to their corresponding file names, e.g. fooBar.sol contains a contract called 'FooBar'.
I made this change because I spent quite some time trying to get Truffle to deploy before I realized that the problem was my contract name and the file name in the contracts directory were not identical.
Let me know if you want me to make it more generic and handle all cases where the contact and files names do not match.