Skip to content

Commit

Permalink
test: gracefully handling imabalanced deposit fail
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed May 29, 2024
1 parent 951eabc commit 5d02dbf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/unitary/pool/stateful/test_stateful.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import boa
from boa import BoaError
from hypothesis import assume, event, note
from hypothesis.stateful import precondition, rule
from hypothesis.strategies import data, floats, integers, sampled_from
Expand Down Expand Up @@ -187,7 +188,11 @@ def add_liquidity_imbalanced(self, data, user: str):
imbalanced_amounts = self.correct_all_decimals(imbalanced_amounts)

# we add the liquidity
self.add_liquidity(imbalanced_amounts, user)
try:
self.add_liquidity(imbalanced_amounts, user)
event("imbalanced add_liquidity successful")
except BoaError:
event("imbalanced add_liquidity failed")

# since this is an imbalanced deposit we report the new equilibrium
self.report_equilibrium()
Expand Down

0 comments on commit 5d02dbf

Please sign in to comment.