Add cap server client#2049
Open
ilija42 wants to merge 2 commits into
Open
Conversation
|
👋 ilija42, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces new Stellar CRE chain-capability bindings (generated protobuf + server wrapper) and supporting proto/domain conversion + validation helpers, and extends the Stellar domain client interface.
Changes:
- Added
SimulateTransactionto thepkg/types/chains/stellar.Clientinterface. - Added generated Stellar chain-capability proto/server code under
pkg/capabilities/v2/chain-capabilities/stellar/. - Added proto helper conversions/validators (with tests) for Stellar chain-capability messages; bumped
chainlink-protos/cre/godependency.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/types/chains/stellar/stellar.go | Extends Stellar domain client interface with SimulateTransaction. |
| pkg/capabilities/v2/chain-capabilities/stellar/server/client_server_gen.go | Generated capability server wrapper for Stellar methods (GetLatestLedger/ReadContract/WriteReport). |
| pkg/capabilities/v2/chain-capabilities/stellar/proto_helpers.go | Adds proto↔domain conversion helpers and request validation. |
| pkg/capabilities/v2/chain-capabilities/stellar/proto_helpers_test.go | Adds unit tests for conversions and validators. |
| pkg/capabilities/v2/chain-capabilities/stellar/generate.go | Adds go:generate entry for Stellar capability codegen. |
| pkg/capabilities/v2/chain-capabilities/stellar/client.pb.go | Generated protobuf bindings for Stellar CRE client capability. |
| go.mod | Bumps github.com/smartcontractkit/chainlink-protos/cre/go version. |
| go.sum | Updates checksums for the bumped dependency version. |
Files not reviewed (2)
- pkg/capabilities/v2/chain-capabilities/stellar/client.pb.go: Language not supported
- pkg/capabilities/v2/chain-capabilities/stellar/server/client_server_gen.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
6
to
+8
| // Both methods map 1:1 to the Stellar RPC API. | ||
| type Client interface { | ||
| SimulateTransaction(context.Context, string, []byte) ([]byte, error) |
| } | ||
|
|
||
| // ConvertGetLatestLedgerResponseToProto converts the domain GetLatestLedgerResponse to a proto. | ||
| // Hash must be a valid lowercase hex string; XDR fields must be valid standard base64. |
| // domain type. Hash is returned as lowercase hex; XDR fields are returned as standard base64. | ||
| func ConvertGetLatestLedgerResponseFromProto(p *GetLatestLedgerResponse) (stellartypes.GetLatestLedgerResponse, error) { | ||
| if p == nil { | ||
| return stellartypes.GetLatestLedgerResponse{}, errors.New("GetLatestLedgerResponse is nil") |
| // ValidateReadContractRequest checks that required fields are present. | ||
| func ValidateReadContractRequest(req *ReadContractRequest) error { | ||
| if req == nil { | ||
| return errors.New("ReadContractRequest is nil") |
| // ValidateWriteReportRequest checks that required fields are present. | ||
| func ValidateWriteReportRequest(req *WriteReportRequest) error { | ||
| if req == nil { | ||
| return errors.New("WriteReportRequest is nil") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requires
Supports