diff --git a/mev_inspect/inspector_uniswap.py b/mev_inspect/inspector_uniswap.py index 1c04aab..f64933d 100644 --- a/mev_inspect/inspector_uniswap.py +++ b/mev_inspect/inspector_uniswap.py @@ -83,10 +83,14 @@ class UniswapInspector: for call in calls: print("\n", call) if ( - call["action"]["to"] == uniswap_router_address.lower() - or call["action"]["to"] == sushiswap_router_address.lower() - ) and utils.check_call_for_signature( - call, self.uniswap_router_trade_signatures + call["type"] == "call" + and ( + call["action"]["to"] == uniswap_router_address.lower() + or call["action"]["to"] == sushiswap_router_address.lower() + ) + and utils.check_trace_for_signature( + call, self.uniswap_router_trade_signatures + ) ): # print("WIP, here is where there is a call that matches what we are looking for") 1 == 1 diff --git a/mev_inspect/utils.py b/mev_inspect/utils.py index e6f2ec9..d5008ad 100644 --- a/mev_inspect/utils.py +++ b/mev_inspect/utils.py @@ -2,16 +2,14 @@ from typing import List from hexbytes.main import HexBytes -from mev_inspect.schemas import Trace - -def check_trace_for_signature(trace: Trace, signatures: List[str]): - if trace.action["input"] == None: +def check_trace_for_signature(trace: dict, signatures: List[str]): + if trace["action"]["input"] == None: return False ## Iterate over all signatures, and if our trace matches any of them set it to True for signature in signatures: - if HexBytes(trace.action["input"]).startswith(signature): + if HexBytes(trace["action"]["input"]).startswith(signature): ## Note that we are turning the input into hex bytes here, which seems to be fine ## Working with strings was doing weird things return True