Skip to content

geolocation: add cross-language borsh fixture tests#3682

Open
0xzrf wants to merge 1 commit intomalbeclabs:mainfrom
0xzrf:fixture_tests
Open

geolocation: add cross-language borsh fixture tests#3682
0xzrf wants to merge 1 commit intomalbeclabs:mainfrom
0xzrf:fixture_tests

Conversation

@0xzrf
Copy link
Copy Markdown

@0xzrf 0xzrf commented May 7, 2026

Summary of Changes

  • Added cross-language fixture coverage for the geolocation Go SDK by introducing a Rust fixture generator and Go fixture tests.
  • The Rust generator (sdk/geolocation/testdata/fixtures/generate-fixtures) serializes real onchain Rust structs via Borsh and writes paired .bin + .json fixtures for:
    • GeolocationProgramConfig
    • GeoProbe
    • GeolocationUser (including targets and result_destination)
  • Added Go fixture tests (sdk/geolocation/go/fixture_test.go) that load those fixtures, deserialize using the Go SDK, and validate field-by-field values against the JSON sidecars.
  • Wired the new generator and tests into repo workflows:
    • make generate-fixtures now generates geolocation fixtures
    • make sdk-test now runs go test ./sdk/geolocation/go/...
    • excluded the generator crate from the root Cargo workspace to match existing fixture-generator conventions
  • Why this is necessary: Go-only round-trip tests can miss subtle Rust↔Go Borsh incompatibilities; fixture tests ensure the Go SDK can deserialize authoritative Rust-produced bytes, preventing regressions and onchain decoding failures.
  • Metrics exposed: None.
  • Supporting docs / external resources: Issue: #3306.
  • CHANGELOG.md update needed: No.

Testing Verification

  • make generate-fixtures
  • go test ./sdk/geolocation/go/...
  • make sdk-test

@0xzrf 0xzrf changed the title added fixture tests geolocation: add cross-language borsh fixture tests May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant