From 6c6e6bb2899c3ff440452c4f6f3589f7ff406d77 Mon Sep 17 00:00:00 2001 From: Stefan George Date: Sun, 30 Oct 2016 12:54:18 +0100 Subject: [PATCH 1/2] return contract with contract_name if contract_name is set --- ethereum/_solidity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/_solidity.py b/ethereum/_solidity.py index c76fa88e1..4efd4528e 100644 --- a/ethereum/_solidity.py +++ b/ethereum/_solidity.py @@ -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): From 2f45d99d8661caf905d47bb6fd11860aae0eb7d6 Mon Sep 17 00:00:00 2001 From: Stefan George Date: Sun, 30 Oct 2016 12:56:23 +0100 Subject: [PATCH 2/2] comment out wrong assertion --- ethereum/abi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/abi.py b/ethereum/abi.py index 141327c58..53d238b30 100644 --- a/ethereum/abi.py +++ b/ethereum/abi.py @@ -798,7 +798,7 @@ def dec(typ, arg): # Dynamic-sized strings are encoded as + 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: