Remove global amino
codec instances
#7310
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.
Milestone
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 variableamino
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 passamino
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
amino
removal/cc @amaurymartiny , @aaronc
For Admin Use
The text was updated successfully, but these errors were encountered: