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 +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,34 @@ def sub1():
31
31
}
32
32
"""
33
33
34
+ @pytest .mark .xfail (reason = "compilation from file seems to work with library, but the ABI-calling tx fails" )
35
+ @pytest .mark .skipif (get_solidity () is None , reason = "'solc' compiler not available" )
36
+ def test_compile_from_file (tmpdir ):
37
+ contractsdir = tmpdir .mkdir ("contracts" )
38
+ otherpath = contractsdir .join ("Other.sol" )
39
+ otherpath .write ("""library Other {
40
+ function seven() returns (int256 y) {
41
+ y = 7;
42
+ }
43
+ }
44
+ """ )
45
+ userpath = contractsdir .join ("user.sol" )
46
+ userpath .write ("""import "Other.sol";
47
+ contract user {
48
+ function test() returns (int256 seven) {
49
+ seven = Other.seven();
50
+ }
51
+ }
52
+ """ )
53
+ s = tester .state ()
54
+ othercontract = s .abi_contract (None , path = str (otherpath ), language = 'solidity' )
55
+ # assert othercontract.seven() == 7
56
+ libraryuser = s .abi_contract ('' , path = str (userpath ),
57
+ # libraries still need to be supplied with their address:
58
+ libraries = {'Other' : othercontract .address .encode ('hex' )},
59
+ language = 'solidity' )
60
+ assert libraryuser .test () == 7
61
+
34
62
35
63
@pytest .mark .skipif (get_solidity () is None , reason = "'solc' compiler not available" )
36
64
def test_interop ():
You can’t perform that action at this time.
0 commit comments