Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit e152213

Browse files
committed
Adjust test to new compiler versions
1 parent e8a432c commit e152213

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ethereum/tests/test_tester.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
import pytest
66

77
from ethereum.tester import state, ABIContract
8-
from ethereum._solidity import get_solidity, compile_file
8+
from ethereum._solidity import (
9+
get_solidity,
10+
compile_file,
11+
solidity_get_contract_data,
12+
)
913

1014
SOLIDITY_AVAILABLE = get_solidity() is not None
1115
CONTRACTS_DIR = path.join(path.dirname(__file__), 'contracts')
@@ -17,11 +21,17 @@ def test_abicontract_interface():
1721
tester_state = state()
1822

1923
contract_path = path.join(CONTRACTS_DIR, 'simple_contract.sol')
24+
contract_name = 'Simple'
2025
simple_compiled = compile_file(contract_path)
21-
simple_address = tester_state.evm(simple_compiled['Simple']['bin'])
26+
simple_data = solidity_get_contract_data(
27+
simple_compiled,
28+
contract_path,
29+
contract_name,
30+
)
31+
simple_address = tester_state.evm(simple_data['bin'])
2232

2333
# ABIContract class must accept json_abi
24-
abi_json = json.dumps(simple_compiled['Simple']['abi']).encode('utf-8')
34+
abi_json = json.dumps(simple_data['abi']).encode('utf-8')
2535

2636
abi = ABIContract(
2737
_state=tester_state,

0 commit comments

Comments
 (0)