This repository was archived by the owner on May 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 5
5
import pytest
6
6
7
7
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
+ )
9
13
10
14
SOLIDITY_AVAILABLE = get_solidity () is not None
11
15
CONTRACTS_DIR = path .join (path .dirname (__file__ ), 'contracts' )
@@ -17,11 +21,17 @@ def test_abicontract_interface():
17
21
tester_state = state ()
18
22
19
23
contract_path = path .join (CONTRACTS_DIR , 'simple_contract.sol' )
24
+ contract_name = 'Simple'
20
25
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' ])
22
32
23
33
# 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' )
25
35
26
36
abi = ABIContract (
27
37
_state = tester_state ,
You can’t perform that action at this time.
0 commit comments