Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -177,18 +177,7 @@ def send_message(send,rec,message):
|
|
177 |
print(f'response2:: {response}')
|
178 |
print(f'message2:: {message_out}')
|
179 |
lod_rec = response
|
180 |
-
|
181 |
-
mes1,val,mes2,ind = chatchain.valid_rec()
|
182 |
-
print (f'val:: {val}')
|
183 |
-
if val == False:
|
184 |
-
p=False
|
185 |
-
mes = f"Recipient: {rec} Blockchain is not valid. {mes2} at Index {ind}"
|
186 |
-
print(mes)
|
187 |
-
p=True
|
188 |
-
#if z==False:
|
189 |
-
# mes = b_mes
|
190 |
-
# p=False
|
191 |
-
'''
|
192 |
p=True
|
193 |
except Exception as e:
|
194 |
mes = f"An Error Occured: {e}"
|
@@ -273,9 +262,9 @@ with gr.Blocks() as app:
|
|
273 |
gr.Column()
|
274 |
def test_fn(im):
|
275 |
return (im)
|
276 |
-
def create_new_chain(address,im):
|
277 |
address = str(address.strip("b").strip("'"))
|
278 |
-
mychain_rec = chatchain.MyChainRec(chain_load=f'{main_chain}{address}/',create=address)
|
279 |
chatchain.store_image(img=im,chain_load=f'{main_chain}',address=address)
|
280 |
response = {'chain': mychain_rec.chain,
|
281 |
'length': len(mychain_rec.chain)}
|
@@ -294,7 +283,7 @@ with gr.Blocks() as app:
|
|
294 |
input_key.change(crypt.address,input_key,sender).then(rec_list_up,in_chain,rec)
|
295 |
pass_btn.click(checkp,pass_box,[invalid,valida])
|
296 |
|
297 |
-
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])
|
298 |
rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes])
|
299 |
rsa_dec_btn.click(crypt.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
300 |
|
|
|
177 |
print(f'response2:: {response}')
|
178 |
print(f'message2:: {message_out}')
|
179 |
lod_rec = response
|
180 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
p=True
|
182 |
except Exception as e:
|
183 |
mes = f"An Error Occured: {e}"
|
|
|
262 |
gr.Column()
|
263 |
def test_fn(im):
|
264 |
return (im)
|
265 |
+
def create_new_chain(address,pub_key,im):
|
266 |
address = str(address.strip("b").strip("'"))
|
267 |
+
mychain_rec = chatchain.MyChainRec(chain_load=f'{main_chain}{address}/',create=address,pub_key=pub_key)
|
268 |
chatchain.store_image(img=im,chain_load=f'{main_chain}',address=address)
|
269 |
response = {'chain': mychain_rec.chain,
|
270 |
'length': len(mychain_rec.chain)}
|
|
|
283 |
input_key.change(crypt.address,input_key,sender).then(rec_list_up,in_chain,rec)
|
284 |
pass_btn.click(checkp,pass_box,[invalid,valida])
|
285 |
|
286 |
+
gen_wal_btn.click(crypt.generate_keys,None,[out2,out1,img3,out3,img1,img2]).then(create_new_chain,[out3,out2,img1],[response_json,block_text,rec]).then(test_fn,[img1],[input_key])
|
287 |
rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes])
|
288 |
rsa_dec_btn.click(crypt.decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
289 |
|