JoinColony / solcover

Code coverage for solidity
MIT License
64 stars 8 forks source link

Simplify instrumentation #55

Closed maurelian closed 7 years ago

maurelian commented 7 years ago

Is there any reason you couldn't just add a private string variable called fileName, and then call that variable in the events rather than using the full path the every time? it would be tidier, and I don't know too much about the compiler, but hopefully it'd reduce the size of the bytecode output.

area commented 7 years ago

I believe we need to include the path in case files are present that have the same name, but it's entirely reasonable to suggest the path should only be relative to the project's directory.

maurelian commented 7 years ago

I was thinking more like this https://github.com/maurelian/uport-proxy/blob/modifyContract/contracts/IdentityFactory.sol#L10

But removing the need for the full path might help too.

area commented 7 years ago

Ah, I see. I'd rather not head down that road - if we did, anyone using our tool that happened to have a variable named fileName wouldn't be able to use solcover.

EDIT: We parse the AST, so we could come up with a unique ID that we know isn't in there in principle...