Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -584,48 +584,48 @@ with gr.Blocks() as bc:
|
|
584 |
balance_rec = 0
|
585 |
mes = "blank message"
|
586 |
try:
|
587 |
-
b_mes,z=bc_utils.valid()
|
588 |
-
if z == True:
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
603 |
print (f'val:: {val}')
|
604 |
if val == False:
|
605 |
p=False
|
606 |
-
mes = f"
|
607 |
#mes = "Blockchain is not valid."
|
608 |
-
|
609 |
-
|
610 |
-
if p==True:
|
611 |
-
|
612 |
-
response,message = get_my_chain_rec(rec)
|
613 |
-
lod_rec = response
|
614 |
-
mes1,val,mes2,ind = valid_rec()
|
615 |
-
print (f'val:: {val}')
|
616 |
-
if val == False:
|
617 |
-
p=False
|
618 |
-
mes = f"Recipient: {rec} Blockchain is not valid. {mes2} at Index {ind}"
|
619 |
-
#mes = "Blockchain is not valid."
|
620 |
-
#print (lod_rec)
|
621 |
-
|
622 |
|
623 |
-
|
624 |
-
|
625 |
|
626 |
-
if z==False:
|
627 |
-
|
628 |
-
|
629 |
except Exception as e:
|
630 |
mes = f"Blockchain not loaded? {e}"
|
631 |
p=False
|
@@ -640,24 +640,24 @@ with gr.Blocks() as bc:
|
|
640 |
|
641 |
|
642 |
mychain_send.new_transaction(f"{send}",f"{rec}",f"{amount}")
|
643 |
-
mychain_trans.new_transaction(f"{send}",f"{rec}",f"{amount}")
|
644 |
|
645 |
message_send = "Transaction Added to Pool"
|
646 |
data_send = pd.DataFrame(mychain_send.pending_transactions)
|
647 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_rec}")
|
648 |
message_rec = "Transaction Added to Pool"
|
649 |
data_rec = pd.DataFrame(mychain_rec.pending_transactions)
|
650 |
-
response_send, show_chain_send, message_send = mychain_mine_block_send(
|
651 |
|
652 |
#mychain_mine_block_trans(balance_send, chain_r=None,chain_n=send)
|
653 |
|
654 |
-
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(
|
655 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
656 |
_,rec_send=update_send_list()
|
657 |
_,rec_drop=update_rec_list()
|
658 |
-
trans_bx = merge_trans()
|
659 |
-
trans_data, mes = bc_utils.bc_transactions(trans_bx)
|
660 |
-
return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec, rec_send, rec_drop
|
661 |
|
662 |
|
663 |
|
|
|
584 |
balance_rec = 0
|
585 |
mes = "blank message"
|
586 |
try:
|
587 |
+
#b_mes,z=bc_utils.valid()
|
588 |
+
#if z == True:
|
589 |
+
try:
|
590 |
+
response,message = get_my_chain_send(send)
|
591 |
+
#print (f'response:{response}::message{message}')
|
592 |
+
#r = requests.get(f'{main_balance}{send}.json')
|
593 |
+
lod=response
|
594 |
+
#lod = json.loads(response)
|
595 |
+
#print (lod)
|
596 |
+
p=True
|
597 |
+
except Exception as e:
|
598 |
+
lod=[]
|
599 |
+
p=False
|
600 |
+
mes = f"Sender has no wallet {e}"
|
601 |
+
pass
|
602 |
+
mes1,val,mes2,ind = valid_send()
|
603 |
+
print (f'val:: {val}')
|
604 |
+
if val == False:
|
605 |
+
p=False
|
606 |
+
mes = f"Sender: {send} Blockchain is not valid. {mes2} at Index {ind}"
|
607 |
+
#mes = "Blockchain is not valid."
|
608 |
+
|
609 |
+
#if val == True:
|
610 |
+
if p==True:
|
611 |
+
|
612 |
+
response,message = get_my_chain_rec(rec)
|
613 |
+
lod_rec = response
|
614 |
+
mes1,val,mes2,ind = valid_rec()
|
615 |
print (f'val:: {val}')
|
616 |
if val == False:
|
617 |
p=False
|
618 |
+
mes = f"Recipient: {rec} Blockchain is not valid. {mes2} at Index {ind}"
|
619 |
#mes = "Blockchain is not valid."
|
620 |
+
#print (lod_rec)
|
621 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
|
623 |
+
|
624 |
+
print(mes)
|
625 |
|
626 |
+
#if z==False:
|
627 |
+
# mes = b_mes
|
628 |
+
# p=False
|
629 |
except Exception as e:
|
630 |
mes = f"Blockchain not loaded? {e}"
|
631 |
p=False
|
|
|
640 |
|
641 |
|
642 |
mychain_send.new_transaction(f"{send}",f"{rec}",f"{amount}")
|
643 |
+
#mychain_trans.new_transaction(f"{send}",f"{rec}",f"{amount}")
|
644 |
|
645 |
message_send = "Transaction Added to Pool"
|
646 |
data_send = pd.DataFrame(mychain_send.pending_transactions)
|
647 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_rec}")
|
648 |
message_rec = "Transaction Added to Pool"
|
649 |
data_rec = pd.DataFrame(mychain_rec.pending_transactions)
|
650 |
+
response_send, show_chain_send, message_send = mychain_mine_block_send(chain_r=None,chain_n=send)
|
651 |
|
652 |
#mychain_mine_block_trans(balance_send, chain_r=None,chain_n=send)
|
653 |
|
654 |
+
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(chain_r=None,chain_n=rec)
|
655 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
656 |
_,rec_send=update_send_list()
|
657 |
_,rec_drop=update_rec_list()
|
658 |
+
#trans_bx = merge_trans()
|
659 |
+
#trans_data, mes = bc_utils.bc_transactions(trans_bx)
|
660 |
+
return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec, rec_send, rec_drop)
|
661 |
|
662 |
|
663 |
|