diff --git a/apps/cic-eth/cic_eth/api/api_task.py b/apps/cic-eth/cic_eth/api/api_task.py index 433c1be8..b0ecf047 100644 --- a/apps/cic-eth/cic_eth/api/api_task.py +++ b/apps/cic-eth/cic_eth/api/api_task.py @@ -17,7 +17,8 @@ from cic_eth.enum import LockEnum app = celery.current_app -logg = logging.getLogger(__name__) +#logg = logging.getLogger(__name__) +logg = logging.getLogger() class Api(ApiBase): @@ -119,6 +120,7 @@ class Api(ApiBase): logg.debug('looking up tokens without external proof check: {}'.format(','.join(token_symbols))) proof = '' + logg.debug('proof is {}'.format(proof)) l = len(token_symbols) if len(proof) == 0: l = 0 diff --git a/apps/cic-eth/cic_eth/eth/erc20.py b/apps/cic-eth/cic_eth/eth/erc20.py index 080c0cea..4a65adc3 100644 --- a/apps/cic-eth/cic_eth/eth/erc20.py +++ b/apps/cic-eth/cic_eth/eth/erc20.py @@ -491,7 +491,8 @@ def token_info(self, tokens, chain_spec_dict, proofs=[]): token_symbol_proof_hex = to_identifier(token_chain_object.symbol) token_proofs = [token_symbol_proof_hex] - token_proofs += proofs[i] + if len(proofs) > 0: + token_proofs += proofs[i] tokens[i] = { 'decimals': token_chain_object.decimals, diff --git a/apps/cic-eth/tests/task/api/test_app_noncritical.py b/apps/cic-eth/tests/task/api/test_app_noncritical.py index 85ef8630..ba8acb3b 100644 --- a/apps/cic-eth/tests/task/api/test_app_noncritical.py +++ b/apps/cic-eth/tests/task/api/test_app_noncritical.py @@ -110,7 +110,7 @@ def test_tokens_noproof( custodial_roles, foo_token_declaration, bar_token_declaration, - celery_session_worker, + celery_worker, ): api = Api(str(default_chain_spec), queue=None, callback_param='foo') @@ -120,10 +120,10 @@ def test_tokens_noproof( assert len(r) == 1 assert r[0]['address'] == strip_0x(foo_token) - t = api.tokens(['FOO'], proof='') + t = api.tokens(['BAR'], proof='') r = t.get() assert len(r) == 1 - assert r[0]['address'] == strip_0x(foo_token) + assert r[0]['address'] == strip_0x(bar_token) t = api.tokens(['FOO'], proof=None) r = t.get()