Remove InterfaceTypeRepCheck - all exercises are on interface now

This commit is contained in:
Dylan Thinnes 2022-08-30 10:53:01 +01:00
parent 8f0c2c90ce
commit d8a0a7f299

View File

@ -1,45 +0,0 @@
-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
-- @SINCE-LF-FEATURE DAML_INTERFACE_EXTENDED
-- @ERROR Attempt to fetch or exercise a wrongly typed contract
-- | Verify that you can't accidentally exercise a T1 template
-- through a T2 contract id, via interface choices.
module InterfaceTypeRepCheck where
data EmptyInterfaceView = EmptyInterfaceView {}
interface I where
viewtype EmptyInterfaceView
getOwner : Party
choice MyArchive : ()
controller getOwner this
do pure ()
template T1
with
owner1: Party
where
signatory owner1
interface instance I for T1 where
view = EmptyInterfaceView
getOwner = owner1
template T2
with
owner2: Party
where
signatory owner2
interface instance I for T2 where
view = EmptyInterfaceView
getOwner = owner2
main = scenario do
p <- getParty "Alice"
submit p do
cidT1 <- create (T1 p)
let cidT2 = coerceContractId @T1 @T2 cidT1
exercise cidT2 MyArchive
-- @ENABLE-SCENARIOS