Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error message for ownerless contracts #865

Merged
merged 1 commit into from
Nov 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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