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

Create Admin controller #194

Merged
merged 10 commits into from
Dec 21, 2020
Merged

Create Admin controller #194

merged 10 commits into from
Dec 21, 2020

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Dec 18, 2020

Closes #181

  • Create new package for controllers, outside of cw0
  • Add Admin controller here
  • Integrate it into cw4-group
  • Integrate it into cw4-stake

Follow-Up:

  • Port Hooks/Claim controllers to the same pattern (and move packages) Hooks controller #195
  • More some structs into cw0, so they can be imported by eg. cw4?

@ethanfrey
Copy link
Member Author

@maurolacy curious what you think of this (just focus on cw4-group/srccontracts.rs and controllers/src/admin.rs.

Admin is a trivial example and maybe easy to cut and paste, but I was looking for a format to move these controllers, for maximum composability. So I can port hooks, claims, etc into this format.

@maurolacy
Copy link
Contributor

Hi, OK, will take a look tomorrow.

Making slow progress with #163 ... let's talk tomorrow, as I'm almost there with the impl, and have some questions for you. Good thing is that I now have a much better grasp at storage-plus (Map, Prefix and the like).

@ethanfrey
Copy link
Member Author

Nice. Yeah, storage-plus is a good piece to master and review by usage.

Good to review the api first with real usages. Then the implementation. I am sure there are ways to clean it up. Especially all the length prefixing calls. But best to actually work on the code.

I hope the Key trait makes sense (and you see how this allows us to naively construct indexes)

@ethanfrey ethanfrey marked this pull request as ready for review December 20, 2020 10:06
@ethanfrey ethanfrey merged commit 48aa763 into master Dec 21, 2020
@ethanfrey ethanfrey deleted the admin-controller branch December 21, 2020 16:28
This pull request was 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

Successfully merging this pull request may close these issues.

Pull out admin helper/controller into cw0
2 participants