From 878c63391bddb1e4f0bbee3943933e7ffceb5f78 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Tue, 26 Jun 2018 20:00:39 +0200 Subject: [PATCH] Client: fix gas and storage estimation --- src/proto_alpha/lib_client/injection.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml index 15f0549f2..de52b65a6 100644 --- a/src/proto_alpha/lib_client/injection.ml +++ b/src/proto_alpha/lib_client/injection.ml @@ -283,7 +283,7 @@ let may_patch_limits cctxt#message "Estimated gas: %s units (will add 100 for safety)" (Z.to_string gas) >>= fun () -> - return (Z.add gas (Z.of_int 100)) + return (Z.min (Z.add gas (Z.of_int 100)) gas_limit) end else return c.gas_limit end >>=? fun gas_limit -> @@ -298,7 +298,7 @@ let may_patch_limits cctxt#message "Estimated storage: %s bytes added (will add 20 for safety)" (Z.to_string storage) >>= fun () -> - return (Z.add storage (Z.of_int 20)) + return (Z.min (Z.add storage (Z.of_int 20)) storage_limit) end else return c.storage_limit end >>=? fun storage_limit ->