Update classifiers and tests
This commit is contained in:
parent
d0ab255a5c
commit
9883680dfa
@ -1,9 +1,10 @@
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
from mev_inspect.schemas.classifiers import (
|
||||
Classifier,
|
||||
ClassifiedTrace,
|
||||
ClassifierSpec,
|
||||
DecodedCallTrace,
|
||||
LiquidationClassifier,
|
||||
TransferClassifier,
|
||||
)
|
||||
from mev_inspect.schemas.liquidations import Liquidation
|
||||
@ -11,21 +12,24 @@ from mev_inspect.schemas.traces import Protocol
|
||||
from mev_inspect.schemas.transfers import Transfer
|
||||
|
||||
|
||||
class AaveLiquidationClassifier(Classifier):
|
||||
class AaveLiquidationClassifier(LiquidationClassifier):
|
||||
@staticmethod
|
||||
def parse_liquidation(
|
||||
self, liquidation_trace: DecodedCallTrace, child_transfers: List[Transfer]
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
child_traces: List[ClassifiedTrace],
|
||||
) -> Optional[Liquidation]:
|
||||
|
||||
liquidator = liquidation_trace.from_address
|
||||
|
||||
(debt_token_address, debt_purchase_amount) = self._get_debt_data(
|
||||
(debt_token_address, debt_purchase_amount) = _get_debt_data(
|
||||
liquidation_trace, child_transfers, liquidator
|
||||
)
|
||||
|
||||
if debt_purchase_amount == 0:
|
||||
return None
|
||||
|
||||
(received_token_address, received_amount) = self._get_received_data(
|
||||
(received_token_address, received_amount) = _get_received_data(
|
||||
liquidation_trace, child_transfers, liquidator
|
||||
)
|
||||
|
||||
@ -46,35 +50,6 @@ class AaveLiquidationClassifier(Classifier):
|
||||
error=liquidation_trace.error,
|
||||
)
|
||||
|
||||
def _get_received_data(
|
||||
self,
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
liquidator: str,
|
||||
) -> Tuple[str, int]:
|
||||
|
||||
"""Look for and return liquidator payback from liquidation"""
|
||||
for transfer in child_transfers:
|
||||
|
||||
if transfer.to_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidation_trace.inputs["_collateral"], 0
|
||||
|
||||
def _get_debt_data(
|
||||
self,
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
liquidator: str,
|
||||
) -> Tuple[str, int]:
|
||||
"""Get transfer from liquidator to AAVE"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
if transfer.from_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidation_trace.inputs["_reserve"], 0
|
||||
|
||||
|
||||
class AaveTransferClassifier(TransferClassifier):
|
||||
@staticmethod
|
||||
@ -107,3 +82,32 @@ ATOKENS_SPEC = ClassifierSpec(
|
||||
)
|
||||
|
||||
AAVE_CLASSIFIER_SPECS: List[ClassifierSpec] = [AAVE_SPEC, ATOKENS_SPEC]
|
||||
|
||||
|
||||
def _get_received_data(
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
liquidator: str,
|
||||
) -> Tuple[str, int]:
|
||||
|
||||
"""Look for and return liquidator payback from liquidation"""
|
||||
for transfer in child_transfers:
|
||||
|
||||
if transfer.to_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidation_trace.inputs["_collateral"], 0
|
||||
|
||||
|
||||
def _get_debt_data(
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
liquidator: str,
|
||||
) -> Tuple[str, int]:
|
||||
"""Get transfer from liquidator to AAVE"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
if transfer.from_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidation_trace.inputs["_reserve"], 0
|
||||
|
@ -3,9 +3,9 @@ from typing import List, Optional, Tuple
|
||||
from mev_inspect.schemas.classifiers import (
|
||||
Classification,
|
||||
ClassifiedTrace,
|
||||
Classifier,
|
||||
ClassifierSpec,
|
||||
DecodedCallTrace,
|
||||
LiquidationClassifier,
|
||||
SeizeClassifier,
|
||||
)
|
||||
from mev_inspect.schemas.liquidations import Liquidation
|
||||
@ -13,28 +13,28 @@ from mev_inspect.schemas.traces import Protocol
|
||||
from mev_inspect.schemas.transfers import Transfer
|
||||
|
||||
|
||||
class CompoundLiquidationClassifier(Classifier):
|
||||
class CompoundLiquidationClassifier(LiquidationClassifier):
|
||||
@staticmethod
|
||||
def parse_liquidation(
|
||||
self,
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_traces: List[ClassifiedTrace],
|
||||
child_transfers: List[Transfer],
|
||||
child_traces: List[ClassifiedTrace],
|
||||
) -> Optional[Liquidation]:
|
||||
|
||||
seize_trace = self._get_seize_call(child_traces)
|
||||
seize_trace = _get_seize_call(child_traces)
|
||||
|
||||
if seize_trace is not None and seize_trace.inputs is not None:
|
||||
|
||||
liquidator = seize_trace.inputs["liquidator"]
|
||||
|
||||
(debt_token_address, debt_purchase_amount) = self._get_debt_data(
|
||||
(debt_token_address, debt_purchase_amount) = _get_debt_data(
|
||||
liquidator, child_transfers
|
||||
)
|
||||
|
||||
if debt_purchase_amount == 0:
|
||||
return None
|
||||
|
||||
(received_token_address, received_amount) = self._get_received_data(
|
||||
(received_token_address, received_amount) = _get_received_data(
|
||||
liquidator, child_transfers
|
||||
)
|
||||
|
||||
@ -56,38 +56,6 @@ class CompoundLiquidationClassifier(Classifier):
|
||||
)
|
||||
return None
|
||||
|
||||
def _get_seize_call(
|
||||
self, traces: List[ClassifiedTrace]
|
||||
) -> Optional[ClassifiedTrace]:
|
||||
"""Find the call to `seize` in the child traces (successful liquidation)"""
|
||||
for trace in traces:
|
||||
if trace.classification == Classification.seize:
|
||||
return trace
|
||||
return None
|
||||
|
||||
def _get_received_data(
|
||||
self, liquidator: str, child_transfers: List[Transfer]
|
||||
) -> Tuple[str, int]:
|
||||
"""Look for and return payment for liquidation"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
if transfer.to_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidator, 0
|
||||
|
||||
def _get_debt_data(
|
||||
self, liquidator: str, child_transfers: List[Transfer]
|
||||
) -> Tuple[str, int]:
|
||||
"""Get transfer from liquidator to compound"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
|
||||
if transfer.from_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidator, 0
|
||||
|
||||
|
||||
COMPOUND_V2_CETH_SPEC = ClassifierSpec(
|
||||
abi_name="CEther",
|
||||
@ -245,3 +213,33 @@ COMPOUND_CLASSIFIER_SPECS: List[ClassifierSpec] = [
|
||||
CREAM_CETH_SPEC,
|
||||
CREAM_CTOKEN_SPEC,
|
||||
]
|
||||
|
||||
|
||||
def _get_seize_call(traces: List[ClassifiedTrace]) -> Optional[ClassifiedTrace]:
|
||||
"""Find the call to `seize` in the child traces (successful liquidation)"""
|
||||
for trace in traces:
|
||||
if trace.classification == Classification.seize:
|
||||
return trace
|
||||
return None
|
||||
|
||||
|
||||
def _get_received_data(
|
||||
liquidator: str, child_transfers: List[Transfer]
|
||||
) -> Tuple[str, int]:
|
||||
"""Look for and return payment for liquidation"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
if transfer.to_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidator, 0
|
||||
|
||||
|
||||
def _get_debt_data(liquidator: str, child_transfers: List[Transfer]) -> Tuple[str, int]:
|
||||
"""Get transfer from liquidator to compound"""
|
||||
|
||||
for transfer in child_transfers:
|
||||
if transfer.from_address == liquidator:
|
||||
return transfer.token_address, transfer.amount
|
||||
|
||||
return liquidator, 0
|
||||
|
@ -51,9 +51,9 @@ class LiquidationClassifier(Classifier):
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def parse_liquidation(
|
||||
trace: ClassifiedTrace,
|
||||
liquidation_trace: DecodedCallTrace,
|
||||
child_transfers: List[Transfer],
|
||||
child_traces: List[ClassifiedTrace] = [],
|
||||
child_traces: List[ClassifiedTrace],
|
||||
) -> Optional[Liquidation]:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
676
tests/blocks/Terminal Saved Output
Normal file
676
tests/blocks/Terminal Saved Output
Normal file
@ -0,0 +1,676 @@
|
||||
(base) gheise@mac mev-inspect-py % git branch
|
||||
0x-bug
|
||||
0x-v2
|
||||
aave-liquidations-v3
|
||||
aave-zero-bug
|
||||
add-liquidation-addresses
|
||||
add-liquidation-timestamp
|
||||
classifier-helpers
|
||||
coingecko-api
|
||||
compound-tokens
|
||||
compound-v2
|
||||
* compound-v3
|
||||
double-arb-bug
|
||||
geth
|
||||
main
|
||||
migrations-fix
|
||||
swapmodel
|
||||
token-decimals
|
||||
(base) gheise@mac mev-inspect-py % git checkout main
|
||||
M mev_inspect/classifiers/specs/compound.py
|
||||
Switched to branch 'main'
|
||||
Your branch is up to date with 'origin/main'.
|
||||
(base) gheise@mac mev-inspect-py % git branch -D compound-v3
|
||||
Deleted branch compound-v3 (was 9604e01).
|
||||
(base) gheise@mac mev-inspect-py % git checkout -b liquidation-classifiers
|
||||
Switched to a new branch 'liquidation-classifiers'
|
||||
(base) gheise@mac mev-inspect-py % git status
|
||||
On branch liquidation-classifiers
|
||||
Changes not staged for commit:
|
||||
(use "git add <file>..." to update what will be committed)
|
||||
(use "git restore <file>..." to discard changes in working directory)
|
||||
modified: mev_inspect/classifiers/specs/aave.py
|
||||
modified: mev_inspect/classifiers/specs/compound.py
|
||||
modified: mev_inspect/inspect_block.py
|
||||
modified: mev_inspect/liquidations.py
|
||||
modified: mev_inspect/schemas/classifiers.py
|
||||
|
||||
Untracked files:
|
||||
(use "git add <file>..." to include in what will be committed)
|
||||
.hypothesis/
|
||||
=
|
||||
|
||||
no changes added to commit (use "git add" and/or "git commit -a")
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:3: in <module>
|
||||
from mev_inspect.schemas.classifiers import Classifier, ClassifierSpec
|
||||
mev_inspect/schemas/classifiers.py:45: in <module>
|
||||
class LiquidationClassifier(Classifier):
|
||||
mev_inspect/schemas/classifiers.py:55: in LiquidationClassifier
|
||||
) -> Optional[Liquidation]:
|
||||
E NameError: name 'Liquidation' is not defined
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/aave.py", line 17
|
||||
E """Inspect list of classified traces and identify liquidation"""
|
||||
E ^
|
||||
E IndentationError: expected an indented block
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/aave.py", line 47
|
||||
E )
|
||||
E ^
|
||||
E SyntaxError: unmatched ')'
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/aave.py", line 26
|
||||
E continue
|
||||
E ^
|
||||
E SyntaxError: 'continue' not properly in loop
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/aave.py:10: in <module>
|
||||
class AaveLiquidationClassifier(LiquidationClassifier):
|
||||
mev_inspect/classifiers/specs/aave.py:14: in AaveLiquidationClassifier
|
||||
child_traces: List[Trace]
|
||||
E NameError: name 'List' is not defined
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/aave.py:11: in <module>
|
||||
class AaveLiquidationClassifier(LiquidationClassifier):
|
||||
mev_inspect/classifiers/specs/aave.py:15: in AaveLiquidationClassifier
|
||||
child_traces: List[Trace]
|
||||
E NameError: name 'Trace' is not defined
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/aave.py:12: in <module>
|
||||
class AaveLiquidationClassifier(LiquidationClassifier):
|
||||
mev_inspect/classifiers/specs/aave.py:17: in AaveLiquidationClassifier
|
||||
) -> Optional[Liquidation]:
|
||||
E NameError: name 'Liquidation' is not defined
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:6: in <module>
|
||||
from .aave import AAVE_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/aave.py:13: in <module>
|
||||
class AaveLiquidationClassifier(LiquidationClassifier):
|
||||
mev_inspect/classifiers/specs/aave.py:55: in AaveLiquidationClassifier
|
||||
) -> Tuple[str, int]:
|
||||
E NameError: name 'Tuple' is not defined
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:9: in <module>
|
||||
from .compound import COMPOUND_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/compound.py", line 5
|
||||
E LiquidationClassifier,
|
||||
E ^
|
||||
E SyntaxError: invalid syntax
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:9: in <module>
|
||||
from .compound import COMPOUND_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/compound.py", line 50
|
||||
E )
|
||||
E IndentationError: unexpected indent
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % ./mev test
|
||||
Running tests
|
||||
Skipping virtualenv creation, as specified in config file.
|
||||
ImportError while loading conftest '/app/tests/conftest.py'.
|
||||
tests/conftest.py:6: in <module>
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
mev_inspect/classifiers/trace.py:15: in <module>
|
||||
from .specs import ALL_CLASSIFIER_SPECS
|
||||
mev_inspect/classifiers/specs/__init__.py:9: in <module>
|
||||
from .compound import COMPOUND_CLASSIFIER_SPECS
|
||||
E File "/app/mev_inspect/classifiers/specs/compound.py", line 52
|
||||
E """Find the call to `seize` in the child traces (successful liquidation)"""
|
||||
E ^
|
||||
E IndentationError: expected an indented block
|
||||
command terminated with exit code 4
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
- files were modified by this hook
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 28:50: if not isinstance(trace, DecodedCallTrace)
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py: Cannot parse: 52:4: """Find the call to `seize` in the child traces (successful liquidation)"""
|
||||
reformatted /Users/gheise/mev-inspect-py/mev_inspect/schemas/classifiers.py
|
||||
reformatted /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/aave.py
|
||||
Oh no! 💥 💔 💥
|
||||
2 files reformatted, 1 file left unchanged, 2 files failed to reformat.
|
||||
|
||||
isort....................................................................Failed
|
||||
- hook id: isort
|
||||
- files were modified by this hook
|
||||
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./mev_inspect/schemas/classifiers.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/mev_inspect/schemas/classifiers.py.isorted' -> '/Users/gheise/mev-inspect-py/mev_inspect/schemas/classifiers.py'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./mev_inspect/crud/prices.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/mev_inspect/crud/prices.py.isorted'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./mev_inspect/classifiers/specs/aave.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/aave.py.isorted' -> '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/aave.py'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
Skipped 2 files
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
Fixing /Users/gheise/mev-inspect-py/mev_inspect/schemas/classifiers.py
|
||||
Fixing /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/aave.py
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
Skipped 2 files
|
||||
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 2
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
-----------------------------------
|
||||
Your code has been rated at 8.32/10
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/classifiers/specs/compound.py:52: error: expected an indented block
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 28:50: if not isinstance(trace, DecodedCallTrace)
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py: Cannot parse: 52:4: """Find the call to `seize` in the child traces (successful liquidation)"""
|
||||
Oh no! 💥 💔 💥
|
||||
3 files left unchanged, 2 files failed to reformat.
|
||||
|
||||
isort....................................................................Passed
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 2
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 8.32/10 (previous run: 8.32/10, +0.00)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/classifiers/specs/compound.py:52: error: expected an indented block
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py: Cannot parse: 77:38: seize_trace: DecodedCallTrace,,
|
||||
Oh no! 💥 💔 💥
|
||||
3 files left unchanged, 2 files failed to reformat.
|
||||
|
||||
isort....................................................................Passed
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 2
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 8.32/10 (previous run: 8.32/10, +0.00)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/classifiers/specs/compound.py:77: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
- files were modified by this hook
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
reformatted /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py
|
||||
Oh no! 💥 💔 💥
|
||||
1 file reformatted, 3 files left unchanged, 1 file failed to reformat.
|
||||
|
||||
isort....................................................................Failed
|
||||
- hook id: isort
|
||||
- files were modified by this hook
|
||||
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./mev_inspect/classifiers/specs/compound.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py.isorted' -> '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
Skipped 2 files
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
Fixing /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py
|
||||
Skipped 2 files
|
||||
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 6
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.compound
|
||||
mev_inspect/classifiers/specs/compound.py:16:27: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:19:22: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:25:57: E0602: Undefined variable '_get_debt_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:32:56: E0602: Undefined variable '_get_received_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:56:39: E0602: Undefined variable 'Classification' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:61:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:62:27: E0602: Undefined variable 'DecodeCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:62:8: W0613: Unused argument 'liquidation_trace' (unused-argument)
|
||||
mev_inspect/classifiers/specs/compound.py:78:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:79:27: E0602: Undefined variable 'DecodeCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:87:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:87:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:79:8: W0613: Unused argument 'liquidation_trace' (unused-argument)
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 5.11/10 (previous run: 8.32/10, -3.22)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/liquidations.py:62: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
Oh no! 💥 💔 💥
|
||||
4 files left unchanged, 1 file failed to reformat.
|
||||
|
||||
isort....................................................................Passed
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 6
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.compound
|
||||
mev_inspect/classifiers/specs/compound.py:16:27: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:19:22: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:25:57: E0602: Undefined variable '_get_debt_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:32:56: E0602: Undefined variable '_get_received_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:56:39: E0602: Undefined variable 'Classification' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:61:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:62:27: E0602: Undefined variable 'DecodeCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:62:8: W0613: Unused argument 'liquidation_trace' (unused-argument)
|
||||
mev_inspect/classifiers/specs/compound.py:78:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:79:27: E0602: Undefined variable 'DecodeCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:87:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:87:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:79:8: W0613: Unused argument 'liquidation_trace' (unused-argument)
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 5.11/10 (previous run: 5.11/10, +0.00)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/liquidations.py:62: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
Oh no! 💥 💔 💥
|
||||
4 files left unchanged, 1 file failed to reformat.
|
||||
|
||||
isort....................................................................Failed
|
||||
- hook id: isort
|
||||
- files were modified by this hook
|
||||
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
Fixing /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./alembic/versions/083978d6e455_create_miner_payments_table.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/alembic/versions/083978d6e455_create_miner_payments_table.py.isorted'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
Skipped 2 files
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/api.py:475: UserWarning: /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py unable to sort due to existing syntax errors
|
||||
warn(f"{actual_file_path} unable to sort due to existing syntax errors")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./mev_inspect/classifiers/specs/compound.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py.isorted' -> '/Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
/Users/gheise/Library/Caches/pypoetry/virtualenvs/mev-inspect-uEL1ukhj-py3.9/lib/python3.9/site-packages/isort/main.py:103: UserWarning: Unable to parse file ./alembic/versions/9b8ae51c5d56_add_swap_arbitrage_join_table.py due to [Errno 2] No such file or directory: '/Users/gheise/mev-inspect-py/alembic/versions/9b8ae51c5d56_add_swap_arbitrage_join_table.py.isorted'
|
||||
warn(f"Unable to parse file {file_name} due to {error}")
|
||||
Skipped 2 files
|
||||
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 6
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.compound
|
||||
mev_inspect/classifiers/specs/compound.py:3:0: E0611: No name 'DecodeCallTrace' in module 'mev_inspect.schemas.classifiers' (no-name-in-module)
|
||||
mev_inspect/classifiers/specs/compound.py:17:27: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:20:22: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:26:57: E0602: Undefined variable '_get_debt_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:33:56: E0602: Undefined variable '_get_received_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:57:39: E0602: Undefined variable 'Classification' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:62:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:70:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:78:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:86:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:86:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:3:0: W0611: Unused DecodeCallTrace imported from mev_inspect.schemas.classifiers (unused-import)
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 5.43/10 (previous run: 5.11/10, +0.32)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/liquidations.py:62: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
- files were modified by this hook
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
reformatted /Users/gheise/mev-inspect-py/mev_inspect/classifiers/specs/compound.py
|
||||
Oh no! 💥 💔 💥
|
||||
1 file reformatted, 3 files left unchanged, 1 file failed to reformat.
|
||||
|
||||
isort....................................................................Passed
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 6
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.compound
|
||||
mev_inspect/classifiers/specs/compound.py:3:0: E0611: No name 'DecodeCallTrace' in module 'mev_inspect.schemas.classifiers' (no-name-in-module)
|
||||
mev_inspect/classifiers/specs/compound.py:17:33: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:26:57: E0602: Undefined variable '_get_debt_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:33:56: E0602: Undefined variable '_get_received_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:59:39: E0602: Undefined variable 'Classification' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:65:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:73:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:73:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:65:8: W0613: Unused argument 'seize_trace' (unused-argument)
|
||||
mev_inspect/classifiers/specs/compound.py:82:21: E0602: Undefined variable 'DecodedCallTrace' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:90:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:90:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:82:8: W0613: Unused argument 'seize_trace' (unused-argument)
|
||||
mev_inspect/classifiers/specs/compound.py:3:0: W0611: Unused DecodeCallTrace imported from mev_inspect.schemas.classifiers (unused-import)
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 5.59/10 (previous run: 5.43/10, +0.16)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/liquidations.py:62: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py % git add mev_inspect
|
||||
(base) gheise@mac mev-inspect-py % poetry run pre-commit
|
||||
The currently activated Python version 3.8.5 is not supported by the project (^3.9).
|
||||
Trying to find and use a compatible version.
|
||||
Using python3.9 (3.9.9)
|
||||
black....................................................................Failed
|
||||
- hook id: black
|
||||
- exit code: 123
|
||||
|
||||
error: cannot format /Users/gheise/mev-inspect-py/mev_inspect/liquidations.py: Cannot parse: 62:60: if trace.transaction_hash == parent.transaction_hash
|
||||
Oh no! 💥 💔 💥
|
||||
4 files left unchanged, 1 file failed to reformat.
|
||||
|
||||
isort....................................................................Passed
|
||||
pylint...................................................................Failed
|
||||
- hook id: pylint
|
||||
- exit code: 6
|
||||
|
||||
************* Module mev_inspect.classifiers.specs.compound
|
||||
mev_inspect/classifiers/specs/compound.py:26:57: E0602: Undefined variable '_get_debt_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:33:56: E0602: Undefined variable '_get_received_data' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:59:39: E0602: Undefined variable 'Classification' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:73:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:73:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:65:8: W0613: Unused argument 'seize_trace' (unused-argument)
|
||||
mev_inspect/classifiers/specs/compound.py:90:37: E0602: Undefined variable 'Transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:90:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/compound.py:82:8: W0613: Unused argument 'seize_trace' (unused-argument)
|
||||
************* Module mev_inspect.classifiers.specs.aave
|
||||
mev_inspect/classifiers/specs/aave.py:25:53: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:32:52: E0602: Undefined variable 'self' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:62:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
mev_inspect/classifiers/specs/aave.py:78:49: E0602: Undefined variable 'get_transfer' (undefined-variable)
|
||||
************* Module mev_inspect.inspect_block
|
||||
mev_inspect/inspect_block.py:36:0: E0611: No name 'liquidations' in module 'mev_inspect' (no-name-in-module)
|
||||
|
||||
------------------------------------------------------------------
|
||||
Your code has been rated at 6.70/10 (previous run: 5.59/10, +1.12)
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
|
||||
|
||||
mypy.....................................................................Failed
|
||||
- hook id: mypy
|
||||
- exit code: 2
|
||||
|
||||
mev_inspect/liquidations.py:62: error: invalid syntax
|
||||
Found 1 error in 1 file (errors prevented further checking)
|
||||
|
||||
(base) gheise@mac mev-inspect-py %
|
@ -1,7 +1,7 @@
|
||||
from typing import List
|
||||
|
||||
from mev_inspect.aave_liquidations import get_aave_liquidations
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
from mev_inspect.liquidations import get_liquidations
|
||||
from mev_inspect.schemas.liquidations import Liquidation
|
||||
from mev_inspect.schemas.traces import Protocol
|
||||
from mev_inspect.transfers import ETH_TOKEN_ADDRESS
|
||||
@ -31,9 +31,10 @@ def test_single_weth_liquidation(trace_classifier: TraceClassifier):
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_aave_liquidations(classified_traces)
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
_assert_equal_list_of_liquidations(result, liquidations)
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_single_liquidation(trace_classifier: TraceClassifier):
|
||||
@ -59,9 +60,10 @@ def test_single_liquidation(trace_classifier: TraceClassifier):
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_aave_liquidations(classified_traces)
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
_assert_equal_list_of_liquidations(result, liquidations)
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_single_liquidation_with_atoken_payback(trace_classifier: TraceClassifier):
|
||||
@ -87,9 +89,10 @@ def test_single_liquidation_with_atoken_payback(trace_classifier: TraceClassifie
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_aave_liquidations(classified_traces)
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
_assert_equal_list_of_liquidations(result, liquidations)
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_multiple_liquidations_in_block(trace_classifier: TraceClassifier):
|
||||
@ -139,10 +142,11 @@ def test_multiple_liquidations_in_block(trace_classifier: TraceClassifier):
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_aave_liquidations(classified_traces)
|
||||
result = get_liquidations(classified_traces)
|
||||
liquidations = [liquidation1, liquidation2, liquidation3]
|
||||
|
||||
_assert_equal_list_of_liquidations(result, liquidations)
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_liquidations_with_eth_transfer(trace_classifier: TraceClassifier):
|
||||
@ -179,10 +183,11 @@ def test_liquidations_with_eth_transfer(trace_classifier: TraceClassifier):
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_aave_liquidations(classified_traces)
|
||||
result = get_liquidations(classified_traces)
|
||||
liquidations = [liquidation1, liquidation2]
|
||||
|
||||
_assert_equal_list_of_liquidations(result, liquidations)
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def _assert_equal_list_of_liquidations(
|
||||
|
@ -1,5 +1,5 @@
|
||||
from mev_inspect.classifiers.trace import TraceClassifier
|
||||
from mev_inspect.compound_liquidations import get_compound_liquidations
|
||||
from mev_inspect.liquidations import get_liquidations
|
||||
from mev_inspect.schemas.liquidations import Liquidation
|
||||
from mev_inspect.schemas.traces import Protocol
|
||||
from tests.utils import load_comp_markets, load_cream_markets, load_test_block
|
||||
@ -30,8 +30,10 @@ def test_c_ether_liquidations(trace_classifier: TraceClassifier):
|
||||
]
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_compound_liquidations(classified_traces)
|
||||
assert result == liquidations
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
block_number = 13207907
|
||||
transaction_hash = (
|
||||
@ -55,8 +57,10 @@ def test_c_ether_liquidations(trace_classifier: TraceClassifier):
|
||||
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_compound_liquidations(classified_traces)
|
||||
assert result == liquidations
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
block_number = 13298725
|
||||
transaction_hash = (
|
||||
@ -79,8 +83,10 @@ def test_c_ether_liquidations(trace_classifier: TraceClassifier):
|
||||
]
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_compound_liquidations(classified_traces)
|
||||
assert result == liquidations
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_c_token_liquidation(trace_classifier: TraceClassifier):
|
||||
@ -105,8 +111,10 @@ def test_c_token_liquidation(trace_classifier: TraceClassifier):
|
||||
]
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_compound_liquidations(classified_traces)
|
||||
assert result == liquidations
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
||||
|
||||
def test_cream_token_liquidation(trace_classifier: TraceClassifier):
|
||||
@ -131,5 +139,7 @@ def test_cream_token_liquidation(trace_classifier: TraceClassifier):
|
||||
]
|
||||
block = load_test_block(block_number)
|
||||
classified_traces = trace_classifier.classify(block.traces)
|
||||
result = get_compound_liquidations(classified_traces)
|
||||
assert result == liquidations
|
||||
result = get_liquidations(classified_traces)
|
||||
|
||||
for liquidation in liquidations:
|
||||
assert liquidation in result
|
||||
|
Loading…
x
Reference in New Issue
Block a user