Used black
This commit is contained in:
parent
f1431cec4c
commit
ce047e1f2a
@ -63,8 +63,12 @@ async def run():
|
|||||||
)
|
)
|
||||||
|
|
||||||
w3 = Web3(HTTPProvider(rpc))
|
w3 = Web3(HTTPProvider(rpc))
|
||||||
res = w3.provider.make_request('trace_block', ['earliest'])
|
res = w3.provider.make_request("trace_block", ["earliest"])
|
||||||
if 'error' in res and res['error']['message'] == 'the method trace_block does not exist/is not available':
|
if (
|
||||||
|
"error" in res
|
||||||
|
and res["error"]["message"]
|
||||||
|
== "the method trace_block does not exist/is not available"
|
||||||
|
):
|
||||||
type_e = RPCType.geth
|
type_e = RPCType.geth
|
||||||
else:
|
else:
|
||||||
type_e = RPCType.parity
|
type_e = RPCType.parity
|
||||||
@ -72,7 +76,6 @@ async def run():
|
|||||||
# type_e = convert_str_to_enum(sys.argv[1])
|
# type_e = convert_str_to_enum(sys.argv[1])
|
||||||
inspector = MEVInspector(rpc, type_e)
|
inspector = MEVInspector(rpc, type_e)
|
||||||
|
|
||||||
|
|
||||||
while not killer.kill_now:
|
while not killer.kill_now:
|
||||||
await inspect_next_block(
|
await inspect_next_block(
|
||||||
inspector,
|
inspector,
|
||||||
|
@ -38,7 +38,11 @@ async def create_from_block_number(
|
|||||||
trace_db_session: Optional[orm.Session],
|
trace_db_session: Optional[orm.Session],
|
||||||
) -> Block:
|
) -> Block:
|
||||||
|
|
||||||
type = RPCType.geth if geth_poa_middleware in w3.provider.middlewares else RPCType.parity
|
type = (
|
||||||
|
RPCType.geth
|
||||||
|
if geth_poa_middleware in w3.provider.middlewares
|
||||||
|
else RPCType.parity
|
||||||
|
)
|
||||||
if type == RPCType.geth:
|
if type == RPCType.geth:
|
||||||
block_json = await w3.eth.get_block(block_number)
|
block_json = await w3.eth.get_block(block_number)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user