Remove unused cache field
This commit is contained in:
parent
c436c6480e
commit
e9d71f62bf
8
cli.py
8
cli.py
@ -37,10 +37,9 @@ def coro(f):
|
|||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("block_number", type=int)
|
@click.argument("block_number", type=int)
|
||||||
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
|
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
|
||||||
@click.option("--cache/--no-cache", default=True)
|
|
||||||
@coro
|
@coro
|
||||||
async def inspect_block_command(block_number: int, rpc: str, cache: bool):
|
async def inspect_block_command(block_number: int, rpc: str):
|
||||||
inspector = MEVInspector(rpc=rpc, cache=cache)
|
inspector = MEVInspector(rpc=rpc)
|
||||||
await inspector.inspect_single_block(block=block_number)
|
await inspector.inspect_single_block(block=block_number)
|
||||||
|
|
||||||
|
|
||||||
@ -58,7 +57,6 @@ async def fetch_block_command(block_number: int, rpc: str):
|
|||||||
@click.argument("after_block", type=int)
|
@click.argument("after_block", type=int)
|
||||||
@click.argument("before_block", type=int)
|
@click.argument("before_block", type=int)
|
||||||
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
|
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
|
||||||
@click.option("--cache/--no-cache", default=True)
|
|
||||||
@click.option(
|
@click.option(
|
||||||
"--max-concurrency",
|
"--max-concurrency",
|
||||||
type=int,
|
type=int,
|
||||||
@ -73,13 +71,11 @@ async def inspect_many_blocks_command(
|
|||||||
after_block: int,
|
after_block: int,
|
||||||
before_block: int,
|
before_block: int,
|
||||||
rpc: str,
|
rpc: str,
|
||||||
cache: bool,
|
|
||||||
max_concurrency: int,
|
max_concurrency: int,
|
||||||
request_timeout: int,
|
request_timeout: int,
|
||||||
):
|
):
|
||||||
inspector = MEVInspector(
|
inspector = MEVInspector(
|
||||||
rpc=rpc,
|
rpc=rpc,
|
||||||
cache=cache,
|
|
||||||
max_concurrency=max_concurrency,
|
max_concurrency=max_concurrency,
|
||||||
request_timeout=request_timeout,
|
request_timeout=request_timeout,
|
||||||
)
|
)
|
||||||
|
@ -21,13 +21,9 @@ class MEVInspector:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
rpc: str,
|
rpc: str,
|
||||||
cache: bool = False,
|
|
||||||
max_concurrency: int = 1,
|
max_concurrency: int = 1,
|
||||||
request_timeout: int = 300,
|
request_timeout: int = 300,
|
||||||
):
|
):
|
||||||
if not cache:
|
|
||||||
logger.info("Skipping cache")
|
|
||||||
|
|
||||||
self.inspect_db_session = get_inspect_session()
|
self.inspect_db_session = get_inspect_session()
|
||||||
self.trace_db_session = get_trace_session()
|
self.trace_db_session = get_trace_session()
|
||||||
self.base_provider = get_base_provider(rpc, request_timeout=request_timeout)
|
self.base_provider = get_base_provider(rpc, request_timeout=request_timeout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user