Michelson: reindent interpreter
This commit is contained in:
parent
82dcd5c179
commit
ef29aa2d0a
@ -70,6 +70,11 @@ let rec unparse_stack
|
||||
| Item (v, rest), Item_t (ty, rest_ty, _) ->
|
||||
Micheline.strip_locations (unparse_data ty v) :: unparse_stack (rest, rest_ty)
|
||||
|
||||
let check_qta qta =
|
||||
if Compare.Int.(qta <= 0)
|
||||
then fail Quota_exceeded
|
||||
else return ()
|
||||
|
||||
let rec interp
|
||||
: type p r.
|
||||
?log: (Script.location * int * Script.expr list) list ref ->
|
||||
@ -82,9 +87,7 @@ let rec interp
|
||||
Contract.origination_nonce -> int -> context -> (b, a) descr -> b stack ->
|
||||
(a stack * int * context * Contract.origination_nonce) tzresult Lwt.t =
|
||||
fun origination qta ctxt ({ instr ; loc } as descr) stack ->
|
||||
if Compare.Int.(qta <= 0) then
|
||||
fail Quota_exceeded
|
||||
else
|
||||
check_qta qta >>=? fun () ->
|
||||
let logged_return ?(origination = origination) (ret, qta, ctxt) =
|
||||
match log with
|
||||
| None -> return (ret, qta, ctxt, origination)
|
||||
|
Loading…
Reference in New Issue
Block a user