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

Fix transaction verbosity #695

Merged
merged 1 commit into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions brownie/network/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def deploy(
gas_price: Optional[int] = None,
nonce: Optional[int] = None,
required_confs: int = 1,
silent: bool = False,
silent: bool = None,
) -> Any:
"""Deploys a contract.

Expand All @@ -377,6 +377,8 @@ def deploy(
f"Local RPC using '{rpc.evm_version()}' but contract was compiled for '{evm}'"
)
data = contract.deploy.encode_input(*args)
if silent is None:
silent = bool(CONFIG.mode == "test" or CONFIG.argv["silent"])
with self._lock:
try:
txid = self._transact( # type: ignore
Expand Down Expand Up @@ -471,7 +473,7 @@ def transfer(
data: str = None,
nonce: Optional[int] = None,
required_confs: int = 1,
silent: bool = False,
silent: bool = None,
) -> TransactionReceipt:
"""
Broadcast a transaction from this account.
Expand All @@ -488,6 +490,8 @@ def transfer(
Returns:
TransactionReceipt object
"""
if silent is None:
silent = bool(CONFIG.mode == "test" or CONFIG.argv["silent"])
with self._lock:
tx = {
"from": self.address,
Expand Down
9 changes: 2 additions & 7 deletions brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
self,
txid: Union[str, bytes],
sender: Any = None,
silent: bool = None,
silent: bool = True,
required_confs: int = 1,
name: str = "",
revert_data: Optional[Tuple] = None,
Expand All @@ -126,12 +126,7 @@ def __init__(
name: contract function being called
revert_data: (revert string, program counter, revert type)
"""
if silent is None and (CONFIG.mode == "test" or CONFIG.argv["silent"]):
self._silent = True
else:
if silent is None:
silent = True
self._silent = silent
self._silent = silent

if isinstance(txid, bytes):
txid = HexBytes(txid).hex()
Expand Down