Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuh25 committed Oct 14, 2024
1 parent 9dce6df commit eba59b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tradeexecutor/ethereum/routing_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class OutOfBalance(Exception):
#: How much maximum we can spend on a swap
#:
SWAP_GAS_LIMITS = {
ChainId.arbitrum.value: 200_000,
ChainId.arbitrum.value: 1_000_000,
ChainId.polygon.value: 500_000,
ChainId.ethereum.value: 200_000,
}
Expand Down Expand Up @@ -115,21 +115,23 @@ def __init__(
if tx_builder is not None:
self.tx_builder = tx_builder
self.web3 = self.tx_builder.web3
self.chain_id = self.tx_builder.chain_id
else:
# DummyExecution model does not have a wallet
# and cannot build transactions
self.tx_builder = None
self.hot_wallet = None
self.web3 = web3
self.chain_id = web3.eth.chain_id

# router -> erc-20 mappings
self.approved_routes = defaultdict(set)

# set gas limits
if approve_gas_limit is None:
approve_gas_limit = APPROVE_GAS_LIMITS.get(self.tx_builder.chain_id, DEFAULT_APPROVE_GAS_LIMIT)
self.approve_gas_limit = APPROVE_GAS_LIMITS.get(self.chain_id, DEFAULT_APPROVE_GAS_LIMIT)
if swap_gas_limit is None:
swap_gas_limit = SWAP_GAS_LIMITS.get(self.tx_builder.chain_id, DEFAULT_SWAP_GAS_LIMIT)
self.swap_gas_limit = SWAP_GAS_LIMITS.get(self.chain_id, DEFAULT_SWAP_GAS_LIMIT)

@abstractmethod
def get_uniswap_for_pair():
Expand Down

0 comments on commit eba59b2

Please sign in to comment.