From f87016a561458bc269686107292534ebfda5da76 Mon Sep 17 00:00:00 2001 From: Luke Van Seters Date: Tue, 28 Sep 2021 12:55:03 -0400 Subject: [PATCH] Add field for transfer classifiers --- mev_inspect/schemas/classifier_specs.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mev_inspect/schemas/classifier_specs.py b/mev_inspect/schemas/classifier_specs.py index 37703b5..7afd941 100644 --- a/mev_inspect/schemas/classifier_specs.py +++ b/mev_inspect/schemas/classifier_specs.py @@ -1,8 +1,15 @@ -from typing import Dict, List, Optional +from typing import Callable, Dict, List, Optional from pydantic import BaseModel -from .classified_traces import Classification, Protocol +from .classified_traces import Classification, DecodedCallTrace, Protocol +from .transfers import Transfer + + +TransferClassifier = Callable[ + [DecodedCallTrace, List[DecodedCallTrace], List[DecodedCallTrace]], + Transfer, +] class ClassifierSpec(BaseModel): @@ -10,3 +17,4 @@ class ClassifierSpec(BaseModel): protocol: Optional[Protocol] = None valid_contract_addresses: Optional[List[str]] = None classifications: Dict[str, Classification] = {} + transfer_classifiers: Dict[str, TransferClassifier] = {}