Skip to content

sdk/geolocation: GO: add instruction builders, executor, and write client…#3180

Draft
ben-dz wants to merge 2 commits intomainfrom
bdz/doublezero-3011-write
Draft

sdk/geolocation: GO: add instruction builders, executor, and write client…#3180
ben-dz wants to merge 2 commits intomainfrom
bdz/doublezero-3011-write

Conversation

@ben-dz
Copy link
Contributor

@ben-dz ben-dz commented Mar 5, 2026

Resolves: #3011

Summary of Changes

  • Add transaction executor with signing, submission, and finalization logic
  • Add 7 instruction builders (InitProgramConfig, UpdateProgramConfig, CreateGeoProbe, UpdateGeoProbe, DeleteGeoProbe, AddParentDevice, RemoveParentDevice) with Borsh-serialized args and account meta derivation
  • Expand Client with write methods and Signer() accessor; New() now accepts a signer parameter
  • Expand RPCClient interface with transaction submission methods

Note: This PR builds on #3179 (read-only SDK). Base branch is bdz/doublezero-3011-read-only.

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 10 +883 / -12 +871
Tests 3 +940 / -6 +934
Scaffolding 2 +19 / -0 +19

~50/50 split between implementation and tests.

Key files (click to expand)
  • smartcontract/sdk/go/geolocation/instruction_test.go — 551 lines of tests covering all 7 instruction builders (account metas, args serialization, PDA derivation)
  • smartcontract/sdk/go/geolocation/executor_test.go — 383 lines testing transaction lifecycle (happy path, preflight skip, blockhash errors, send failures, finalization timeout/errors)
  • smartcontract/sdk/go/geolocation/executor.go — transaction executor: blockhash fetch, signing, submission, polling-based finalization with configurable timeout
  • smartcontract/sdk/go/geolocation/client.go — adds executor field, signer parameter to New(), 7 write methods, Signer() accessor
  • smartcontract/sdk/go/geolocation/create_geo_probe.go — instruction builder with 6 account metas and Borsh-serialized args
  • smartcontract/sdk/go/geolocation/update_geo_probe.go — instruction builder for geo probe updates
  • smartcontract/sdk/go/geolocation/add_parent_device.go — instruction builder for adding parent devices to a geo probe
  • smartcontract/sdk/go/geolocation/remove_parent_device.go — instruction builder for removing parent devices

Testing Verification

  • All 44 unit tests pass (24 from read-only base + 20 new write-side tests)
  • Instruction tests verify correct account meta ordering, signer/writable flags, PDA derivation, and Borsh-serialized discriminant+args for all 7 instructions
  • Executor tests cover happy path finalization, SkipPreflight propagation, blockhash/send/finalization error paths, and timeout behavior

Base automatically changed from bdz/doublezero-3011-read-only to main March 5, 2026 22:11
@ben-dz ben-dz changed the title sdk/geolocation: add instruction builders, executor, and write client… sdk/geolocation: GO: add instruction builders, executor, and write client… Mar 5, 2026
… methods

Adds the write-side of the geolocation Go SDK: instruction builders for
all 7 program instructions, transaction executor with finalization
polling, and client write methods.
@ben-dz ben-dz force-pushed the bdz/doublezero-3011-write branch from 470d5b7 to 7c763e0 Compare March 5, 2026 22:32
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.

geolocation: Go SDK — GeoProbe types and client methods

1 participant