diff --git a/src/test/contracts/hashlock.mligo b/src/test/contracts/hashlock.mligo new file mode 100644 index 000000000..b30f2bc9b --- /dev/null +++ b/src/test/contracts/hashlock.mligo @@ -0,0 +1,16 @@ +type storage = { + hashed: bytes; + unused: bool; +} + +type parameter = { + hashable: bytes; + message: unit -> operation list; +} + +let main ((p,s): parameter * storage) : operation list * storage = + if ((Crypto.sha256 p.hashable) = s.hashed) && s.unused + then + let s: storage = {hashed = s.hashed; unused = false} in + ((p.message ()), s) + else (([]: operation list), s)