style: improve schema naming bcuz imagine complained
This commit is contained in:
parent
0d6215f82e
commit
96d2171daa
@ -5,12 +5,12 @@ from mev_inspect.schemas.traces import (
|
||||
Classification,
|
||||
DecodedCallTrace,
|
||||
)
|
||||
from mev_inspect.schemas.punk_bid import Punk_Bid
|
||||
from mev_inspect.schemas.punk_accept_bid import Punk_Accept_Bid
|
||||
from mev_inspect.schemas.punk_bid import PunkBid
|
||||
from mev_inspect.schemas.punk_accept_bid import PunkAcceptBid
|
||||
from mev_inspect.traces import get_traces_by_transaction_hash
|
||||
|
||||
|
||||
def get_punk_accept_bids(traces: List[ClassifiedTrace]) -> List[Punk_Accept_Bid]:
|
||||
def get_punk_accept_bids(traces: List[ClassifiedTrace]) -> List[PunkAcceptBid]:
|
||||
punk_accept_bids = []
|
||||
|
||||
for _, transaction_traces in get_traces_by_transaction_hash(traces).items():
|
||||
@ -23,7 +23,7 @@ def get_punk_accept_bids(traces: List[ClassifiedTrace]) -> List[Punk_Accept_Bid]
|
||||
|
||||
def _get_punk_accept_bids_for_transaction(
|
||||
traces: List[ClassifiedTrace],
|
||||
) -> List[Punk_Accept_Bid]:
|
||||
) -> List[PunkAcceptBid]:
|
||||
ordered_traces = list(sorted(traces, key=lambda t: t.trace_address))
|
||||
|
||||
punk_accept_bids = []
|
||||
@ -33,7 +33,7 @@ def _get_punk_accept_bids_for_transaction(
|
||||
continue
|
||||
|
||||
elif trace.classification == Classification.punk_accept_bid:
|
||||
punk_accept_bid = Punk_Accept_Bid(
|
||||
punk_accept_bid = PunkAcceptBid(
|
||||
block_number=trace.block_number,
|
||||
transaction_hash=trace.transaction_hash,
|
||||
trace_address=trace.trace_address,
|
||||
@ -47,7 +47,7 @@ def _get_punk_accept_bids_for_transaction(
|
||||
return punk_accept_bids
|
||||
|
||||
|
||||
def get_punk_bids(traces: List[ClassifiedTrace]) -> List[Punk_Bid]:
|
||||
def get_punk_bids(traces: List[ClassifiedTrace]) -> List[PunkBid]:
|
||||
punk_bids = []
|
||||
|
||||
for _, transaction_traces in get_traces_by_transaction_hash(traces).items():
|
||||
@ -56,7 +56,7 @@ def get_punk_bids(traces: List[ClassifiedTrace]) -> List[Punk_Bid]:
|
||||
return punk_bids
|
||||
|
||||
|
||||
def _get_punk_bids_for_transaction(traces: List[ClassifiedTrace]) -> List[Punk_Bid]:
|
||||
def _get_punk_bids_for_transaction(traces: List[ClassifiedTrace]) -> List[PunkBid]:
|
||||
ordered_traces = list(sorted(traces, key=lambda t: t.trace_address))
|
||||
|
||||
punk_bids = []
|
||||
@ -66,7 +66,7 @@ def _get_punk_bids_for_transaction(traces: List[ClassifiedTrace]) -> List[Punk_B
|
||||
continue
|
||||
|
||||
elif trace.classification == Classification.punk_bid:
|
||||
punk_bid = Punk_Bid(
|
||||
punk_bid = PunkBid(
|
||||
transaction_hash=trace.transaction_hash,
|
||||
block_number=trace.block_number,
|
||||
trace_address=trace.trace_address,
|
||||
|
@ -5,8 +5,8 @@ from pydantic import BaseModel
|
||||
|
||||
from .traces import Classification, DecodedCallTrace, Protocol
|
||||
from .transfers import Transfer
|
||||
from .punk_bid import Punk_Bid
|
||||
from .punk_accept_bid import Punk_Accept_Bid
|
||||
from .punk_bid import PunkBid
|
||||
from .punk_accept_bid import PunkAcceptBid
|
||||
|
||||
|
||||
class Classifier(ABC):
|
||||
@ -23,7 +23,7 @@ class PunkBidClassifier(Classifier):
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def get_bid(trace: DecodedCallTrace) -> Punk_Bid:
|
||||
def get_bid(trace: DecodedCallTrace) -> PunkBid:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ class PunkAcceptBidClassifier(Classifier):
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def get_accept_bid(trace: DecodedCallTrace) -> Punk_Accept_Bid:
|
||||
def get_accept_bid(trace: DecodedCallTrace) -> PunkAcceptBid:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ from typing import List
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Punk_Accept_Bid(BaseModel):
|
||||
class PunkAcceptBid(BaseModel):
|
||||
block_number: int
|
||||
transaction_hash: str
|
||||
trace_address: List[int]
|
||||
|
@ -2,10 +2,11 @@ from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
class Punk_Bid(BaseModel):
|
||||
|
||||
class PunkBid(BaseModel):
|
||||
block_number: int
|
||||
transaction_hash: str
|
||||
trace_address: List[int]
|
||||
from_address: str
|
||||
punk_index: int
|
||||
amount: int
|
||||
amount: int
|
||||
|
Loading…
x
Reference in New Issue
Block a user