Trace is an object

This commit is contained in:
Luke Van Seters 2021-07-21 12:30:57 -04:00
parent 0e45f22de8
commit b99f7b5aa8

View File

@ -2,14 +2,16 @@ from typing import List
from hexbytes.main import HexBytes
from mev_inspect.schemas.blocks import Trace
def check_trace_for_signature(trace: dict, signatures: List[str]):
if trace["action"]["input"] == None:
def check_trace_for_signature(trace: Trace, 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