Skip to content
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

fixed arguments passing #626

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

alimaktabi
Copy link
Collaborator

@alimaktabi alimaktabi commented Sep 17, 2024

Summary by Sourcery

Fix argument passing in the Arbitrum and Optimism constraint modules by providing the correct user address to the get_delegates_address function.

Bug Fixes:

  • Fix argument passing to the get_delegates_address function in both Arbitrum and Optimism constraint modules to ensure the correct user address is used.

Copy link
Contributor

sourcery-ai bot commented Sep 17, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue with argument passing in the is_observed method for both Arbitrum and Optimism constraints. The main change is in how the get_delegates_address method is called and how its result is handled.

File-Level Changes

Change Details Files
Fixed argument passing to get_delegates_address method and added a check for empty delegated address
  • Changed token_client.get_delegates_address() to token_client.get_delegates_address(user_address)
  • Added a condition to check if delegated_address is empty: if not delegated_address or (...)
core/constraints/arbitrum.py
core/constraints/optimism.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @alimaktabi - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The fix looks good, but consider refactoring in the future to reduce code duplication between arbitrum.py and optimism.py, possibly by creating a shared base class or utility function.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@alimaktabi alimaktabi merged commit 2b0df88 into develop Sep 17, 2024
1 check passed
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