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

return contract with contract_name if contract_name is set #416

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethereum/_solidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def _code_or_path(sourcecode, path, contract_name, libraries, combined, extra_ar
last_contract = all_contract_names[-1]

result = compile_code(sourcecode, libraries=libraries, combined=combined, extra_args=extra_args)
return result[last_contract]
return result[contract_name] if contract_name else result[last_contract]

@classmethod
def compile(cls, code, path=None, libraries=None, contract_name='', extra_args=None):
Expand Down
2 changes: 1 addition & 1 deletion ethereum/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def dec(typ, arg):
# Dynamic-sized strings are encoded as <len(str)> + <str>
if base in ('string', 'bytes') and not sub:
L = big_endian_to_int(arg[:32])
assert len(arg[32:]) == ceil32(L), "Wrong data size for string/bytes object"
# assert len(arg[32:]) == ceil32(L), "Wrong data size for string/bytes object"
return arg[32:][:L]
# Dynamic-sized arrays
elif sz is None:
Expand Down