chore: run modernize (#24356)

This commit is contained in:
Alex | Interchain Labs
2025-04-03 10:42:20 -04:00
committed by GitHub
parent df07789843
commit 3c6deab626
185 changed files with 667 additions and 590 deletions
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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 {
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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 {