First test work commit, don't touch
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
contract SpendContract =
|
||||
function withdraw : (int) => int
|
||||
|
||||
contract SpendTest =
|
||||
|
||||
function spend(to, amount) =
|
||||
let total = Contract.balance
|
||||
Chain.spend(to, amount)
|
||||
total - amount
|
||||
|
||||
function withdraw(amount) : int =
|
||||
spend(Call.caller, amount)
|
||||
|
||||
function withdraw_from(account, amount) =
|
||||
account.withdraw(amount)
|
||||
withdraw(amount)
|
||||
|
||||
function 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)
|
||||
|
||||
Reference in New Issue
Block a user