Skip to content

Commit

Permalink
Don't try to automatise remaining token list in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Dec 27, 2024
1 parent 516f88f commit 293f789
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions eth_defi/velvet/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def prepare_swap_with_enso(
swap_all=False,
from_: HexAddress | str | None = None,
retries=5,
manage_token_list=True,
) -> dict:
"""Prepare a swap transaction using Enso intent engine and Vevlet API.
Expand All @@ -208,8 +209,10 @@ def prepare_swap_with_enso(
Used with Anvil and unlocked accounts.
"""

if swap_all:
remaining_tokens.remove(token_in)
if manage_token_list:
if swap_all:
assert token_in in remaining_tokens, f"Enso swap full amount: Tried to remove {token_in}, not in the list {remaining_tokens}"
remaining_tokens.remove(token_in)

tx_data = swap_with_velvet_and_enso(
rebalance_address=self.info["rebalancing"],
Expand Down

0 comments on commit 293f789

Please sign in to comment.