Spaces:
Sleeping
Sleeping
Update proof_engine.py
Browse files- proof_engine.py +7 -9
proof_engine.py
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
| 5 |
-
"state": state,
|
| 6 |
-
"timestamp": int(time.time())
|
| 7 |
-
}
|
| 8 |
-
canonical = json.dumps(payload, sort_keys=True, separators=(",", ":"))
|
| 9 |
return {
|
| 10 |
-
"hash": hashlib.sha256(
|
| 11 |
-
"
|
|
|
|
| 12 |
}
|
|
|
|
| 1 |
+
import hashlib
|
| 2 |
+
import json
|
| 3 |
|
| 4 |
+
def generate_proof(state):
|
| 5 |
+
raw = json.dumps(state, sort_keys=True).encode()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
return {
|
| 7 |
+
"hash": hashlib.sha256(raw).hexdigest(),
|
| 8 |
+
"deterministic": True,
|
| 9 |
+
"enforcement": "simulation-only"
|
| 10 |
}
|