From c44439bd903db15d83a6f82f2055e23a8a04994b Mon Sep 17 00:00:00 2001 From: Louis Holbrook Date: Wed, 19 May 2021 15:11:08 +0000 Subject: [PATCH] Fix outdated module names in cic-eth tests --- apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py | 4 +++- apps/cic-eth/tests/conftest.py | 2 +- apps/cic-eth/tests/filters/test_callback_filter.py | 6 ++---- apps/cic-eth/tests/task/api/test_list.py | 2 +- apps/cic-eth/tests/task/test_task_account.py | 2 +- apps/cic-eth/tests/task/test_task_erc20.py | 2 +- apps/cic-eth/tests/unit/ext/test_address.py | 4 ++-- apps/cic-eth/tests/unit/ext/test_ext_tx.py | 2 +- 8 files changed, 12 insertions(+), 12 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 84b61671..4852ab65 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py @@ -72,7 +72,9 @@ class CallbackFilter(SyncFilter): #transfer_data['token_address'] = tx.inputs[0] faucet_contract = tx.inputs[0] - o = Faucet.token(faucet_contract, sender_address=self.caller_address) + c = Faucet(self.chain_spec) + + o = c.token(faucet_contract, sender_address=self.caller_address) r = conn.do(o) transfer_data['token_address'] = add_0x(c.parse_token(r)) diff --git a/apps/cic-eth/tests/conftest.py b/apps/cic-eth/tests/conftest.py index eca7cc8c..bc7a82bb 100644 --- a/apps/cic-eth/tests/conftest.py +++ b/apps/cic-eth/tests/conftest.py @@ -4,7 +4,7 @@ import sys import logging # external imports -from chainlib.eth.erc20 import ERC20 +from eth_erc20 import ERC20 # local imports from cic_eth.api import Api diff --git a/apps/cic-eth/tests/filters/test_callback_filter.py b/apps/cic-eth/tests/filters/test_callback_filter.py index 0edca810..7f0437bc 100644 --- a/apps/cic-eth/tests/filters/test_callback_filter.py +++ b/apps/cic-eth/tests/filters/test_callback_filter.py @@ -14,9 +14,9 @@ from chainlib.eth.tx import ( Tx, ) from chainlib.eth.block import Block -from chainlib.eth.erc20 import ERC20 +from eth_erc20 import ERC20 from sarafu_faucet import MinterFaucet -from eth_accounts_index import AccountRegistry +from eth_accounts_index.registry import AccountRegistry from potaahto.symbols import snake_and_camel from hexathon import add_0x @@ -26,7 +26,6 @@ from cic_eth.runnable.daemons.filters.callback import CallbackFilter logg = logging.getLogger() -@pytest.mark.skip() def test_transfer_tx( default_chain_spec, init_database, @@ -66,7 +65,6 @@ def test_transfer_tx( assert transfer_type == 'transfer' -@pytest.mark.skip() def test_transfer_from_tx( default_chain_spec, init_database, diff --git a/apps/cic-eth/tests/task/api/test_list.py b/apps/cic-eth/tests/task/api/test_list.py index 0a452396..a861a42b 100644 --- a/apps/cic-eth/tests/task/api/test_list.py +++ b/apps/cic-eth/tests/task/api/test_list.py @@ -4,7 +4,7 @@ import logging # external imports import pytest from chainlib.eth.nonce import RPCNonceOracle -from chainlib.eth.erc20 import ERC20 +from eth_erc20 import ERC20 from chainlib.eth.tx import receipt # local imports diff --git a/apps/cic-eth/tests/task/test_task_account.py b/apps/cic-eth/tests/task/test_task_account.py index 010f0e51..a384babb 100644 --- a/apps/cic-eth/tests/task/test_task_account.py +++ b/apps/cic-eth/tests/task/test_task_account.py @@ -9,7 +9,7 @@ import celery from chainlib.connection import RPCConnection from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.tx import receipt -from eth_accounts_index import AccountRegistry +from eth_accounts_index.registry import AccountRegistry from hexathon import strip_0x from chainqueue.db.enum import StatusEnum from chainqueue.db.models.otx import Otx diff --git a/apps/cic-eth/tests/task/test_task_erc20.py b/apps/cic-eth/tests/task/test_task_erc20.py index c202bded..d0024278 100644 --- a/apps/cic-eth/tests/task/test_task_erc20.py +++ b/apps/cic-eth/tests/task/test_task_erc20.py @@ -4,7 +4,7 @@ import logging # external imports import pytest import celery -from chainlib.eth.erc20 import ERC20 +from eth_erc20 import ERC20 from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.tx import ( receipt, diff --git a/apps/cic-eth/tests/unit/ext/test_address.py b/apps/cic-eth/tests/unit/ext/test_address.py index 332af060..2a768928 100644 --- a/apps/cic-eth/tests/unit/ext/test_address.py +++ b/apps/cic-eth/tests/unit/ext/test_address.py @@ -3,7 +3,7 @@ from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.tx import ( receipt, ) -from eth_address_declarator import AddressDeclarator +from eth_address_declarator import Declarator from hexathon import add_0x # local imports @@ -23,7 +23,7 @@ def test_translate( nonce_oracle = RPCNonceOracle(contract_roles['CONTRACT_DEPLOYER'], eth_rpc) - c = AddressDeclarator(default_chain_spec, signer=eth_signer, nonce_oracle=nonce_oracle) + c = Declarator(default_chain_spec, signer=eth_signer, nonce_oracle=nonce_oracle) description = 'alice'.encode('utf-8').ljust(32, b'\x00').hex() (tx_hash_hex, o) = c.add_declaration(address_declarator, contract_roles['CONTRACT_DEPLOYER'], agent_roles['ALICE'], add_0x(description)) diff --git a/apps/cic-eth/tests/unit/ext/test_ext_tx.py b/apps/cic-eth/tests/unit/ext/test_ext_tx.py index 2fadca4b..90241865 100644 --- a/apps/cic-eth/tests/unit/ext/test_ext_tx.py +++ b/apps/cic-eth/tests/unit/ext/test_ext_tx.py @@ -8,7 +8,7 @@ from chainlib.eth.tx import ( count, receipt, ) -from chainlib.eth.erc20 import ERC20 +from eth_erc20 import ERC20 from chainlib.eth.nonce import RPCNonceOracle # local imports