Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -394,35 +394,36 @@ def issue_tokens(send,rec,amount):
|
|
394 |
mes = f"Sender has no wallet {e}"
|
395 |
pass
|
396 |
mes1,val = valid_send()
|
397 |
-
if val ==
|
398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
try:
|
400 |
-
balance =
|
|
|
401 |
except Exception:
|
402 |
-
balance = 0
|
403 |
p=False
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
try:
|
412 |
-
balance = lod_rec["chain"][-1]["balance"]
|
413 |
-
#print (balance)
|
414 |
-
except Exception:
|
415 |
-
p=False
|
416 |
-
balance = 0
|
417 |
-
balance_rec =int(balance)+int(amount)
|
418 |
-
|
419 |
-
if balance_send < 0:
|
420 |
-
mes ="Not enough tokens"
|
421 |
-
p = False
|
422 |
-
else:
|
423 |
-
p = False
|
424 |
-
mes=mes1
|
425 |
-
pass
|
426 |
print(mes)
|
427 |
|
428 |
if z==False:
|
@@ -488,7 +489,7 @@ def update_send_list():
|
|
488 |
send_list.append(ea.split("/",1)[1].split(".",1)[0])
|
489 |
except Exception:
|
490 |
pass
|
491 |
-
return send_list, gr.Dropdown.update(label="Sender", choices=[f for f in send_list]
|
492 |
send_list,send_drop = update_send_list()
|
493 |
|
494 |
def update_rec_list():
|
|
|
394 |
mes = f"Sender has no wallet {e}"
|
395 |
pass
|
396 |
mes1,val = valid_send()
|
397 |
+
if val == False:
|
398 |
+
p=False
|
399 |
+
mes = mes1
|
400 |
+
|
401 |
+
#if val == True:
|
402 |
+
if p==True:
|
403 |
+
try:
|
404 |
+
balance = lod["chain"][-1]["balance"]
|
405 |
+
except Exception:
|
406 |
+
balance = 0
|
407 |
+
p=False
|
408 |
+
#print (balance)
|
409 |
+
balance_send =int(balance)-int(amount)
|
410 |
+
if balance_send >=0:
|
411 |
+
p=True
|
412 |
+
response,message = get_my_chain_rec(rec)
|
413 |
+
lod_rec = response
|
414 |
+
#print (lod_rec)
|
415 |
try:
|
416 |
+
balance = lod_rec["chain"][-1]["balance"]
|
417 |
+
#print (balance)
|
418 |
except Exception:
|
|
|
419 |
p=False
|
420 |
+
balance = 0
|
421 |
+
balance_rec =int(balance)+int(amount)
|
422 |
+
|
423 |
+
if balance_send < 0:
|
424 |
+
mes ="Not enough tokens"
|
425 |
+
p = False
|
426 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
print(mes)
|
428 |
|
429 |
if z==False:
|
|
|
489 |
send_list.append(ea.split("/",1)[1].split(".",1)[0])
|
490 |
except Exception:
|
491 |
pass
|
492 |
+
return send_list, gr.Dropdown.update(label="Sender", choices=[f for f in send_list])
|
493 |
send_list,send_drop = update_send_list()
|
494 |
|
495 |
def update_rec_list():
|