Compound backfilling/removed network calls (#125)

* Removes `collateral_token_address` from both aave/comp for consistency
This commit is contained in:
Taarush Vemulapalli
2021-12-02 14:19:32 -05:00
committed by GitHub
parent 912239fc2e
commit 1fb65bacc1
8 changed files with 37 additions and 69 deletions

View File

@@ -2,7 +2,6 @@ from mev_inspect.compound_liquidations import get_compound_liquidations
from mev_inspect.schemas.liquidations import Liquidation
from mev_inspect.schemas.traces import Protocol
from mev_inspect.classifiers.trace import TraceClassifier
from mev_inspect.transfers import ETH_TOKEN_ADDRESS
from tests.utils import load_test_block, load_comp_markets, load_cream_markets
comp_markets = load_comp_markets()
@@ -19,7 +18,6 @@ def test_c_ether_liquidations():
Liquidation(
liquidated_user="0xb5535a3681cf8d5431b8acfd779e2f79677ecce9",
liquidator_user="0xe0090ec6895c087a393f0e45f1f85098a6c33bef",
collateral_token_address=ETH_TOKEN_ADDRESS,
debt_token_address="0x39aa39c021dfbae8fac545936693ac917d5e7563",
debt_purchase_amount=268066492249420078,
received_amount=4747650169097,
@@ -32,7 +30,7 @@ def test_c_ether_liquidations():
block = load_test_block(block_number)
trace_classifier = TraceClassifier()
classified_traces = trace_classifier.classify(block.traces)
result = get_compound_liquidations(classified_traces, comp_markets, cream_markets)
result = get_compound_liquidations(classified_traces)
assert result == liquidations
block_number = 13207907
@@ -44,7 +42,6 @@ def test_c_ether_liquidations():
Liquidation(
liquidated_user="0x45df6f00166c3fb77dc16b9e47ff57bc6694e898",
liquidator_user="0xe0090ec6895c087a393f0e45f1f85098a6c33bef",
collateral_token_address=ETH_TOKEN_ADDRESS,
debt_token_address="0x35a18000230da775cac24873d00ff85bccded550",
debt_purchase_amount=414547860568297082,
received_amount=321973320649,
@@ -58,7 +55,7 @@ def test_c_ether_liquidations():
block = load_test_block(block_number)
trace_classifier = TraceClassifier()
classified_traces = trace_classifier.classify(block.traces)
result = get_compound_liquidations(classified_traces, comp_markets, cream_markets)
result = get_compound_liquidations(classified_traces)
assert result == liquidations
block_number = 13298725
@@ -70,7 +67,6 @@ def test_c_ether_liquidations():
Liquidation(
liquidated_user="0xacbcf5d2970eef25f02a27e9d9cd31027b058b9b",
liquidator_user="0xe0090ec6895c087a393f0e45f1f85098a6c33bef",
collateral_token_address=ETH_TOKEN_ADDRESS,
debt_token_address="0x35a18000230da775cac24873d00ff85bccded550",
debt_purchase_amount=1106497772527562662,
received_amount=910895850496,
@@ -83,7 +79,7 @@ def test_c_ether_liquidations():
block = load_test_block(block_number)
trace_classifier = TraceClassifier()
classified_traces = trace_classifier.classify(block.traces)
result = get_compound_liquidations(classified_traces, comp_markets, cream_markets)
result = get_compound_liquidations(classified_traces)
assert result == liquidations
@@ -97,7 +93,6 @@ def test_c_token_liquidation():
Liquidation(
liquidated_user="0xacdd5528c1c92b57045041b5278efa06cdade4d8",
liquidator_user="0xe0090ec6895c087a393f0e45f1f85098a6c33bef",
collateral_token_address="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
debt_token_address="0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4",
debt_purchase_amount=1207055531,
received_amount=21459623305,
@@ -110,7 +105,7 @@ def test_c_token_liquidation():
block = load_test_block(block_number)
trace_classifier = TraceClassifier()
classified_traces = trace_classifier.classify(block.traces)
result = get_compound_liquidations(classified_traces, comp_markets, cream_markets)
result = get_compound_liquidations(classified_traces)
assert result == liquidations
@@ -124,7 +119,6 @@ def test_cream_token_liquidation():
Liquidation(
liquidated_user="0x46bf9479dc569bc796b7050344845f6564d45fba",
liquidator_user="0xa2863cad9c318669660eb4eca8b3154b90fb4357",
collateral_token_address="0x514910771af9ca656af840dff83e8264ecf986ca",
debt_token_address="0x44fbebd2f576670a6c33f6fc0b00aa8c5753b322",
debt_purchase_amount=14857434973806369550,
received_amount=1547215810826,
@@ -137,5 +131,5 @@ def test_cream_token_liquidation():
block = load_test_block(block_number)
trace_classifier = TraceClassifier()
classified_traces = trace_classifier.classify(block.traces)
result = get_compound_liquidations(classified_traces, comp_markets, cream_markets)
result = get_compound_liquidations(classified_traces)
assert result == liquidations