Merge pull request #2371 from tuxxy/oops

Set teacher min_stake to 15000 NU.
pull/2451/head
K Prasch 2020-12-06 17:39:00 -08:00 committed by GitHub
commit 60c73b87a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1 @@
Corrected minimum stake value for --min-stake CLI option

View File

@ -27,7 +27,9 @@ from nucypher.cli.types import (
GWEI,
NETWORK_PORT,
NuCypherNetworkName,
WEI
WEI,
STAKED_TOKENS_RANGE,
MIN_ALLOWED_LOCKED_TOKENS
)
from nucypher.utilities.logging import Logger
@ -49,7 +51,7 @@ option_hw_wallet = click.option('--hw-wallet/--no-hw-wallet')
option_light = click.option('--light', help="Indicate that node is light", is_flag=True, default=None)
option_lonely = click.option('--lonely', help="Do not connect to seednodes", is_flag=True)
option_m = click.option('--m', help="M-Threshold KFrags", type=click.INT)
option_min_stake = click.option('--min-stake', help="The minimum stake the teacher must have to be a teacher", type=click.INT, default=0)
option_min_stake = click.option('--min-stake', help="The minimum stake the teacher must have to be locally accepted.", type=STAKED_TOKENS_RANGE, default=MIN_ALLOWED_LOCKED_TOKENS)
option_n = click.option('--n', help="N-Total KFrags", type=click.INT)
option_parameters = click.option('--parameters', help="Filepath to a JSON file containing additional parameters", type=EXISTING_READABLE_FILE)
option_participant_address = click.option('--participant-address', help="Participant's checksum address.", type=EIP55_CHECKSUM_ADDRESS)

View File

@ -20,6 +20,8 @@ from decimal import Decimal, DecimalException
from eth_utils import to_checksum_address
from ipaddress import ip_address
from nucypher.blockchain.economics import StandardTokenEconomics
from nucypher.blockchain.eth.token import NU
from nucypher.blockchain.eth.interfaces import BlockchainInterface
from nucypher.blockchain.eth.networks import NetworksInventory
@ -106,6 +108,10 @@ EIP55_CHECKSUM_ADDRESS = ChecksumAddress()
WEI = click.IntRange(min=1, clamp=False) # TODO: Better validation for ether and wei values?
GWEI = DecimalRange(min=0)
__min_allowed_locked = NU.from_nunits(StandardTokenEconomics._default_minimum_allowed_locked).to_tokens()
MIN_ALLOWED_LOCKED_TOKENS = Decimal(__min_allowed_locked)
STAKED_TOKENS_RANGE = DecimalRange(min=__min_allowed_locked)
# Filesystem
EXISTING_WRITABLE_DIRECTORY = click.Path(exists=True, dir_okay=True, file_okay=False, writable=True)
EXISTING_READABLE_FILE = click.Path(exists=True, dir_okay=False, file_okay=True, readable=True)