From fea699f7107789946a6b7fe113bbb99d64f1d0e2 Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 26 Mar 2026 19:37:48 +0000 Subject: [PATCH 1/2] fix(ci): replace rate-limited Infura with public RPC and fix type errors - Switch PROVIDER_MAINNET fallback from Infura to ethereum.publicnode.com (Infura public key was hitting "Too Many Requests" rate limits) - Add dev/v4 and dev/v4-fin branches to CI triggers - Fix mypy errors: use str() for bytes fallback in token name/symbol decode, add type: ignore for web3 get_logs attribute Co-authored-by: Bob --- .github/workflows/test.yml | 7 +++---- uniswap/uniswap4.py | 4 ++-- uniswap/util.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c45b4bd..bac54f20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,12 @@ name: Test on: push: - branches: [ master ] + branches: [ master, dev/v4, dev/v4-fin ] pull_request: - branches: [ master ] + branches: [ master, dev/v4, dev/v4-fin ] env: - # Public key for PRs, plz don't abuse - PROVIDER_MAINNET: ${{ secrets.MAINNET_PROVIDER || 'https://mainnet.infura.io/v3/42ffb4f2549c4a5fa3b5d6db70f6fad1' }} + PROVIDER_MAINNET: ${{ secrets.MAINNET_PROVIDER || 'https://ethereum.publicnode.com' }} PROVIDER_ARBITRUM: 'https://rpc.ankr.com/arbitrum' PROVIDER_XDAI: 'https://rpc.ankr.com/gnosis' diff --git a/uniswap/uniswap4.py b/uniswap/uniswap4.py index f350708c..98e2a824 100644 --- a/uniswap/uniswap4.py +++ b/uniswap/uniswap4.py @@ -1433,12 +1433,12 @@ def get_token(self, address: AddressLike, abi_name: str = "erc20") -> ERC20Token try: name = _name.decode() except Exception: - name = _name + name = str(_name) try: symbol = _symbol.decode() except Exception as e: logger.warning(f"Error occurred while decoding symbol for {address}: {e}") - symbol = _symbol + symbol = str(_symbol) return ERC20Token(symbol, address, name, decimals) # Estimates slippage for the given amount of token0 diff --git a/uniswap/util.py b/uniswap/util.py index 143147f5..d5512d52 100644 --- a/uniswap/util.py +++ b/uniswap/util.py @@ -261,7 +261,7 @@ def fetch_poolkey_data( # "fromBlock": str(start_block), # "toBlock": str(end_block), # } - logs = pool_manager_contract.events.Initialize().get_logs( + logs = pool_manager_contract.events.Initialize().get_logs( # type: ignore[attr-defined] fromBlock=start_block, toBlock=end_block ) except Exception as e: From 06fa4369bb31f8c32c4fc2509f98675bd3498b81 Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 26 Mar 2026 20:31:14 +0000 Subject: [PATCH 2/2] fix(ci): switch Arbitrum RPC and resolve mypy warning --- .github/workflows/test.yml | 2 +- uniswap/uniswap4.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bac54f20..33b8585d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: PROVIDER_MAINNET: ${{ secrets.MAINNET_PROVIDER || 'https://ethereum.publicnode.com' }} - PROVIDER_ARBITRUM: 'https://rpc.ankr.com/arbitrum' + PROVIDER_ARBITRUM: 'https://arb1.arbitrum.io/rpc' PROVIDER_XDAI: 'https://rpc.ankr.com/gnosis' jobs: diff --git a/uniswap/uniswap4.py b/uniswap/uniswap4.py index 98e2a824..3fb3ae4e 100644 --- a/uniswap/uniswap4.py +++ b/uniswap/uniswap4.py @@ -1437,7 +1437,11 @@ def get_token(self, address: AddressLike, abi_name: str = "erc20") -> ERC20Token try: symbol = _symbol.decode() except Exception as e: - logger.warning(f"Error occurred while decoding symbol for {address}: {e}") + logger.warning( + "Error occurred while decoding symbol for %s: %s", + _addr_to_str(address), + e, + ) symbol = str(_symbol) return ERC20Token(symbol, address, name, decimals)