ligo/src/test/contracts/get_contract.ligo
Christian Rinderknecht 313bb0c2b3 Reverted two changes.
2020-03-04 15:23:51 +01:00

17 lines
563 B
Plaintext

type storage is unit
type return is list (operation) * storage
function cb (const s : storage) : return is block {
const c : contract (unit) = get_contract (Tezos.sender)
} with (list [Tezos.transaction (unit, 0tez, c)], s)
function cbo (const s : unit) : return is
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))
end
} with (list [Tezos.transaction (unit, 0tez, c)], s)