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

linking schemes to controller #49

Closed
jellegerbrandy opened this issue Jul 16, 2017 · 3 comments
Closed

linking schemes to controller #49

jellegerbrandy opened this issue Jul 16, 2017 · 3 comments
Assignees

Comments

@jellegerbrandy
Copy link
Contributor

jellegerbrandy commented Jul 16, 2017

Here's the thing:

In the library, I'd expect this kind of interaction (one of these, I'm not sure about the syntax yet):

organization.proposeNewScheme(...) 
organization.schemeRegistrar.proposeScheme(...)
organization.schemes.schemeRegisterar.proposeScheme(...)

The first problem with this is that at the moment there is no way (as far as I can see) to get the 'schemeRegistrar' from the controller.

There is an extra complication that in theory there is no the schemeRegistrar, there could be many registered.

(Just be clear, what we can do is:

  1. get SchemeRegister events for a controller
  2. get the addresses of the registered schemes from these events
  3. get the permissions and params of each registered scheme from the controller
  4. get info from the scheme instances themselves
    )

Possible solutions:

  • add "type" to schemes mapping (makes registerScheme calls more complex)
  • add "type" property to each Scheme instance
  • add specific properties to the controller for schemeRegistrar, updateScheme and globalConstraintRegistrar (with specific registration functions).

I vote tentatively for the second solution, which seems the least traumatic and does not need any changes in the code.

@jellegerbrandy
Copy link
Contributor Author

jellegerbrandy commented Jul 16, 2017

I see now that I could derive the type of scheme from its permissions. But we will need an interface also for other types of schemes. I'd go for the second option: each Scheme as a type or schemeType attribute that has the same name as the contract - from that we can derive its interface (if we have the code).

@jellegerbrandy
Copy link
Contributor Author

After talking to adam we'll do it lke this:

  • We know at which address our schemes are "officially deployed"
  • We keeep a list o fthese addresses with their associated interfaces in the library and use that

@leviadam
Copy link
Contributor

I think this can be closed.

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

No branches or pull requests

2 participants