-
Notifications
You must be signed in to change notification settings - Fork 245
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
[DO NOT MERGE] Disputable: Move set agreement to Kernel #599
base: next
Are you sure you want to change the base?
Conversation
fa0d40b
to
595ed33
Compare
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.
A few minor comments, but LGTM!
For other's sake, we decided to batch this breaking change with a few more breaking changes down the road as we otherwise cannot use the same DAOFactory
s and DAO templates as before to create test organizations with Agreements.
@@ -15,6 +17,8 @@ interface IKernelEvents { | |||
|
|||
// This should be an interface, but interfaces can't inherit yet :( | |||
contract IKernel is IKernelEvents, IVaultRecoverable { | |||
function setAgreement(IDisputable _disputableApp, IAgreement _agreement) external; | |||
|
|||
function acl() public view returns (IACL); | |||
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool); | |||
|
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.
Two comments:
- Are we able to move all the interfaces to be external?
- Should we use
AragonApp
as the type forsetApp()
'sapp
parameter? I'm debating if this interface dependency tree is worth it, but if not, then we may also want to typesetAgreement()
with just addresses.
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 planning to discuss this as one of the things to change in the new breaking version, but yea, I'd love to polish all the interfaces we provide
|
||
const currentAgreement = await disputable.getAgreement() | ||
assert.equal(currentAgreement, agreement, 'disputable agreement does not match') | ||
}) | ||
|
||
it('emits an event', async () => { | ||
const receipt = await disputable.setAgreement(agreement, { from }) | ||
const { tx } = await dao.setAgreement(disputable.address, agreement, { from }) | ||
const receipt = await web3.eth.getTransactionReceipt(tx) |
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.
Oh interesting, was the receipt we got as the return of dao.setAgreement()
not sufficient?
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.
For some reason, it wasn't working. I think this will be fixed when we upgrade to Truffle 5 + helpers
As an alternative implementation, we could introduce the concept of It would work similarly to how This change in the ACL could be useful for other cases as well, such as setting permissions just once for the admin functions of an app that the DAO has multiple instances of (e.g. multiple Voting instances). |
This PR moves the
setAgreement
security check to the Kernel, allowing us to define Agreement<>Kernel permissions instead of Agreement<>Disputable ones.