Browse Source

Emergency fix.

Thomas Kerber 1 year ago
parent
commit
1e594b1f15
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      ethvc/src/lib.rs

+ 11
- 3
ethvc/src/lib.rs View File

@@ -22,10 +22,18 @@ pub fn init_proofs() {
22 22
 }
23 23
 
24 24
 pub fn finalise_proofs() -> Vec<u8> {
25
-    // TODO: currently proofs don't work with output, or are concatinated.
26
-    let _ = consume_proofs();
25
+    let proofs = consume_proofs();
27 26
     PROVING.write().map(|mut p| *p = false).ok();
28
-    vec![42]
27
+    let mut ret = Vec::new();
28
+    for mut proof in proofs.into_iter() {
29
+        ret.extend(&[0u8; 28]);
30
+        ret.push(((proof.len() >> 24) & 0xff) as u8);
31
+        ret.push(((proof.len() >> 16) & 0xff) as u8);
32
+        ret.push(((proof.len() >>  8) & 0xff) as u8);
33
+        ret.push(((proof.len() >>  0) & 0xff) as u8);
34
+        ret.append(&mut proof);
35
+    }
36
+    ret
29 37
 }
30 38
 
31 39
 pub fn call(input: &[u8]) -> Vec<u8> {

Loading…
Cancel
Save