Improve legibility
This commit is contained in:
parent
0cc259220d
commit
2f9dbeae08
@ -15,23 +15,15 @@ def find_liquidations_from_traces(
|
|||||||
|
|
||||||
"""Inspect list of classified traces and identify liquidation"""
|
"""Inspect list of classified traces and identify liquidation"""
|
||||||
|
|
||||||
liquidations: List[ClassifiedTrace] = []
|
liquidations: List[Liquidation] = []
|
||||||
seen_transactions: List[str] = []
|
|
||||||
result: List[Liquidation] = []
|
|
||||||
|
|
||||||
for trace in traces:
|
for trace in traces:
|
||||||
|
|
||||||
if isinstance(trace, DecodedCallTrace):
|
if trace.classification == Classification.liquidate and isinstance(
|
||||||
|
trace, DecodedCallTrace
|
||||||
# Check for liquidation and register trace and unique liquidator
|
|
||||||
if (
|
|
||||||
trace.classification == Classification.liquidate
|
|
||||||
and trace.transaction_hash not in seen_transactions
|
|
||||||
):
|
):
|
||||||
|
|
||||||
liquidations.append(trace)
|
liquidations.append(
|
||||||
|
|
||||||
result.append(
|
|
||||||
Liquidation(
|
Liquidation(
|
||||||
liquidated_user=trace.inputs["_user"],
|
liquidated_user=trace.inputs["_user"],
|
||||||
collateral_address=trace.inputs["_collateral"],
|
collateral_address=trace.inputs["_collateral"],
|
||||||
@ -40,4 +32,4 @@ def find_liquidations_from_traces(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
return result
|
return liquidations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user