Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,9 +67,10 @@ with gr.Blocks() as app:
|
|
67 |
gr.Column()
|
68 |
def test_fn(im):
|
69 |
return (im)
|
70 |
-
def create_new_chain(address):
|
71 |
address = str(address.strip("b").strip("'"))
|
72 |
-
mychain_rec = chatchain.MyChainRec(chain_load=main_chain,create=address)
|
|
|
73 |
response = {'chain': mychain_rec.chain,
|
74 |
'length': len(mychain_rec.chain)}
|
75 |
message = f"Blockchain loaded from: {main_chain}{address}.json"
|
@@ -82,7 +83,7 @@ with gr.Blocks() as app:
|
|
82 |
input_key.change(crypt.address,input_key,sender)
|
83 |
pass_btn.click(checkp,pass_box,[invalid,valida])
|
84 |
|
85 |
-
gen_wal_btn.click(crypt.generate_keys,None,[out2,out1,img3,out3,img1,img2]).then(create_new_chain,out3,[response_json,block_text,rec]).then(test_fn,[img1],[input_key])
|
86 |
rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes])
|
87 |
rsa_dec_btn.click(crypt.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
88 |
|
|
|
67 |
gr.Column()
|
68 |
def test_fn(im):
|
69 |
return (im)
|
70 |
+
def create_new_chain(address,im):
|
71 |
address = str(address.strip("b").strip("'"))
|
72 |
+
mychain_rec = chatchain.MyChainRec(chain_load=f'{main_chain}{address}/',create=address)
|
73 |
+
chatchain.StoreImage(img=im,chain_load=f'{main_chain}{address}/')
|
74 |
response = {'chain': mychain_rec.chain,
|
75 |
'length': len(mychain_rec.chain)}
|
76 |
message = f"Blockchain loaded from: {main_chain}{address}.json"
|
|
|
83 |
input_key.change(crypt.address,input_key,sender)
|
84 |
pass_btn.click(checkp,pass_box,[invalid,valida])
|
85 |
|
86 |
+
gen_wal_btn.click(crypt.generate_keys,None,[out2,out1,img3,out3,img1,img2]).then(create_new_chain,[out3,img1],[response_json,block_text,rec]).then(test_fn,[img1],[input_key])
|
87 |
rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes])
|
88 |
rsa_dec_btn.click(crypt.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
89 |
|