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

Reduce Module Dependency #1810

Closed
mossid opened this issue Jul 25, 2018 · 3 comments
Closed

Reduce Module Dependency #1810

mossid opened this issue Jul 25, 2018 · 3 comments
Labels
S:proposed Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.

Comments

@mossid
Copy link
Contributor

mossid commented Jul 25, 2018

Currently modules under x/ have following dependencies:

  • Bank: Auth for accessing accounts
  • Gov: Bank for modifying balances
  • Slashing: Params for retrieving parameters
  • Stake: Bank for modifying balances

To reduce the dependencies, we must import interface that satisfies the needs, not the keeper struct itself. We are doing it for stake module, and allso see #1528

So instead of importing bank.CoinKeeper from bank, we can define type CoinKeeper interface in types/(since it is needed widely) and import that.

@rigelrozanski
Copy link
Contributor

As per discussions with @sunnya97 we should probably define a new layer of abstraction for the common interfaces which all modules anticipated to be working together fulfill (kind of like a types/ dir for a group of modules). You should sync with sunny on this one for sure!

@jackzampolin jackzampolin added Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. S:proposed and removed discussion labels Oct 12, 2018
@jackzampolin
Copy link
Member

This is a good one! And should be part of any code cleanup!

@jackzampolin
Copy link
Member

We have started to express this with the expected keepers concept. Going to go ahead and close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:proposed Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

No branches or pull requests

5 participants