mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-21 01:37:15 +03:00
a925f0174c
* update copyright notices for 2021 To be merged on 2021-01-01. CHANGELOG_BEGIN CHANGELOG_END * patch-bazel-windows & da-ghc-lib
34 lines
875 B
Haskell
34 lines
875 B
Haskell
-- Copyright (c) 2021 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
|
|
|
|
controller p can
|
|
nonconsuming CreateEvent : ContractId Event
|
|
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
|