Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Common interface for Package contract #140

Merged
merged 7 commits into from
Sep 28, 2018

Conversation

spalladino
Copy link
Contributor

@spalladino spalladino commented Sep 26, 2018

Fixes #138

@spalladino spalladino added the status:in-progress Under development, do not merge this PR label Sep 26, 2018
@facuspagnuolo facuspagnuolo self-assigned this Sep 27, 2018
Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

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

Looks good, I'd add tests for the new functions and the improvements for addVersion

@@ -85,7 +85,7 @@ contract App is Ownable {
function unsetPackage(string packageName) public onlyOwner {
require(address(providers[packageName].package) != address(0), "Package to unset not found");
delete providers[packageName];
emit PackageChanged(packageName, address(0), "");
emit PackageChanged(packageName, address(0), [uint64(0), uint64(0), uint64(0)]);
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about having sth like PackageSet and PackageUnset events instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that having a single event is more useful in terms of watching the contract. If you are tracking the status of a particular package (or all packages), tracking only PackageSet events does not work, since you'd need the Unset as well. In other words, it wouldn't make sense to filter by Set events and not by Unset events at the same time; so it's just simpler for the client to merge them in a single event. OTOH, it feels odd to be filling args with empty values.

Anyway, I have no strong preference. I'd keep it as Changed just because it's the same pattern we're using in the ImplementationDirectory as well, and I don't see a reason to change that interface. But I'm ok with making the change if you think it's for the best.

@spalladino
Copy link
Contributor Author

I'd add tests for the new functions and the improvements for addVersion

Absolutely, will be working on that today

@spalladino spalladino force-pushed the feature/common-package-interface-#138 branch from 4d42757 to 318cc60 Compare September 27, 2018 21:23
@spalladino spalladino removed the status:in-progress Under development, do not merge this PR label Sep 28, 2018
@spalladino
Copy link
Contributor Author

@facuspagnuolo ready to review

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

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

LGTM!

@spalladino spalladino added the status:ready-to-merge Order mergify to merge label Sep 28, 2018
@mergify mergify bot merged commit edbd20f into master Sep 28, 2018
@facuspagnuolo facuspagnuolo deleted the feature/common-package-interface-#138 branch September 28, 2018 22:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready-to-merge Order mergify to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt Package to follow a standard interface as discussed with Aragon
2 participants