Skip to content

Commit

Permalink
Type hinting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BowTiedDevil committed Mar 10, 2024
1 parent 154eacc commit c8ef2f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/degenbot/actions/conditional_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
class ConditionalAction:
def __init__(
self,
condition: Callable[[Any], bool],
actions: Sequence[Callable[[Any], Any]],
condition: Callable[[], bool],
actions: Sequence[Callable[[], Any]],
):
self.condition = condition
self.actions = actions

def check(self):
def check(self) -> None:
if self.condition() is True:
for action in self.actions:
action()
4 changes: 2 additions & 2 deletions src/degenbot/uniswap/v2_liquidity_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def external_update(
print_ratios=not silent,
)

def get_absolute_price(self, token) -> Fraction:
def get_absolute_price(self, token: Erc20Token) -> Fraction:
"""
Get the absolute price for the given token, expressed as a ratio of the two pool tokens.
"""
Expand All @@ -687,7 +687,7 @@ def get_absolute_price(self, token) -> Fraction:
else:
raise ValueError(f"Unknown token {token}")

def get_nominal_price(self, token) -> Fraction:
def get_nominal_price(self, token: Erc20Token) -> Fraction:
"""
Get the nominal price for the given token, expressed as a ratio of the two pool tokens,
corrected for decimal place values.
Expand Down
4 changes: 2 additions & 2 deletions src/degenbot/uniswap/v3_liquidity_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ def simulate_swap(
),
)

def get_absolute_price(self, token) -> Fraction:
def get_absolute_price(self, token: Erc20Token) -> Fraction:
"""
Get the absolute price for the given token, expressed as a ratio of the two pool tokens.
"""
Expand All @@ -1164,7 +1164,7 @@ def get_absolute_price(self, token) -> Fraction:
else:
raise ValueError(f"Unknown token {token}")

def get_nominal_price(self, token) -> Fraction:
def get_nominal_price(self, token: Erc20Token) -> Fraction:
"""
Get the nominal price for the given token, expressed as a ratio of the two pool tokens,
corrected for decimal place values.
Expand Down

0 comments on commit c8ef2f8

Please sign in to comment.