Client/RPCs: fix storage cost estimation

This commit is contained in:
Benjamin Canou 2018-06-25 17:25:36 +02:00
parent 509a8a801a
commit 92a3c709a1
2 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ let estimated_storage res =
estimated_storage rest >>? fun storage2 -> estimated_storage rest >>? fun storage2 ->
Ok (Z.add storage1 storage2) in Ok (Z.add storage1 storage2) in
estimated_storage res >>? fun diff -> estimated_storage res >>? fun diff ->
Ok (max Z.zero diff) Ok (Z.max Z.zero diff)
let originated_contracts_single let originated_contracts_single
(type kind) (type kind)

View File

@ -248,15 +248,15 @@ module Scripts = struct
match protocol_data.contents with match protocol_data.contents with
| Single (Manager_operation _) as op -> | Single (Manager_operation _) as op ->
partial_precheck_manager_contents_list ctxt op >>=? fun ctxt -> partial_precheck_manager_contents_list ctxt op >>=? fun ctxt ->
Apply.apply_manager_contents_list ctxt Readable baker op >>= fun (_ctxt, result) -> Apply.apply_manager_contents_list ctxt Optimized baker op >>= fun (_ctxt, result) ->
return result return result
| Cons (Manager_operation _, _) as op -> | Cons (Manager_operation _, _) as op ->
partial_precheck_manager_contents_list ctxt op >>=? fun ctxt -> partial_precheck_manager_contents_list ctxt op >>=? fun ctxt ->
Apply.apply_manager_contents_list ctxt Readable baker op >>= fun (_ctxt, result) -> Apply.apply_manager_contents_list ctxt Optimized baker op >>= fun (_ctxt, result) ->
return result return result
| _ -> | _ ->
Apply.apply_contents_list Apply.apply_contents_list
ctxt Readable shell.branch baker operation ctxt Optimized shell.branch baker operation
operation.protocol_data.contents >>=? fun (_ctxt, result) -> operation.protocol_data.contents >>=? fun (_ctxt, result) ->
return result return result