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
+7 -7
View File
@@ -1,26 +1,26 @@
contract SpendContract =
function withdraw : (int) => int
entrypoint withdraw : (int) => int
contract SpendTest =
stateful function spend(to, amount) =
stateful entrypoint spend(to, amount) =
let total = Contract.balance
Chain.spend(to, amount)
total - amount
stateful function withdraw(amount) : int =
stateful entrypoint withdraw(amount) : int =
spend(Call.caller, amount)
stateful function withdraw_from(account, amount) =
stateful entrypoint withdraw_from(account, amount) =
account.withdraw(amount)
withdraw(amount)
stateful function spend_from(from, to, amount) =
stateful entrypoint spend_from(from, to, amount) =
from.withdraw(amount)
Chain.spend(to, amount)
Chain.balance(to)
function get_balance() = Contract.balance
function get_balance_of(a) = Chain.balance(a)
entrypoint get_balance() = Contract.balance
entrypoint get_balance_of(a) = Chain.balance(a)