-
Notifications
You must be signed in to change notification settings - Fork 17
Feat: add summary #111
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
Feat: add summary #111
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 type hints and documentation across the codebase, implements a summary feature for scan results, and refactors code for improved maintainability. The changes focus on improving code quality through better error handling, cleaner abstractions, and enhanced observability.
Key Changes:
- Added type hints to function signatures throughout the codebase
- Added docstrings to document function purposes, parameters, returns, and exceptions
- Implemented a final summary feature that aggregates and displays source and bytecode comparison statistics
- Refactored error handling to raise exceptions instead of calling sys.exit(), improving testability
- Extracted helper functions to reduce complexity in long functions
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
diffyscan/diffyscan.py | Added summary statistics tracking and final summary printing; refactored config processing with helper functions; updated function signatures with type hints |
diffyscan/utils/binary_verifier.py | Fixed bytecode slicing bug; refactored deep_match_bytecode by extracting helper functions; added return value to indicate match status |
diffyscan/utils/calldata.py | Added type hints and comprehensive docstrings; extracted validation logic into separate function |
diffyscan/utils/common.py | Converted error handling from sys.exit() to exceptions; refactored HTTP request handling with decorator; improved temp file handling in prettify_solidity |
diffyscan/utils/compiler.py | Added type hints and docstrings to all compiler-related functions |
diffyscan/utils/custom_types.py | Fixed typo in class name; updated TypedDict definitions with NotRequired for optional fields |
diffyscan/utils/encoder.py | Fixed tuple encoding logic to properly handle dynamic parts; added type hints |
diffyscan/utils/explorer.py | Refactored explorer fetching with helper functions; improved error handling; added validation helper; updated type hints |
diffyscan/utils/github.py | Added type hints to function signatures; improved documentation |
diffyscan/utils/hardhat.py | Added TIMEOUT_FOR_CONNECT_SEC constant |
diffyscan/utils/helpers.py | Added type hints and docstrings |
diffyscan/utils/node_handler.py | Added comprehensive docstrings and type hints |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
👏 LGTM, only adding REMOTE_RPC_URL="..." and LOCAL_RPC_URL="..." every time is annoying, maybe add some default value
local_rpc_url = load_env("LOCAL_RPC_URL", masked=False, required=True) | ||
remote_rpc_url = load_env("REMOTE_RPC_URL", masked=True, required=True) |
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.
Maybe add some default at least for LOCAL_RPC_URL here?
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.
will introduce in a separate PR
Uh oh!
There was an error while loading. Please reload this page.