mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
151e12b81a
This is the result of: - Updating `./COPY` to say `2023`. - Running `./dev-env/bin/dade-copyright-headers update .`
34 lines
876 B
Haskell
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
|