Skip to content

Commit

Permalink
remove config pr from here
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Jul 4, 2024
1 parent 7041fba commit 831e4ca
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 593 deletions.
87 changes: 0 additions & 87 deletions ignite/cmd/scaffold_configs.go

This file was deleted.

14 changes: 4 additions & 10 deletions ignite/cmd/scaffold_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"github.com/ignite/cli/v28/ignite/services/scaffolder"
)

const (
FlagIndexes = "index"
)
const FlagIndexName = "index"

// NewScaffoldMap returns a new command to scaffold a map.
func NewScaffoldMap() *cobra.Command {
Expand Down Expand Up @@ -67,16 +65,12 @@ For detailed type information use ignite scaffold type --help

c.Flags().AddFlagSet(flagSetYes())
c.Flags().AddFlagSet(flagSetScaffoldType())
c.Flags().StringSlice(FlagIndexes, []string{"index"}, "fields that index the value")
c.Flags().String(FlagIndexName, "index", "field that index the value")

return c
}

func scaffoldMapHandler(cmd *cobra.Command, args []string) error {
indexes, err := cmd.Flags().GetStringSlice(FlagIndexes)
if err != nil {
return err
}

return scaffoldType(cmd, args, scaffolder.MapType(indexes...))
index, _ := cmd.Flags().GetString(FlagIndexName)
return scaffoldType(cmd, args, scaffolder.MapType(index))
}
6 changes: 0 additions & 6 deletions ignite/cmd/scaffold_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,13 @@ func scaffoldModuleHandler(cmd *cobra.Command, args []string) error {
requireRegistration, _ := cmd.Flags().GetBool(flagRequireRegistration)
params, _ := cmd.Flags().GetStringSlice(flagParams)

moduleConfigs, err := cmd.Flags().GetStringSlice(flagModuleConfigs)
if err != nil {
return err
}

cacheStorage, err := newCache(cmd)
if err != nil {
return err
}

options := []scaffolder.ModuleCreationOption{
scaffolder.WithParams(params),
scaffolder.WithModuleConfigs(moduleConfigs),
}

// Check if the module must be an IBC module
Expand Down
89 changes: 0 additions & 89 deletions ignite/cmd/scaffold_params.go

This file was deleted.

80 changes: 0 additions & 80 deletions ignite/services/scaffolder/configs.go

This file was deleted.

7 changes: 0 additions & 7 deletions ignite/services/scaffolder/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ func generate(
return xgenny.SourceModification{}, err
}

// Parse configs with the associated type
configsFields, err := field.ParseFields(moduleConfigs, checkForbiddenTypeIndex)
if err != nil {
return xgenny.SourceModification{}, err
}

githubPath := gomodulepath.ExtractAppPath(pathInfo.RawPath)
if !strings.Contains(githubPath, "/") {
// A username must be added when the app module appPath has a single element
Expand Down Expand Up @@ -123,7 +117,6 @@ func generate(
AppName: pathInfo.Package,
AppPath: absRoot,
Params: paramsFields,
Configs: configsFields,
IsIBC: false,
}
// Check if the module name is valid
Expand Down
17 changes: 0 additions & 17 deletions ignite/services/scaffolder/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ type moduleCreationOptions struct {
// params list of parameters.
params []string

// moduleConfigs list of module configs.
moduleConfigs []string

// ibcChannelOrdering ibc channel ordering.
ibcChannelOrdering string

Expand All @@ -125,13 +122,6 @@ func WithParams(params []string) ModuleCreationOption {
}
}

// WithModuleConfigs scaffolds a module with module configs.
func WithModuleConfigs(moduleConfigs []string) ModuleCreationOption {
return func(m *moduleCreationOptions) {
m.moduleConfigs = moduleConfigs
}
}

// WithIBCChannelOrdering configures channel ordering of the IBC module.
func WithIBCChannelOrdering(ordering string) ModuleCreationOption {
return func(m *moduleCreationOptions) {
Expand Down Expand Up @@ -190,12 +180,6 @@ func (s Scaffolder) CreateModule(
return err
}

// Parse configs with the associated type
configs, err := field.ParseFields(creationOpts.moduleConfigs, checkForbiddenTypeIndex)
if err != nil {
return err
}

// Check dependencies
if err := checkDependencies(creationOpts.dependencies, s.path); err != nil {
return err
Expand All @@ -205,7 +189,6 @@ func (s Scaffolder) CreateModule(
ModuleName: moduleName,
ModulePath: s.modpath.RawPath,
Params: params,
Configs: configs,
AppName: s.modpath.Package,
AppPath: s.path,
IsIBC: creationOpts.ibc,
Expand Down
Loading

0 comments on commit 831e4ca

Please sign in to comment.