Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from chatchain import MyChainSend,MyChainRec
|
|
4 |
import crypt
|
5 |
import os
|
6 |
from huggingface_hub import (upload_file,HfApi)
|
7 |
-
|
8 |
|
9 |
rec_list = []
|
10 |
pa=os.environ['PASS']
|
@@ -29,7 +29,7 @@ def get_my_chain_send(sender_name=None):
|
|
29 |
r1 = requests.get(f'{main_chain}{sender_name}/{sender_name}.json')
|
30 |
|
31 |
print (f's={r1.text}')
|
32 |
-
mychain_send = MyChainSend(chain_load=f'{main_chain}{sender_name}/',load=r1.text)
|
33 |
|
34 |
response = {'chain': mychain_send.chain,
|
35 |
'length': len(mychain_send.chain)}
|
@@ -41,7 +41,7 @@ def get_my_chain_send(sender_name=None):
|
|
41 |
except Exception:
|
42 |
message = f"Error loading from: {sender_name}"
|
43 |
print (message)
|
44 |
-
return
|
45 |
|
46 |
def get_my_chain_rec(recipient_name=None):
|
47 |
global mychain_rec
|
@@ -203,11 +203,11 @@ def send_message(send,rec,message):
|
|
203 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{message}")
|
204 |
message_rec = "Transaction Added to Pool"
|
205 |
data_rec = pd.DataFrame(mychain_rec.pending_transactions)
|
206 |
-
response_send, show_chain_send, message_send = mychain_mine_block_send(chain_r=None,chain_n=send)
|
207 |
|
208 |
#mychain_mine_block_trans(balance_send, chain_r=None,chain_n=send)
|
209 |
|
210 |
-
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(chain_r=None,chain_n=rec)
|
211 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
212 |
#_,rec_send=update_send_list()
|
213 |
_,rec_drop=update_rec_list(main_chain)
|
|
|
4 |
import crypt
|
5 |
import os
|
6 |
from huggingface_hub import (upload_file,HfApi)
|
7 |
+
import requests
|
8 |
|
9 |
rec_list = []
|
10 |
pa=os.environ['PASS']
|
|
|
29 |
r1 = requests.get(f'{main_chain}{sender_name}/{sender_name}.json')
|
30 |
|
31 |
print (f's={r1.text}')
|
32 |
+
mychain_send = chatchain.MyChainSend(chain_load=f'{main_chain}{sender_name}/',load=r1.text)
|
33 |
|
34 |
response = {'chain': mychain_send.chain,
|
35 |
'length': len(mychain_send.chain)}
|
|
|
41 |
except Exception:
|
42 |
message = f"Error loading from: {sender_name}"
|
43 |
print (message)
|
44 |
+
return {"MESSAGE":"Error Loading Chain"},message
|
45 |
|
46 |
def get_my_chain_rec(recipient_name=None):
|
47 |
global mychain_rec
|
|
|
203 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{message}")
|
204 |
message_rec = "Transaction Added to Pool"
|
205 |
data_rec = pd.DataFrame(mychain_rec.pending_transactions)
|
206 |
+
response_send, show_chain_send, message_send = mychain_mine_block_send(chain_r=None,chain_n=f'{send}/{send}')
|
207 |
|
208 |
#mychain_mine_block_trans(balance_send, chain_r=None,chain_n=send)
|
209 |
|
210 |
+
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(chain_r=None,chain_n=f'{rec}/{rec}')
|
211 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
212 |
#_,rec_send=update_send_list()
|
213 |
_,rec_drop=update_rec_list(main_chain)
|