Payback function output order
This commit is contained in:
parent
4c203da24e
commit
4c889f813c
@ -53,9 +53,9 @@ def get_aave_liquidations(
|
||||
)
|
||||
|
||||
(
|
||||
received_amount,
|
||||
received_token_address,
|
||||
) = _get_payback_amount_and_token_address(trace, child_traces, liquidator)
|
||||
received_amount,
|
||||
) = _get_payback_token_and_amount(trace, child_traces, liquidator)
|
||||
|
||||
liquidations.append(
|
||||
Liquidation(
|
||||
@ -76,9 +76,9 @@ def get_aave_liquidations(
|
||||
return liquidations
|
||||
|
||||
|
||||
def _get_payback_amount_and_token_address(
|
||||
def _get_payback_token_and_amount(
|
||||
liquidation: DecodedCallTrace, child_traces: List[ClassifiedTrace], liquidator: str
|
||||
) -> Tuple[int, str]:
|
||||
) -> Tuple[str, int]:
|
||||
|
||||
"""Look for and return liquidator payback from liquidation"""
|
||||
for child in child_traces:
|
||||
@ -91,6 +91,6 @@ def _get_payback_amount_and_token_address(
|
||||
and child_transfer.to_address == liquidator
|
||||
and child.from_address in AAVE_CONTRACT_ADDRESSES
|
||||
):
|
||||
return child_transfer.amount, child_transfer.token_address
|
||||
return child_transfer.token_address, child_transfer.amount
|
||||
|
||||
return 0, liquidation.inputs["_collateral"]
|
||||
return liquidation.inputs["_collateral"], 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user