Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -367,7 +367,13 @@ def issue_tokens(send,rec,amount):
|
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
############################## MYCHAIN END ###############################
|
| 372 |
|
| 373 |
def res_source():
|
|
@@ -541,7 +547,7 @@ with gr.Blocks() as bc:
|
|
| 541 |
return e,None,None,e
|
| 542 |
|
| 543 |
|
| 544 |
-
gen_wal_btn.click(app_og.generate_keys,None,[out2,out1, img3,out3,img1,img2]).then(app_og.test_fn,[img1,img2],[priv_key_in,pub_key_in])
|
| 545 |
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)
|
| 546 |
rsa_dec_btn.click(app_og.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
| 547 |
|
|
|
|
| 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}{recipient_name}.json"
|
| 376 |
+
return response,message
|
| 377 |
############################## MYCHAIN END ###############################
|
| 378 |
|
| 379 |
def res_source():
|
|
|
|
| 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,out_3,[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 |
|