Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -365,15 +365,20 @@ def issue_tokens(send,rec,amount):
|
|
365 |
trans_data, mes = bc_utils.bc_transactions(trans_bx)
|
366 |
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,trans_data)
|
367 |
|
368 |
-
|
|
|
369 |
|
370 |
def create_new_chain(address):
|
|
|
371 |
mychain_rec = MyChainRec(chain_load=main_balance,create=address)
|
372 |
response = {'chain': mychain_rec.chain,
|
373 |
'length': len(mychain_rec.chain)}
|
374 |
|
375 |
-
message = f"Blockchain loaded from: {main_balance}{
|
376 |
-
|
|
|
|
|
|
|
377 |
############################## MYCHAIN END ###############################
|
378 |
|
379 |
def res_source():
|
@@ -547,7 +552,7 @@ with gr.Blocks() as bc:
|
|
547 |
return e,None,None,e
|
548 |
|
549 |
|
550 |
-
gen_wal_btn.click(app_og.generate_keys,None,[out2,out1, img3,out3,img1,img2]).then(create_new_chain,out3,[block_text,json_out]).then(app_og.test_fn,[img1,img2],[priv_key_in,pub_key_in])
|
551 |
rsa_enc_btn.click(app_og.encrypt_text,[rsa_to_enc,pub_key_in,out3],[rsa_enc_mes,qr_enc_mes]).then(app_og.test_fn2,qr_enc_mes,mes_in)
|
552 |
rsa_dec_btn.click(app_og.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
553 |
|
|
|
365 |
trans_data, mes = bc_utils.bc_transactions(trans_bx)
|
366 |
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,trans_data)
|
367 |
|
368 |
+
#global send_list
|
369 |
+
#global rec_list
|
370 |
|
371 |
def create_new_chain(address):
|
372 |
+
address = str(address.strip("b").strip("'"))
|
373 |
mychain_rec = MyChainRec(chain_load=main_balance,create=address)
|
374 |
response = {'chain': mychain_rec.chain,
|
375 |
'length': len(mychain_rec.chain)}
|
376 |
|
377 |
+
message = f"Blockchain loaded from: {main_balance}{address}.json"
|
378 |
+
send_list,send_drop = update_send_list()
|
379 |
+
rec_list, rec_drop = update_rec_list()
|
380 |
+
|
381 |
+
return response,message,send_drop,rec_drop
|
382 |
############################## MYCHAIN END ###############################
|
383 |
|
384 |
def res_source():
|
|
|
552 |
return e,None,None,e
|
553 |
|
554 |
|
555 |
+
gen_wal_btn.click(app_og.generate_keys,None,[out2,out1, img3,out3,img1,img2]).then(create_new_chain,out3,[block_text,json_out,send,rec]).then(app_og.test_fn,[img1,img2],[priv_key_in,pub_key_in])
|
556 |
rsa_enc_btn.click(app_og.encrypt_text,[rsa_to_enc,pub_key_in,out3],[rsa_enc_mes,qr_enc_mes]).then(app_og.test_fn2,qr_enc_mes,mes_in)
|
557 |
rsa_dec_btn.click(app_og.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
558 |
|