This should be refactored to create the Basic Manager from the Module manager , so that we only define the list of modules once
We should use the function provided by the cosmos SDK for this
// NewBasicManagerFromManager creates a new BasicManager from a Manager
// The BasicManager will contain all AppModuleBasic from the AppModule Manager
// Module's AppModuleBasic can be overridden by passing a custom AppModuleBasic map
func NewBasicManagerFromManager(manager *Manager, customModuleBasics map[string]AppModuleBasic) BasicManager {
moduleMap := make(map[string]AppModuleBasic)
for name, module := range manager.Modules {
if customBasicMod, ok := customModuleBasics[name]; ok {
moduleMap[name] = customBasicMod
continue
}
if appModule, ok := module.(appmodule.AppModule); ok {
moduleMap[name] = CoreAppModuleBasicAdaptor(name, appModule)
continue
}
if basicMod, ok := module.(AppModuleBasic); ok {
moduleMap[name] = basicMod
}
}
return moduleMap
}
Currently, we create the Basic manager separately
https://github.com/zeta-chain/zeta-node/blob/74b0ad7c2e62aa94826cebaaf1421e83523f15fb/app/modules.go#L61-L90
This should be refactored to create the Basic Manager from the Module manager , so that we only define the list of modules once
We should use the function provided by the cosmos SDK for this