Trace is an object
This commit is contained in:
parent
0e45f22de8
commit
b99f7b5aa8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user