Handle single dict input to account tx list, add ext module to tasker

This commit is contained in:
nolash 2021-03-02 16:49:30 +01:00
parent 3ceafa90f4
commit 9119c04f1f
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 8 additions and 2 deletions

View File

@ -490,7 +490,7 @@ class Api:
queue=self.queue, queue=self.queue,
) )
if self.callback_param != None: if self.callback_param != None:
s_assemble.link(self.callback_success).on_error(self.callback_error) s_brief.link(self.callback_success).on_error(self.callback_error)
t = None t = None
if external_task != None: if external_task != None:
@ -515,7 +515,8 @@ class Api:
c = celery.chain(s_external_get, s_external_process) c = celery.chain(s_external_get, s_external_process)
t = celery.chord([s_local, c])(s_brief) t = celery.chord([s_local, c])(s_brief)
else: else:
t = s_local.apply_sync() s_local.link(s_brief)
t = s_local.apply_async()
return t return t

View File

@ -149,6 +149,9 @@ def tx_collate(tx_batches, chain_str, offset, limit, newest_first=True):
txs_by_block = {} txs_by_block = {}
chain_spec = ChainSpec.from_chain_str(chain_str) chain_spec = ChainSpec.from_chain_str(chain_str)
if isinstance(tx_batches, dict):
tx_batches = [tx_batches]
for b in tx_batches: for b in tx_batches:
for v in b.values(): for v in b.values():
tx = None tx = None

View File

@ -40,6 +40,8 @@ from cic_eth.callbacks import redis
from cic_eth.db.models.base import SessionBase from cic_eth.db.models.base import SessionBase
from cic_eth.db.models.otx import Otx from cic_eth.db.models.otx import Otx
from cic_eth.db import dsn_from_config from cic_eth.db import dsn_from_config
from cic_eth.ext import tx
from cic_eth.ext import address
logging.basicConfig(level=logging.WARNING) logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger() logg = logging.getLogger()