DAML-LF: unset the field NodeFecth#value_version in transaction.proto (#6784)

According transaction specification the field `value_version` "is
optional; if defined, it must be a version ofthe value
specification, and `template_id` shall be consumed according to
that version.  Otherwise, it is assumed to be version 1."

We take advantage that the encoding of identifier in value does not
change since version "1" to unset the field `value_version`, hence
using the default interpretation.

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Remy 2020-07-20 17:50:59 +02:00 committed by GitHub
parent 5f4dd39b5d
commit fca9f3d90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,14 +186,13 @@ object TransactionCoder {
} }
case nf @ NodeFetch(_, _, _, _, _, _, _) => case nf @ NodeFetch(_, _, _, _, _, _, _) =>
val (vversion, etid) = ValueCoder.encodeIdentifier( val (_, etid) = ValueCoder.encodeIdentifier(
nf.templateId, nf.templateId,
valueVersion1Only(transactionVersion) option ValueVersion("1"), valueVersion1Only(transactionVersion) option ValueVersion("1"),
) )
val fetchBuilder = TransactionOuterClass.NodeFetch val fetchBuilder = TransactionOuterClass.NodeFetch
.newBuilder() .newBuilder()
.setTemplateId(etid) .setTemplateId(etid)
.setValueVersion(vversion.protoValue)
.addAllStakeholders(nf.stakeholders.toSet[String].asJava) .addAllStakeholders(nf.stakeholders.toSet[String].asJava)
.addAllSignatories(nf.signatories.toSet[String].asJava) .addAllSignatories(nf.signatories.toSet[String].asJava)