Add Stellar get transaction status fields - #2369
Conversation
|
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a protobuf/gRPC contract and tightens conversion semantics, which is high-impact and benefits from final human review for compatibility and rollout considerations.
Pull request overview
Adds richer, presence-aware Stellar GetTransaction response modeling and enforces stricter (status- and type-consistent) protobuf/domain conversions for Stellar RPC-related types.
Changes:
- Expanded domain + protobuf
GetTransactionResponseto include explicit status, tx hash, result XDR/meta XDR, and optional fee/ledger metadata. - Hardened Stellar proto helper converters: validate ledger key XDR inputs and reject status-inconsistent
GetTransactionresponses; updated relayer servers to surface conversion errors. - Updated tests and module dependencies to support the new validation and fields.
File summaries
| File | Description |
|---|---|
| pkg/types/chains/stellar/stellar.go | Introduces GetTransactionStatus and expands GetTransactionResponse with status/hash/XDR fields and presence-aware fee/ledger metadata. |
| pkg/loop/internal/relayerset/stellar.go | Propagates conversion/validation errors when converting GetTransaction responses to proto. |
| pkg/loop/internal/relayerset/relayerset_test.go | Updates Stellar service tests for new key fixtures and the expanded GetTransactionResponse. |
| pkg/loop/internal/relayer/stellar.go | Propagates conversion/validation errors when converting GetTransaction responses to proto. |
| pkg/loop/internal/relayer/stellar_test.go | Updates round-trip gRPC tests for new key fixtures and expanded GetTransactionResponse. |
| pkg/chains/stellar/stellar.proto | Adds GetTransactionStatus enum; makes fee/ledger fields optional; adds tx hash and result XDR fields. |
| pkg/chains/stellar/stellar.pb.go | Regenerated protobuf Go bindings for the updated Stellar proto definitions. |
| pkg/chains/stellar/proto_helpers.go | Adds LedgerKey XDR validation; makes GetTransaction converters status-aware and validates response consistency. |
| pkg/chains/stellar/proto_helpers_test.go | Adds coverage for LedgerKey XDR validation and the expanded GetTransaction conversion logic. |
| go.mod | Adds Stellar XDR dependency required by new validation logic. |
| go.sum | Updates sums for newly added/indirect dependencies. |
Review details
Files not reviewed (1)
- pkg/chains/stellar/stellar.pb.go: Generated file
Suppressed comments (1)
pkg/chains/stellar/proto_helpers.go:990
- convertGetTransactionStatusFromProto treats GET_TRANSACTION_STATUS_UNSPECIFIED (0) as an "unsupported" proto enum value, even though it's the defined default when the field is unset. Handling it explicitly makes the validation failure clearer and avoids implying the sender used an unknown enum.
func convertGetTransactionStatusFromProto(s GetTransactionStatus) (stellar.GetTransactionStatus, error) {
switch s {
case GetTransactionStatus_GET_TRANSACTION_STATUS_NOT_FOUND:
return stellar.GetTransactionStatusNotFound, nil
case GetTransactionStatus_GET_TRANSACTION_STATUS_FAILED:
return stellar.GetTransactionStatusFailed, nil
case GetTransactionStatus_GET_TRANSACTION_STATUS_SUCCESS:
return stellar.GetTransactionStatusSuccess, nil
default:
return 0, fmt.Errorf("unsupported proto get transaction status: %d", s)
}
- Files reviewed: 9/11 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
00aa331 to
4cab41b
Compare
Summary
Tests