Prototype: two-step client style for data feeds bindings - #166
Merged
Fletch153 merged 4 commits intoJul 23, 2026
Merged
Conversation
Reverts all generated files (interface .rs, generated clients, lock files) to the base branch state so the PR diff shows only hand-written changes. check-generated and Go builds will fail on this commit by design. Regenerate with 'make generate-bindings' before merge.
- Derive prepended type aliases from the contract crates' source (filtered to referenced names) instead of hard-coded literals; output verified byte-identical - Unify I256 dispatch on a single resolveAlias pre-check in rustTypeToGo/getToScValConverter/generateVecItemParse; drop the unreachable duplicate branches - Populate knownAliases in GenerateClient too, removing the hidden ordering dependency on GenerateTypes - Collapse typesFileNeedsImports to one field loop; needBig now derives from fields only (I256 aliases emit no code) - Hoist i256 range constants to package vars in scval - Embed SorobanContractDeployer in test fakes instead of stubbing unused methods - Replace completeness-test map/slice triple bookkeeping with one pinned slice; FeedUpdated.Answer check is now compile-time - Generalize the rmn_remote auth-event patch to one regex; make all contractevent patch regexes arg-order-independent - Drop the Makefile gofmt pass (generator output is gofmt-canonical)
This reverts commit 879946e.
Soroban's contract spec carries no view/mutability marker, so the direct client style needs a hand-maintained read-only list to decide simulate vs invoke per function. The twostep style removes that classification entirely: every generated method builds and returns a *bindings.Call[T], and the caller executes it with Result (free simulation) or SignAndSend (fee-paying transaction) — read/write intent becomes explicit and reviewable at each call site, mirroring Soroban's official TypeScript bindings. - bindings.Call[T] runtime type with Result/SignAndSend - generator -style flag (direct unchanged and default; twostep rejects -readonly); style column in gen_bindings.sh - cache and proxy regenerated in twostep style; their read-only lists deleted; types.go byte-identical - CCIP contracts stay on the direct style; regeneration verified byte-identical
Soroban Contract Test Coverage92.64% line coverage — 18001 / 19431 lines hit
Per-Contract Breakdown
Full file-level coverage report |
Fletch153
merged commit Jul 23, 2026
c0c5b80
into
feature/DF-25434/data-feeds-deployment
12 of 22 checks passed
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.
Summary
bindings.Call[T]: every DF client method builds a call; the caller executes withResult(ctx)(free simulation) orSignAndSend(ctx)(fee-paying transaction).Context
Soroban's contract spec has no view/mutability marker, so the direct style needs a hand-maintained readonly list per contract (silent-no-op hazard if a listed function ever starts writing state). The two-step shape — same as Soroban's official TypeScript bindings — makes read-vs-write intent explicit at each call site instead:
Changes
bindings/call.go—Call[T]runtime (~70 lines) +Void.generator:-styleflag (directdefault and unchanged;twosteprejects-readonly),generateMethodTwoStepemission reusing the existing decode codegen.scripts/gen_bindings.sh: style column; DF rows switched totwostep, readonly lists deleted.client.goregenerated (methods dropctx, return*bindings.Call[T]);types.gobyte-identical.Testing
go test ./...inbindings/— all pass, including newTestCallRoutesResultToSimulateAndSignAndSendToInvokeandTestGenerateClientTwoStepStyle.committee_verifierunder the new generator — md5-identical to committed output.Notes
.SignAndSend(ctx)/.Result(ctx)suffixes and its e2e re-run; #23208's rewrite would target this API directly.