diff --git a/docs/liquidity.md b/docs/liquidity.md index db273055..5427fe97 100644 --- a/docs/liquidity.md +++ b/docs/liquidity.md @@ -175,11 +175,11 @@ As in Michelson, there are different types of integers: a `tz` suffix (`1.00tz`, etc.) or as a string with type coercion (`("1.00" : tez)`). -Timestamps are written in ISO 8601 format or integer seconds since epoch, the -following are equivalent: +Timestamps are written in ISO 8601 format, like in Michelson: * `("2015-12-01T10:01:00+01:00" : timestamp)` -* `("1448960460" : timestamp)` -* `(1448960460 : timestamp)` + +Keys and signatures constants are the same as the ones in Michelson: +* `("tz1hxLtJnSYCVabeGio3M87Yp8ChLF9LFmCM" : key)` There are also three types of collections: lists, sets and maps. Constants collections can be created directly: diff --git a/tools/liquidity/liquidCheck.ml b/tools/liquidity/liquidCheck.ml index fc9a0f2f..d3cb47e5 100644 --- a/tools/liquidity/liquidCheck.ml +++ b/tools/liquidity/liquidCheck.ml @@ -1371,16 +1371,11 @@ let check_const_type ~to_tez loc ty cst = | Ttez, CString s -> CTez (to_tez s) | Tkey, CKey s - | Tkey, CString s -> CKey s - - | Ttimestamp, CInt { integer = s } - | Ttimestamp, CNat { integer = s } -> CTimestamp s + | Tkey, CString s -> CKey s | Ttimestamp, CString s | Ttimestamp, CTimestamp s -> begin (* approximation of correct tezos timestamp *) - try Scanf.sscanf s "%_d%!" () - with _ -> try Scanf.sscanf s "%_d-%_d-%_dT%_d:%_d:%_dZ%!" () with _ -> try Scanf.sscanf s "%_d-%_d-%_d %_d:%_d:%_dZ%!" () diff --git a/tools/liquidity/with-tezos/liquidToTezos.ml b/tools/liquidity/with-tezos/liquidToTezos.ml index 4c5bf18f..a66c2988 100644 --- a/tools/liquidity/with-tezos/liquidToTezos.ml +++ b/tools/liquidity/with-tezos/liquidToTezos.ml @@ -62,6 +62,9 @@ let rec convert_const expr = | CSignature _|CLeft _|CRight _) *) | CTimestamp s -> Script_repr.String (0, s) + | CKey s -> Script_repr.String (0, s) + | CSignature s -> Script_repr.String (0, s) + | _ -> LiquidLoc.raise_error "to-tezos: unimplemented const:\n%s%!" (LiquidPrinter.Michelson.string_of_const expr)