Update tests for entrypoints

This commit is contained in:
Ulf Norell
2019-06-27 14:16:33 +02:00
parent 85408a12a2
commit 6a59e455ce
51 changed files with 465 additions and 446 deletions
+4 -4
View File
@@ -1,17 +1,17 @@
// An implementation of the factorial function where each recursive
// call is to another contract. Not the cheapest way to compute factorial.
contract FactorialServer =
function fac : (int) => int
entrypoint fac : (int) => int
contract Factorial =
record state = {worker : FactorialServer}
function init(worker) = {worker = worker}
entrypoint init(worker) = {worker = worker}
stateful function set_worker(worker) = put(state{worker = worker})
stateful entrypoint set_worker(worker) = put(state{worker = worker})
function fac(x : int) : int =
entrypoint fac(x : int) : int =
if(x == 0) 1
else x * state.worker.fac(x - 1)