From 5d3d773f41c7c8bf17894bce89cf3cad96b61ea4 Mon Sep 17 00:00:00 2001 From: Louis Holbrook Date: Sun, 2 May 2021 17:11:03 +0000 Subject: [PATCH] Update componens for chainlib erc20 split --- .../cic_cache/runnable/daemons/filters/erc20.py | 2 +- apps/cic-cache/requirements.txt | 6 +++--- apps/cic-cache/test_requirements.txt | 4 +--- apps/cic-eth/cic_eth/eth/account.py | 8 ++++---- apps/cic-eth/cic_eth/eth/erc20.py | 2 +- apps/cic-eth/cic_eth/ext/tx.py | 2 +- apps/cic-eth/docker/Dockerfile | 2 +- apps/cic-eth/requirements.txt | 16 ++++++++-------- apps/contract-migration/docker/Dockerfile | 10 ++++++---- apps/contract-migration/scripts/requirements.txt | 4 ++-- apps/contract-migration/seed_cic_eth.sh | 2 +- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/apps/cic-cache/cic_cache/runnable/daemons/filters/erc20.py b/apps/cic-cache/cic_cache/runnable/daemons/filters/erc20.py index 0dc618e0..e3628b40 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/filters/erc20.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/filters/erc20.py @@ -2,7 +2,6 @@ import logging # external imports -from chainlib.eth.erc20 import ERC20 from chainlib.eth.address import ( to_checksum_address, ) @@ -13,6 +12,7 @@ from cic_eth_registry.error import ( NotAContractError, ContractMismatchError, ) +from eth_erc20 import ERC20 # local imports from .base import TagSyncFilter diff --git a/apps/cic-cache/requirements.txt b/apps/cic-cache/requirements.txt index 82eb421a..9ea4ffd3 100644 --- a/apps/cic-cache/requirements.txt +++ b/apps/cic-cache/requirements.txt @@ -1,12 +1,12 @@ -cic-base~=0.1.2b6 +cic-base~=0.1.2b8 alembic==1.4.2 confini~=0.3.6rc3 uwsgi==2.0.19.1 moolb~=0.1.0 -cic-eth-registry~=0.5.5a1 +cic-eth-registry~=0.5.5a4 SQLAlchemy==1.3.20 semver==2.13.0 psycopg2==2.8.6 celery==4.4.7 redis==3.5.3 -chainsyncer[sql]~=0.0.2a2 +chainsyncer[sql]~=0.0.2a4 diff --git a/apps/cic-cache/test_requirements.txt b/apps/cic-cache/test_requirements.txt index dce79ea1..e0addadd 100644 --- a/apps/cic-cache/test_requirements.txt +++ b/apps/cic-cache/test_requirements.txt @@ -8,6 +8,4 @@ eth_tester==0.5.0b3 py-evm==0.3.0a20 web3==5.12.2 cic-eth-registry~=0.5.5a3 -giftable-erc20-token~=0.0.8a10 -eth-address-index~=0.1.1a10 -sarafu-faucet~=0.0.3a1 +cic-base[full]==0.1.2b8 diff --git a/apps/cic-eth/cic_eth/eth/account.py b/apps/cic-eth/cic_eth/eth/account.py index 10a0bde9..de2e7f0b 100644 --- a/apps/cic-eth/cic_eth/eth/account.py +++ b/apps/cic-eth/cic_eth/eth/account.py @@ -127,13 +127,13 @@ def register(self, account_address, chain_spec_dict, writer_address=None): if writer_address == ZERO_ADDRESS: session.close() raise RoleMissingError('call address for resgistering {}'.format(account_address)) - account_registry_address = registry.by_name('AccountRegistry', sender_address=call_address) + account_registry_address = registry.by_name('AccountsIndex', sender_address=call_address) # Generate and sign transaction rpc_signer = RPCConnection.connect(chain_spec, 'signer') nonce_oracle = CustodialTaskNonceOracle(writer_address, self.request.root_id, session=session) #, default_nonce) - gas_oracle = self.create_gas_oracle(rpc, AccountRegistry.gas) - account_registry = AccountRegistry(chain_spec, signer=rpc_signer, nonce_oracle=nonce_oracle, gas_oracle=gas_oracle) + gas_oracle = self.create_gas_oracle(rpc, AccountsIndex.gas) + account_registry = AccountsIndex(chain_spec, signer=rpc_signer, nonce_oracle=nonce_oracle, gas_oracle=gas_oracle) (tx_hash_hex, tx_signed_raw_hex) = account_registry.add(account_registry_address, writer_address, account_address, tx_format=TxFormat.RLP_SIGNED) rpc_signer.disconnect() @@ -338,7 +338,7 @@ def cache_account_data( chain_spec = ChainSpec.from_dict(chain_spec_dict) tx_signed_raw_bytes = bytes.fromhex(tx_signed_raw_hex[2:]) tx = unpack(tx_signed_raw_bytes, chain_spec) - tx_data = AccountRegistry.parse_add_request(tx['data']) + tx_data = AccountsIndex.parse_add_request(tx['data']) session = SessionBase.create_session() tx_cache = TxCache( diff --git a/apps/cic-eth/cic_eth/eth/erc20.py b/apps/cic-eth/cic_eth/eth/erc20.py index 71dfd6a2..4daf693b 100644 --- a/apps/cic-eth/cic_eth/eth/erc20.py +++ b/apps/cic-eth/cic_eth/eth/erc20.py @@ -6,7 +6,6 @@ import celery from chainlib.eth.constant import ZERO_ADDRESS from chainlib.chain import ChainSpec from chainlib.connection import RPCConnection -from chainlib.eth.erc20 import ERC20 from chainlib.eth.tx import ( TxFormat, unpack, @@ -16,6 +15,7 @@ from cic_eth_registry.erc20 import ERC20Token from hexathon import strip_0x from chainqueue.db.models.tx import TxCache from chainqueue.error import NotLocalTxError +from eth_erc20 import ERC20 # local imports from cic_eth.db.models.base import SessionBase diff --git a/apps/cic-eth/cic_eth/ext/tx.py b/apps/cic-eth/cic_eth/ext/tx.py index a5d59aa7..dc9f0ad2 100644 --- a/apps/cic-eth/cic_eth/ext/tx.py +++ b/apps/cic-eth/cic_eth/ext/tx.py @@ -14,13 +14,13 @@ from chainlib.eth.tx import ( ) from chainlib.eth.block import block_by_number from chainlib.eth.contract import abi_decode_single -from chainlib.eth.erc20 import ERC20 from hexathon import strip_0x from cic_eth_registry import CICRegistry from cic_eth_registry.erc20 import ERC20Token from chainqueue.db.models.otx import Otx from chainqueue.db.enum import StatusEnum from chainqueue.query import get_tx_cache +from eth_erc20 import ERC20 # local imports from cic_eth.queue.time import tx_times diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index 23fd1b6f..163b3016 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.2b6 +RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2b8 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 aa6e69fc..7b57e8c3 100644 --- a/apps/cic-eth/requirements.txt +++ b/apps/cic-eth/requirements.txt @@ -1,24 +1,24 @@ -cic-base==0.1.2b6 +cic-base==0.1.2b8 celery==4.4.7 crypto-dev-signer~=0.4.14b3 confini~=0.3.6rc3 -cic-eth-registry~=0.5.5a2 +cic-eth-registry~=0.5.5a4 redis==3.5.3 alembic==1.4.2 websockets==8.1 requests~=2.24.0 -eth_accounts_index~=0.0.11a10 -erc20-transfer-authorization~=0.3.1a5 +eth_accounts_index~=0.0.11a11 +erc20-transfer-authorization~=0.3.1a6 uWSGI==2.0.19.1 semver==2.13.0 websocket-client==0.57.0 moolb~=0.1.1b2 -eth-address-index~=0.1.1a10 -chainlib~=0.0.2b1 +eth-address-index~=0.1.1a11 +chainlib~=0.0.3a1 hexathon~=0.0.1a7 -pysha3==1.0.2 -chainsyncer[sql]~=0.0.2a2 +chainsyncer[sql]~=0.0.2a4 chainqueue~=0.0.2a2 sarafu-faucet==0.0.3a1 coincurve==15.0.0 +sarafu-faucet==0.0.3a2 potaahto~=0.0.1a1 diff --git a/apps/contract-migration/docker/Dockerfile b/apps/contract-migration/docker/Dockerfile index e1e1e3d3..1b0ef49f 100644 --- a/apps/contract-migration/docker/Dockerfile +++ b/apps/contract-migration/docker/Dockerfile @@ -54,11 +54,13 @@ ENV PATH $NVM_DIR/versions/node//v$NODE_VERSION/bin:$PATH ARG pip_extra_args="" ARG pip_index_url=https://pypi.org/simple ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433 -ARG cic_base_version=0.1.2b6 +ARG cic_base_version=0.1.2b8 ARG cic_eth_version=0.11.0b12 -ARG sarafu_faucet_version=0.0.3a1 -ARG sarafu_token_version=0.0.1a7 -RUN pip install --user $pip_extra_args --index-url $pip_index_url --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \ +ARG sarafu_token_version=0.0.1a8 +ARG sarafu_faucet_version=0.0.3a2 +RUN pip install --user --index-url https://pypi.org/simple --extra-index-url $pip_extra_index_url \ + cic-base[full_graph]==$cic_base_version \ + cic-eth==$cic_eth_version \ sarafu-faucet==$sarafu_faucet_version \ sarafu-token==$sarafu_token_version \ cic-eth==$cic_eth_version diff --git a/apps/contract-migration/scripts/requirements.txt b/apps/contract-migration/scripts/requirements.txt index b4849c5a..92c179a7 100644 --- a/apps/contract-migration/scripts/requirements.txt +++ b/apps/contract-migration/scripts/requirements.txt @@ -1,5 +1,5 @@ -cic-base[full_graph]==0.1.2b6 -sarafu-faucet==0.0.3a1 +cic-base[full_graph]==0.1.2b8 +sarafu-faucet==0.0.3a2 cic-eth==0.11.0b12 cic-types==0.1.0a10 crypto-dev-signer==0.4.14b3 diff --git a/apps/contract-migration/seed_cic_eth.sh b/apps/contract-migration/seed_cic_eth.sh index 5db1e428..fee0d3e5 100755 --- a/apps/contract-migration/seed_cic_eth.sh +++ b/apps/contract-migration/seed_cic_eth.sh @@ -99,7 +99,7 @@ export DEV_ETH_SARAFU_TOKEN_ADDRESS=$DEV_ETH_RESERVE_ADDRESS # Transfer tokens to gifter address >&2 echo "transfer sarafu tokens to token gifter address" ->&2 eth-transfer -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER --token-address $DEV_RESERVE_ADDRESS -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER ${token_amount:0:-1} +>&2 erc20-transfer -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER --token-address $DEV_RESERVE_ADDRESS -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER ${token_amount:0:-1} #echo -n 0 > $init_level_file