Skip to content

Conversation

@leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Jan 6, 2026

What

Add package-level documentation for clients/rpcclient explaining client creation, available API methods, request/response types, and error handling. Add example tests demonstrating usage patterns for all client methods. Add unit tests with mock HTTP servers for all RPC client methods. Add goc comments to the Client type and all exported methods.

Preview

To view the new docs, visit:
https://pkg.go.dev/github.com/stellar/[email protected]/clients/rpcclient

Why

Docs and examples make the rpcclient package 🎸.

Unit tests will increase confidence in the package and give us some fast failures on breakage.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation and test coverage to the rpcclient package. The changes include package-level documentation explaining the RPC client's purpose and usage patterns, godoc comments for all exported types and methods, example tests demonstrating each client method, and unit tests with mock HTTP servers validating all RPC client functionality.

Key Changes:

  • Added package documentation (doc.go) with usage examples and API overview
  • Added godoc comments to Client type and all exported methods
  • Added example tests for all client methods showing typical usage patterns
  • Added unit tests with mock JSON-RPC servers for complete method coverage

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

File Description
clients/rpcclient/doc.go New package documentation describing client creation, API methods, request/response types, and error handling
clients/rpcclient/main.go Added godoc comments to Client type and all exported methods describing their purpose and behavior
clients/rpcclient/examples_test.go New file with example tests demonstrating usage patterns for all client methods
clients/rpcclient/main_test.go New file with unit tests using mock HTTP servers to validate all RPC client methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leighmcculloch leighmcculloch changed the title Add rpcclient package documentation and tests Add rpcclient pkg docs, examples, and tests Jan 6, 2026
@leighmcculloch leighmcculloch marked this pull request as ready for review January 6, 2026 04:27
@leighmcculloch leighmcculloch enabled auto-merge (squash) January 6, 2026 04:28
@leighmcculloch leighmcculloch enabled auto-merge (squash) January 6, 2026 04:29
@leighmcculloch leighmcculloch merged commit 5e732d7 into main Jan 9, 2026
11 checks passed
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.

3 participants