Skip to content

refactor: clean up unused code#174

Merged
TheDZhon merged 8 commits into
mainfrom
chore/remove-deep-match-bytecode
Jun 26, 2026
Merged

refactor: clean up unused code#174
TheDZhon merged 8 commits into
mainfrom
chore/remove-deep-match-bytecode

Conversation

@tamtamchik

@tamtamchik tamtamchik commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary:

  • Remove unused deep_match_bytecode.
  • Remove unused exception/logger leftovers.
  • Inline explorer config reads.
  • Align config TypedDict with runtime fields.
  • Remove deprecated CLI/config compatibility.

Tests:

  • uv run pytest -q
  • uv run mypy

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_bytecode from diffyscan/utils/binary_verifier.py.
  • Removed BinVerifierError from diffyscan/utils/custom_exceptions.py.
  • Updated tests/test_binary_verifier.py to validate analyze_bytecode_diff analysis 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.

@tamtamchik tamtamchik changed the title refactor: remove unused deep_match_bytecode refactor: clean up unused code Jun 24, 2026
@tamtamchik tamtamchik requested a review from Copilot June 24, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_id is checked with truthiness here; if it were ever 0 it would be treated as “not set”. Since this value can also be a string when loaded from config, it’s safer to normalize to int | None and check is 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")

Comment thread diffyscan/diffyscan.py
@tamtamchik tamtamchik force-pushed the chore/remove-deep-match-bytecode branch from 363d509 to ba75fbb Compare June 24, 2026 15:10
@tamtamchik tamtamchik force-pushed the chore/remove-deep-match-bytecode branch from ba75fbb to 5f8a831 Compare June 24, 2026 15:20
@tamtamchik tamtamchik force-pushed the chore/remove-deep-match-bytecode branch from 26aca64 to aff6d5b Compare June 24, 2026 15:31
@tamtamchik tamtamchik marked this pull request as ready for review June 24, 2026 15:31
@tamtamchik tamtamchik requested a review from a team as a code owner June 24, 2026 15:31
@tamtamchik tamtamchik requested a review from Copilot June 24, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread diffyscan/diffyscan.py
Comment thread diffyscan/utils/explorer.py
Comment thread tests/test_diffyscan_allowlist_runtime.py Outdated
TheDZhon and others added 3 commits June 26, 2026 20:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@TheDZhon TheDZhon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GG 🎬

@TheDZhon TheDZhon merged commit 78c1b20 into main Jun 26, 2026
15 checks passed
@TheDZhon TheDZhon deleted the chore/remove-deep-match-bytecode branch June 26, 2026 17:50
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