refactor: clean up unused code#174
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the bytecode verification utilities by removing an unused legacy wrapper (deep_match_bytecode) and its associated exception type, and updates the test suite to assert directly on the structured output from analyze_bytecode_diff.
Changes:
- Removed
deep_match_bytecodefromdiffyscan/utils/binary_verifier.py. - Removed
BinVerifierErrorfromdiffyscan/utils/custom_exceptions.py. - Updated
tests/test_binary_verifier.pyto validateanalyze_bytecode_diffanalysis fields instead of exception behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_binary_verifier.py | Updates tests to assert on analyze_bytecode_diff outputs (length mismatch and mismatch range classification). |
| diffyscan/utils/custom_exceptions.py | Removes the now-unused BinVerifierError exception class. |
| diffyscan/utils/binary_verifier.py | Removes the unused deep_match_bytecode wrapper and its dependency on BinVerifierError. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
diffyscan/diffyscan.py:308
explorer_chain_idis checked with truthiness here; if it were ever0it would be treated as “not set”. Since this value can also be a string when loaded from config, it’s safer to normalize toint | Noneand checkis not None.
explorer_hostname = config.get("explorer_hostname")
explorer_chain_id = config.get("explorer_chain_id")
logger.divider()
logger.okay("Contract", contract_address_from_config)
logger.okay("Blockchain explorer Hostname", explorer_hostname)
if explorer_chain_id:
logger.okay("Blockchain explorer Chain ID", explorer_chain_id)
else:
logger.warn("Blockchain explorer Chain ID isn't set")
363d509 to
ba75fbb
Compare
ba75fbb to
5f8a831
Compare
26aca64 to
aff6d5b
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary:
deep_match_bytecode.TypedDictwith runtime fields.Tests:
uv run pytest -quv run mypy