Omnibus commited on
Commit
64d23ac
·
1 Parent(s): 8947128

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -550,6 +550,7 @@ with gr.Blocks() as bc:
550
  send_trans=gr.Button("Post Transaction")
551
  mine_b = gr.Button("Mine Block")
552
  check = gr.Button("Check Chain")
 
553
  check_all = gr.Button("Check All")
554
  with gr.Column():
555
  block_text = gr.Textbox()
@@ -594,7 +595,23 @@ with gr.Blocks() as bc:
594
  def res_send(send):
595
  mychain_send = MyChainSend(chain_load=main_balance,create=send)
596
  return ("Sender Blockchain Reset")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
 
 
 
598
  reset_sender.click(res_send,send,block_text)
599
  reset_blockchain.click(res_bc,None,block_text)
600
  reset_source.click(res_source,None,block_text)
 
550
  send_trans=gr.Button("Post Transaction")
551
  mine_b = gr.Button("Mine Block")
552
  check = gr.Button("Check Chain")
553
+ check_trans = gr.Button("Check Transactions")
554
  check_all = gr.Button("Check All")
555
  with gr.Column():
556
  block_text = gr.Textbox()
 
595
  def res_send(send):
596
  mychain_send = MyChainSend(chain_load=main_balance,create=send)
597
  return ("Sender Blockchain Reset")
598
+
599
+ def deep_trans():
600
+ chain1=mychain_send.chain
601
+ chain2=blockchain.chain
602
+ valid,ind,mes = mychain_send.deep_valid_send(chain1,chain2)
603
+
604
+ if valid:
605
+ response = 'The Blockchain is valid.'
606
+ z=True
607
+ else:
608
+ response = f'Blockchain is not valid. {mes} at Index {ind}'
609
+ z=False
610
+ return response,z
611
+
612
 
613
+ check_trans.click(deep_trans,None,[block_text,out_box_bool])
614
+
615
  reset_sender.click(res_send,send,block_text)
616
  reset_blockchain.click(res_bc,None,block_text)
617
  reset_source.click(res_source,None,block_text)