From be32fc75fcb3450997ba2d485728beddb406027a Mon Sep 17 00:00:00 2001 From: nolash Date: Wed, 14 Apr 2021 20:28:05 +0200 Subject: [PATCH] Add value to token data from giftto --- .../cic_eth/runnable/daemons/filters/callback.py | 15 +++++++++------ apps/cic-eth/docker/Dockerfile | 2 +- apps/cic-eth/requirements.txt | 4 ++-- apps/contract-migration/docker/Dockerfile | 4 ++-- apps/contract-migration/scripts/requirements.txt | 4 ++-- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py index 630988a8..ed544de0 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py @@ -76,6 +76,10 @@ class CallbackFilter(SyncFilter): r = conn.do(o) transfer_data['token_address'] = add_0x(c.parse_token(r)) + o = c.amount(faucet_contract, sender_address=self.caller_address) + r = conn.do(o) + transfer_data['amount'] = add_0x(c.parse_amount(r)) + return ('tokengift', transfer_data) @@ -140,12 +144,11 @@ class CallbackFilter(SyncFilter): def filter(self, conn, block, tx, db_session=None): transfer_data = None transfer_type = None - (transfer_type, transfer_data) = self.parse_data(tx, conn) -# try: -# (transfer_type, transfer_data) = self.parse_data(tx, conn) -# except TypeError: -# logg.debug('invalid method data length for tx {}'.format(tx.hash)) -# return + try: + (transfer_type, transfer_data) = self.parse_data(tx, conn) + except TypeError: + logg.debug('invalid method data length for tx {}'.format(tx.hash)) + return if len(tx.payload) < 8: logg.debug('callbacks filter data length not sufficient for method signature in tx {}, skipping'.format(tx.hash)) diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index dcbd87b2..4b6c788a 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -29,7 +29,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip # python merge_requirements.py | tee merged_requirements.txt #RUN cd cic-base && \ # pip install $pip_extra_index_url_flag -r ./merged_requirements.txt -RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2a72 +RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2a76 COPY cic-eth/scripts/ scripts/ COPY cic-eth/setup.cfg cic-eth/setup.py ./ diff --git a/apps/cic-eth/requirements.txt b/apps/cic-eth/requirements.txt index 9d831a41..97848c39 100644 --- a/apps/cic-eth/requirements.txt +++ b/apps/cic-eth/requirements.txt @@ -1,4 +1,4 @@ -cic-base~=0.1.2a75 +cic-base~=0.1.2a76 celery==4.4.7 crypto-dev-signer~=0.4.14b2 confini~=0.3.6rc3 @@ -21,5 +21,5 @@ chainsyncer[sql]~=0.0.2a1 chainqueue~=0.0.1a7 pysha3==1.0.2 coincurve==15.0.0 -sarafu-faucet==0.0.2a27 +sarafu-faucet==0.0.2a28 potaahto~=0.0.1a1 diff --git a/apps/contract-migration/docker/Dockerfile b/apps/contract-migration/docker/Dockerfile index a35364ab..42d6102d 100644 --- a/apps/contract-migration/docker/Dockerfile +++ b/apps/contract-migration/docker/Dockerfile @@ -57,9 +57,9 @@ WORKDIR /home/grassroots USER grassroots ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433 -ARG cic_base_version=0.1.2a75 +ARG cic_base_version=0.1.2a76 ARG cic_eth_version=0.11.0b5 -ARG sarafu_faucet_version=0.0.2a27 +ARG sarafu_faucet_version=0.0.2a28 ARG cic_contracts_version=0.0.2a2 RUN pip install --user --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \ cic-eth==$cic_eth_version \ diff --git a/apps/contract-migration/scripts/requirements.txt b/apps/contract-migration/scripts/requirements.txt index f02621a6..599eeea3 100644 --- a/apps/contract-migration/scripts/requirements.txt +++ b/apps/contract-migration/scripts/requirements.txt @@ -1,5 +1,5 @@ -cic-base[full]==0.1.2a75 -sarafu-faucet==0.0.2a27 +cic-base[full]==0.1.2a76 +sarafu-faucet==0.0.2a28 cic-eth==0.11.0b5 cic-types==0.1.0a10 crypto-dev-signer==0.4.14b2