From 80022c8213ca5df05b0ec55ecf514569cdd4d333 Mon Sep 17 00:00:00 2001 From: redshiftzero Date: Fri, 5 Apr 2019 12:04:56 -0700 Subject: [PATCH] bug: raise exception instead of silently ignoring unnecessary args --- web3/contract.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web3/contract.py b/web3/contract.py index 6138bb7c17..a3c23dba9b 100644 --- a/web3/contract.py +++ b/web3/contract.py @@ -474,6 +474,10 @@ def _encode_constructor_data(cls, args=None, kwargs=None): encode_abi(cls.web3, constructor_abi, arguments, data=cls.bytecode) ) else: + if args is not None or kwargs is not None: + msg = "Constructor args were provided, but no constructor function was provided." + raise TypeError(msg) + deploy_data = to_hex(cls.bytecode) return deploy_data