Test cases for protected calls

This commit is contained in:
Ulf Norell
2020-03-02 11:41:45 +01:00
parent 4a812b6f3b
commit e64ac9396a
3 changed files with 29 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
contract Remote =
entrypoint id : int => int
contract ProtectedCall =
entrypoint bad(r : Remote) =
r.id(protected = 0 == 1, 18)
+14
View File
@@ -0,0 +1,14 @@
contract Remote =
entrypoint id : int => int
contract ProtectedCall =
function higher_order(r : Remote) =
r.id
entrypoint test_ok(r : Remote) =
let f = higher_order(r)
let Some(n) = r.id(protected = true, 10)
let Some(m) = f(protected = true, 5)
n + m + r.id(protected = false, 100) + f(1)