build: NONEVM-4285: implement stellar encoder#730
Conversation
🦋 Changeset detectedLatest commit: 7f05103 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| } | ||
|
|
||
| s := *af.Value | ||
| if len(s) >= hexPrefixLen && (s[0:hexPrefixLen] == "0x" || s[0:hexPrefixLen] == "0X") { |
There was a problem hiding this comment.
another nit: if you use n.SetString(*af.Value, 0) it auto-detects the 0x prefix and interprets it as hex.
gustavogama-cll
left a comment
There was a problem hiding this comment.
Added a few minor suggestions about small optimizations which can be safely ignored. The only real requests I have is (1) to review the functions that are initially exported (remember we can always change from private to public afterwards); (2) improve the test coverage, for this type of code I think we should aim for >80%.
There was a problem hiding this comment.
Pull request overview
This PR introduces Stellar (Soroban MCMS) ABI-compatible hashing/encoding support in the Go SDK and updates dependency management to track the new Stellar SDK dependency.
Changes:
- Add Stellar as a supported chain family in chain selector handling.
- Introduce a new
sdk/stellarpackage implementingsdk.Encoderplus ABI preimage construction and golden-vector tests. - Update
go.mod/go.sum, Dependabot allowlist, and add a changeset for publishing.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
types/chain_selector.go |
Adds chainsel.FamilyStellar to the list of supported families. |
sdk/stellar/encoder.go |
Implements sdk.Encoder for Stellar and parses optional additionalFields.value. |
sdk/stellar/encode.go |
Implements Stellar-specific ABI word packing and Keccak hashing for metadata/ops. |
sdk/stellar/constants.go |
Defines ABI/layout constants and domain separators. |
sdk/stellar/address.go |
Parses Stellar contract identifiers from strkey or 32-byte hex. |
sdk/stellar/chain.go |
Maps chain selector → Stellar network ID via chain-selectors. |
sdk/stellar/encoder_test.go |
Tests encoder output consistency and contract-id parsing. |
sdk/stellar/encode_test.go |
Tests domain constants and hashing against golden vectors / ABI encoder. |
go.mod |
Adds github.com/stellar/go-stellar-sdk (and indirect go-xdr). |
go.sum |
Updates dependency checksums (incl. Stellar deps, go-errors bump). |
.github/dependabot.yml |
Allowlists github.com/stellar/go-stellar-sdk for gomod updates. |
.changeset/free-peaches-itch.md |
Declares a patch release for Stellar encoder support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…cms into stellar-encoder
|




Uh oh!
There was an error while loading. Please reload this page.