Rename create_swap functions
This commit is contained in:
parent
4fdd628ce3
commit
37e6900f46
@ -6,7 +6,7 @@ from mev_inspect.schemas.transfers import Transfer, ETH_TOKEN_ADDRESS
|
||||
from mev_inspect.schemas.traces import DecodedCallTrace, ClassifiedTrace
|
||||
|
||||
|
||||
def create_swap_from_transfers(
|
||||
def create_swap_from_pool_transfers(
|
||||
trace: DecodedCallTrace,
|
||||
recipient_address: str,
|
||||
prior_transfers: List[Transfer],
|
||||
@ -55,7 +55,7 @@ def create_swap_from_transfers(
|
||||
)
|
||||
|
||||
|
||||
def create_swap_from_transfers_not_including_pool(
|
||||
def create_swap_from_recipient_transfers(
|
||||
trace: DecodedCallTrace,
|
||||
pool_address: str,
|
||||
recipient_address: str,
|
||||
|
@ -9,7 +9,7 @@ from mev_inspect.schemas.classifiers import (
|
||||
ClassifierSpec,
|
||||
SwapClassifier,
|
||||
)
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_transfers
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_pool_transfers
|
||||
|
||||
BALANCER_V1_POOL_ABI_NAME = "BPool"
|
||||
|
||||
@ -24,7 +24,7 @@ class BalancerSwapClassifier(SwapClassifier):
|
||||
|
||||
recipient_address = trace.from_address
|
||||
|
||||
swap = create_swap_from_transfers(
|
||||
swap = create_swap_from_pool_transfers(
|
||||
trace, recipient_address, prior_transfers, child_transfers
|
||||
)
|
||||
return swap
|
||||
|
@ -10,7 +10,7 @@ from mev_inspect.schemas.classifiers import (
|
||||
SwapClassifier,
|
||||
)
|
||||
from mev_inspect.classifiers.helpers import (
|
||||
create_swap_from_transfers_not_including_pool,
|
||||
create_swap_from_recipient_transfers,
|
||||
)
|
||||
|
||||
BANCOR_NETWORK_ABI_NAME = "BancorNetwork"
|
||||
@ -26,7 +26,7 @@ class BancorSwapClassifier(SwapClassifier):
|
||||
) -> Optional[Swap]:
|
||||
recipient_address = trace.from_address
|
||||
|
||||
swap = create_swap_from_transfers_not_including_pool(
|
||||
swap = create_swap_from_recipient_transfers(
|
||||
trace,
|
||||
BANCOR_NETWORK_CONTRACT_ADDRESS,
|
||||
recipient_address,
|
||||
|
@ -10,7 +10,7 @@ from mev_inspect.schemas.classifiers import (
|
||||
ClassifierSpec,
|
||||
SwapClassifier,
|
||||
)
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_transfers
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_pool_transfers
|
||||
|
||||
|
||||
class CurveSwapClassifier(SwapClassifier):
|
||||
@ -23,7 +23,7 @@ class CurveSwapClassifier(SwapClassifier):
|
||||
|
||||
recipient_address = trace.from_address
|
||||
|
||||
swap = create_swap_from_transfers(
|
||||
swap = create_swap_from_pool_transfers(
|
||||
trace, recipient_address, prior_transfers, child_transfers
|
||||
)
|
||||
return swap
|
||||
|
@ -9,7 +9,7 @@ from mev_inspect.schemas.classifiers import (
|
||||
ClassifierSpec,
|
||||
SwapClassifier,
|
||||
)
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_transfers
|
||||
from mev_inspect.classifiers.helpers import create_swap_from_pool_transfers
|
||||
|
||||
|
||||
UNISWAP_V2_PAIR_ABI_NAME = "UniswapV2Pair"
|
||||
@ -26,7 +26,7 @@ class UniswapV3SwapClassifier(SwapClassifier):
|
||||
|
||||
recipient_address = trace.inputs.get("recipient", trace.from_address)
|
||||
|
||||
swap = create_swap_from_transfers(
|
||||
swap = create_swap_from_pool_transfers(
|
||||
trace, recipient_address, prior_transfers, child_transfers
|
||||
)
|
||||
return swap
|
||||
@ -42,7 +42,7 @@ class UniswapV2SwapClassifier(SwapClassifier):
|
||||
|
||||
recipient_address = trace.inputs.get("to", trace.from_address)
|
||||
|
||||
swap = create_swap_from_transfers(
|
||||
swap = create_swap_from_pool_transfers(
|
||||
trace, recipient_address, prior_transfers, child_transfers
|
||||
)
|
||||
return swap
|
||||
|
Loading…
x
Reference in New Issue
Block a user