-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix/ownable error - Silent transferOwnership Failure #323
Conversation
@pooleja test coverage decreased, can you check that please? You can get the test coverage locally by running |
Ownable.sol says it is at 100% still: That is the only contract code touched. I am wondering if the code coverage counts lines without actual code, like |
Ah, sorry. ACK! |
@cgewecke Do you have any hint as to what caused the coverage decrease? Let's merge this anyway. |
@frangio Interesting - it looks like it's because the old tests hit both branches of an if statement raising the overall value of branch coverage for the whole project, and coveralls is averaging everything together. From Istanbul's report in the CI (the second number is the branch totals): A previous build had these values: Also . . . I'm seeing coverage crash occasionally in the CI here on a weird database error, so if you see really bad numbers that could also be a cause. Re-running on Travis could clear it. We're upgrading to testrpc 4.x over the weekend which might help smooth things out. |
Guys @pooleja @frangio ,
All test will pass successfully. We need to check both paths of execution by failing when there is no error thrown at all:
|
Good catch @jakub-wojciechowski. @pooleja Can you fix the test? |
Yep, I will take care of that. Good catch. |
Added the assert.fail() call to ensure there is no regression so it will be caught if the check for invalid address is removed. |
Fix/ownable error - Silent transferOwnership Failure
Fixes #319
The transfer ownership call in the Ownable contract had a silent failure if the "to" address was not set in the transferOwnership() call. This fix adds a specific require() call so that any callers of the function will be notified that they passed an incorrect error.