From bb3ace07a1ae66c08ef86cc6e49094712167d3e6 Mon Sep 17 00:00:00 2001 From: Robert Miller Date: Thu, 25 Nov 2021 16:48:48 -0500 Subject: [PATCH] =move punk classifiers out of classifer.py --- mev_inspect/classifiers/specs/cryptopunks.py | 20 ++++++++++++---- mev_inspect/schemas/classifiers.py | 24 -------------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/mev_inspect/classifiers/specs/cryptopunks.py b/mev_inspect/classifiers/specs/cryptopunks.py index 37f9e2b..a482b1f 100644 --- a/mev_inspect/classifiers/specs/cryptopunks.py +++ b/mev_inspect/classifiers/specs/cryptopunks.py @@ -1,13 +1,23 @@ -from mev_inspect.schemas.traces import ( - Protocol, -) +from mev_inspect.schemas.traces import Protocol, Classification from mev_inspect.schemas.classifiers import ( ClassifierSpec, - PunkBidClassifier, - PunkBidAcceptanceClassifier, + Classifier, ) + +class PunkBidAcceptanceClassifier(Classifier): + @staticmethod + def get_classification() -> Classification: + return Classification.punk_accept_bid + + +class PunkBidClassifier(Classifier): + @staticmethod + def get_classification() -> Classification: + return Classification.punk_bid + + CRYPTO_PUNKS_SPEC = ClassifierSpec( abi_name="cryptopunks", protocol=Protocol.cryptopunks, diff --git a/mev_inspect/schemas/classifiers.py b/mev_inspect/schemas/classifiers.py index 5b55d91..ab50271 100644 --- a/mev_inspect/schemas/classifiers.py +++ b/mev_inspect/schemas/classifiers.py @@ -5,8 +5,6 @@ from pydantic import BaseModel from .traces import Classification, DecodedCallTrace, Protocol from .transfers import Transfer -from .punk_bid import PunkBid -from .punk_accept_bid import PunkBidAcceptance class Classifier(ABC): @@ -16,28 +14,6 @@ class Classifier(ABC): raise NotImplementedError() -class PunkBidClassifier(Classifier): - @staticmethod - def get_classification() -> Classification: - return Classification.punk_bid - - @staticmethod - @abstractmethod - def get_bid(trace: DecodedCallTrace) -> PunkBid: - raise NotImplementedError() - - -class PunkBidAcceptanceClassifier(Classifier): - @staticmethod - def get_classification() -> Classification: - return Classification.punk_accept_bid - - @staticmethod - @abstractmethod - def get_accept_bid(trace: DecodedCallTrace) -> PunkBidAcceptance: - raise NotImplementedError() - - class TransferClassifier(Classifier): @staticmethod def get_classification() -> Classification: