Supply Chain Integrity, Transparency, and Trust (IETF SCITT)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin: clean API review — drop phantom types, proof is heap, Heap.to_seq

+9 -10
+1 -5
lib/atp/scitt_atp.ml
··· 30 30 31 31 let hash_equal = Atp.Cid.equal 32 32 let hash_block data = Atp.Cid.v `Dag_cbor data 33 - let hash_to_bytes = Atp.Cid.to_raw_bytes 34 - let hash_of_bytes = Atp.Cid.of_raw_bytes 35 - let block_to_bytes s = s 36 - let block_of_bytes s = s 37 33 end) 38 34 39 35 (* MST parse: decode DAG-CBOR MST node, extract entries *) ··· 195 191 Cbort.Cbor.bytes (Atp.Cid.to_raw_bytes cid); 196 192 Cbort.Cbor.bytes data; 197 193 ]) 198 - proof.blocks); 194 + (List.of_seq (Irmin.Heap.to_seq proof.heap))); 199 195 ] 200 196 in 201 197 let encoded_proof = Cbort.encode_string Cbort.any proof_cbor in
+8 -5
lib/proof.ml
··· 75 75 76 76 let hash_equal = Atp.Cid.equal 77 77 let hash_block data = Atp.Cid.v `Dag_cbor data 78 - let hash_to_bytes = Atp.Cid.to_raw_bytes 79 - let hash_of_bytes = Atp.Cid.of_raw_bytes 80 - let block_to_bytes s = s 81 - let block_of_bytes s = s 82 78 end) 83 79 84 80 let mst_parse : S.parse = ··· 161 157 items 162 158 | None -> [] 163 159 in 164 - let proof = S.proof_of_blocks ~before ~after blocks in 160 + let proof : S.proof = 161 + { 162 + before; 163 + after; 164 + heap = 165 + Irmin.Heap.of_list ~equal:Atp.Cid.equal blocks; 166 + } 167 + in 165 168 (* Verify by replaying the lookup *) 166 169 match 167 170 S.verify proof repo_schema (fun c ->