Let's say I have a contract which, for the sake of this post, inherits OpenZeppelin's Ownable
. I made a minor update (in terms of code / complexity: an override & revert to disable a method). Then I added tests, and the results were like this:
Contract: SampleMetaverse
✓ does not allow renouncing the ownership (using: account 0)
✓ does not allow transferring ownership to others than the owner (using: account 1)
✓ allows transferring ownership to self (using: account 0) (407ms)
✓ allows transferring ownership to others (using: account 0) (89ms)
✓ does not allow renouncing the ownership (using: account 1)
✓ allows transferring ownership to self (using: account 1) (115ms)
✓ allows transferring ownership to others (using: account 1) (92ms)
I see the numbers in milliseconds to be in red (this is a truffle test). To what extent should I care about this?
The contract (the part I am testing) goes like this, actually:
abstract contract SafeOwnable is Ownable {
constructor() Ownable() {}
/**
* @dev Trying to renounce the ownership is forbidden in these contracts.
*/
function renounceOwnership() public override onlyOwner {
revert("SafeOwnable: ownership cannot be renounced");
}
}