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 global amino codec instances #7310

Closed
1 of 4 tasks
robert-zaremba opened this issue Sep 15, 2020 · 1 comment
Closed
1 of 4 tasks

Remove global amino codec instances #7310

robert-zaremba opened this issue Sep 15, 2020 · 1 comment
Labels
T:tech debt Tech debt that should be cleaned up Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.

Comments

@robert-zaremba
Copy link
Collaborator

Summary

amino codec requires to register all structures for encoding and decoding.
This is done during the module initialization process using RegisterLegacyAminoCodec function.

Problem Definition

We need to ensure that the codec we are using for encoding and decoding data structures has registered that structures in advance. In some modules (x/bank, x/auth...) we are defining a global variable amino and register local structures with it.
At the same time we are also doing the same things in module initialization from the application amino instance. The reason we use a module global variable is because it's needed in some exported functions and it was probably hard to pass amino codec as a dependency (through part of a struct or an argument). Examples: GetPubKey code,

Moreover, in some places we are saying that we use this global variables for tests, but they are declared in non-tests files and used in non-test files. Example.

Proposal

  1. Either add this issue to 0.41 release tracker -> as a part of amino removal
  2. or plan for refactoring.

/cc @amaurymartiny , @aaronc


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba robert-zaremba added the Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. label Sep 15, 2020
@robert-zaremba robert-zaremba modified the milestones: v0.40.1, v0.41 Sep 15, 2020
@aaronc aaronc modified the milestones: v0.41, v0.42 Jan 6, 2021
@tac0turtle tac0turtle added the T:tech debt Tech debt that should be cleaned up label Oct 21, 2022
@tac0turtle
Copy link
Member

done with eden, amino is inferred with proto files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:tech debt Tech debt that should be cleaned up Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

No branches or pull requests

4 participants