sdk/geolocation: GO: add instruction builders, executor, and write client…#3180
Draft
sdk/geolocation: GO: add instruction builders, executor, and write client…#3180
Conversation
… 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.
470d5b7 to
7c763e0
Compare
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.
Resolves: #3011
Summary of Changes
Clientwith write methods andSigner()accessor;New()now accepts a signer parameterRPCClientinterface with transaction submission methodsNote: This PR builds on #3179 (read-only SDK). Base branch is
bdz/doublezero-3011-read-only.Diff Breakdown
~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 timeoutsmartcontract/sdk/go/geolocation/client.go— adds executor field, signer parameter toNew(), 7 write methods,Signer()accessorsmartcontract/sdk/go/geolocation/create_geo_probe.go— instruction builder with 6 account metas and Borsh-serialized argssmartcontract/sdk/go/geolocation/update_geo_probe.go— instruction builder for geo probe updatessmartcontract/sdk/go/geolocation/add_parent_device.go— instruction builder for adding parent devices to a geo probesmartcontract/sdk/go/geolocation/remove_parent_device.go— instruction builder for removing parent devicesTesting Verification