Skip to content
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

Merged
merged 10 commits into from
Jan 26, 2018
Merged

Enhancement/heritable encapsulation #692 #702

merged 10 commits into from
Jan 26, 2018

Conversation

trejas
Copy link
Contributor

@trejas trejas commented Jan 24, 2018

  • πŸ“˜ 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.

Copy link
Contributor

@frangio frangio left a 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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. Fixed.

* @dev Use these getter functions to access the internal variables in
* an inherited contract.
*/
function getHeir() public view returns(address) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@frangio
Copy link
Contributor

frangio commented Jan 26, 2018

Thanks @trejas! πŸ˜„

@frangio frangio merged commit 7a0bfdf into OpenZeppelin:master Jan 26, 2018
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants