Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Commit f7ef9fc

Browse files
authored
fix: typing issues in uniswap.py (#214)
1 parent 06e95ac commit f7ef9fc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎uniswap/uniswap.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
import logging
44
import functools
5-
from typing import List, Any, Optional, Union, Tuple, Dict
5+
from typing import List, Any, Optional, Union, Tuple, Dict, Iterable
66

77
from web3 import Web3
88
from web3.eth import Contract
@@ -1256,7 +1256,7 @@ def get_raw_price(
12561256
token_out = self.get_weth_address()
12571257

12581258
if self.version == 2:
1259-
params = [
1259+
params: Iterable[Union[ChecksumAddress,Optional[int]]] = [
12601260
self.w3.toChecksumAddress(token_in),
12611261
self.w3.toChecksumAddress(token_out),
12621262
]
@@ -1337,7 +1337,7 @@ def estimate_price_impact(
13371337
return 1
13381338

13391339
if price_small == 0:
1340-
# Occures when `token_out` amount in the pool equals 0
1340+
# Occurs when `token_out` amount in the pool equals 0
13411341
return 1
13421342
try:
13431343
cost_amount = self.get_price_input(
@@ -1351,7 +1351,7 @@ def estimate_price_impact(
13511351
cost_amount / (amount_in / (10 ** self.get_token(token_in).decimals))
13521352
) / 10 ** self.get_token(token_out).decimals
13531353

1354-
return (price_small - price_amount) / price_small
1354+
return float((price_small - price_amount) / price_small)
13551355

13561356
# ------ Exchange ------------------------------------------------------------------
13571357
@supports([1, 2])

0 commit comments

Comments
 (0)