From 9430ee3131a03cb24e95ae664e4c0c908e599c69 Mon Sep 17 00:00:00 2001 From: Sofia Faro Date: Tue, 7 Dec 2021 00:38:59 +0000 Subject: [PATCH] interfaces: Add requires in DefInterface protobuf (#11986) Part of #11978 changelog_begin changelog_end --- compiler/daml-lf-proto/src/DA/Daml/LF/Proto3/EncodeV1.hs | 5 +++-- .../main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/daml-lf-proto/src/DA/Daml/LF/Proto3/EncodeV1.hs b/compiler/daml-lf-proto/src/DA/Daml/LF/Proto3/EncodeV1.hs index 1c61dbecc2..278bdfabcf 100644 --- a/compiler/daml-lf-proto/src/DA/Daml/LF/Proto3/EncodeV1.hs +++ b/compiler/daml-lf-proto/src/DA/Daml/LF/Proto3/EncodeV1.hs @@ -1005,10 +1005,11 @@ encodeDefInterface :: DefInterface -> Encode P.DefInterface encodeDefInterface DefInterface{..} = do defInterfaceLocation <- traverse encodeSourceLoc intLocation defInterfaceTyconInternedDname <- encodeDottedNameId unTypeConName intName - defInterfaceParamInternedStr <- encodeNameId unExprVarName intParam - defInterfaceFixedChoices <- encodeNameMap encodeTemplateChoice intFixedChoices + let defInterfaceRequires = V.empty -- TODO https://github.com/digital-asset/daml/issues/11978 defInterfaceMethods <- encodeNameMap encodeInterfaceMethod intMethods + defInterfaceParamInternedStr <- encodeNameId unExprVarName intParam defInterfacePrecond <- encodeExpr intPrecondition + defInterfaceFixedChoices <- encodeNameMap encodeTemplateChoice intFixedChoices pure $ P.DefInterface{..} encodeInterfaceMethod :: InterfaceMethod -> Encode P.InterfaceMethod diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto b/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto index 41e1ec1e15..feabd9cbff 100644 --- a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto +++ b/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto @@ -1532,12 +1532,13 @@ message InterfaceMethod { message DefInterface { Location location = 1; int32 tycon_interned_dname = 2; - repeated InterfaceMethod methods = 3; + repeated TypeConName requires = 3; + repeated InterfaceMethod methods = 4; - // Binder for interface value ("this") in fixed choices. - int32 param_interned_str = 4; - repeated TemplateChoice fixed_choices = 5; + // Binder for interface value ("this") in precond and fixed choices. + int32 param_interned_str = 5; Expr precond = 6; + repeated TemplateChoice fixed_choices = 7; } // Exception definition