fix error nesting

This commit is contained in:
Taarush Vemulapalli 2021-12-22 10:40:48 -05:00
parent 55e1736a51
commit 2d0c7e2a16

View File

@ -52,14 +52,13 @@ def _get_arbitrages_from_swaps(swaps: List[Swap]) -> List[Arbitrage]:
] ]
routes = _get_all_routes(start, end, potential_intermediate_swaps) routes = _get_all_routes(start, end, potential_intermediate_swaps)
error = None
for route in routes: for route in routes:
start_amount = route[0].token_in_amount start_amount = route[0].token_in_amount
end_amount = route[-1].token_out_amount end_amount = route[-1].token_out_amount
profit_amount = end_amount - start_amount profit_amount = end_amount - start_amount
for swap in route: for swap in route:
error = None
if swap.error is not None: if swap.error is not None:
error = swap.error error = swap.error