Merge pull request #116 from flashbots/cache-field-remove

Remove unused cache field
This commit is contained in:
Luke Van Seters 2021-11-02 15:59:13 -04:00 committed by GitHub
commit b5a9bed2d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

8
cli.py
View File

@ -37,10 +37,9 @@ def coro(f):
@cli.command()
@click.argument("block_number", type=int)
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
@click.option("--cache/--no-cache", default=True)
@coro
async def inspect_block_command(block_number: int, rpc: str, cache: bool):
inspector = MEVInspector(rpc=rpc, cache=cache)
async def inspect_block_command(block_number: int, rpc: str):
inspector = MEVInspector(rpc=rpc)
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("before_block", type=int)
@click.option("--rpc", default=lambda: os.environ.get(RPC_URL_ENV, ""))
@click.option("--cache/--no-cache", default=True)
@click.option(
"--max-concurrency",
type=int,
@ -73,13 +71,11 @@ async def inspect_many_blocks_command(
after_block: int,
before_block: int,
rpc: str,
cache: bool,
max_concurrency: int,
request_timeout: int,
):
inspector = MEVInspector(
rpc=rpc,
cache=cache,
max_concurrency=max_concurrency,
request_timeout=request_timeout,
)

View File

@ -21,13 +21,9 @@ class MEVInspector:
def __init__(
self,
rpc: str,
cache: bool = False,
max_concurrency: int = 1,
request_timeout: int = 300,
):
if not cache:
logger.info("Skipping cache")
self.inspect_db_session = get_inspect_session()
self.trace_db_session = get_trace_session()
self.base_provider = get_base_provider(rpc, request_timeout=request_timeout)