Skip to content

Commit

Permalink
test: relaxed invariant
Browse files Browse the repository at this point in the history
attempt to make invariant stricter broke stateful testing
  • Loading branch information
AlbertoCentonze committed May 21, 2024
1 parent 7bb59c4 commit 340d947
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/unitary/pool/stateful/stateful_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,10 @@ def virtual_price(self):
assert (self.pool.virtual_price() - 1e18) * 2 >= (
self.pool.xcp_profit() - 1e18
), "virtual price should be at least twice the profit"
# assert (
# abs(log(self.pool.virtual_price() / self.pool.get_virtual_price()))
# < 1e-10
# ), "cached virtual price shouldn't lag behind current virtual price"
assert self.pool.virtual_price() == self.pool.get_virtual_price()
assert (
abs(log(self.pool.virtual_price() / self.pool.get_virtual_price()))
< 1e-10
), "cached virtual price shouldn't lag behind current virtual price"

@invariant()
def up_only_profit(self):
Expand Down

0 comments on commit 340d947

Please sign in to comment.