mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Remove references to tacoshi, and make denominations data driven
This commit is contained in:
parent
8f27e3430d
commit
72ddb11dff
1 changed files with 10 additions and 10 deletions
20
tipbot.py
20
tipbot.py
|
@ -32,6 +32,7 @@ wallet_port = 6061
|
||||||
wallet_update_time = 30 # seconds
|
wallet_update_time = 30 # seconds
|
||||||
coin=1e12
|
coin=1e12
|
||||||
coin_name = "Monero"
|
coin_name = "Monero"
|
||||||
|
coin_denominations = [[1000000, 1, "piconero"], [1000000000, 1e6, "micronero"], [1000000000000, 1e9, "millinero"]]
|
||||||
address_length = [95, 95] # min/max size of addresses
|
address_length = [95, 95] # min/max size of addresses
|
||||||
address_prefix = ['4', '9'] # allowed prefixes of addresses
|
address_prefix = ['4', '9'] # allowed prefixes of addresses
|
||||||
withdrawal_fee = 10000000000
|
withdrawal_fee = 10000000000
|
||||||
|
@ -198,16 +199,15 @@ def AmountToString(amount):
|
||||||
if amount == None:
|
if amount == None:
|
||||||
amount = 0
|
amount = 0
|
||||||
lamount=long(amount)
|
lamount=long(amount)
|
||||||
if coin_name == "monero" or coin_name == "Monero":
|
samount = None
|
||||||
if lamount < 1000000:
|
if lamount == 0:
|
||||||
samount = "%u tacoshi" % lamount
|
samount = "0 %s" % coin_name
|
||||||
elif lamount < 1000000000:
|
|
||||||
samount = " %.16g micromonero" % (float(lamount) / 1e6)
|
|
||||||
elif lamount < 1000000000000:
|
|
||||||
samount = " %.16g millimonero" % (float(lamount) / 1e9)
|
|
||||||
else:
|
|
||||||
samount = "%.16g monero" % (float(lamount) / coin)
|
|
||||||
else:
|
else:
|
||||||
|
for den in coin_denominations:
|
||||||
|
if lamount < den[0]:
|
||||||
|
samount = "%.16g %s" % (float(lamount) / den[1], den[2])
|
||||||
|
break
|
||||||
|
if not samount:
|
||||||
samount = "%.16g %s" % (float(lamount) / coin, coin_name)
|
samount = "%.16g %s" % (float(lamount) / coin, coin_name)
|
||||||
log_log("AmountToString: %s -> %s" % (str(amount),samount))
|
log_log("AmountToString: %s -> %s" % (str(amount),samount))
|
||||||
return samount
|
return samount
|
||||||
|
@ -321,7 +321,7 @@ def Rain(nick,data):
|
||||||
SendTo(sendto, "Nobody eligible for rain")
|
SendTo(sendto, "Nobody eligible for rain")
|
||||||
return
|
return
|
||||||
if units < users:
|
if units < users:
|
||||||
SendTo(sendto, "This would mean not even a tacoshi per nick")
|
SendTo(sendto, "This would mean not even an atomic unit per nick")
|
||||||
return
|
return
|
||||||
log_info("%s wants to rain %s on %s users in %s" % (nick, AmountToString(units), users, chan))
|
log_info("%s wants to rain %s on %s users in %s" % (nick, AmountToString(units), users, chan))
|
||||||
log_log("users in %s: %s" % (chan, str(userlist)))
|
log_log("users in %s: %s" % (chan, str(userlist)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue