Don't let users bet 0 coins
This commit is contained in:
parent
2acf9bdd31
commit
44f3e241d2
1 changed files with 6 additions and 3 deletions
|
@ -6,10 +6,12 @@ DEFAULT_REDEEM_DELAY = 600 # 600 seconds, 10 minutes
|
||||||
DEFAULT_REDEEM_AMOUNT = "100.0"
|
DEFAULT_REDEEM_AMOUNT = "100.0"
|
||||||
DEFAULT_INTEREST_RATE = "0.01"
|
DEFAULT_INTEREST_RATE = "0.01"
|
||||||
INTEREST_INTERVAL = 60*60 # 1 hour
|
INTEREST_INTERVAL = 60*60 # 1 hour
|
||||||
DECIMAL_ZERO = decimal.Decimal("0")
|
|
||||||
REGEX_FLOAT = re.compile("(?:\d+(?:\.\d{1,2}|$)|\.\d{1,2})")
|
REGEX_FLOAT = re.compile("(?:\d+(?:\.\d{1,2}|$)|\.\d{1,2})")
|
||||||
DEFAULT_MARKET_CAP = str(1_000_000_000)
|
DEFAULT_MARKET_CAP = str(1_000_000_000)
|
||||||
|
|
||||||
|
DECIMAL_ZERO = decimal.Decimal("0")
|
||||||
|
DECIMAL_BET_MINIMUM = decimal.Decimal("0.01")
|
||||||
|
|
||||||
HOUR_SECONDS = (1*60)*60
|
HOUR_SECONDS = (1*60)*60
|
||||||
LOTTERY_INTERVAL = (60*60)*6 # 6 hours
|
LOTTERY_INTERVAL = (60*60)*6 # 6 hours
|
||||||
LOTTERY_BUYIN = "100.00"
|
LOTTERY_BUYIN = "100.00"
|
||||||
|
@ -397,7 +399,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
event["user"].nickname)
|
event["user"].nickname)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
coin_bet = self._parse_coins(coin_bet, DECIMAL_ZERO)
|
coin_bet = self._parse_coins(coin_bet, DECIMAL_BET_MINIMUM)
|
||||||
except CoinParseException as e:
|
except CoinParseException as e:
|
||||||
raise utils.EventError("%s: %s" % (event["user"].nickname,
|
raise utils.EventError("%s: %s" % (event["user"].nickname,
|
||||||
str(e)))
|
str(e)))
|
||||||
|
@ -541,7 +543,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
for i, bet_amount in enumerate(bet_amounts):
|
for i, bet_amount in enumerate(bet_amounts):
|
||||||
try:
|
try:
|
||||||
bet_amounts[i] = self._parse_coins(bet_amount, DECIMAL_ZERO)
|
bet_amounts[i] = self._parse_coins(bet_amount,
|
||||||
|
DECIMAL_BET_MINIMUM)
|
||||||
except CoinParseException as e:
|
except CoinParseException as e:
|
||||||
raise utils.EventError("%s: %s" % (event["user"].nickname,
|
raise utils.EventError("%s: %s" % (event["user"].nickname,
|
||||||
str(e)))
|
str(e)))
|
||||||
|
|
Loading…
Reference in a new issue