Skip to content

Commit

Permalink
Merge pull request #865 from eth-brownie/fix-from-exception
Browse files Browse the repository at this point in the history
Improved error message for ownerless contracts
  • Loading branch information
iamdefinitelyahuman authored Nov 24, 2020
2 parents e81cb67 + d99eb3e commit 57cc1ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions brownie/network/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def __call__(self, *args: Tuple) -> Union["Contract", TransactionReceiptType]:
args, tx = _get_tx(None, args)
if not tx["from"]:
raise AttributeError(
"No deployer address given. You must supply a tx dict"
" as the last argument with a 'from' field."
"Final argument must be a dict of transaction parameters that "
"includes a `from` field specifying the address to deploy from"
)
return tx["from"].deploy(
self._parent,
Expand Down Expand Up @@ -293,8 +293,8 @@ def estimate_gas(self, *args: Tuple) -> int:
args, tx = _get_tx(None, args)
if not tx["from"]:
raise AttributeError(
"Contract has no owner, you must supply a tx dict"
" as the last argument with a 'from' field."
"Final argument must be a dict of transaction parameters that "
"includes a `from` field specifying the sender of the transaction"
)

return tx["from"].estimate_gas(
Expand Down Expand Up @@ -1076,8 +1076,8 @@ def transact(self, *args: Tuple) -> TransactionReceiptType:
args, tx = _get_tx(self._owner, args)
if not tx["from"]:
raise AttributeError(
"Contract has no owner, you must supply a tx dict"
" as the last argument with a 'from' field."
"Final argument must be a dict of transaction parameters that "
"includes a `from` field specifying the sender of the transaction"
)

return tx["from"].transfer(
Expand Down Expand Up @@ -1166,8 +1166,8 @@ def estimate_gas(self, *args: Tuple) -> int:
args, tx = _get_tx(self._owner, args)
if not tx["from"]:
raise AttributeError(
"Contract has no owner, you must supply a tx dict"
" as the last argument with a 'from' field."
"Final argument must be a dict of transaction parameters that "
"includes a `from` field specifying the sender of the transaction"
)

return tx["from"].estimate_gas(
Expand Down

0 comments on commit 57cc1ac

Please sign in to comment.