Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed May 9, 2024
1 parent 5ffc924 commit bc56b88
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ignite/templates/ibc/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ func protoModify(opts *PacketOptions) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range append(opts.Fields.Custom(), opts.AckFields.Custom()...) {
protopath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoImports = append(protoImports, protoutil.NewImport(protopath))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
if err := protoutil.AddImports(protoFile, true, protoImports...); err != nil {
return errors.Errorf("failed while adding imports to %s: %w", path, err)
Expand Down Expand Up @@ -349,7 +349,7 @@ func protoTxModify(opts *PacketOptions) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range opts.Fields.Custom() {
protopath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protopath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protopath))
}
if err := protoutil.AddImports(protoFile, true, protoImports...); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ignite/templates/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func protoTxMessageModify(opts *Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range append(opts.ResFields.Custom(), opts.Fields.Custom()...) {
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v.proto", opts.AppName, opts.ModuleName, f)
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
if err = protoutil.AddImports(protoFile, true, protoImports...); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions ignite/templates/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func protoQueryModify(opts *Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range append(opts.ResFields.Custom(), opts.ReqFields.Custom()...) {
protopath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoImports = append(protoImports, protoutil.NewImport(protopath))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
if err = protoutil.AddImports(protoFile, true, protoImports...); err != nil {
return errors.Errorf("failed to add imports to %s: %w", path, err)
Expand Down
2 changes: 1 addition & 1 deletion ignite/templates/typed/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func protoTxModify(opts *typed.Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range opts.Fields.Custom() {
protoPath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
// we already know an import exists, pass false for fallback.
Expand Down
4 changes: 2 additions & 2 deletions ignite/templates/typed/map/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func protoRPCModify(opts *typed.Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range opts.Fields.Custom() {
protoPath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
// we already know an import exists, pass false for fallback.
Expand Down Expand Up @@ -597,7 +597,7 @@ func protoTxModify(opts *typed.Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range opts.Fields.Custom() {
protoPath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
// we already know an import exists, pass false for fallback.
Expand Down
2 changes: 1 addition & 1 deletion ignite/templates/typed/singleton/singleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func protoTxModify(opts *typed.Options) genny.RunFn {
protoImports = append(protoImports, protoutil.NewImport(imp))
}
for _, f := range opts.Fields.Custom() {
protoPath := opts.ProtoFile(fmt.Sprintf("%v.proto", f))
protoPath := fmt.Sprintf("%[1]v/%[2]v/%[3]v/%[4]v.proto", opts.AppName, opts.ModuleName, opts.ProtoVer, f)
protoImports = append(protoImports, protoutil.NewImport(protoPath))
}
// we already know an import exists, pass false for fallback.
Expand Down

0 comments on commit bc56b88

Please sign in to comment.