-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Refactoring Superuser contract to allow Owners to transfer ownership … #978
Refactoring Superuser contract to allow Owners to transfer ownership … #978
Conversation
…when they are not superusers OpenZeppelin#50
In Ownable.sol I extracted the functionality of transferOwnership to an internal function and moved the renounceOwnership function above the transferOwnership function. |
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.
LGTM. @frangio ?
test/ownership/Superuser.test.js
Outdated
|
||
it('should change owner after the owner transfers the ownership', async function () { | ||
await expectEvent.inTransaction( | ||
this.superuser.transferOwnership(finalOwner, { from: newOwner }), |
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.
I was confused that newOwner
was sending this tx, but I saw that you're using the same Superuser
instance for all tests! You should create the Superuser
instance in a beforeEach
block instead of before
, so as to have the tests be independent of one another.
Then it will be firstOwner
sending this tx.
Great! @frangio |
Fixes #50
Refactor to the Superuser contract to allow owners that are not superusers to transfer the ownership of the contract.
npm run lint:all:fix
).