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

Remove alias.go usage #6311

Closed
4 tasks
colin-axner opened this issue Jun 1, 2020 · 9 comments · Fixed by #6579
Closed
4 tasks

Remove alias.go usage #6311

colin-axner opened this issue Jun 1, 2020 · 9 comments · Fixed by #6579
Labels
help wanted S:proposal accepted T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).

Comments

@colin-axner
Copy link
Contributor

Summary

Remove alias.go files in favor of more verbose import names such as <modulename>types and <modulename>keeper

Problem Definition

alias.go can be useful when managing access to internal types, but the sdk does not use internals anymore. Currently I believe its usage is purely aesthetic.

I think verbose import names are especially useful for new developers to the codebase who might not be familiar with the differences between keeper/ and types/. Verbose import names indicate clearly which package the type comes from. I've also found alias.go to be out dated do to lack of enforcement of updating it on unused types (perhaps from the types being directly imported).

Proposal

Remove alias.go, use verbose import names. Remove from module design spec as well.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@fedekunze fedekunze added T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). S:proposed labels Jun 1, 2020
@alexanderbez
Copy link
Contributor

I fully support this proposal as I was never a fan of the alias approach. Now that we no longer have internal APIs, this makes more sense. We may want to revisit this post software freeze/1.0 stable release.

@dauTT
Copy link
Contributor

dauTT commented Jun 8, 2020

Hi, can I work on this?

@fedekunze
Copy link
Collaborator

Sure thing @dauTT. I’d recommend you to do it one module per PR at a time. Otherwise the changes would be massive

@dauTT
Copy link
Contributor

dauTT commented Jun 9, 2020

I will track the progress of this task here:

module status PR
auth closed #6440
bank closed #6311
capability closed #6438
crisis closed #6437
distribution closed #6436
evidence closed #6435
genaccounts closed no needed
genutil closed #6433
gov closed #6432
ibc closed #6429
ibc-transfer closed #6427
mint closed #6424
params closed #6415
simulation closed no needed
slashing closed #6417
staking closed #6397
upgrade closed #6382

@tac0turtle
Copy link
Member

nice table! To make things easier you don't need to create issues for each one. You can just ref this issue and close it when they are all done.

@aaronc
Copy link
Member

aaronc commented Jun 15, 2020

Great 👍 . One thing I often encounter with aliases is that they introduce unnecessary cyclic dependencies sometimes. Often, I have to manually use x/auth/types instead of x/auth to avoid this.

@dauTT
Copy link
Contributor

dauTT commented Jun 17, 2020

All the sub tasks above are completed. I think we can close this issue. 😄

@colin-axner
Copy link
Contributor Author

Sub modules in IBC need to have alias.go removed (03-connection, 04-channel etc)

@tac0turtle
Copy link
Member

there seems to be one last straggler:

package vesting
if anyone wants to pick it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted S:proposal accepted T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants