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

fix: token flag for cluster pay #171

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dtdang
Copy link
Contributor

@dtdang dtdang commented Nov 12, 2024

What I did

Looks for the token symbol if the address is valid or if the token symbol is given then it compares it to the accepted tokens list for the network.

fixes: #170

How I did it

How to verify it

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

accepted_tokens = platform.get_accepted_tokens(network.chain_id)
if token:
try:
token_symbol = Contract(token).symbol()
Copy link
Member

Choose a reason for hiding this comment

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

I think you could do something like check if it's an address, and then do this without a try...except

Copy link
Contributor Author

@dtdang dtdang Nov 14, 2024

Choose a reason for hiding this comment

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

I've tried checking for an address without a try...except but even using convert will need one. The first method will check if it an address by association if the Contract(token) gives a value error but the new push checks using convert and will give a ConversionError. Both do the same thing but the second is more descriptive.

silverback/_cli.py Outdated Show resolved Hide resolved
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.

--token flag on cluster pay command doesn't work
2 participants