daml/daml-lf/tests/DontDiscloseNonConsumingExercisesToObservers.daml
Gary Verhaegen 151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00

34 lines
876 B
Haskell

-- Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module DontDiscloseNonConsumingExercisesToObservers where
template NonObservable with
p : Party
obs : Party
where
signatory p
observer obs
nonconsuming choice CreateEvent : ContractId Event
controller p
do create $ Event p
template Event with
p : Party
where
signatory p
-- Bob should not be able to fetch when DontDiscloseNonConsumingExercisesToObservers is set,
-- because he is only an observer and the choice CreateEventis non-consuming.
test_DontDiscloseNonConsumingExercisesToObervers = scenario do
alice <- getParty "alice"
bob <- getParty "bob"
cid <- submit alice $ do
c <- create $ NonObservable alice bob
exercise c CreateEvent
submitMustFail bob $ fetch cid