daml/daml-lf/tests/Interfaces.daml
Robin Krom fcd3b6622b
ifaces:support exercising by required interface (#13554)
* ifaces:support exercising by required interface

This adds support to exercise an interface choice on a contract ID,
where the interface is required by one of the implemented interfaces of
the contract template.

Fixes #13434.

CHANGELOG_BEGIN
CHANGELOG_END

* some improvements based on review

* added a test plus a bugfix

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/PhaseOne.scala

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* 2 more interface tests for the command preprocessor

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-12 18:15:29 +00:00

47 lines
935 B
Haskell

-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module Interfaces where
interface I1 where
getOwner1 : Party
choice C1 : ()
controller getOwner1 this
do pure ()
interface I2 where
getOwner2 : Party
choice C2 : ()
controller getOwner2 this
do pure ()
interface I3 requires I4 where
interface I4 where
getOwner4 : Party
choice C4 : ()
controller getOwner4 this
do pure ()
template T1
with
owner1 : Party
where
signatory owner1
implements I1 where
getOwner1 = owner1
choice OwnChoice : ()
controller owner1
do pure ()
template T2
with
owner2 : Party
where
signatory owner2
implements I1 where
getOwner1 = owner2
implements I2 where
getOwner2 = owner2
implements I4 where
getOwner4 = owner2