From fabcb3d62cac78ef5908211705066cbb2354da9e Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Mon, 7 Oct 2024 13:55:05 -0700 Subject: [PATCH] Fixing event getter in unit fuzz --- src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py b/src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py index 5e4d4d6cac..cbf41a5e7f 100644 --- a/src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py +++ b/src/agent0/hyperfuzz/unit_fuzz/fuzz_profit_check.py @@ -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.") @@ -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.")