Add value to token data from giftto

This commit is contained in:
nolash 2021-04-14 20:28:05 +02:00
parent bb930ce148
commit be32fc75fc
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 16 additions and 13 deletions

View File

@ -76,6 +76,10 @@ class CallbackFilter(SyncFilter):
r = conn.do(o) r = conn.do(o)
transfer_data['token_address'] = add_0x(c.parse_token(r)) 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) return ('tokengift', transfer_data)
@ -140,12 +144,11 @@ class CallbackFilter(SyncFilter):
def filter(self, conn, block, tx, db_session=None): def filter(self, conn, block, tx, db_session=None):
transfer_data = None transfer_data = None
transfer_type = None transfer_type = None
(transfer_type, transfer_data) = self.parse_data(tx, conn) try:
# try: (transfer_type, transfer_data) = self.parse_data(tx, conn)
# (transfer_type, transfer_data) = self.parse_data(tx, conn) except TypeError:
# except TypeError: logg.debug('invalid method data length for tx {}'.format(tx.hash))
# logg.debug('invalid method data length for tx {}'.format(tx.hash)) return
# return
if len(tx.payload) < 8: if len(tx.payload) < 8:
logg.debug('callbacks filter data length not sufficient for method signature in tx {}, skipping'.format(tx.hash)) logg.debug('callbacks filter data length not sufficient for method signature in tx {}, skipping'.format(tx.hash))

View File

@ -29,7 +29,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip
# python merge_requirements.py | tee merged_requirements.txt # python merge_requirements.py | tee merged_requirements.txt
#RUN cd cic-base && \ #RUN cd cic-base && \
# pip install $pip_extra_index_url_flag -r ./merged_requirements.txt # 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/scripts/ scripts/
COPY cic-eth/setup.cfg cic-eth/setup.py ./ COPY cic-eth/setup.cfg cic-eth/setup.py ./

View File

@ -1,4 +1,4 @@
cic-base~=0.1.2a75 cic-base~=0.1.2a76
celery==4.4.7 celery==4.4.7
crypto-dev-signer~=0.4.14b2 crypto-dev-signer~=0.4.14b2
confini~=0.3.6rc3 confini~=0.3.6rc3
@ -21,5 +21,5 @@ chainsyncer[sql]~=0.0.2a1
chainqueue~=0.0.1a7 chainqueue~=0.0.1a7
pysha3==1.0.2 pysha3==1.0.2
coincurve==15.0.0 coincurve==15.0.0
sarafu-faucet==0.0.2a27 sarafu-faucet==0.0.2a28
potaahto~=0.0.1a1 potaahto~=0.0.1a1

View File

@ -57,9 +57,9 @@ WORKDIR /home/grassroots
USER grassroots USER grassroots
ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433 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 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 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 \ RUN pip install --user --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \
cic-eth==$cic_eth_version \ cic-eth==$cic_eth_version \

View File

@ -1,5 +1,5 @@
cic-base[full]==0.1.2a75 cic-base[full]==0.1.2a76
sarafu-faucet==0.0.2a27 sarafu-faucet==0.0.2a28
cic-eth==0.11.0b5 cic-eth==0.11.0b5
cic-types==0.1.0a10 cic-types==0.1.0a10
crypto-dev-signer==0.4.14b2 crypto-dev-signer==0.4.14b2