chore: run modernize (#24356)
This commit is contained in:
@@ -59,7 +59,7 @@ type configurator struct {
|
||||
}
|
||||
|
||||
// RegisterService implements the grpc.Server interface.
|
||||
func (c *configurator) RegisterService(sd *googlegrpc.ServiceDesc, ss interface{}) {
|
||||
func (c *configurator) RegisterService(sd *googlegrpc.ServiceDesc, ss any) {
|
||||
desc, err := c.cdc.InterfaceRegistry().FindDescriptorByName(protoreflect.FullName(sd.ServiceName))
|
||||
if err != nil {
|
||||
c.err = err
|
||||
|
||||
@@ -276,7 +276,7 @@ func (gam GenesisOnlyAppModule) ConsensusVersion() uint64 { return 1 }
|
||||
// Manager defines a module manager that provides the high level utility for managing and executing
|
||||
// operations for a group of modules
|
||||
type Manager struct {
|
||||
Modules map[string]interface{} // interface{} is used now to support the legacy AppModule as well as new core appmodule.AppModule.
|
||||
Modules map[string]any // interface{} is used now to support the legacy AppModule as well as new core appmodule.AppModule.
|
||||
OrderInitGenesis []string
|
||||
OrderExportGenesis []string
|
||||
OrderPreBlockers []string
|
||||
@@ -289,7 +289,7 @@ type Manager struct {
|
||||
|
||||
// NewManager creates a new Manager object.
|
||||
func NewManager(modules ...AppModule) *Manager {
|
||||
moduleMap := make(map[string]interface{})
|
||||
moduleMap := make(map[string]any)
|
||||
modulesStr := make([]string, 0, len(modules))
|
||||
preBlockModulesStr := make([]string, 0)
|
||||
for _, module := range modules {
|
||||
@@ -319,7 +319,7 @@ func NewManager(modules ...AppModule) *Manager {
|
||||
// NewManagerFromMap creates a new Manager object from a map of module names to module implementations.
|
||||
// This method should be used for apps and modules which have migrated to the cosmossdk.io/core.appmodule.AppModule API.
|
||||
func NewManagerFromMap(moduleMap map[string]appmodule.AppModule) *Manager {
|
||||
simpleModuleMap := make(map[string]interface{})
|
||||
simpleModuleMap := make(map[string]any)
|
||||
modulesStr := make([]string, 0, len(simpleModuleMap))
|
||||
preBlockModulesStr := make([]string, 0)
|
||||
for name, module := range moduleMap {
|
||||
|
||||
@@ -17,7 +17,7 @@ type TestSuite struct {
|
||||
|
||||
func (s *TestSuite) TestAssertNoForgottenModules() {
|
||||
m := Manager{
|
||||
Modules: map[string]interface{}{"a": nil, "b": nil},
|
||||
Modules: map[string]any{"a": nil, "b": nil},
|
||||
}
|
||||
tcs := []struct {
|
||||
name string
|
||||
@@ -42,7 +42,7 @@ func (s *TestSuite) TestAssertNoForgottenModules() {
|
||||
|
||||
func (s *TestSuite) TestModuleNames() {
|
||||
m := Manager{
|
||||
Modules: map[string]interface{}{"a": nil, "b": nil},
|
||||
Modules: map[string]any{"a": nil, "b": nil},
|
||||
}
|
||||
ms := m.ModuleNames()
|
||||
sort.Strings(ms)
|
||||
|
||||
@@ -61,7 +61,7 @@ func NewSimulationManager(modules ...AppModuleSimulation) *SimulationManager {
|
||||
// with the same moduleName.
|
||||
// Then it attempts to cast every provided AppModule into an AppModuleSimulation.
|
||||
// If the cast succeeds, its included, otherwise it is excluded.
|
||||
func NewSimulationManagerFromAppModules(modules map[string]interface{}, overrideModules map[string]AppModuleSimulation) *SimulationManager {
|
||||
func NewSimulationManagerFromAppModules(modules map[string]any, overrideModules map[string]AppModuleSimulation) *SimulationManager {
|
||||
simModules := []AppModuleSimulation{}
|
||||
appModuleNamesSorted := make([]string, 0, len(modules))
|
||||
for moduleName := range modules {
|
||||
|
||||
Reference in New Issue
Block a user