370112f9b8
This patch is co-authored with: cagdas.bozman@ocamlpro.com With this patch the economic protocol is now compiled as as "functor-pack", parameterized over the environment. This will ease the protocol reusability outside of the tezos source tree (e.g. for a michelson Web IDE) and will allow proper unit testing of the economic protocol. This functorization allows to break the dependency of the 'tezos-protocol-compiler' on various '.mli' of the node, and hence we don't need anymore the unusual compilation schema: a.mli -> b.mli -> b.ml -> a.ml where 'A' is linked after 'B' but 'a.mli' should still be compiled before 'b.mli'. This will simplify a switch to 'ocp-build' or 'jbuiler'.
20 lines
397 B
OCaml
20 lines
397 B
OCaml
|
|
type 'a encoding
|
|
|
|
val simple_decode: 'a encoding -> string -> 'a option
|
|
val simple_encode: 'a encoding -> 'a -> string
|
|
|
|
type data = ..
|
|
|
|
val register_encoding:
|
|
prefix: string ->
|
|
length: int ->
|
|
to_raw: ('a -> string) ->
|
|
of_raw: (string -> 'a option) ->
|
|
wrap: ('a -> data) ->
|
|
'a encoding
|
|
|
|
val check_encoded_prefix: 'a encoding -> string -> int -> unit
|
|
|
|
val decode: string -> data option
|