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

Add --silent flag for brownie run #680

Merged
merged 2 commits into from
Jul 12, 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
1 change: 1 addition & 0 deletions brownie/_cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

Options:
--network [name] Use a specific network (default {CONFIG.settings['networks']['default']})
--silent Suppress console output for transactions
--interactive -I Open an interactive console if the script fails
--gas -g Display gas profile for function calls
--tb -t Show entire python traceback on exceptions
Expand Down
13 changes: 8 additions & 5 deletions brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
self,
txid: Union[str, bytes],
sender: Any = None,
silent: bool = True,
silent: bool = None,
required_confs: int = 1,
name: str = "",
revert_data: Optional[Tuple] = None,
Expand All @@ -107,14 +107,17 @@ def __init__(
txid: hexstring transaction ID
sender: sender as a hex string or Account object
required_confs: the number of required confirmations before processing the receipt
silent: toggles console verbosity
silent: toggles console verbosity (default True)
name: contract function being called
revert_data: (revert string, program counter, revert type)
"""

self._silent = silent
if CONFIG.mode == "test":
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

if isinstance(txid, bytes):
txid = txid.hex()
if not self._silent:
Expand Down