Skip to content

Commit 7bab6fa

Browse files
committed
Merge branch 'main' into feature/PLEX-1560-header-by-number
# Conflicts: # go.mod # go.sum # pkg/capabilities/v2/chain-capabilities/evm/client.pb.go
2 parents 42e31e2 + 1ae7457 commit 7bab6fa

File tree

10 files changed

+46
-19
lines changed

10 files changed

+46
-19
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ require (
3737
github.com/shopspring/decimal v1.4.0
3838
github.com/smartcontractkit/chain-selectors v1.0.62
3939
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1
40-
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715162846-cd5803fa3877
41-
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250708135749-8736758474ec
40+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715171446-42e31e2bef64
41+
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8
4242
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58
4343
github.com/smartcontractkit/freeport v0.1.1
4444
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,12 @@ github.com/smartcontractkit/chain-selectors v1.0.62 h1:KWLEyKQXHxGGHIlUfLrzjYldl
304304
github.com/smartcontractkit/chain-selectors v1.0.62/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8=
305305
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 h1:ca2z5OXgnbBPQRxpwXwBLJsUA1+cAp5ncfW4Ssvd6eY=
306306
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1/go.mod h1:NZv/qKYGFRnkjOYBouajnDfFoZ+WDa6H2KNmSf1dnKc=
307-
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715162846-cd5803fa3877 h1:n8WiGAsNYycKlQnYV69j41Ajwnm7LWgARDOk5kZlmxg=
308-
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715162846-cd5803fa3877/go.mod h1:U1UAbPhy6D7Qz0wHKGPoQO+dpR0hsYjgUz8xwRrmKwI=
309-
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250708135749-8736758474ec h1:6XpqaGA2a4ik2zte0bEKeFIgPyHlTQNrVdaIbJWqlks=
310-
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250708135749-8736758474ec/go.mod h1:0B4c6GEcnm67Q/E8vwpxTpdjL8elQkh8pVzxGhXkVsM=
307+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250710185807-2e08944e72d2 h1:pMwrNp2BFITYYDP3sAiGtecDP3frYDNPXpa4/vleghU=
308+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250710185807-2e08944e72d2/go.mod h1:U1UAbPhy6D7Qz0wHKGPoQO+dpR0hsYjgUz8xwRrmKwI=
309+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715171446-42e31e2bef64 h1:g7jkGxtlJOP7cJjtPFCaRfsvwT8UJRnJs6SVRsx/hA4=
310+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250715171446-42e31e2bef64/go.mod h1:U1UAbPhy6D7Qz0wHKGPoQO+dpR0hsYjgUz8xwRrmKwI=
311+
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8 h1:/AUP/7d2ILZyYeb/Zs70WllVzjuyzUjQGDJCaF50hww=
312+
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8/go.mod h1:ay4g8WruGFr512i+0IWDPmc1ZGpsw2ivfqfk0ED9vqY=
311313
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58 h1:yXbKWplUgoC+PoOoPXseKunxElXrnCKnKBGxkmUVR2I=
312314
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58/go.mod h1:HHGeDUpAsPa0pmOx7wrByCitjQ0mbUxf0R9v+g67uCA=
313315
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20250430163438-97d324ef9061 h1:5BKk6j2QWmb5TFoWYVLuL8U2XUIzTUUo5HBkCHTX2kM=

pkg/capabilities/v2/chain-capabilities/evm/server/client_server_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/v2/protoc/pkg/template_generator.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,19 @@ func (t *TemplateGenerator) runTemplate(name, tmplText string, args any, partial
203203

204204
return "emptypb.Empty", nil
205205
},
206+
"CleanComments": func(line string) string {
207+
line = strings.TrimSpace(line)
208+
switch {
209+
case strings.HasPrefix(line, "//"):
210+
return strings.TrimSpace(strings.TrimPrefix(line, "//"))
211+
case strings.HasPrefix(line, "/*"):
212+
line = strings.TrimPrefix(line, "/*")
213+
line = strings.TrimSuffix(line, "*/")
214+
return strings.TrimSpace(line)
215+
default:
216+
return line
217+
}
218+
},
206219
}).Funcs(t.ExtraFns)
207220

