Expose projection from contract key to maintainers (#3396)

This commit is contained in:
Moritz Kiefer 2019-11-09 19:00:00 +01:00 committed by mergify[bot]
parent d032415d1b
commit 028dfcf6d4
6 changed files with 10 additions and 3 deletions

View File

@ -481,12 +481,12 @@ GRPC_HASKELL_COMMIT = "11681ec6b99add18a8d1315f202634aea343d146"
GRPC_HASKELL_HASH = "c6201f4e2fd39f25ca1d47b1dac4efdf151de88a2eb58254d61abc2760e58fda"
GHC_LIB_VERSION = "8.8.1.20191015"
GHC_LIB_VERSION = "8.8.1.20191108"
http_archive(
name = "haskell_ghc__lib__parser",
build_file = "//3rdparty/haskell:BUILD.ghc-lib-parser",
sha256 = "1f86522a1c554839fa5a5c1a0bc0462c055fb93c925f912689bc7af24c7118c1",
sha256 = "1954f2170bb789341359e91b957875664ba175d83aaa96bea036e5cb946aae70",
strip_prefix = "ghc-lib-parser-{}".format(GHC_LIB_VERSION),
urls = ["https://digitalassetsdk.bintray.com/ghc-lib/ghc-lib-parser-{}.tar.gz".format(GHC_LIB_VERSION)],
)
@ -568,7 +568,7 @@ hazel_repositories(
# Read [Working on ghc-lib] for ghc-lib update instructions at
# https://github.com/digital-asset/daml/blob/master/ghc-lib/working-on-ghc-lib.md.
hazel_ghclibs(GHC_LIB_VERSION, "0000000000000000000000000000000000000000000000000000000000000000", "237246bf2b473f370470fa7949582ba381884979876535573b9212cf4dd0b856") +
hazel_ghclibs(GHC_LIB_VERSION, "0000000000000000000000000000000000000000000000000000000000000000", "2982c8f85c25df382dd35247ccf94abb783434817a3e258b900bf01578bd772b") +
hazel_github_external("digital-asset", "hlint", "951fdb6d28d7eed8ea1c7f3be69da29b61fcbe8f", "f5fb4cf98cde3ecf1209857208369a63ba21b04313d570c41dffe9f9139a1d34") +
hazel_github_external("awakesecurity", "proto3-wire", "4f355bbac895d577d8a28f567ab4380f042ccc24", "031e05d523a887fbc546096618bc11dceabae224462a6cdd6aab11c1658e17a3") +
hazel_github_external(

View File

@ -98,6 +98,8 @@ class Template t => TemplateKey t k | t -> k where
-- stakeholders of the fetched contract are, which requires
-- getting the contract instance.
-- | The list of maintainers of a contract key.
maintainer : k -> [Party]
-- | Exercise a choice on the contract associated with the given key.
--

View File

@ -45,3 +45,5 @@ test = scenario do
fetchByKey accountKey
accountCid' === accountCid
account' === account
maintainer @Account accountKey === [bank]

View File

@ -38,6 +38,7 @@ instance ProposalInstance t => TemplateKey (Proposal t) ([Party], Text) where
key = _keyProposal
fetchByKey = _fetchByKeyProposal
lookupByKey = _lookupByKeyProposal
maintainer = _maintainerProposal (_hasKeyProposal : HasKey (Proposal t))
data Accept = Accept{}
deriving (Eq, Show)

View File

@ -259,6 +259,7 @@ instance TemplateKey Enrollment Registration where
key = _keyEnrollment
fetchByKey = _fetchByKeyEnrollment
lookupByKey = _lookupByKeyEnrollment
maintainer = _maintainerEnrollment (_hasKeyEnrollment : HasKey Enrollment)
```
### Example (3)

View File

@ -25,3 +25,4 @@ HEAD — ongoing
- [Sandbox] Add the option to start the sandbox with JWT based authentication. See `issue #3363 <https://github.com/digital-asset/daml/issues/3363>`__.
- [Sandbox] Fixed a bug in the SQL backend that caused the database to be flooded with requests when streaming out transactions.
- [Extractor - Experimental] Fix bug in reading TLS parameters.
- [DAML Stdlib] Add a ``maintainer`` function that will give you the list of maintainers of a contract key.