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