-
Notifications
You must be signed in to change notification settings - Fork 543
Add rpcclient pkg docs, examples, and tests #5890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
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.