ligo/src/test/contracts/get_contract.ligo

20 lines
526 B
Plaintext
Raw Normal View History

type storage is unit
type return is list (operation) * storage
function cb (const s : storage) : return is
2020-01-29 14:09:02 +01:00
block {
2020-01-21 02:24:16 -06:00
const c : contract(unit) = get_contract(sender)
2020-01-29 14:09:02 +01:00
}
with (list [transaction(unit, 0mutez, c)], s)
2020-01-29 14:09:02 +01:00
function cbo (const s : unit) : return is
2020-01-29 14:09:02 +01:00
block {
const c : contract (unit) =
2020-01-21 02:24:16 -06:00
case (get_contract_opt(sender) : option(contract(unit))) of
Some (c) -> c
| None -> (failwith ("contract not found") : contract (unit))
2020-01-29 14:09:02 +01:00
end
}
with (list [transaction(unit, 0mutez, c)], s)