From e7b15c3d95463f80e9f35a297eda798ae650579a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 5 Feb 2020 14:37:25 +0100 Subject: [PATCH] Don't use emitter.message() unless you want to print to the logs too. --- nucypher/cli/commands/worklock.py | 4 ++-- nucypher/cli/painting.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nucypher/cli/commands/worklock.py b/nucypher/cli/commands/worklock.py index a74e83407..bf12292e2 100644 --- a/nucypher/cli/commands/worklock.py +++ b/nucypher/cli/commands/worklock.py @@ -165,7 +165,7 @@ def claim(general_config, worklock_options, registry_options, force): worklock_options.bidder_address = select_client_account(emitter=emitter, provider_uri=general_config.provider_uri) if not force: - emitter.message("Note: Claiming WorkLock NU tokens will initialize a new stake.", color='blue') + emitter.echo("Note: Claiming WorkLock NU tokens will initialize a new stake.", color='blue') click.confirm(f"Continue worklock claim for bidder {worklock_options.bidder_address}?", abort=True) emitter.message("Submitting Claim...") registry = registry_options.get_registry(emitter, general_config.debug) @@ -187,7 +187,7 @@ def remaining_work(general_config, worklock_options, registry_options): registry = registry_options.get_registry(emitter, general_config.debug) bidder = worklock_options.create_bidder(registry=registry) _remaining_work = bidder.remaining_work - emitter.message(f"Work Remaining for {worklock_options.bidder_address}: {_remaining_work}") + emitter.echo(f"Work Remaining for {worklock_options.bidder_address}: {_remaining_work}") return # Exit diff --git a/nucypher/cli/painting.py b/nucypher/cli/painting.py index 02b7d3bec..109cb869c 100644 --- a/nucypher/cli/painting.py +++ b/nucypher/cli/painting.py @@ -851,7 +851,7 @@ Slowing Refund .... {worklock_agent.contract.functions.SLOWING_REFUND().call()} Refund Rate ....... {worklock_agent.get_refund_rate()} Deposit Rate ...... {worklock_agent.get_deposit_rate()} """ - emitter.message(payload) + emitter.echo(payload) return @@ -865,7 +865,7 @@ Completed Work ....... {bidder.completed_work} Remaining Work ....... {bidder.remaining_work} Refunded Work ........ {bidder.refunded_work} """ - emitter.message(message) + emitter.echo(message) return @@ -898,7 +898,7 @@ def paint_bidding_notice(emitter, bidder): Accept worklock terms and node operator obligation?""" - emitter.message(obligation) + emitter.echo(obligation) return @@ -918,4 +918,4 @@ Create a stake with your allocation contract: Bond a worker to your stake: 'nucypher stake set-worker --worker-address ' """ - emitter.message(message, color='green') + emitter.echo(message, color='green')