Skip to content

Improve Type Checking, Proxy Implementation, and Documentation #151

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JAGADISHSUNILPEDNEKAR
Copy link
Contributor

This PR addresses several TODO items related to type checking, proxy implementation, and documentation:

Type Checking Improvements

  • Added necessary type annotations and casting to proxy.py to ensure mypy compatibility
  • Updated mypy.ini configuration for Python 3.12 compatibility
  • Fixed issues with return type annotations to eliminate "Returning Any from function declared to return specific type" errors
  • Used explicit casting with cast() to ensure type safety while maintaining code clarity

Proxy Implementation Enhancements

  • Completely revamped the NodeProxy class with:
    • Comprehensive support for all major Bitcoin Core RPC methods
    • Better error handling with custom RPCError class
    • Full type annotations for better IDE integration
    • Detailed docstrings for all methods
    • Configurable connection parameters (host, port, timeout, HTTPS)
    • Backward compatibility with existing code

Documentation Improvements

  • Added comprehensive documentation for key modules:
    • Documentation for Address functionality (addresses.rst)
    • Documentation for SegWit functionality (segwit.rst)
    • Enhanced documentation for the Proxy module (proxy.rst)
  • Updated index.rst to include the new documentation files
  • Added Jupyter notebooks for interactive documentation:
    • keys_and_addresses.ipynb
    • proxy.ipynb

This PR is a significant step toward improving code quality, developer experience, and documentation as outlined in our TODO list. Would love to hear your feedback @karask

All tests pass
Screenshot 2025-04-03 at 3 01 39 AM

@JAGADISHSUNILPEDNEKAR
Copy link
Contributor Author

@karask
As everything is related to documentation improvement and creation of Jupyter notebooks
I have included them in the same PR
No functional changes have been made( except the test_proxy.py file {which also has been handled properly})
Let me know if you are okay with this approach or need any other changes
I would be happy to make it

@JAGADISHSUNILPEDNEKAR
Copy link
Contributor Author

JAGADISHSUNILPEDNEKAR commented Apr 5, 2025

If you want I can split it into Multiple PRs
Let me know how you want me to split it into as in what part you want in a particular PR

I was thinking of splitting it into 4 PRs

Documentation improvements (addresses.rst, segwit.rst, updated proxy.rst, index.rst updates)
Type checking improvements (mypy.ini updates, type annotations in proxy.py)
Proxy implementation enhancements (NodeProxy class revamp)
Jupyter notebooks

let me know if you find this PR suitable or you want me to go ahead with this approach or anything which you might suggest
Once again Thank you for your guidance

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