bugfixes for pool detection and runner error reporting
This commit is contained in:
@@ -41,6 +41,12 @@ class Pools:
|
||||
except ContractLogicError:
|
||||
log.debug(f'new Unknown pool at {address}')
|
||||
found = Pool(chain=chain, address=address, exchange=Exchange.Unknown, base=ADDRESS_0, quote=ADDRESS_0, fee=0)
|
||||
except ValueError as v:
|
||||
if v.args[0].get('code') == -32000:
|
||||
log.debug(f'new Unknown pool at {address}')
|
||||
found = Pool(chain=chain, address=address, exchange=Exchange.Unknown, base=ADDRESS_0, quote=ADDRESS_0, fee=0)
|
||||
else:
|
||||
raise
|
||||
db.session.add(found)
|
||||
Pools.instances[key] = found
|
||||
return None if found.exchange == Exchange.Unknown else found
|
||||
|
||||
@@ -323,7 +323,13 @@ class BlockStateRunner:
|
||||
if not self.state_initialized:
|
||||
await self.do_state_init_cbs()
|
||||
# logevent callbacks
|
||||
for future, callback, event, filter_args in batches:
|
||||
while True:
|
||||
try:
|
||||
# we remove entries as we process them, so the exception handler doesn't re-await the callbacks
|
||||
batch = batches.pop(0)
|
||||
except IndexError:
|
||||
break
|
||||
future, callback, event, filter_args = batch
|
||||
if future is None:
|
||||
await maywait(callback()) # non-log callback
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user