runner event handling fixes

This commit is contained in:
Tim
2024-03-24 15:39:40 -04:00
parent f01f67a005
commit 1d8147e14f
2 changed files with 8 additions and 2 deletions

View File

@@ -43,7 +43,13 @@ class BlockProgressor(metaclass=ABCMeta):
"""
if log_filter is None and event is not None:
log_filter = {'topics': [topic(event.abi)]}
cb = callback if event is None or multi else functools.partial(map, callback)
if multi or event is None:
cb = callback
else:
async def _map(func, events):
for e in events:
await maywait(func(e))
cb = callback if event is None or multi else functools.partial(_map, callback)
self.events.append((cb, event, log_filter))
@abstractmethod

View File

@@ -38,7 +38,7 @@ def dumps(obj):
return dumpb(obj).decode('utf8')
def dumpb(obj):
opts = orjson.OPT_PASSTHROUGH_SUBCLASS | orjson.OPT_STRICT_INTEGER
opts = orjson.OPT_PASSTHROUGH_SUBCLASS
return orjson.dumps(obj, default=_serialize, option=opts)