-
Notifications
You must be signed in to change notification settings - Fork 795
Etherscan could also have a plain source mapping #2491
Etherscan could also have a plain source mapping #2491
Conversation
|
If you try with the link above, you will find that it's missing the key fields, i.e. just plain source code mapping like: { "a.sol" : "..." } EDIT: Oh wait, you are correct, I made a mistake here. Will update the code. |
Reference: 0x68b26dcf21180d2a8de5a303f8cc5b14c8d99c4c
Ah alright, that makes sense. |
8fc7368
to
053aa61
Compare
Fixed already. Regarding the test case, I didn't see any existing test cases actually requesting the network (even no existing test cases for SourceCodeMetadata). Is it proper to make unit tests rely on network service? |
You can add one at the bottom of |
The problem is not about the place for tests, but how to test it? Request etherscan? |
Yes, see |
Done |
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.
Thanks for spotting this! I've fixed the tests in #2492.
Motivation
Always finding funny things when playing with Etherscan API, try:
curl "https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0x68b26dcf21180d2a8de5a303f8cc5b14c8d99c4c"
This gives a plain source code mapping in the
SourceCode
field instead of plain source code.Solution
As shown.