Merged
Conversation
gkoch78
reviewed
Feb 20, 2025
gkoch78
reviewed
Feb 20, 2025
gkoch78
reviewed
Feb 20, 2025
| Args: | ||
| token_out (TokenInfo): The token to be bought (going out from the pool) | ||
| token_in (TokenInfo): The token to be sold (going into the pool) | ||
| amount_in (Decimal): The amount of the token to be sold |
Contributor
There was a problem hiding this comment.
Suggested change
| amount_in (Decimal): The amount of the token to be sold | |
| amount_in (TokenAmount): The amount of the token to be sold |
gkoch78
reviewed
Feb 20, 2025
| token_in = quote.token_in | ||
| token_out = quote.token_out | ||
| wei_in = token_in.convert_to_wei(quote.amount_in) | ||
| wei_in = token_in.to_amount(quote.amount_in) |
Contributor
There was a problem hiding this comment.
names could imply we are having a unit issue: storing token amount in Wei/base unit
gkoch78
reviewed
Feb 20, 2025
| token_out = quote.token_out | ||
| wei_in = token_in.convert_to_wei(quote.amount_in) | ||
| approval_receipt = self._approve_token_spending(token_in, wei_in) | ||
| wei_in = token_in.to_amount(quote.amount_in) |
Contributor
There was a problem hiding this comment.
rename wei_in into amount_in
gkoch78
reviewed
Feb 20, 2025
| def test_has_token(portfolio_balance: PortfolioBalance, eth_token: TokenInfo, usdc_token: TokenInfo) -> None: | ||
| assert portfolio_balance.has_token(eth_token.address) is True | ||
| assert portfolio_balance.has_token(usdc_token.address) is True | ||
| assert portfolio_balance.has_token("0x0000000000000000000000000000000000000000") is False |
Contributor
There was a problem hiding this comment.
using ZeroAddress from EVMClient instead
Co-authored-by: Guillaume Koch <39165367+gkoch78@users.noreply.github.com>
Co-authored-by: Guillaume Koch <39165367+gkoch78@users.noreply.github.com>
gkoch78
approved these changes
Feb 21, 2025
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.
No description provided.