diff --git a/apps/cic-eth/cic_eth/api/api_task.py b/apps/cic-eth/cic_eth/api/api_task.py index bee04223..346ab03b 100644 --- a/apps/cic-eth/cic_eth/api/api_task.py +++ b/apps/cic-eth/cic_eth/api/api_task.py @@ -515,7 +515,7 @@ class Api(ApiBase): :param password: Password to encode the password with in the backend (careful, you will have to remember it) :type password: str :param register: Register the new account in accounts index backend - :type password: bool + :type register: bool :returns: uuid of root task :rtype: celery.Task """ diff --git a/apps/cic-eth/cic_eth/cli/config.py b/apps/cic-eth/cic_eth/cli/config.py index ebc45018..7dfc5d75 100644 --- a/apps/cic-eth/cic_eth/cli/config.py +++ b/apps/cic-eth/cic_eth/cli/config.py @@ -73,6 +73,7 @@ class Config(BaseConfig): db, ) + celery_config_url = urllib.parse.urlsplit(config.get('CELERY_BROKER_URL')) hostport = urlhostmerge( celery_config_url[1], diff --git a/apps/cic-eth/cic_eth/eth/erc20.py b/apps/cic-eth/cic_eth/eth/erc20.py index a8922f27..0f89436b 100644 --- a/apps/cic-eth/cic_eth/eth/erc20.py +++ b/apps/cic-eth/cic_eth/eth/erc20.py @@ -397,6 +397,8 @@ def cache_transfer_data( sender_address = tx_normalize.wallet_address(tx['from']) recipient_address = tx_normalize.wallet_address(tx_data[0]) token_value = tx_data[1] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() @@ -404,8 +406,8 @@ def cache_transfer_data( 'hash': tx_hash_hex, 'from': sender_address, 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, } @@ -437,14 +439,16 @@ def cache_transfer_from_data( spender_address = tx_data[0] recipient_address = tx_data[1] token_value = tx_data[2] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() tx_dict = { 'hash': tx_hash_hex, 'from': tx['from'], 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, } @@ -476,14 +480,16 @@ def cache_approve_data( sender_address = tx_normalize.wallet_address(tx['from']) recipient_address = tx_normalize.wallet_address(tx_data[0]) token_value = tx_data[1] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() tx_dict = { 'hash': tx_hash_hex, 'from': sender_address, 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, } diff --git a/apps/cic-eth/cic_eth/queue/balance.py b/apps/cic-eth/cic_eth/queue/balance.py index f2f87fb5..8c48ab91 100644 --- a/apps/cic-eth/cic_eth/queue/balance.py +++ b/apps/cic-eth/cic_eth/queue/balance.py @@ -72,7 +72,7 @@ def __balance_incoming_compatible(token_address, receiver_address): status_compare = dead() q = q.filter(Otx.status.op('&')(status_compare)==0) # TODO: this can change the result for the recipient if tx is later obsoleted and resubmission is delayed. - q = q.filter(Otx.status.op('&')(StatusBits.IN_NETWORK)==StatusBits.IN_NETWORK) + #q = q.filter(Otx.status.op('&')(StatusBits.IN_NETWORK)==StatusBits.IN_NETWORK) q = q.filter(TxCache.destination_token_address==token_address) delta = 0 for r in q.all(): diff --git a/apps/cic-eth/requirements.txt b/apps/cic-eth/requirements.txt index 72118a58..1d38191e 100644 --- a/apps/cic-eth/requirements.txt +++ b/apps/cic-eth/requirements.txt @@ -1,6 +1,6 @@ celery==4.4.7 semver==2.13.0 -chainlib-eth~=0.0.14 +chainlib-eth~=0.0.15 urlybird~=0.0.1 cic-eth-registry~=0.6.5 cic-types~=0.2.1a8 diff --git a/apps/cic-eth/tests/filters/test_token_filter.py b/apps/cic-eth/tests/filters/test_token_filter.py index d37888cd..b94797ca 100644 --- a/apps/cic-eth/tests/filters/test_token_filter.py +++ b/apps/cic-eth/tests/filters/test_token_filter.py @@ -41,8 +41,7 @@ def test_filter_gas( token_registry, register_lookups, register_tokens, - #celery_session_worker, - celery_worker, + celery_session_worker, cic_registry, ): diff --git a/apps/contract-migration/requirements.txt b/apps/contract-migration/requirements.txt index 209d1121..db889d39 100644 --- a/apps/contract-migration/requirements.txt +++ b/apps/contract-migration/requirements.txt @@ -4,7 +4,7 @@ chainlib-eth~=0.0.15 eth-erc20~=0.1.5 erc20-demurrage-token~=0.0.7 eth-address-index~=0.2.4 -cic-eth-registry~=0.6.4 +cic-eth-registry~=0.6.5 erc20-faucet==0.3.2 sarafu-faucet==0.0.7 confini~=0.5.3 diff --git a/apps/data-seeding/docker/Dockerfile b/apps/data-seeding/docker/Dockerfile index cd6493cf..6a3ebf4e 100644 --- a/apps/data-seeding/docker/Dockerfile +++ b/apps/data-seeding/docker/Dockerfile @@ -1,16 +1,25 @@ -# syntax = docker/dockerfile:1.2 -FROM registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev-5ab8bf45 +ARG DOCKER_REGISTRY="registry.gitlab.com/grassrootseconomics" + +FROM $DOCKER_REGISTRY/cic-base-images:python-3.8.6-dev-e8eb2ee2 WORKDIR /root RUN mkdir -vp /usr/local/etc/cic -COPY package.json \ - package-lock.json \ - ./ +ARG NPM_REPOSITORY=${NPM_REPOSITORY:-https://registry.npmjs.org} +RUN npm config set snyk=false +#RUN npm config set registry={NPM_REPOSITORY} +RUN npm config set registry=${NPM_REPOSITORY} + +# copy the dependencies +COPY package.json package-lock.json ./ +RUN --mount=type=cache,mode=0755,target=/root/.npm \ + npm set cache /root/.npm && \ + npm cache verify && \ + npm ci --verbose -RUN npm ci --production +#RUN npm ci --production --verbose #RUN --mount=type=cache,mode=0755,target=/root/node_modules npm install COPY common/ cic_ussd/common/ @@ -22,6 +31,7 @@ ARG EXTRA_PIP_ARGS="" ARG PIP_INDEX_URL=https://pypi.org/simple RUN pip install --index-url $PIP_INDEX_URL \ + --pre \ --extra-index-url $EXTRA_PIP_INDEX_URL $EXTRA_PIP_ARGS \ -r requirements.txt diff --git a/apps/data-seeding/requirements.txt b/apps/data-seeding/requirements.txt index fa3807fc..87aa1d28 100644 --- a/apps/data-seeding/requirements.txt +++ b/apps/data-seeding/requirements.txt @@ -4,7 +4,7 @@ cic-types~=0.2.1a8 funga>=0.5.1 faker==4.17.1 chainsyncer~=0.0.7a3 -chainlib-eth~=0.0.14 +chainlib-eth~=0.0.15 eth-address-index~=0.2.4a1 eth-contract-registry~=0.6.3a3 eth-accounts-index~=0.1.2a3