Skip to content

Commit

Permalink
Fixing event getter in unit fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui committed Oct 7, 2024
1 parent 19a7627 commit fabcb3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ def invariant_check(check_data: dict[str, Any]) -> None:
exception_data: dict[str, Any] = {}

# Check long trade
base_amount_returned: FixedPoint = check_data["long_events"]["close"].amount
base_amount_provided: FixedPoint = check_data["long_events"]["open"].amount
base_amount_returned: FixedPoint = check_data["long_events"]["close"].args.amount
base_amount_provided: FixedPoint = check_data["long_events"]["open"].args.amount
if base_amount_returned >= base_amount_provided:
difference_in_wei = abs(base_amount_returned.scaled_value - base_amount_provided.scaled_value)
exception_message.append("LONG: Amount returned on closing was too large.")
Expand All @@ -328,8 +328,8 @@ def invariant_check(check_data: dict[str, Any]) -> None:
failed = True

# Check short trade
base_amount_returned: FixedPoint = check_data["short_events"]["close"].amount
base_amount_provided: FixedPoint = check_data["short_events"]["open"].amount
base_amount_returned: FixedPoint = check_data["short_events"]["close"].args.amount
base_amount_provided: FixedPoint = check_data["short_events"]["open"].args.amount
if base_amount_returned >= base_amount_provided:
difference_in_wei = abs(base_amount_returned.scaled_value - base_amount_provided.scaled_value)
exception_message.append("SHORT: Amount returned on closing was too large.")
Expand Down

0 comments on commit fabcb3d

Please sign in to comment.