diff --git a/apps/cic-eth/cic_eth/db/models/nonce.py b/apps/cic-eth/cic_eth/db/models/nonce.py index a029d81e..3b474a98 100644 --- a/apps/cic-eth/cic_eth/db/models/nonce.py +++ b/apps/cic-eth/cic_eth/db/models/nonce.py @@ -88,7 +88,7 @@ class Nonce(SessionBase): #session.execute('UNLOCK TABLE nonce') #conn.close() session.commit() - session.commit() +# session.commit() SessionBase.release_session(session) return nonce diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/transferauth.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/transferauth.py index 8a7ead1a..ad921b47 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/transferauth.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/transferauth.py @@ -46,8 +46,12 @@ class TransferAuthFilter(SyncFilter): def filter(self, conn, block, tx, session): #rcpt, chain_str, session=None): + if tx.payload == None: + logg.debug('no payload') + return False + payloadlength = len(tx.payload) - if len(tx.payload) != 8+256: + if payloadlength != 8+256: logg.debug('{} below minimum length for a transfer auth call'.format(payloadlength)) logg.debug('payload {}'.format(tx.payload)) return False diff --git a/apps/cic-eth/tests/fixtures_celery.py b/apps/cic-eth/tests/fixtures_celery.py index 5d4f712d..39395ac9 100644 --- a/apps/cic-eth/tests/fixtures_celery.py +++ b/apps/cic-eth/tests/fixtures_celery.py @@ -13,7 +13,6 @@ def celery_includes(): return [ 'cic_eth.eth.bancor', 'cic_eth.eth.token', - 'cic_eth.eth.request', 'cic_eth.eth.tx', 'cic_eth.ext.tx', 'cic_eth.queue.tx', diff --git a/apps/cic-eth/tests/tasks/test_transfer_approval.py b/apps/cic-eth/tests/tasks/test_transfer_approval.py deleted file mode 100644 index 574cd4c3..00000000 --- a/apps/cic-eth/tests/tasks/test_transfer_approval.py +++ /dev/null @@ -1,76 +0,0 @@ -# standard imports -import logging -import time - -# third-party imports -from erc20_approval_escrow import TransferApproval -import celery -import sha3 - -# local imports -from cic_eth.eth.token import TokenTxFactory - -logg = logging.getLogger() - - -# BUG: transaction receipt only found sometimes -def test_transfer_approval( - default_chain_spec, - transfer_approval, - bancor_tokens, - w3_account_roles, - eth_empty_accounts, - cic_registry, - init_database, - celery_session_worker, - init_eth_tester, - init_w3, - ): - - s = celery.signature( - 'cic_eth.eth.request.transfer_approval_request', - [ - [ - { - 'address': bancor_tokens[0], - }, - ], - w3_account_roles['eth_account_sarafu_owner'], - eth_empty_accounts[0], - 1024, - str(default_chain_spec), - ], - ) - - s_send = celery.signature( - 'cic_eth.eth.tx.send', - [ - str(default_chain_spec), - ], - - ) - s.link(s_send) - t = s.apply_async() - - tx_signed_raws = t.get() - for r in t.collect(): - logg.debug('result {}'.format(r)) - - assert t.successful() - - init_eth_tester.mine_block() - - h = sha3.keccak_256() - tx_signed_raw = tx_signed_raws[0] - tx_signed_raw_bytes = bytes.fromhex(tx_signed_raw[2:]) - h.update(tx_signed_raw_bytes) - tx_hash = h.digest() - rcpt = init_w3.eth.getTransactionReceipt(tx_hash) - - assert rcpt.status == 1 - - a = TransferApproval(init_w3, transfer_approval) - assert a.last_serial() == 1 - - logg.debug('requests {}'.format(a.requests(1)['serial'])) - diff --git a/apps/contract-migration/scripts/import_balance.py b/apps/contract-migration/scripts/import_balance.py index 658ab0d6..d9347f57 100644 --- a/apps/contract-migration/scripts/import_balance.py +++ b/apps/contract-migration/scripts/import_balance.py @@ -148,7 +148,11 @@ class Handler: return u = Person.deserialize(o) original_address = u.identities[old_chain_spec.engine()]['{}:{}'.format(old_chain_spec.common_name(), old_chain_spec.network_id())][0] - balance = self.balances[original_address] + try: + balance = self.balances[original_address] + except KeyError as e: + logg.error('balance get fail orig {} new {}'.format(original_address, recipient)) + return # TODO: store token object in handler ,get decimals from there multiplier = 10**6