This repository was archived by the owner on May 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +22
-29
lines changed Expand file tree Collapse file tree 8 files changed +22
-29
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ install:
30
30
- travis_retry python setup.py install
31
31
- travis_retry pip install -r dev_requirements.txt
32
32
script :
33
- - make lint-minimal
34
- - make test-minimal
35
33
# XXX: For now we're only performing minimal CI checks as most tests are
36
34
# broken. Tests will be individually added here as they're fixed.
35
+ - make lint-minimal
36
+ - make test-passing
37
37
# - if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi;
38
38
# - tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py
39
39
# - tox -e $TOX_ENV -- ethereum/tests/test_vm.py
Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ lint-minimal:
45
45
test :
46
46
py.test --tb=no ethereum/tests/
47
47
48
- test-minimal :
49
- py.test ethereum/tests/test_abi.py ethereum/tests/test_bloom.py ethereum/tests/test_chain.py ethereum/tests/test_compress.py ethereum/tests/test_db.py ethereum/tests/test_difficulty.py ethereum/tests/test_opcodes.py ethereum/tests/test_trie_next_prev.py ethereum/tests/test_utils.py
48
+ test-passing :
49
+ py.test ethereum/tests/test_abi.py ethereum/tests/test_bloom.py ethereum/tests/test_chain.py ethereum/tests/test_compress.py ethereum/tests/test_db.py ethereum/tests/test_difficulty.py ethereum/tests/test_opcodes.py ethereum/tests/test_trie_next_prev.py ethereum/tests/test_genesis.py ethereum/tests/test_serialization.py ethereum/tests/test_trie.py
50
+
51
+ test-failing :
52
+ py.test ethereum/tests/test_blockstransactions.py ethereum/tests/test_transactions.py ethereum/tests/test_keys.py ethereum/tests/test_state.py ethereum/tests/test_contracts.py ethereum/tests/test_tester.py
50
53
51
54
testnovm :
52
55
py.test --tb=no ethereum/tests/ --ignore=ethereum/tests/test_vm.py
Original file line number Diff line number Diff line change 1
1
import os
2
2
import pytest
3
3
import json
4
- import ethereum .testutils as testutils
5
- from ethereum .testutils import fixture_to_bytes
4
+ from ethereum .tools import testutils
6
5
import ethereum .utils as utils
7
6
from ethereum .utils import encode_hex
8
7
from ethereum .tests .utils import new_env
@@ -27,7 +26,7 @@ def genesis_fixture():
27
26
# FIXME: assert that link is uptodate
28
27
for k in ('genesis_rlp_hex' , 'genesis_state_root' , 'genesis_hash' ):
29
28
assert k in genesis_fixture
30
- return fixture_to_bytes ( genesis_fixture )
29
+ return genesis_fixture
31
30
32
31
33
32
@pytest .mark .xfail # code not in sync with genesis fixtures
Original file line number Diff line number Diff line change 1
1
import rlp
2
- from ethereum import tester , block
2
+ from ethereum .tools import tester
3
+ from ethereum import block
3
4
import pytest
4
5
5
6
@@ -24,5 +25,5 @@ def test_returnten():
24
25
open (filename , 'w' ).write (mul2_code )
25
26
c = s .contract (returnten_code )
26
27
s .send (tester .k0 , c , 0 )
27
- b2 = rlp .decode (rlp .encode (s .block ), blocks .Block , env = s .env )
28
+ b2 = rlp .decode (rlp .encode (s .block ), block .Block , env = s .env )
28
29
assert rlp .encode (b2 ) == rlp .encode (s .block )
Original file line number Diff line number Diff line change 4
4
5
5
import pytest
6
6
7
- from ethereum .tester import state , ABIContract
8
- from ethereum ._solidity import (
7
+ from ethereum .tools . tester import Chain , ABIContract
8
+ from ethereum .tools . _solidity import (
9
9
get_solidity ,
10
10
compile_file ,
11
11
solidity_get_contract_data ,
18
18
@pytest .mark .skipif (not SOLIDITY_AVAILABLE , reason = 'solc compiler not available' )
19
19
def test_abicontract_interface ():
20
20
""" Test for issue #370. """
21
- tester_state = state ()
21
+ tester_state = Chain ()
22
22
23
23
contract_path = path .join (CONTRACTS_DIR , 'simple_contract.sol' )
24
24
contract_name = 'Simple'
@@ -28,18 +28,15 @@ def test_abicontract_interface():
28
28
contract_path ,
29
29
contract_name ,
30
30
)
31
- simple_address = tester_state .evm (simple_data ['bin' ])
31
+ simple_address = tester_state .contract (simple_data ['bin' ])
32
32
33
33
# ABIContract class must accept json_abi
34
34
abi_json = json .dumps (simple_data ['abi' ]).encode ('utf-8' )
35
35
36
36
abi = ABIContract (
37
- _state = tester_state ,
37
+ _chain = tester_state ,
38
38
_abi = abi_json ,
39
39
address = simple_address ,
40
- listen = False ,
41
- log_listener = None ,
42
- default_key = None ,
43
40
)
44
41
45
42
assert abi .test () == 1 # pylint: disable=no-member
Original file line number Diff line number Diff line change 2
2
import ethereum .utils as utils
3
3
import rlp
4
4
from rlp .utils import decode_hex , encode_hex , str_to_bytes
5
- from ethereum .utils import encode_hex
6
- import ethereum .testutils as testutils
7
- from ethereum .testutils import fixture_to_bytes
8
- from ethereum .state_transition import config_fork_specific_validation
5
+ from ethereum .tools import testutils
6
+ from ethereum .messages import config_fork_specific_validation
9
7
import ethereum .config as config
10
8
import sys
11
9
import json
19
17
# hint: use 'py.test' with the '-s' option to dump logs to the console
20
18
# configure_logging(':trace')
21
19
22
- encode_hex ('' )
23
-
24
20
25
21
def test_transaction (filename , testname , testdata ):
26
- testdata = fixture_to_bytes (testdata )
27
22
28
23
try :
29
24
rlpdata = decode_hex (testdata ["rlp" ][2 :])
Original file line number Diff line number Diff line change 1
1
import os
2
- import ethereum .testutils as testutils
3
2
import json
4
3
import ethereum .trie as trie
5
4
import ethereum .db as db
8
7
from rlp .utils import decode_hex
9
8
from ethereum .utils import encode_hex
10
9
from ethereum .abi import is_string
11
- from ethereum .testutils import fixture_to_bytes
12
10
logger = get_logger ()
13
11
14
12
# customize VM log output to your needs
@@ -32,7 +30,7 @@ def load_tests():
32
30
sub_fixture = json .load (open (os .path .join (testdir , f )))
33
31
for k , v in sub_fixture .items ():
34
32
fixture [f + "_" + k ] = v
35
- return fixture_to_bytes ( fixture )
33
+ return fixture
36
34
37
35
38
36
def run_test (name , pairs ):
Original file line number Diff line number Diff line change 1
1
import json
2
2
import sys
3
- import ethereum .testutils as testutils
3
+ from ethereum .tools import testutils
4
4
from ethereum .slogging import get_logger , configure_logging
5
5
logger = get_logger ()
6
6
# customize VM log output to your needs
11
11
12
12
13
13
def test_vm (filename , testname , testdata ):
14
- testutils .check_vm_test (testutils . fixture_to_bytes ( testdata ) )
14
+ testutils .check_vm_test (testdata )
15
15
16
16
17
17
def pytest_generate_tests (metafunc ):
You can’t perform that action at this time.
0 commit comments