From c9efaa2a642dac3e54fdef414740963bdeda2b89 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Fri, 9 Sep 2016 18:05:23 +0200 Subject: [PATCH] Proto: fix interpretation of tez constants. --- src/proto/bootstrap/script_ir_translator.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto/bootstrap/script_ir_translator.ml b/src/proto/bootstrap/script_ir_translator.ml index 449d9c439..3d149557c 100644 --- a/src/proto/bootstrap/script_ir_translator.ml +++ b/src/proto/bootstrap/script_ir_translator.ml @@ -542,14 +542,14 @@ and parse_untagged_data | Int_t k, (Float (loc, _) | Prim (loc, _, _) | String (loc, _) | Seq (loc, _)) -> fail @@ Invalid_constant (loc, string_of_int_kind k) (* Tez amounts *) - | Tez_t, Int (loc, v) -> begin try + | Tez_t, String (loc, v) -> begin try match Tez.of_string v with | None -> raise Exit | Some tez -> return tez with _ -> fail @@ Invalid_constant (loc, "tez") end - | Tez_t, (Float (loc, _) | Prim (loc, _, _) | String (loc, _) | Seq (loc, _)) -> + | Tez_t, (Float (loc, _) | Int (loc, _) | Prim (loc, _, _) | Seq (loc, _)) -> fail @@ Invalid_constant (loc, "tez") (* Timestamps *) | Timestamp_t, (Float (loc, v) | Int (loc, v)) -> begin