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

remove admin functionality from RBAC.sol #836

Merged

Conversation

shrugs
Copy link
Contributor

@shrugs shrugs commented Mar 24, 2018

Fixes #802

πŸš€ Description

separates the rbac admin functionality into a second contract. this is a breaking change.

  • πŸ“˜ I've reviewed the OpenZeppelin Contributor Guidelines
  • βœ… I've added tests where applicable to test my new functionality.
  • πŸ“– I've made sure that my contracts are well-documented.
  • 🎨 I've run the JS/Solidity linters and fixed any issues (npm run lint:all:fix).

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.

The PR includes an entirely new package-lock.json by mistake I think. πŸ˜…

@@ -26,7 +26,7 @@ contract('Bounty', function (accounts) {
let bounty = await SecureTargetBounty.new();
sendReward(owner, bounty.address, reward);

assert.equal(reward, web3.eth.getBalance(bounty.address).toNumber());
assert.equal(reward, await web3.eth.getBalance(bounty.address).toNumber());
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think toNumber returns a promise, so the await isn't necessary.

Additionally, we shouldn't be converting to Number. See #204. The Crowdsale tests do the correct thing:

https://github.com/OpenZeppelin/zeppelin-solidity/blob/c05918c3cc10d9394fd5fb95deb04036204ac896/test/crowdsale/Crowdsale.test.js#L46

@@ -99,16 +99,16 @@ contract('SampleCrowdsale', function ([owner, wallet, investor]) {
});

it('should allow refunds if the goal is not reached', async function () {
const balanceBeforeInvestment = web3.eth.getBalance(investor);
// const balanceBeforeInvestment = web3.eth.getBalance(investor);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these commented out lines be part of the PR?

@shrugs
Copy link
Contributor Author

shrugs commented Apr 3, 2018

thanks for the second pair of eyes!!

the commented out functions are a very odd bug on my side; the last transaction in SampleCrowdsale.test.js is complaining about the wrong number of solidity function arguments, but it's a 0-argument function. The travis tests seem to pass just fine.

I've reverted all of those changes and force-pushed this branch

@shrugs shrugs force-pushed the fix/rbac-separation-of-concerns-#802 branch from 7983b1c to 485034a Compare April 3, 2018 18:47
@shrugs shrugs force-pushed the fix/rbac-separation-of-concerns-#802 branch from 485034a to 997a004 Compare April 3, 2018 18:47
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.

LGTM

@shrugs shrugs merged commit a6bef44 into OpenZeppelin:master Apr 3, 2018
@shrugs shrugs deleted the fix/rbac-separation-of-concerns-#802 branch April 3, 2018 19:56
frangio pushed a commit to frangio/openzeppelin-contracts that referenced this pull request Apr 5, 2018
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.

Remove admin functionality from RBAC
2 participants