Skip to content

Commit

Permalink
Pass silent flag through to Erc20Token
Browse files Browse the repository at this point in the history
  • Loading branch information
BowTiedDevil committed Oct 10, 2024
1 parent ca1e35c commit 57c30b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/degenbot/managers/erc20_token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def __init__(
def get_erc20token(
self,
address: str,
*,
silent: bool = False,
# accept any number of keyword arguments, which are
# passed directly to Erc20Token without validation
**kwargs: Any,
Expand All @@ -62,7 +64,7 @@ def get_erc20token(
if address == EtherPlaceholder.address:
token_helper = EtherPlaceholder()
else:
token_helper = Erc20Token(address=address, **kwargs)
token_helper = Erc20Token(address=address, silent=silent, **kwargs)

with self._lock:
self._erc20tokens[address] = token_helper
Expand Down
8 changes: 6 additions & 2 deletions src/degenbot/transaction/uniswap_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,8 +1497,12 @@ def _process_uniswap_v2_transaction() -> None:
init_hash=self.v2_pool_manager._pool_init_hash,
),
tokens=[
token_manager.get_erc20token(token0_address),
token_manager.get_erc20token(token1_address),
token_manager.get_erc20token(
token0_address, silent=self.silent
),
token_manager.get_erc20token(
token1_address, silent=self.silent
),
],
)

Expand Down

0 comments on commit 57c30b4

Please sign in to comment.