Skip to content

Commit

Permalink
fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed Feb 1, 2024
1 parent ac83875 commit ded7b6a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/monitoring_tests/cost_coverage_zero_signed_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from src.monitoring_tests.base_test import BaseTest
from src.apis.web3api import Web3API
from src.apis.orderbookapi import OrderbookAPI
from src.constants import DAY_BLOCK_INTERVAL, CAP_PARAMETER


class CostCoverageForZeroSignedFee(BaseTest):
Expand Down Expand Up @@ -37,17 +36,12 @@ def cost_coverage(self, competition_data: dict[str, Any], gas_cost: float) -> bo

solution = competition_data["solutions"][-1]
tx_hash = competition_data["transactionHash"]
print("Processing " + tx_hash)
solver = solution["solver"]
ucp = solution["clearingPrices"]
orders = solution["orders"]
native_prices = competition_data["auction"]["prices"]
total_fee = 0
for x in orders:
id = x["id"]
raw_sell_amount = int(x["sellAmount"])
raw_buy_amount = int(x["buyAmount"])
order_data = self.orderbook_api.get_order_data(id)
for order in orders:
order_data = self.orderbook_api.get_order_data(order["id"])
if order_data is None:
return False
sell_token = order_data["sellToken"]
Expand All @@ -63,8 +57,10 @@ def cost_coverage(self, competition_data: dict[str, Any], gas_cost: float) -> bo

fee = (
(
raw_sell_amount
- raw_buy_amount * int(ucp[buy_token]) / int(ucp[sell_token])
int(order["sellAmount"])
- int(order["buyAmount"])
* int(ucp[buy_token])
/ int(ucp[sell_token])
)
* int(native_prices[sell_token])
/ 10**36
Expand Down

0 comments on commit ded7b6a

Please sign in to comment.