temporarily remove the token system (will restore later)

This commit is contained in:
Jude Nelson
2018-04-24 16:36:55 -04:00
parent 52cd65421a
commit d5826b752d

View File

@@ -208,22 +208,11 @@ def is_subdomain(fqn):
return is_address_subdomain(fqn)[0]
def price_name(name, namespace, block_height):
def price_name( name, namespace, block_height ):
"""
Calculate the price of a name (without its namespace ID), given the
namespace parameters.
The minimum price is NAME_COST_UNIT (or NAME_COST_UNIT_STACKS)
"""
units = None
cost_unit = None
if namespace['version'] == NAMESPACE_VERSION_PAY_WITH_STACKS:
units = 'STACKS'
cost_unit = NAME_COST_UNIT_STACKS
else:
units = 'BTC'
cost_unit = NAME_COST_UNIT
base = namespace['base']
coeff = namespace['coeff']
buckets = namespace['buckets']
@@ -246,21 +235,21 @@ def price_name(name, namespace, block_height):
# non-alpha!
discount = max( discount, namespace['nonalpha_discount'] )
price = (float(coeff * (base ** bucket_exponent)) / float(discount)) * cost_unit
if price < cost_unit:
price = cost_unit
price = (float(coeff * (base ** bucket_exponent)) / float(discount)) * NAME_COST_UNIT
if price < NAME_COST_UNIT:
price = NAME_COST_UNIT
price_multiplier = get_epoch_price_multiplier(block_height, namespace['namespace_id'], units)
price_multiplier = get_epoch_price_multiplier( block_height, namespace['namespace_id'] )
return price * price_multiplier
def price_namespace( namespace_id, block_height, units ):
def price_namespace( namespace_id, block_height ):
"""
Calculate the cost of a namespace.
Returns the price on success
Returns None if the namespace is invalid or if the units are invalid
Returns None if the namespace is invalid
"""
price_table = get_epoch_namespace_prices( block_height, units )
price_table = get_epoch_namespace_prices( block_height )
if price_table is None:
return None