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: typed cursors with 'a t / 'a cursor and Map combinator

- Schema is now a GADT: 'a t with Opaque : H.block t,
Node : ... -> children t, Map, Rec
- Cursors carry the value type: 'a cursor
- get : 'a cursor -> 'a option (decoded value)
- put : 'a cursor -> 'a -> 'a cursor
- set : 'a cursor -> string -> H.block -> 'a cursor (raw block)
- get_block : _ cursor -> H.block option (raw escape hatch)
- step / up return existential: type step = Step : 'a cursor -> step
- map : dec:('b -> 'a) -> enc:('a -> 'b) -> 'b t -> 'a t
- produce / verify callbacks return step * 'b
- All callsites updated: backends, tests, bin commands, ocaml-scitt
- 11 tests pass

+5 -4
+2 -2
lib/atp/scitt_atp.ml
··· 174 174 let proof, _value = 175 175 S.produce C.heap repo_schema tree_root (fun c -> 176 176 match S.step c rk with 177 - | Some leaf -> (leaf, S.get leaf) 178 - | None -> (c, None)) 177 + | Some (S.Step leaf) -> (S.Step leaf, S.get_block leaf) 178 + | None -> (S.Step c, None)) 179 179 in 180 180 (* Encode proof as CBOR: [repo_key, [before, after, [[cid, block], ...]]] *) 181 181 let proof_cbor =
+3 -2
lib/proof.ml
··· 169 169 match 170 170 S.verify proof repo_schema (fun c -> 171 171 match S.step c repo_key with 172 - | Some leaf -> (leaf, S.get leaf) 173 - | None -> (c, None)) 172 + | Some (S.Step leaf) -> 173 + (S.Step leaf, S.get_block leaf) 174 + | None -> (S.Step c, None)) 174 175 with 175 176 | Ok (Some dagcbor) -> ( 176 177 match extract_cose dagcbor with