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

Commit d4c8667

Browse files
committed
Fixed solidity wrapper
1 parent b56bde5 commit d4c8667

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ethereum/tools/_solidity.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class Solc(object):
312312

313313
@staticmethod
314314
def _code_or_path(sourcecode, path, contract_name, libraries, combined):
315-
warnings.warn('solc_wrapper is deprecated, please use the functions compile_file or compile_code')
315+
# warnings.warn('solc_wrapper is deprecated, please use the functions compile_file or compile_code')
316316

317317
if sourcecode and path:
318318
raise ValueError('sourcecode and path are mutually exclusive.')
@@ -331,7 +331,12 @@ def _code_or_path(sourcecode, path, contract_name, libraries, combined):
331331
last_contract = all_contract_names[-1]
332332

333333
result = compile_code(sourcecode, libraries=libraries, combined=combined)
334-
return result[last_contract]
334+
if last_contract in result:
335+
return result[last_contract]
336+
elif '<stdin>:' + last_contract in result:
337+
return result['<stdin>:' + last_contract]
338+
else:
339+
raise Exception("Solidity compiler did not output code for the last contract for some reason")
335340

336341
@classmethod
337342
def compile(cls, code, path=None, libraries=None, contract_name=''):

fixtures

Submodule fixtures updated 1 file

0 commit comments

Comments
 (0)