Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -237,7 +237,7 @@ def mine_block(chain_r=None,chain_n=None):
|
|
237 |
'previous_hash': block['previous_hash']}
|
238 |
message = "A block is MINED"
|
239 |
show_chain = display_chain()
|
240 |
-
if len(blockchain.chain) >
|
241 |
blockchain.reset()
|
242 |
response = None
|
243 |
show_chain=display_chain()
|
@@ -466,7 +466,8 @@ def issue_tokens(send,rec,amount):
|
|
466 |
p = False
|
467 |
|
468 |
return mes,p
|
469 |
-
|
|
|
470 |
with gr.Blocks() as bc:
|
471 |
with gr.Row(visible=True) as invalid:
|
472 |
pass_box = gr.Textbox()
|
@@ -485,6 +486,7 @@ with gr.Blocks() as bc:
|
|
485 |
in_chain_btn=gr.Button("Load Chain")
|
486 |
create_bc = gr.Button("Create New Blockchain")
|
487 |
send=gr.Textbox(label="Sender")
|
|
|
488 |
rec=gr.Textbox(label="Recipient")
|
489 |
am=gr.Textbox(label="Amount")
|
490 |
send_trans=gr.Button("Post Transaction")
|
|
|
237 |
'previous_hash': block['previous_hash']}
|
238 |
message = "A block is MINED"
|
239 |
show_chain = display_chain()
|
240 |
+
if len(blockchain.chain) > 1000:
|
241 |
blockchain.reset()
|
242 |
response = None
|
243 |
show_chain=display_chain()
|
|
|
466 |
p = False
|
467 |
|
468 |
return mes,p
|
469 |
+
#api = HfApi(token=token)
|
470 |
+
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
471 |
with gr.Blocks() as bc:
|
472 |
with gr.Row(visible=True) as invalid:
|
473 |
pass_box = gr.Textbox()
|
|
|
486 |
in_chain_btn=gr.Button("Load Chain")
|
487 |
create_bc = gr.Button("Create New Blockchain")
|
488 |
send=gr.Textbox(label="Sender")
|
489 |
+
send = gr.Dropdown(label="Sender", choices=[f for f in f_ist], value = "Bank")
|
490 |
rec=gr.Textbox(label="Recipient")
|
491 |
am=gr.Textbox(label="Amount")
|
492 |
send_trans=gr.Button("Post Transaction")
|