-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Enhancement/heritable encapsulation #692 #702
Enhancement/heritable encapsulation #692 #702
Conversation
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 a lot @trejas! I've requested a few changes.
package.json
Outdated
@@ -57,6 +57,7 @@ | |||
}, | |||
"dependencies": { | |||
"dotenv": "^4.0.0", | |||
"ethjs-abi": "^0.2.1" | |||
"ethjs-abi": "^0.2.1", | |||
"lint": "^1.1.2" |
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 think you mistakenly installed this package.
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.
You are correct. Fixed.
contracts/ownership/Heritable.sol
Outdated
* @dev Use these getter functions to access the internal variables in | ||
* an inherited contract. | ||
*/ | ||
function getHeir() public view returns(address) { |
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.
As of #666 we've adopted the convention that private state variables with public getters follow the naming convention that
- state variable has a suffix underscore
_
, and - getter is the name of the variable without suffix underscore.
In this case, for example, we'd have address private heir_
and function heir() public view
.
Can you please change the PR to follow this convention?
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.
Will do.
Thanks @trejas! π |
* Modified Gitignore for Sublime * Added getter functions for public variables * Added encapsulation to Heritable public variables. * Added encapsulation to Heritable public variables. * Added encapsulation to Heritable public variables. * Updated tests to use getter methods instead of, now, private variables. * Conformed variable names to current conventions. * Requested changes * revert package-lock.json changes
π I've reviewed the OpenZeppelin Contributor Guidelines
β I've added tests where applicable to test my new functionality.
DID NOT SEE THE HERITABLE TESTS. fixing now.
π I've made sure that my contracts are well-documented.
π¨ I've run the JS/Solidity linters (
npm run lint:all:fix
) and fixed any issues.Enhancement #692
π Description
Added encapsulation to Heritable public variables.