-
Notifications
You must be signed in to change notification settings - Fork 2
fix(common): fix equality check for Chain objects with None #166
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
45d3e42 to
059389e
Compare
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 fixes a bug where comparing Chain enum objects with None would cause an error (GATE3-20 on Sentry). The fix adds proper type checking in the Chain.eq method to safely handle comparisons with None and other non-Chain objects.
Key changes:
- Updated Chain.eq to check if the other object is None or not a Chain instance before comparing attributes
- Added comprehensive test coverage for Chain equality edge cases
- Version bumped to 0.11.1
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Version bump from 0.11.0 to 0.11.1 for the bug fix release |
| app/api/common/models.py | Fixed Chain.eq to handle None and non-Chain object comparisons safely |
| app/api/common/test_models.py | Added comprehensive tests for Chain equality including None, invalid types, and valid chain comparisons |
| app/api/swap/providers/jupiter/client.py | Code formatting improvement (split long line) |
| app/api/oauth/zebpay.py | Import reordering to follow PEP 8 conventions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| none = None | ||
| assert (none == chain) is False | ||
|
|
||
| assert chain == chain |
Copilot
AI
Jan 9, 2026
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.
Comparison of identical values; use cmath.isnan() if testing for not-a-number.
| assert chain == chain |
| assert (none == chain) is False | ||
|
|
||
| assert chain == chain | ||
| assert chain is chain |
Copilot
AI
Jan 9, 2026
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.
Comparison of identical values; use cmath.isnan() if testing for not-a-number.
| assert chain is chain | |
| assert isinstance(chain, Chain) |
|
Sentry Issue: GATE3-20 |
Fixes GATE3-20 on Sentry