Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -378,9 +378,9 @@ def issue_tokens(send,rec,amount):
|
|
378 |
response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
|
379 |
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
|
380 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
381 |
-
update_send_list()
|
382 |
-
update_rec_list()
|
383 |
-
return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec)
|
384 |
############################## MYCHAIN END ###############################
|
385 |
|
386 |
def res_source():
|
@@ -419,8 +419,8 @@ def update_send_list():
|
|
419 |
send_list.append(ea.split("/",1)[1].split(".",1)[0])
|
420 |
except Exception:
|
421 |
pass
|
422 |
-
return send_list
|
423 |
-
send_list = update_send_list()
|
424 |
|
425 |
def update_rec_list():
|
426 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="dataset"))
|
@@ -432,8 +432,8 @@ def update_rec_list():
|
|
432 |
rec_list.append(ea.split("/",1)[1].split(".",1)[0])
|
433 |
except Exception:
|
434 |
pass
|
435 |
-
return rec_list
|
436 |
-
rec_list = update_rec_list()
|
437 |
|
438 |
with gr.Blocks() as bc:
|
439 |
with gr.Row(visible=True) as invalid:
|
@@ -490,7 +490,7 @@ with gr.Blocks() as bc:
|
|
490 |
json_out_rec = gr.JSON()
|
491 |
chain_json_rec = gr.JSON()
|
492 |
reset_source.click(res_source,None,block_text)
|
493 |
-
issue_btn.click(issue_tokens,[send,rec,am],[block_text,out_box_bool,json_out_send,json_out_rec,chain_json_send,chain_json_rec,trans_data_send,trans_data_rec,block_text_send,block_text_rec])
|
494 |
#issue_btn.click(issue_tokens,[send,rec,am],[block_text,out_box_bool,json_out_send])
|
495 |
|
496 |
node_add.click(add_node,[this_space,node_repo,node_space,node_file],block_text)
|
|
|
378 |
response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
|
379 |
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
|
380 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
381 |
+
_,rec_send=update_send_list()
|
382 |
+
_,rec_drop=update_rec_list()
|
383 |
+
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)
|
384 |
############################## MYCHAIN END ###############################
|
385 |
|
386 |
def res_source():
|
|
|
419 |
send_list.append(ea.split("/",1)[1].split(".",1)[0])
|
420 |
except Exception:
|
421 |
pass
|
422 |
+
return send_list, gr.Dropdown.update(label="Sender", choices=[f for f in send_list], value = "Bank")
|
423 |
+
send_list,send_drop = update_send_list()
|
424 |
|
425 |
def update_rec_list():
|
426 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="dataset"))
|
|
|
432 |
rec_list.append(ea.split("/",1)[1].split(".",1)[0])
|
433 |
except Exception:
|
434 |
pass
|
435 |
+
return rec_list, gr.Dropdown.update(label="Recipient", choices=[f for f in rec_list], allow_custom_value=True)
|
436 |
+
rec_list, rec_drop = update_rec_list()
|
437 |
|
438 |
with gr.Blocks() as bc:
|
439 |
with gr.Row(visible=True) as invalid:
|
|
|
490 |
json_out_rec = gr.JSON()
|
491 |
chain_json_rec = gr.JSON()
|
492 |
reset_source.click(res_source,None,block_text)
|
493 |
+
issue_btn.click(issue_tokens,[send,rec,am],[block_text,out_box_bool,json_out_send,json_out_rec,chain_json_send,chain_json_rec,trans_data_send,trans_data_rec,block_text_send,block_text_rec,send,rec])
|
494 |
#issue_btn.click(issue_tokens,[send,rec,am],[block_text,out_box_bool,json_out_send])
|
495 |
|
496 |
node_add.click(add_node,[this_space,node_repo,node_space,node_file],block_text)
|