Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.62
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717142627-ae07002b923d
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717171326-3713a263eb89
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250717190838-612a8b4eb22f
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58
github.com/smartcontractkit/freeport v0.1.1
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,12 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 h1:ca2z5OXgn
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1/go.mod h1:NZv/qKYGFRnkjOYBouajnDfFoZ+WDa6H2KNmSf1dnKc=
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717142627-ae07002b923d h1:wQK8b6D04/uAO0gOLAPgqKSc9Y2uGBv3mizhjbpyuzU=
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717142627-ae07002b923d/go.mod h1:U1UAbPhy6D7Qz0wHKGPoQO+dpR0hsYjgUz8xwRrmKwI=
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717171326-3713a263eb89 h1:6ZTpkl368bTeECC57Wis8hQitpZLNw/am0mN/VoPEQU=
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250717171326-3713a263eb89/go.mod h1:U1UAbPhy6D7Qz0wHKGPoQO+dpR0hsYjgUz8xwRrmKwI=
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8 h1:/AUP/7d2ILZyYeb/Zs70WllVzjuyzUjQGDJCaF50hww=
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250715132921-fbb00f834ac8/go.mod h1:ay4g8WruGFr512i+0IWDPmc1ZGpsw2ivfqfk0ED9vqY=
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250717190838-612a8b4eb22f h1:kFSSJGqoaqQbaoQqURUXeo0HfkxnoY59sfDT3fox+Jo=
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250717190838-612a8b4eb22f/go.mod h1:dzrYYwfmS+lgzjS3ulfO5YfQDsqBt/PrtYYik8ImxUk=
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58 h1:yXbKWplUgoC+PoOoPXseKunxElXrnCKnKBGxkmUVR2I=
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20250701181457-37bd0d618b58/go.mod h1:HHGeDUpAsPa0pmOx7wrByCitjQ0mbUxf0R9v+g67uCA=
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20250430163438-97d324ef9061 h1:5BKk6j2QWmb5TFoWYVLuL8U2XUIzTUUo5HBkCHTX2kM=
Expand Down
2 changes: 1 addition & 1 deletion pkg/capabilities/v2/chain-capabilities/evm/client.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 23 additions & 6 deletions pkg/capabilities/v2/protoc/pkg/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,45 @@ package pkg
import (
"fmt"
"strings"
"unicode"

"golang.org/x/exp/slices"

"github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb"
)

// toPascalCase converts a string to PascalCase
func toPascalCase(s string) string {
words := strings.FieldsFunc(s, func(r rune) bool {
return r == '_' || r == '-' || unicode.IsSpace(r)
})

result := ""
for _, word := range words {
if len(word) > 0 {
result += strings.ToUpper(string(word[0])) + strings.ToLower(word[1:])
}
}
return result
}

func StringLblValue(method bool) func(string, *pb.Label) (string, error) {
return func(name string, label *pb.Label) (string, error) {
pascalName := toPascalCase(name)
if method {
name += "()"
pascalName += "()"
}
switch pbLbl := label.Kind.(type) {
case *pb.Label_StringLabel:
return fmt.Sprintf("+ c.%s", name), nil
return fmt.Sprintf("+ c.%s", pascalName), nil
case *pb.Label_Uint32Label:
return fmt.Sprintf("strconv.FormatUint(uint64(c.%s), 10)", name), nil
return fmt.Sprintf("strconv.FormatUint(uint64(c.%s), 10)", pascalName), nil
case *pb.Label_Int32Label:
return fmt.Sprintf("strconv.FormatInt(int64(c.%s), 10)", name), nil
return fmt.Sprintf("strconv.FormatInt(int64(c.%s), 10)", pascalName), nil
case *pb.Label_Uint64Label:
return fmt.Sprintf("strconv.FormatUint(c.%s, 10)", name), nil
return fmt.Sprintf("strconv.FormatUint(c.%s, 10)", pascalName), nil
case *pb.Label_Int64Label:
return fmt.Sprintf("strconv.FormatInt(c.%s, 10)", name), nil
return fmt.Sprintf("strconv.FormatInt(c.%s, 10)", pascalName), nil
default:
return "", fmt.Errorf("unsupported label type: %T", pbLbl)
}
Expand Down
Loading