Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,6 +118,9 @@ def upload_to_blockchain(ipfs_hash):
|
|
| 118 |
|
| 119 |
print("Transaction successful!")
|
| 120 |
print("ETH Tx Hash:", tx_receipt.transactionHash.hex())
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
return tx_receipt.transactionHash.hex()
|
| 123 |
|
|
@@ -156,8 +159,7 @@ def retreive_ipfs_hash_data(hashes):
|
|
| 156 |
def submission(survey_data):
|
| 157 |
ipfs_hash = upload_json_to_ipfs(survey_data)
|
| 158 |
if ipfs_hash:
|
| 159 |
-
|
| 160 |
-
print(ipfs_hash)
|
| 161 |
upload_to_blockchain(ipfs_hash)
|
| 162 |
|
| 163 |
total_number_pages = 3
|
|
@@ -289,7 +291,6 @@ elif st.session_state["current_page"] == 3: # Last Page
|
|
| 289 |
print(e)
|
| 290 |
st.error(f'An error ocurred. Here is the error message: {e}', icon="🚨")
|
| 291 |
|
| 292 |
-
print("Success!")
|
| 293 |
|
| 294 |
if st.button('Back'):
|
| 295 |
st.session_state["current_page"] -= 1
|
|
|
|
| 118 |
|
| 119 |
print("Transaction successful!")
|
| 120 |
print("ETH Tx Hash:", tx_receipt.transactionHash.hex())
|
| 121 |
+
st.success('Data successfully stored. Thank you for taking the survey!', icon="✅")
|
| 122 |
+
st.info(f'The IPFS hash is: {IPFS_hash}', icon="ℹ️")
|
| 123 |
+
st.info(f'The Ethereum hash is: {tx_receipt.logs[0].transactionHash.hex()}', icon="ℹ️")
|
| 124 |
|
| 125 |
return tx_receipt.transactionHash.hex()
|
| 126 |
|
|
|
|
| 159 |
def submission(survey_data):
|
| 160 |
ipfs_hash = upload_json_to_ipfs(survey_data)
|
| 161 |
if ipfs_hash:
|
| 162 |
+
|
|
|
|
| 163 |
upload_to_blockchain(ipfs_hash)
|
| 164 |
|
| 165 |
total_number_pages = 3
|
|
|
|
| 291 |
print(e)
|
| 292 |
st.error(f'An error ocurred. Here is the error message: {e}', icon="🚨")
|
| 293 |
|
|
|
|
| 294 |
|
| 295 |
if st.button('Back'):
|
| 296 |
st.session_state["current_page"] -= 1
|