208221
// Register partials

pkg/capabilities/v2/protoc/pkg/templates/server.go.tmpl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,26 @@ import (
2626
// Avoid unused imports if there is configuration type
2727
var _ = emptypb.Empty{}
2828

29-
{{- range .Services}}
29+
{{ range .Services}}
3030
{{ $hasTriggers := false }}
3131
{{ $hasActions := false }}
32-
{{ $service := . }}
33-
type {{.GoName}}Capability interface {
32+
{{ $service := . -}}
33+
{{ if .Comments.Leading.String }}//{{.GoName}}Capability {{CleanComments .Comments.Leading.String}} {{ end }}
34+
type {{.GoName}}Capability interface { {{- if .Comments.Trailing.String }}//{{.GoName}}Capability {{CleanComments .Comments.Trailing.String}} {{ end }}
3435
{{- range .Methods}}
3536
{{- if isTrigger . }}
3637
{{ $hasTriggers = true }}
37-
Register{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) (<- chan capabilities.TriggerAndId[*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}], error)
38-
Unregister{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) error
38+
{{- if .Comments.Leading.String }}//Register{{.GoName}} registration for {{CleanComments .Comments.Leading.String}} {{ end }}
39+
Register{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) (<- chan capabilities.TriggerAndId[*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}], error) {{- if .Comments.Trailing.String }}// {{CleanComments .Comments.Trailing.String}} {{ end }}
40+
{{ if .Comments.Leading.String }}//Unregister{{.GoName}} unregistration for {{CleanComments .Comments.Leading.String}} {{ end }}
41+
Unregister{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) error {{- if .Comments.Trailing.String }}// {{CleanComments .Comments.Trailing.String}} {{ end }}
3942
{{- else }}
4043
{{ $hasActions = true }}
41-
{{.GoName}}(ctx context.Context, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}} {{if ne "emptypb.Empty" (ConfigType $service)}}, {{(ConfigType $service)}}{{ end }}) (*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}, error)
42-
{{- end }}
44+
{{- if .Comments.Leading.String }}//{{.GoName}} {{CleanComments .Comments.Leading.String}} {{ end }}
45+
{{.GoName}}(ctx context.Context, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}} {{if ne "emptypb.Empty" (ConfigType $service)}}, {{(ConfigType $service)}}{{ end }}) (*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}, error) {{- if .Comments.Trailing.String }}// {{CleanComments .Comments.Trailing.String}} {{ end }}
46+
{{ end }}
4347
{{- end }}
4448

45-
4649
Start(ctx context.Context) error
4750
Close() error
4851
HealthReport() map[string]error
@@ -59,8 +62,8 @@ func New{{.GoName}}Server(capability {{.GoName}}Capability) *{{.GoName}}Server {
5962
stopCh: stopCh,
6063
}
6164
}
62-
63-
type {{.GoName}}Server struct {
65+
{{ if .Comments.Leading.String }}//{{.GoName}}Server {{CleanComments .Comments.Leading.String}} {{ end }}
66+
type {{.GoName}}Server struct { {{- if .Comments.Trailing.String }}// {{CleanComments .Comments.Trailing.String}} {{ end }}
6467
{{.GoName|LowerFirst}}Capability
6568
capabilityRegistry core.CapabilitiesRegistry
6669
stopCh chan struct{}

pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger/server/action_and_trigger_server_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/v2/protoc/pkg/test_capabilities/basicaction/server/basic_action_server_gen.go

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger/server/basic_trigger_server_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/v2/triggers/cron/server/trigger_server_gen.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/v2/triggers/http/server/trigger_server_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)