Skip to content

Commit 05f6976

Browse files
committed
fix: check that type of qty passed to make_trade is int (improved error)
1 parent 0b42700 commit 05f6976

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

uniswap/uniswap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ def make_trade(
450450
fee_on_transfer: bool = False,
451451
) -> HexBytes:
452452
"""Make a trade by defining the qty of the input token."""
453+
if not isinstance(qty, int):
454+
raise TypeError("swapped quantity must be an integer")
455+
453456
if fee is None:
454457
fee = 3000
455458
if self.version == 3:

0 commit comments

Comments
 (0)