Skip to content

Commit

Permalink
Merge pull request #2829 from fjarri/more-n-m-renaming
Browse files Browse the repository at this point in the history
Fix some remaining occurrences of `n` instead of `shares`
  • Loading branch information
KPrasch committed Nov 25, 2021
2 parents 9dab617 + ccfbedb commit 3875f73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/NuCypher_Beachhead.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@
"source": [
"policy = ALICE.grant(BOB, \n",
" label,\n",
" m=m, \n",
" n=n,\n",
" threshold=m, \n",
" shares=n,\n",
" expiration=policy_end_datetime)"
]
},
Expand Down
1 change: 1 addition & 0 deletions newsfragments/2829.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed some occurrences of the old term for ``shares`` (``n``)
4 changes: 2 additions & 2 deletions nucypher/cli/actions/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ def collect_policy_rate_and_value(alice: Alice, rate: int, value: int, shares: i
default_gwei = Web3.fromWei(rate, 'gwei') # wei -> gwei
prompt = "Confirm rate of {node_rate} gwei * {shares} nodes ({period_rate} gwei per period)?"

if not click.confirm(prompt.format(node_rate=default_gwei, period_rate=default_gwei * shares, n=shares), default=True):
if not click.confirm(prompt.format(node_rate=default_gwei, period_rate=default_gwei * shares, shares=shares), default=True):
interactive_rate = click.prompt('Enter rate per period in gwei', type=GWEI)
# TODO: Interactive rate sampling & validation (#1709)
interactive_prompt = prompt.format(node_rate=interactive_rate, period_rate=interactive_rate * shares, n=shares)
interactive_prompt = prompt.format(node_rate=interactive_rate, period_rate=interactive_rate * shares, shares=shares)
click.confirm(interactive_prompt, default=True, abort=True)
rate = Web3.toWei(interactive_rate, 'gwei') # gwei -> wei

Expand Down
2 changes: 1 addition & 1 deletion nucypher/cli/actions/confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def confirm_staged_grant(emitter, grant_request: Dict, federated: bool, seconds_
return

period_rate = Web3.fromWei(pretty_request['shares'] * pretty_request['rate'], 'gwei')
pretty_request['rate'] = f"{pretty_request['rate']} wei/period * {pretty_request['n']} nodes"
pretty_request['rate'] = f"{pretty_request['rate']} wei/period * {pretty_request['shares']} nodes"

expiration = pretty_request['expiration']
periods = calculate_period_duration(future_time=MayaDT.from_datetime(expiration),
Expand Down

0 comments on commit 3875f73

Please sign in to comment.