ligo/src/test/contracts/get_contract.ligo

20 lines
531 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 {
const c : contract (unit) = get_contract (source)
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) =
case (get_contract_opt (source) : 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)