ligo/src/test/contracts/get_contract.ligo

17 lines
563 B
Plaintext
Raw Normal View History

type storage is unit
type return is list (operation) * storage
function cb (const s : storage) : return is block {
2020-03-04 15:23:51 +01:00
const c : contract (unit) = get_contract (Tezos.sender)
} with (list [Tezos.transaction (unit, 0tez, 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) =
case (Tezos.get_contract_opt (Tezos.sender) : option (contract (unit))) of
Some (contract) -> contract
| None -> (failwith ("contract not found") : contract (unit))
2020-01-29 14:09:02 +01:00
end
} with (list [Tezos.transaction (unit, 0tez, c)], s)