missing files in failwith and guess_string tests, oops.
This commit is contained in:
parent
08626f749c
commit
dbe4282659
8
src/contracts/failwith.mligo
Normal file
8
src/contracts/failwith.mligo
Normal file
@ -0,0 +1,8 @@
|
||||
type storage = unit
|
||||
|
||||
(* let%entry main (p:unit) storage = *)
|
||||
(* (failwith "This contract always fails" : unit) *)
|
||||
|
||||
let%entry main (p:unit) storage =
|
||||
if true then failwith "This contract always fails" else ()
|
||||
|
24
src/contracts/guess_string.mligo
Normal file
24
src/contracts/guess_string.mligo
Normal file
@ -0,0 +1,24 @@
|
||||
(** Type of storage for this contract *)
|
||||
type storage = {
|
||||
challenge : string ;
|
||||
}
|
||||
|
||||
(** Initial storage *)
|
||||
let%init storage = {
|
||||
challenge = "" ;
|
||||
}
|
||||
|
||||
type param = {
|
||||
new_challenge : string ;
|
||||
attempt : string ;
|
||||
}
|
||||
|
||||
let%entry attempt (p:param) storage =
|
||||
(* if p.attempt <> storage.challenge then failwith "Failed challenge" else *)
|
||||
let contract : unit contract = Operation.get_contract sender in
|
||||
let transfer : operation = Operation.transaction (unit , contract , 10.00tz) in
|
||||
(* TODO: no syntax for functional updates yet *)
|
||||
(* let storage : storage = { storage with challenge = p.new_challenge } in *)
|
||||
(* for now, rebuild the record by hand. *)
|
||||
let storage : storage = { challenge = p.new_challenge } in
|
||||
((list [] : operation list), storage)
|
1
src/test/.gitignore
vendored
Normal file
1
src/test/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/dune-project
|
Loading…
Reference in New Issue
Block a user