diff --git a/.circleci/config.yml b/.circleci/config.yml index c32b23cc5f..0d67ad645c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -193,8 +193,8 @@ jobs: - image: circleci/python:3.6-stretch environment: TOXENV: py36-integration-parity-ipc - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py36-integration-parity-http: <<: *parity_steps @@ -202,8 +202,8 @@ jobs: - image: circleci/python:3.6-stretch environment: TOXENV: py36-integration-parity-http - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py36-integration-parity-ws: <<: *parity_steps @@ -211,8 +211,8 @@ jobs: - image: circleci/python:3.6-stretch environment: TOXENV: py36-integration-parity-ws - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py36-integration-ethtester-pyevm: <<: *common @@ -292,8 +292,8 @@ jobs: - image: circleci/python:3.7-stretch environment: TOXENV: py37-integration-parity-ipc - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py37-integration-parity-http: <<: *parity_steps @@ -301,8 +301,8 @@ jobs: - image: circleci/python:3.7-stretch environment: TOXENV: py37-integration-parity-http - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py37-integration-parity-ws: <<: *parity_steps @@ -310,8 +310,8 @@ jobs: - image: circleci/python:3.7-stretch environment: TOXENV: py37-integration-parity-ws - PARITY_VERSION: v1.11.11 - PARITY_OS: debian + PARITY_VERSION: v2.3.5 + PARITY_OS: linux py37-integration-ethtester-pyevm: <<: *common diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 913e54e869..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,134 +0,0 @@ -sudo: required -language: python -dist: trusty -env: - global: - - GETH_BASE_INSTALL_PATH=$TRAVIS_BUILD_DIR/gethbin - - PARITY_BASE_INSTALL_PATH=$TRAVIS_BUILD_DIR/paritybin -matrix: - include: - # - # Python 3.5 testing - # - # go-ethereum-ipc v1.7.2 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-ipc" GETH_VERSION=v1.7.2 - # go-ethereum-http v1.7.2 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-http" GETH_VERSION=v1.7.2 - # go-ethereum-ws v1.7.2 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-ws" GETH_VERSION=v1.7.2 - # go-ethereum-ipc v1.8.1 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-ipc" GETH_VERSION=v1.8.1 - # go-ethereum-http v1.8.1 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-http" GETH_VERSION=v1.8.1 - # go-ethereum-ws v1.8.1 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-goethereum-ws" GETH_VERSION=v1.8.1 - # parity-ipc - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-parity-ipc" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # parity-http - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-parity-http" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # parity-ws - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-parity-ws" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # ENS - - python: "3.5" - env: TOX_POSARGS="-e py35-ens" - # core - - python: "3.5" - env: TOX_POSARGS="-e py35-core" - # eth-tester-pyethereum16 - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-ethtester" ETHEREUM_TESTER_CHAIN_BACKEND=eth_tester.backends.PyEthereum16Backend - # eth-tester-pyevm - - python: "3.5" - env: TOX_POSARGS="-e py35-integration-ethtester" ETHEREUM_TESTER_CHAIN_BACKEND=eth_tester.backends.PyEVMBackend - # - # Python 3.6 testing - # - # go-ethereum-ipc v1.7.2 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-ipc" GETH_VERSION=v1.7.2 - # go-ethereum-http v1.7.2 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-http" GETH_VERSION=v1.7.2 - # go-ethereum-ws v1.7.2 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-ws" GETH_VERSION=v1.7.2 - # go-ethereum-ipc v1.8.1 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-ipc" GETH_VERSION=v1.8.1 - # go-ethereum-http v1.8.1 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-http" GETH_VERSION=v1.8.1 - # go-ethereum-ws v1.8.1 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-goethereum-ws" GETH_VERSION=v1.8.1 - # parity-ipc - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-parity-ipc" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # parity-http - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-parity-http" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # parity-ws - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-parity-ws" PARITY_VERSION=v1.10.4 PARITY_OS=debian - # ENS - - python: "3.6" - env: TOX_POSARGS="-e py36-ens" - # lint - - python: "3.6" - env: TOX_POSARGS="-e lint" - # doctest - - python: "3.6" - env: TOX_POSARGS="-e doctest" - # core - - python: "3.6" - env: TOX_POSARGS="-e py36-core" - # eth-tester-pyethereum16 - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-ethtester" ETHEREUM_TESTER_CHAIN_BACKEND=eth_tester.backends.PyEthereum16Backend - # eth-tester-pyevm - - python: "3.6" - env: TOX_POSARGS="-e py36-integration-ethtester" ETHEREUM_TESTER_CHAIN_BACKEND=eth_tester.backends.PyEVMBackend -cache: - - pip: true - - directories: - - $HOME/.ethash/ - - $GETH_BASE_INSTALL_PATH/ - - $PARITY_BASE_INSTALL_PATH/ -before_install: - - if [ -n "$GETH_VERSION" ]; then mkdir -p $HOME/.ethash; fi -install: - - travis_retry pip install pip setuptools --upgrade - - travis_retry pip install tox - - if [ -n "$PARITY_VERSION" ]; then travis_retry pip install eth_utils tqdm requests eth-hash[pycryptodome]; fi -before_script: - - python --version - - pip --version - - if [ -n "$GETH_VERSION" ]; then travis_retry pip install py-geth>=1.10.1; fi - - if [ -n "$GETH_VERSION" ]; then export GOROOT=/usr/lib/go-1.7; fi - - if [ -n "$GETH_VERSION" ]; then export GETH_BINARY="$GETH_BASE_INSTALL_PATH/geth-$GETH_VERSION/bin/geth"; fi - - if [ -n "$GETH_VERSION" ] && [ ! -e "$GETH_BINARY" ]; then travis_retry sudo add-apt-repository -y ppa:gophers/archive; fi - - if [ -n "$GETH_VERSION" ] && [ ! -e "$GETH_BINARY" ]; then travis_retry sudo apt-get update; fi - - if [ -n "$GETH_VERSION" ] && [ ! -e "$GETH_BINARY" ]; then travis_retry sudo apt-get install -y golang-1.7 build-essential; fi - - if [ -n "$GETH_VERSION" ] && [ ! -e "$GETH_BINARY" ]; then python -m geth.install $GETH_VERSION; fi - - if [ -n "$GETH_VERSION" ]; then $GETH_BINARY version; fi - - if [ -n "$GETH_VERSION" ]; then $GETH_BINARY makedag 0 $HOME/.ethash; fi - - if [ -n "$PARITY_VERSION" ]; then python tests/integration/parity/install_parity.py $PARITY_VERSION; fi - - pip freeze -script: - - tox $TOX_POSARGS -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/8210e0e2df3ad138a505 - on_success: change - on_failure: never - on_cancel: never diff --git a/docker-compose.yml b/docker-compose.yml index 55eac8ea98..c130de201a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: build: context: . environment: - PARITY_VERSION: v1.11.7 + PARITY_VERSION: v2.3.5 volumes: - .:/code command: tail -f /dev/null diff --git a/tests/integration/generate_fixtures/common.py b/tests/integration/generate_fixtures/common.py index 689a37a2c0..4a1e490f80 100644 --- a/tests/integration/generate_fixtures/common.py +++ b/tests/integration/generate_fixtures/common.py @@ -12,6 +12,10 @@ to_text, ) +from web3.exceptions import ( + TransactionNotFound, +) + COINBASE = '0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd' COINBASE_PK = '0x58d23b55bc9cdce1f18c2500f40ff4ab7245df9a89505e9b1fa4851f623d241d' @@ -33,7 +37,7 @@ "eip150Block": 0, "eip155Block": 10, "eip158Block": 10, - "eip160Block": 10 + "eip160Block": 10, }, "nonce": "0x0000000000000042", "alloc": { @@ -210,7 +214,10 @@ def mine_transaction_hash(web3, txn_hash): start_time = time.time() web3.geth.miner.start(1) while time.time() < start_time + 120: - receipt = web3.eth.getTransactionReceipt(txn_hash) + try: + receipt = web3.eth.getTransactionReceipt(txn_hash) + except TransactionNotFound: + continue if receipt is not None: web3.geth.miner.stop() return receipt @@ -221,7 +228,7 @@ def mine_transaction_hash(web3, txn_hash): def deploy_contract(web3, name, factory): - web3.personal.unlockAccount(web3.eth.coinbase, KEYFILE_PW) + web3.geth.personal.unlockAccount(web3.eth.coinbase, KEYFILE_PW) deploy_txn_hash = factory.constructor().transact({'from': web3.eth.coinbase}) print('{0}_CONTRACT_DEPLOY_HASH: '.format(name.upper()), deploy_txn_hash) deploy_receipt = mine_transaction_hash(web3, deploy_txn_hash) diff --git a/tests/integration/generate_fixtures/go_ethereum.py b/tests/integration/generate_fixtures/go_ethereum.py index 0e691565b6..7ae49321d8 100644 --- a/tests/integration/generate_fixtures/go_ethereum.py +++ b/tests/integration/generate_fixtures/go_ethereum.py @@ -117,7 +117,7 @@ def setup_chain_state(web3): # # Block with Transaction # - web3.personal.unlockAccount(coinbase, common.KEYFILE_PW) + web3.geth.personal.unlockAccount(coinbase, common.KEYFILE_PW) web3.geth.miner.start(1) mined_txn_hash = web3.eth.sendTransaction({ 'from': coinbase, diff --git a/tests/integration/generate_fixtures/parity.py b/tests/integration/generate_fixtures/parity.py index 594dde778c..ffb6d6eab4 100644 --- a/tests/integration/generate_fixtures/parity.py +++ b/tests/integration/generate_fixtures/parity.py @@ -31,22 +31,22 @@ "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "homesteadTransition": 0, - "eip150Transition": 0, - "eip160Transition": 10, - "eip161abcTransition": 10, - "eip161dTransition": 10 } } }, "params": { "gasLimitBoundDivisor": "0x0400", "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2", + "eip150Transition": 0, "eip155Transition": 10, + "eip160Transition": 10, + "eip161abcTransition": 10, + "eip161dTransition": 10, "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID": "0x539", - "eip98Transition": "0x7fffffffffffffff" + "eip98Transition": "0x7fffffffffffffff", }, "genesis": { "seal": { @@ -107,13 +107,12 @@ def get_parity_process( '--base-path', datadir, '--ipc-path', ipc_path, '--no-ws', - '--no-ui', '--no-warp', '--chain', chain_config_file_path, '--keys-path', keys_path, - '--rpcapi', 'all', - '--rpcport', parity_port, - # '--author', common.COINBASE[2:], + '--jsonrpc-apis', 'all', + '--jsonrpc-port', parity_port, + '--fat-db', 'on', ) print(' '.join(run_command)) try: @@ -145,18 +144,18 @@ def parity_export_blocks_process( 'blocks', os.path.join(datadir, 'blocks_export.rlp'), '--base-path', datadir, '--no-ws', - '--no-ui', '--no-warp', '--chain', chain_config_file_path, - '--rpcapi', 'all', - '--rpcport', parity_port, - # '--author', common.COINBASE[2:], + '--jsonrpc-apis', 'all', + '--jsonrpc-port', parity_port, + '--fat-db', 'on', ) print(' '.join(run_command)) try: proc = common.get_process(run_command) yield proc finally: + time.sleep(10) common.kill_proc_gracefully(proc) output, errors = proc.communicate() print( @@ -241,6 +240,7 @@ def generate_parity_fixture(destination_dir): time.sleep(10) connect_nodes(web3, web3_geth) + time.sleep(10) wait_for_chain_sync(web3, fixture_block_count) static_data = { @@ -262,7 +262,7 @@ def generate_parity_fixture(destination_dir): def connect_nodes(w3_parity, w3_secondary): parity_peers = w3_parity.parity.netPeers() parity_enode = w3_parity.parity.enode() - secondary_node_info = w3_secondary.geth.admin.nodeInfo + secondary_node_info = w3_secondary.geth.admin.nodeInfo() if secondary_node_info['id'] not in (node.get('id', tuple()) for node in parity_peers['peers']): w3_secondary.geth.admin.addPeer(parity_enode) diff --git a/tests/integration/parity-187-fixture/blocks_export.rlp b/tests/integration/parity-187-fixture/blocks_export.rlp deleted file mode 100644 index 02d12ccd4e..0000000000 Binary files a/tests/integration/parity-187-fixture/blocks_export.rlp and /dev/null differ diff --git a/tests/integration/parity-187-fixture/chain_config.json b/tests/integration/parity-187-fixture/chain_config.json deleted file mode 100644 index 61351ae8b7..0000000000 --- a/tests/integration/parity-187-fixture/chain_config.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "CrossClient", "dataDir": "CrossClient", "engine": {"Ethash": {"params": {"minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "homesteadTransition": 0, "eip150Transition": 0, "eip160Transition": 10, "eip161abcTransition": 10, "eip161dTransition": 10}}}, "params": {"gasLimitBoundDivisor": "0x0400", "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2", "eip155Transition": 10, "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID": "0x539", "eip98Transition": "0x7fffffffffffffff"}, "genesis": {"seal": {"ethereum": {"nonce": "0x0000000000000042", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"}}, "difficulty": "0x10000", "author": "0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535", "gasLimit": "0x1000000"}, "accounts": {"0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ecrecover", "pricing": {"linear": {"base": 3000, "word": 0}}}}, "0x12efdc31b1a8fa1a1e756dfd8a1601055c971e13": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "sha256", "pricing": {"linear": {"base": 60, "word": 12}}}}, "0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ripemd160", "pricing": {"linear": {"base": 600, "word": 120}}}}}} \ No newline at end of file diff --git a/tests/integration/parity-187-fixture/network/key b/tests/integration/parity-187-fixture/network/key deleted file mode 100644 index 72cfef2050..0000000000 --- a/tests/integration/parity-187-fixture/network/key +++ /dev/null @@ -1 +0,0 @@ -a439b91e6be75fc688f59b50757ba3b4b0dc454f69a4e2e233508447c331248e \ No newline at end of file diff --git a/tests/integration/parity-188-fixture/blocks_export.rlp b/tests/integration/parity-188-fixture/blocks_export.rlp deleted file mode 100644 index ff8c8ce507..0000000000 Binary files a/tests/integration/parity-188-fixture/blocks_export.rlp and /dev/null differ diff --git a/tests/integration/parity-188-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd b/tests/integration/parity-188-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd deleted file mode 100644 index 30f8e999e4..0000000000 --- a/tests/integration/parity-188-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd +++ /dev/null @@ -1 +0,0 @@ -{"address":"dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd","crypto":{"cipher":"aes-128-ctr","ciphertext":"52e06bc9397ea9fa2f0dae8de2b3e8116e92a2ecca9ad5ff0061d1c449704e98","cipherparams":{"iv":"aa5d0a5370ef65395c1a6607af857124"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"9fdf0764eb3645ffc184e166537f6fe70516bf0e34dc7311dea21f100f0c9263"},"mac":"4e0b51f42b865c15c485f4faefdd1f01a38637e5247f8c75ffe6a8c0eba856f6"},"id":"5a6124e0-10f1-4c1c-ae3e-d903eacb740a","version":3} \ No newline at end of file diff --git a/tests/integration/parity-188-fixture/keys/CrossClient/address_book.json b/tests/integration/parity-188-fixture/keys/CrossClient/address_book.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/tests/integration/parity-188-fixture/keys/CrossClient/address_book.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/tests/integration/parity-188-fixture/network/key b/tests/integration/parity-188-fixture/network/key deleted file mode 100644 index 15c3a3440a..0000000000 --- a/tests/integration/parity-188-fixture/network/key +++ /dev/null @@ -1 +0,0 @@ -cd6bb75fd99adf58a04b71afcf8b588469a6068cee7779592dcd81c13b709749 \ No newline at end of file diff --git a/tests/integration/parity-235-fixture/blocks_export.rlp b/tests/integration/parity-235-fixture/blocks_export.rlp new file mode 100644 index 0000000000..dcafdbd22a Binary files /dev/null and b/tests/integration/parity-235-fixture/blocks_export.rlp differ diff --git a/tests/integration/parity-188-fixture/chain_config.json b/tests/integration/parity-235-fixture/chain_config.json similarity index 80% rename from tests/integration/parity-188-fixture/chain_config.json rename to tests/integration/parity-235-fixture/chain_config.json index 61351ae8b7..bfbdfbf61c 100644 --- a/tests/integration/parity-188-fixture/chain_config.json +++ b/tests/integration/parity-235-fixture/chain_config.json @@ -1 +1 @@ -{"name": "CrossClient", "dataDir": "CrossClient", "engine": {"Ethash": {"params": {"minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "homesteadTransition": 0, "eip150Transition": 0, "eip160Transition": 10, "eip161abcTransition": 10, "eip161dTransition": 10}}}, "params": {"gasLimitBoundDivisor": "0x0400", "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2", "eip155Transition": 10, "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID": "0x539", "eip98Transition": "0x7fffffffffffffff"}, "genesis": {"seal": {"ethereum": {"nonce": "0x0000000000000042", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"}}, "difficulty": "0x10000", "author": "0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535", "gasLimit": "0x1000000"}, "accounts": {"0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ecrecover", "pricing": {"linear": {"base": 3000, "word": 0}}}}, "0x12efdc31b1a8fa1a1e756dfd8a1601055c971e13": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "sha256", "pricing": {"linear": {"base": 60, "word": 12}}}}, "0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ripemd160", "pricing": {"linear": {"base": 600, "word": 120}}}}}} \ No newline at end of file +{"name": "CrossClient", "dataDir": "CrossClient", "engine": {"Ethash": {"params": {"minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "homesteadTransition": 0}}}, "params": {"gasLimitBoundDivisor": "0x0400", "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2", "eip150Transition": 0, "eip155Transition": 10, "eip160Transition": 10, "eip161abcTransition": 10, "eip161dTransition": 10, "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID": "0x539", "eip98Transition": "0x7fffffffffffffff"}, "genesis": {"seal": {"ethereum": {"nonce": "0x0000000000000042", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"}}, "difficulty": "0x10000", "author": "0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535", "gasLimit": "0x1000000"}, "accounts": {"0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ecrecover", "pricing": {"linear": {"base": 3000, "word": 0}}}}, "0x12efdc31b1a8fa1a1e756dfd8a1601055c971e13": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "sha256", "pricing": {"linear": {"base": 60, "word": 12}}}}, "0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6": {"balance": "1000000000000000000000000000", "nonce": "0", "builtin": {"name": "ripemd160", "pricing": {"linear": {"base": 600, "word": 120}}}}}} \ No newline at end of file diff --git a/tests/integration/parity-187-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd b/tests/integration/parity-235-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd similarity index 100% rename from tests/integration/parity-187-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd rename to tests/integration/parity-235-fixture/keys/CrossClient/UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd diff --git a/tests/integration/parity-187-fixture/keys/CrossClient/address_book.json b/tests/integration/parity-235-fixture/keys/CrossClient/address_book.json similarity index 100% rename from tests/integration/parity-187-fixture/keys/CrossClient/address_book.json rename to tests/integration/parity-235-fixture/keys/CrossClient/address_book.json diff --git a/tests/integration/parity-235-fixture/network/key b/tests/integration/parity-235-fixture/network/key new file mode 100644 index 0000000000..11c0558bb3 --- /dev/null +++ b/tests/integration/parity-235-fixture/network/key @@ -0,0 +1 @@ +9cf55e75533a2380bcb2fbb4ff6f5ae86e7d303a331caf099946207bbe53fb21 \ No newline at end of file diff --git a/tests/integration/parity/common.py b/tests/integration/parity/common.py index 3612d3a32e..5cf5848df7 100644 --- a/tests/integration/parity/common.py +++ b/tests/integration/parity/common.py @@ -10,6 +10,9 @@ ParityPersonalModuleTest, Web3ModuleTest, ) +from web3._utils.module_testing.eth_module import ( + UNKNOWN_ADDRESS, +) # some tests appear flaky with Parity v1.10.x MAX_FLAKY_RUNS = 3 @@ -17,7 +20,7 @@ class ParityWeb3ModuleTest(Web3ModuleTest): def _check_web3_clientVersion(self, client_version): - assert client_version.startswith('Parity/') + assert client_version.startswith('Parity-Ethereum/') class ParityEthModuleTest(EthModuleTest): @@ -119,6 +122,44 @@ def test_eth_call_old_contract_state(self, web3, math_contract, unlocked_account if pending_call_result not in range(1, MAX_FLAKY_RUNS + 1): raise AssertionError("pending call result was %d!" % pending_call_result) + def test_eth_getLogs_without_logs(self, web3, block_with_txn_with_log): + # Test with block range + + filter_params = { + "fromBlock": 0, + "toBlock": block_with_txn_with_log['number'] - 1, + } + result = web3.eth.getLogs(filter_params) + assert len(result) == 0 + + # the range is wrong, parity returns error message + filter_params = { + "fromBlock": block_with_txn_with_log['number'], + "toBlock": block_with_txn_with_log['number'] - 1, + } + with pytest.raises(ValueError): + web3.eth.getLogs(filter_params) + + # Test with `address` + + # filter with other address + filter_params = { + "fromBlock": 0, + "address": UNKNOWN_ADDRESS, + } + result = web3.eth.getLogs(filter_params) + assert len(result) == 0 + + # Test with multiple `address` + + # filter with other address + filter_params = { + "fromBlock": 0, + "address": [UNKNOWN_ADDRESS, UNKNOWN_ADDRESS], + } + result = web3.eth.getLogs(filter_params) + assert len(result) == 0 + class ParityTraceModuleTest(TraceModuleTest): def test_list_storage_keys_no_support(self, web3, emitter_contract_address): diff --git a/tests/integration/parity/conftest.py b/tests/integration/parity/conftest.py index 8db497ba3e..c5fbdb6d39 100644 --- a/tests/integration/parity/conftest.py +++ b/tests/integration/parity/conftest.py @@ -18,36 +18,21 @@ KEYFILE_PW = 'web3py-test' -PARITY_1_8_8_FIXTURE = { - 'datadir': 'parity-188-fixture', - 'coinbase': 'dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd', - 'block_hash_with_log': '0xf9aea1029be4b93e30313814d297a2da0c5b204856c4de16c21b87ebaf8f20c5', - 'block_with_txn_hash': '0xf460bffb4ea46c5ec26e2062911f24af3349cd1c895fdb009b4d544569d22a49', - 'emitter_address': '0x4aA591a07989b4F810E2F5cE97e769D60710f168', - 'emitter_deploy_txn_hash': '0xa81e903e9953758c8da5aaae66451ff909edd7bd6aefc3ebeab1e709e3229bcc', - 'empty_block_hash': '0x3b32b087d4fc72091be4fa6b44fc2a78289a15c53fba3454755dd9eaf39f0481', - 'keyfile_pw': 'web3py-test', - 'math_address': '0xd794C821fCCFF5D96F5Db44af7e29977630A9dc2', - 'math_deploy_txn_hash': '0x03cc47c8f58608576187825aed01c4fc64786f1172d182d432336881a75a0fa3', - 'mined_txn_hash': '0x9839fde5fce7f0ed29b49a687d4f7630076069e65c2e1df87ffab9b2844d3899', - 'raw_txn_account': '0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6', - 'txn_hash_with_log': '0x26bad3318b3466833f96d04ac9ba46fbbce11c15be2f83c9fe0b5dc15b2646cd' -} -PARITY_1_8_7_FIXTURE = { - 'datadir': 'parity-187-fixture', +PARITY_2_3_5_FIXTURE = { + 'datadir': 'parity-235-fixture', 'coinbase': 'dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd', - 'block_hash_with_log': '0x342e12ab6d24d7fb1d774a6b47cd2cc04430a3295bee5662d5a1a0b766480031', - 'block_with_txn_hash': '0xa866266a5a348948c38855cc6e990093b35a3d2c43fdddfe3b1259c9c3fc7404', + 'block_hash_with_log': '0x8633d4b5497e5a7e81356cbe3f0a49b63fb2020ddeb6c8c27bcecec541055a3b', + 'block_with_txn_hash': '0xf474a7b80cb6cb2b728b290ce6a0893f5f85d2998c4b252d73300da56de205de', 'emitter_address': '0x4aA591a07989b4F810E2F5cE97e769D60710f168', - 'emitter_deploy_txn_hash': '0xa81e903e9953758c8da5aaae66451ff909edd7bd6aefc3ebeab1e709e3229bcc', - 'empty_block_hash': '0xbcb2826e4376c23e66750607af72965f177f93b39e5024be259e6b0ff4f95e9d', + 'emitter_deploy_txn_hash': '0xa3e3838c01e73dafc7fc9d7e4e6c97523445006ae125ad1085abcf065feed382', + 'empty_block_hash': '0xc46c025ae50a970408a429a5a2baa65f056a173ff1dae0cab4b490d2ee94413f', 'keyfile_pw': 'web3py-test', 'math_address': '0xd794C821fCCFF5D96F5Db44af7e29977630A9dc2', - 'math_deploy_txn_hash': '0x03cc47c8f58608576187825aed01c4fc64786f1172d182d432336881a75a0fa3', - 'mined_txn_hash': '0x9839fde5fce7f0ed29b49a687d4f7630076069e65c2e1df87ffab9b2844d3899', + 'math_deploy_txn_hash': '0xb680f86c00d69484ce68b4d3932c27c4e858c91d6ba8a27f8c499006fe4ced4a', + 'mined_txn_hash': '0x6401f455c01f9eb79fa672a4d24cc7cbbe3891e89eea8db8be39969dc9c480bc', 'raw_txn_account': '0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6', - 'txn_hash_with_log': '0x26bad3318b3466833f96d04ac9ba46fbbce11c15be2f83c9fe0b5dc15b2646cd' + 'txn_hash_with_log': '0xf6ffb7387cd0288cd1db1b1e368e7d4a21bc6e70fd2ef0e9af41f6c32b9e2cc7' } @@ -72,12 +57,7 @@ def get_parity_version(parity_binary): @pytest.fixture(scope="module") def parity_fixture_data(parity_binary): - if os.path.basename(parity_binary) == 'parity-1_8_7': - return PARITY_1_8_7_FIXTURE - elif os.path.basename(parity_binary) == 'parity-1_8_8': - return PARITY_1_8_8_FIXTURE - else: - return PARITY_1_8_7_FIXTURE + return PARITY_2_3_5_FIXTURE @pytest.fixture(scope='module') diff --git a/tests/integration/parity/install_parity.py b/tests/integration/parity/install_parity.py index 9eda35e01e..f223303396 100644 --- a/tests/integration/parity/install_parity.py +++ b/tests/integration/parity/install_parity.py @@ -16,14 +16,10 @@ URI_QUERY_URL = "https://vanity-service.parity.io/parity-binaries" BASE_BIN_PATH = "~/.parity-bin" VERSION_STRINGS = { - "v1.8.7": "1_8_7", - "v1.8.8": "1_8_8", - "v1.9.1": "1_9_1", - "v1.10.4": "1_10_4", - "v1.11.11": "1_11_11", + "v2.3.5": "2_3_5", } ARCHITECTURE = 'x86_64' -OS = os.getenv('PARITY_OS', 'debian') +OS = os.getenv('PARITY_OS', 'linux') @toolz.curry @@ -57,7 +53,7 @@ def get_binary_uri(releases_json): def get_executable_path(version_string): identifier = VERSION_STRINGS[version_string] base_path = os.environ.get('PARITY_BASE_INSTALL_PATH', BASE_BIN_PATH) - path = os.path.join(base_path, 'parity-{0}'.format(identifier)) + path = os.path.join(base_path, f'parity-{identifier}') return os.path.expanduser(path) @@ -66,7 +62,6 @@ def install_parity(version_string): raise ValueError("{0} is not an accepted version identifier.") path = get_executable_path(version_string) - get_uri = toolz.functoolz.compose( get_binary_uri, get_parity_release_json) diff --git a/tox.ini b/tox.ini index f032666338..d368a5adf8 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,6 @@ passenv = PARITY_BINARY PARITY_VERSION PARITY_OS - TRAVIS_BUILD_DIR GOROOT GOPATH basepython =