more camligo
This commit is contained in:
parent
6603b259ca
commit
d19c0058a7
@ -18,6 +18,6 @@ type param = {
|
||||
|
||||
let%entry attempt (p:param) storage =
|
||||
if Crypto.hash (Bytes.pack p.attempt) <> Bytes.pack storage.challenge then failwith "Failed challenge" ;
|
||||
let transfer = Operation.transfer sender 10tz in
|
||||
let storage = storage.challenge <- p.new_challenge in
|
||||
let transfer : operation = Operation.transfer (sender , 10tz) in
|
||||
let storage : storage = storage.challenge <- p.new_challenge in
|
||||
([] , storage)
|
||||
|
@ -25,6 +25,8 @@ module Simplify = struct
|
||||
module Camligo = struct
|
||||
let constants = [
|
||||
("Bytes.pack" , 1) ;
|
||||
("Crypto.hash" , 1) ;
|
||||
("Operation.transfer" , 2) ;
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -582,9 +582,9 @@ module Expression = struct
|
||||
[tuple] ;
|
||||
[type_annotation] ;
|
||||
[lt ; le ; gt ; eq ; neq] ;
|
||||
[application] ;
|
||||
[assignment] ;
|
||||
[cons] ;
|
||||
[application] ;
|
||||
[addition ; substraction] ;
|
||||
[multiplication ; division] ;
|
||||
[list] ;
|
||||
|
@ -47,7 +47,9 @@ let get_p_variable : I.pattern -> string Location.wrap result = fun p ->
|
||||
| _ -> simple_fail "not a pattern variable"
|
||||
|
||||
let get_p_typed_variable : I.pattern -> (string Location.wrap * I.restricted_type_expression Location.wrap) result = fun p ->
|
||||
let%bind (p' , rte) = get_p_type_annotation p in
|
||||
let%bind (p' , rte) =
|
||||
trace (simple_error "get_p_typed_variable") @@
|
||||
get_p_type_annotation p in
|
||||
let%bind var = get_p_variable (unwrap p') in
|
||||
ok (var , rte)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user