update canton to 20240410.13059.vaa7f9dde (#18971)

tell-slack: canton

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
This commit is contained in:
azure-pipelines[bot] 2024-04-10 17:14:58 +02:00 committed by GitHub
parent 0b4f060244
commit f813d79a34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
47 changed files with 82 additions and 55 deletions

View File

@ -26,6 +26,7 @@ message SerializableContract {
message GlobalKey { message GlobalKey {
bytes template_id = 1; bytes template_id = 1;
bytes key = 2; bytes key = 2;
string package_name = 3;
} }
message AggregationRule { message AggregationRule {

View File

@ -187,7 +187,7 @@ message ActionDescription {
bytes node_seed = 6; bytes node_seed = 6;
bool failed = 8; bool failed = 8;
optional string interface_id = 9; optional string interface_id = 9;
optional string template_id = 10; string template_id = 10;
repeated string package_preference = 11; repeated string package_preference = 11;
} }

View File

@ -138,7 +138,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
seed <- seedO.toRight(InvalidActionDescription("No seed for an Exercise node given")) seed <- seedO.toRight(InvalidActionDescription("No seed for an Exercise node given"))
actionDescription <- ExerciseActionDescription.create( actionDescription <- ExerciseActionDescription.create(
inputContract, inputContract,
Some(templateId), templateId,
choice, choice,
interfaceId, interfaceId,
packagePreference, packagePreference,
@ -225,7 +225,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
) = e ) = e
for { for {
inputContractId <- ProtoConverter.parseLfContractId(inputContractIdP) inputContractId <- ProtoConverter.parseLfContractId(inputContractIdP)
templateId <- templateIdP.traverse(RefIdentifierSyntax.fromProtoPrimitive) templateId <- RefIdentifierSyntax.fromProtoPrimitive(templateIdP)
packagePreference <- packagePreferenceP.traverse(ProtoConverter.parsePackageId).map(_.toSet) packagePreference <- packagePreferenceP.traverse(ProtoConverter.parsePackageId).map(_.toSet)
choice <- choiceFromProto(choiceP) choice <- choiceFromProto(choiceP)
interfaceId <- interfaceIdP.traverse(RefIdentifierSyntax.fromProtoPrimitive) interfaceId <- interfaceIdP.traverse(RefIdentifierSyntax.fromProtoPrimitive)
@ -335,7 +335,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
/** @throws InvalidActionDescription if the `chosen_value` cannot be serialized */ /** @throws InvalidActionDescription if the `chosen_value` cannot be serialized */
final case class ExerciseActionDescription private ( final case class ExerciseActionDescription private (
inputContractId: LfContractId, inputContractId: LfContractId,
templateId: Option[LfTemplateId], templateId: LfTemplateId,
choice: LfChoiceName, choice: LfChoiceName,
interfaceId: Option[LfInterfaceId], interfaceId: Option[LfInterfaceId],
packagePreference: Set[LfPackageId], packagePreference: Set[LfPackageId],
@ -359,7 +359,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
v30.ActionDescription.Description.Exercise( v30.ActionDescription.Description.Exercise(
v30.ActionDescription.ExerciseActionDescription( v30.ActionDescription.ExerciseActionDescription(
inputContractId = inputContractId.toProtoPrimitive, inputContractId = inputContractId.toProtoPrimitive,
templateId = templateId.map(i => new RefIdentifierSyntax(i).toProtoPrimitive), templateId = new RefIdentifierSyntax(templateId).toProtoPrimitive,
packagePreference = packagePreference.toSeq, packagePreference = packagePreference.toSeq,
choice = choice, choice = choice,
interfaceId = interfaceId.map(i => new RefIdentifierSyntax(i).toProtoPrimitive), interfaceId = interfaceId.map(i => new RefIdentifierSyntax(i).toProtoPrimitive),
@ -386,7 +386,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
object ExerciseActionDescription { object ExerciseActionDescription {
def tryCreate( def tryCreate(
inputContractId: LfContractId, inputContractId: LfContractId,
templateId: Option[LfTemplateId], templateId: LfTemplateId,
choice: LfChoiceName, choice: LfChoiceName,
interfaceId: Option[LfInterfaceId], interfaceId: Option[LfInterfaceId],
packagePreference: Set[LfPackageId], packagePreference: Set[LfPackageId],
@ -412,7 +412,7 @@ object ActionDescription extends HasProtocolVersionedCompanion[ActionDescription
def create( def create(
inputContractId: LfContractId, inputContractId: LfContractId,
templateId: Option[LfTemplateId], templateId: LfTemplateId,
choice: LfChoiceName, choice: LfChoiceName,
interfaceId: Option[LfInterfaceId], interfaceId: Option[LfInterfaceId],
packagePreference: Set[LfPackageId], packagePreference: Set[LfPackageId],

View File

@ -177,7 +177,7 @@ final case class ViewParticipantData private (
case ExerciseActionDescription( case ExerciseActionDescription(
inputContractId, inputContractId,
commandTemplateId, templateId,
choice, choice,
interfaceId, interfaceId,
packagePreference, packagePreference,
@ -194,12 +194,6 @@ final case class ViewParticipantData private (
), ),
) )
// commandTemplateId is not populated prior to ProtocolVersion.v5
val templateId = commandTemplateId match {
case Some(templateId) => templateId
case _ => inputContract.contract.contractInstance.unversioned.template
}
val cmd = if (byKey) { val cmd = if (byKey) {
val key = inputContract.contract.metadata.maybeKey val key = inputContract.contract.metadata.maybeKey
.map(_.key) .map(_.key)

View File

@ -4,6 +4,7 @@
package com.digitalasset.canton.protocol package com.digitalasset.canton.protocol
import cats.syntax.either.* import cats.syntax.either.*
import com.daml.lf.data.Ref
import com.daml.lf.value.{ValueCoder, ValueOuterClass} import com.daml.lf.value.{ValueCoder, ValueOuterClass}
import com.digitalasset.canton.serialization.ProtoConverter import com.digitalasset.canton.serialization.ProtoConverter
import com.digitalasset.canton.serialization.ProtoConverter.ParsingResult import com.digitalasset.canton.serialization.ProtoConverter.ParsingResult
@ -19,7 +20,11 @@ object GlobalKeySerialization {
keyP <- ValueCoder keyP <- ValueCoder
.encodeVersionedValue(globalKey.map(_.key)) .encodeVersionedValue(globalKey.map(_.key))
.leftMap(_.errorMessage) .leftMap(_.errorMessage)
} yield v30.GlobalKey(templateId = templateIdP.toByteString, key = keyP.toByteString) } yield v30.GlobalKey(
templateId = templateIdP.toByteString,
key = keyP.toByteString,
globalKey.unversioned.packageName,
)
} }
def assertToProto(key: LfVersioned[LfGlobalKey]): v30.GlobalKey = def assertToProto(key: LfVersioned[LfGlobalKey]): v30.GlobalKey =
@ -30,7 +35,7 @@ object GlobalKeySerialization {
) )
def fromProtoV30(globalKeyP: v30.GlobalKey): ParsingResult[LfVersioned[LfGlobalKey]] = { def fromProtoV30(globalKeyP: v30.GlobalKey): ParsingResult[LfVersioned[LfGlobalKey]] = {
val v30.GlobalKey(templateIdBytes, keyBytes) = globalKeyP val v30.GlobalKey(templateIdBytes, keyBytes, packageNameP) = globalKeyP
for { for {
templateIdP <- ProtoConverter.protoParser(ValueOuterClass.Identifier.parseFrom)( templateIdP <- ProtoConverter.protoParser(ValueOuterClass.Identifier.parseFrom)(
templateIdBytes templateIdBytes
@ -51,12 +56,15 @@ object GlobalKeySerialization {
ProtoDeserializationError.ValueDeserializationError("GlobalKey.proto", err.toString) ProtoDeserializationError.ValueDeserializationError("GlobalKey.proto", err.toString)
) )
globalKey <- packageName <- Ref.PackageName
LfGlobalKey .fromString(packageNameP)
.build(templateId, versionedKey.unversioned) .leftMap(err => ProtoDeserializationError.ValueDeserializationError("GlobalKey.proto", err))
.leftMap(err =>
ProtoDeserializationError.ValueDeserializationError("GlobalKey.key", err.toString) globalKey <- LfGlobalKey
) .build(templateId, versionedKey.unversioned, packageName)
.leftMap(err =>
ProtoDeserializationError.ValueDeserializationError("GlobalKey.key", err.toString)
)
} yield LfVersioned(versionedKey.version, globalKey) } yield LfVersioned(versionedKey.version, globalKey)
} }

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: CantonExamples name: CantonExamples

View File

@ -33,7 +33,7 @@ class ActionDescriptionTest extends AnyWordSpec with BaseTest {
"the choice argument cannot be serialized" in { "the choice argument cannot be serialized" in {
ExerciseActionDescription.create( ExerciseActionDescription.create(
suffixedId, suffixedId,
templateId = Some(defaultTemplateId), templateId = defaultTemplateId,
choiceName, choiceName,
None, None,
Set.empty, Set.empty,
@ -58,6 +58,7 @@ class ActionDescriptionTest extends AnyWordSpec with BaseTest {
.build( .build(
LfTransactionBuilder.defaultTemplateId, LfTransactionBuilder.defaultTemplateId,
ExampleTransactionFactory.veryDeepValue, ExampleTransactionFactory.veryDeepValue,
ExampleTransactionFactory.packageName,
) )
.value, .value,
), ),

View File

@ -138,7 +138,7 @@ final class GeneratorsData(
for { for {
inputContractId <- Arbitrary.arbitrary[LfContractId] inputContractId <- Arbitrary.arbitrary[LfContractId]
templateId <- Gen.option(Arbitrary.arbitrary[LfTemplateId]) templateId <- Arbitrary.arbitrary[LfTemplateId]
choice <- Arbitrary.arbitrary[LfChoiceName] choice <- Arbitrary.arbitrary[LfChoiceName]

View File

@ -36,6 +36,7 @@ class TransactionViewTest extends AnyWordSpec with BaseTest with HasExecutionCon
.build( .build(
LfTransactionBuilder.defaultTemplateId, LfTransactionBuilder.defaultTemplateId,
Value.ValueInt64(100L), Value.ValueInt64(100L),
LfTransactionBuilder.defaultPackageName,
) )
.value .value

View File

@ -111,10 +111,11 @@ object ExampleTransactionFactory {
def globalKey( def globalKey(
templateId: LfTemplateId, templateId: LfTemplateId,
value: LfValue, value: LfValue,
packageName: LfPackageName = packageName,
): Versioned[LfGlobalKey] = ): Versioned[LfGlobalKey] =
LfVersioned( LfVersioned(
transactionVersion, transactionVersion,
LfGlobalKey.assertBuild(templateId, value), LfGlobalKey.assertBuild(templateId, value, packageName),
) )
def globalKeyWithMaintainers( def globalKeyWithMaintainers(

View File

@ -283,6 +283,7 @@ class WellFormedTransactionTest extends AnyWordSpec with BaseTest with HasExecut
templateId, templateId,
contractInst.unversioned.arg, contractInst.unversioned.arg,
Set.empty, Set.empty,
packageName,
) )
), ),
), ),

View File

@ -33,6 +33,7 @@ object LfTransactionBuilder {
val defaultGlobalKey: LfGlobalKey = LfGlobalKey.assertBuild( val defaultGlobalKey: LfGlobalKey = LfGlobalKey.assertBuild(
defaultTemplateId, defaultTemplateId,
Value.ValueUnit, Value.ValueUnit,
defaultPackageName,
) )
def allocateNodeId[M[_]](implicit monadInstance: Monad[M]): StateT[M, NodeIdState, LfNodeId] = def allocateNodeId[M[_]](implicit monadInstance: Monad[M]): StateT[M, NodeIdState, LfNodeId] =

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: ai-analysis name: ai-analysis

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: bank name: bank

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: doctor name: doctor

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: health-insurance name: health-insurance

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: medical-records name: medical-records

View File

@ -252,7 +252,7 @@ private[platform] object InMemoryStateUpdater {
arg = createdEvent.createArgument, arg = createdEvent.createArgument,
), ),
globalKey = createdEvent.contractKey.map(k => globalKey = createdEvent.contractKey.map(k =>
Key.assertBuild(createdEvent.templateId, k.unversioned) Key.assertBuild(createdEvent.templateId, k.unversioned, createdEvent.packageName)
), ),
ledgerEffectiveTime = createdEvent.ledgerEffectiveTime, ledgerEffectiveTime = createdEvent.ledgerEffectiveTime,
stakeholders = createdEvent.flatEventWitnesses.map(Party.assertFromString), stakeholders = createdEvent.flatEventWitnesses.map(Party.assertFromString),
@ -266,7 +266,11 @@ private[platform] object InMemoryStateUpdater {
ContractStateEvent.Archived( ContractStateEvent.Archived(
contractId = exercisedEvent.contractId, contractId = exercisedEvent.contractId,
globalKey = exercisedEvent.contractKey.map(k => globalKey = exercisedEvent.contractKey.map(k =>
Key.assertBuild(exercisedEvent.templateId, k.unversioned) Key.assertBuild(
exercisedEvent.templateId,
k.unversioned,
exercisedEvent.packageName,
)
), ),
stakeholders = exercisedEvent.flatEventWitnesses.map(Party.assertFromString), stakeholders = exercisedEvent.flatEventWitnesses.map(Party.assertFromString),
eventOffset = exercisedEvent.eventOffset, eventOffset = exercisedEvent.eventOffset,

View File

@ -88,6 +88,7 @@ private[dao] sealed class ContractsReader(
GlobalKey.assertBuild( GlobalKey.assertBuild(
contract.unversioned.template, contract.unversioned.template,
value.unversioned, value.unversioned,
contract.unversioned.packageName,
) )
} }

View File

@ -282,7 +282,7 @@ final class LfValueTranslation(
globalKey <- createKey globalKey <- createKey
.traverse(key => .traverse(key =>
GlobalKey GlobalKey
.build(templateId, key.unversioned) .build(templateId, key.unversioned, packageName)
.left .left
.map(_.msg) .map(_.msg)
) )
@ -406,7 +406,7 @@ final class LfValueTranslation(
globalKey <- createKey globalKey <- createKey
.traverse(key => .traverse(key =>
GlobalKey GlobalKey
.build(templateId, key.unversioned) .build(templateId, key.unversioned, createdEvent.packageName)
.left .left
.map(_.msg) .map(_.msg)
) )

View File

@ -275,6 +275,7 @@ object ValidateDisclosedContractsTest {
), ),
), ),
api.keyMaintainers, api.keyMaintainers,
Ref.PackageName.assertFromString(api.packageName),
) )
private val keyHash: Hash = keyWithMaintainers.globalKey.hash private val keyHash: Hash = keyWithMaintainers.globalKey.hash

View File

@ -65,6 +65,7 @@ object DisclosedContractCreator {
), ),
), ),
api.keyMaintainers, api.keyMaintainers,
Ref.PackageName.assertFromString(api.packageName),
) )
val fatContractInstance: FatContractInstance = FatContractInstance.fromCreateNode( val fatContractInstance: FatContractInstance = FatContractInstance.fromCreateNode(

View File

@ -118,7 +118,8 @@ class CommandSubmissionServiceImplSpec
LfError.Interpretation( LfError.Interpretation(
LfError.Interpretation.DamlException( LfError.Interpretation.DamlException(
LfInterpretationError.DuplicateContractKey( LfInterpretationError.DuplicateContractKey(
GlobalKey.assertBuild(tmplId, Value.ValueUnit) GlobalKey
.assertBuild(tmplId, Value.ValueUnit, PackageName.assertFromString("pkg-name"))
) )
), ),
None, None,

View File

@ -295,7 +295,7 @@ class UpdateToDbDtoSpec extends AnyWordSpec with Matchers {
create_key_maintainers = Some(Set("signatory2", "signatory3")), create_key_maintainers = Some(Set("signatory2", "signatory3")),
create_key_hash = Some( create_key_hash = Some(
GlobalKey GlobalKey
.assertBuild(contractTemplate, keyValue) .assertBuild(contractTemplate, keyValue, createNode.packageName)
.hash .hash
.bytes .bytes
.toHexString .toHexString

View File

@ -171,6 +171,7 @@ class ContractStateCachesSpec
GlobalKey.assertBuild( GlobalKey.assertBuild(
Identifier.assertFromString(s"some:template:name"), Identifier.assertFromString(s"some:template:name"),
ValueInt64(id.toLong), ValueInt64(id.toLong),
Ref.PackageName.assertFromString("pkg-name"),
) )
private def contract(id: Int): Contract = { private def contract(id: Int): Contract = {

View File

@ -227,6 +227,7 @@ private object MutableCacheBackedContractStoreRaceTests {
keyIdx -> GlobalKey.assertBuild( keyIdx -> GlobalKey.assertBuild(
Identifier.assertFromString("pkgId:module:entity"), Identifier.assertFromString("pkgId:module:entity"),
ValueInt64(keyIdx), ValueInt64(keyIdx),
Ref.PackageName.assertFromString("pkg-name"),
) )
}.toMap }.toMap

View File

@ -397,6 +397,7 @@ object MutableCacheBackedContractStoreSpec {
GlobalKey.assertBuild( GlobalKey.assertBuild(
Identifier.assertFromString(s"some:template:$desc"), Identifier.assertFromString(s"some:template:$desc"),
ValueText(desc), ValueText(desc),
Ref.PackageName.assertFromString("pkg-name"),
) )
private def offset(idx: Long) = Offset.fromByteArray(BigInt(idx).toByteArray) private def offset(idx: Long) = Offset.fromByteArray(BigInt(idx).toByteArray)

View File

@ -80,6 +80,7 @@ private[dao] trait JdbcLedgerDaoContractsSpec extends LoneElement with Inside wi
someTemplateId, someTemplateId,
aTextValue, aTextValue,
Set(alice, bob), Set(alice, bob),
somePackageName,
) )
for { for {

View File

@ -21,6 +21,7 @@ private[dao] trait JdbcLedgerDaoEventsSpec extends LoneElement with Inside with
GlobalKey.assertBuild( GlobalKey.assertBuild(
someTemplateId, someTemplateId,
someContractKey(alice, value), someContractKey(alice, value),
somePackageName,
), ),
Set(alice), Set(alice),
) )

View File

@ -342,7 +342,7 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend with OptionVa
maintainers: Set[Party] maintainers: Set[Party]
): GlobalKeyWithMaintainers = { ): GlobalKeyWithMaintainers = {
val aTextValue = ValueText(scala.util.Random.nextString(10)) val aTextValue = ValueText(scala.util.Random.nextString(10))
GlobalKeyWithMaintainers.assertBuild(someTemplateId, aTextValue, maintainers) GlobalKeyWithMaintainers.assertBuild(someTemplateId, aTextValue, maintainers, somePackageName)
} }
protected final def createAndStoreContract( protected final def createAndStoreContract(

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --enable-interfaces=yes - --enable-interfaces=yes
name: carbonv1-tests name: carbonv1-tests

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --enable-interfaces=yes - --enable-interfaces=yes
name: carbonv2-tests name: carbonv2-tests

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
name: experimental-tests name: experimental-tests
source: . source: .
version: 3.1.0 version: 3.1.0

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --enable-interfaces=yes - --enable-interfaces=yes
name: model-tests name: model-tests

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
name: package-management-tests name: package-management-tests
source: . source: .
version: 3.1.0 version: 3.1.0

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --enable-interfaces=yes - --enable-interfaces=yes
name: semantic-tests name: semantic-tests

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
name: upgrade-tests name: upgrade-tests
source: . source: .
version: 1.0.0 version: 1.0.0

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
name: upgrade-tests name: upgrade-tests
source: . source: .
version: 2.0.0 version: 2.0.0

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
name: upgrade-tests name: upgrade-tests
source: . source: .
version: 3.0.0 version: 3.0.0

View File

@ -272,6 +272,7 @@ object CommandExecutionErrors extends CommandExecutionErrorGroup {
Seq( Seq(
(ErrorResource.TemplateId, key.templateId.toString), (ErrorResource.TemplateId, key.templateId.toString),
(ErrorResource.ContractKey, encodedKey), (ErrorResource.ContractKey, encodedKey),
(ErrorResource.PackageName, key.packageName),
) )
} }
} }
@ -323,6 +324,7 @@ object CommandExecutionErrors extends CommandExecutionErrorGroup {
(ErrorResource.ContractId, err.coid.coid), (ErrorResource.ContractId, err.coid.coid),
(ErrorResource.ContractKey, encodedKey), (ErrorResource.ContractKey, encodedKey),
(ErrorResource.ContractKeyHash, err.declaredHash.toString), (ErrorResource.ContractKeyHash, err.declaredHash.toString),
(ErrorResource.PackageName, err.key.packageName),
) )
} }
} }

View File

@ -146,6 +146,7 @@ object ConsistencyErrors extends ConsistencyErrorGroup {
// If the key is big, it can force chunking other resources. // If the key is big, it can force chunking other resources.
(ErrorResource.TemplateId, key.templateId.toString), (ErrorResource.TemplateId, key.templateId.toString),
(ErrorResource.ContractKey, encodedKey), (ErrorResource.ContractKey, encodedKey),
(ErrorResource.PackageName, key.packageName),
) )
} }
} }
@ -203,6 +204,7 @@ object ConsistencyErrors extends ConsistencyErrorGroup {
// If the key is big, it can force chunking other resources. // If the key is big, it can force chunking other resources.
(ErrorResource.TemplateId, key.templateId.toString), (ErrorResource.TemplateId, key.templateId.toString),
(ErrorResource.ContractKey, encodedKey), (ErrorResource.ContractKey, encodedKey),
(ErrorResource.PackageName, key.packageName),
) )
} }
} }

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: JsonEncodingTest name: JsonEncodingTest

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.dev - --target=2.dev
name: JsonEncodingTestDev name: JsonEncodingTestDev

View File

@ -1,4 +1,4 @@
sdk-version: 3.1.0-snapshot.20240405.12988.0.vc3194058 sdk-version: 3.1.0-snapshot.20240408.12992.0.v0ec87985
build-options: build-options:
- --target=2.1 - --target=2.1
name: AdminWorkflows name: AdminWorkflows

View File

@ -13,7 +13,7 @@ import com.digitalasset.canton.protocol.*
import com.digitalasset.canton.sequencing.protocol.MediatorsOfDomain import com.digitalasset.canton.sequencing.protocol.MediatorsOfDomain
import com.digitalasset.canton.topology.MediatorGroup.MediatorGroupIndex import com.digitalasset.canton.topology.MediatorGroup.MediatorGroupIndex
import com.digitalasset.canton.topology.{DomainId, UniqueIdentifier} import com.digitalasset.canton.topology.{DomainId, UniqueIdentifier}
import com.digitalasset.canton.util.LfTransactionBuilder.defaultTemplateId import com.digitalasset.canton.util.LfTransactionBuilder.{defaultPackageName, defaultTemplateId}
import com.digitalasset.canton.{BaseTest, LfPackageName, LfPartyId, protocol} import com.digitalasset.canton.{BaseTest, LfPackageName, LfPartyId, protocol}
import org.scalatest.Assertion import org.scalatest.Assertion
import org.scalatest.wordspec.AnyWordSpec import org.scalatest.wordspec.AnyWordSpec
@ -172,6 +172,7 @@ class SerializableContractAuthenticatorImplTest extends AnyWordSpec with BaseTes
key = LfGlobalKey.assertBuild( key = LfGlobalKey.assertBuild(
defaultTemplateId, defaultTemplateId,
Value.ValueInt64(0), Value.ValueInt64(0),
defaultPackageName,
), ),
maintainers = maintainers, maintainers = maintainers,
) )

View File

@ -11,6 +11,7 @@ import com.digitalasset.canton.participant.store.memory.InMemoryContractStore
import com.digitalasset.canton.protocol.ExampleTransactionFactory.{ import com.digitalasset.canton.protocol.ExampleTransactionFactory.{
asSerializable, asSerializable,
contractInstance, contractInstance,
packageName,
transactionId, transactionId,
} }
import com.digitalasset.canton.protocol.* import com.digitalasset.canton.protocol.*
@ -97,12 +98,12 @@ class ExtendedContractLookupTest extends AsyncWordSpec with BaseTest {
val transactionId1 = transactionId(1) val transactionId1 = transactionId(1)
val transactionId2 = transactionId(2) val transactionId2 = transactionId(2)
val key00: LfGlobalKey = val key00: LfGlobalKey =
LfGlobalKey.build(instance0Template, ValueUnit).value LfGlobalKey.build(instance0Template, ValueUnit, packageName).value
val key1: LfGlobalKey = val key1: LfGlobalKey =
LfGlobalKey.build(instance0Template, ValueText("abc")).value LfGlobalKey.build(instance0Template, ValueText("abc"), packageName).value
val forbiddenKey: LfGlobalKey = val forbiddenKey: LfGlobalKey =
LfGlobalKey LfGlobalKey
.build(instance0Template, ValueText("forbiddenKey")) .build(instance0Template, ValueText("forbiddenKey"), packageName)
.value .value
val alice = LfPartyId.assertFromString("alice") val alice = LfPartyId.assertFromString("alice")
val bob = LfPartyId.assertFromString("bob") val bob = LfPartyId.assertFromString("bob")

View File

@ -1 +1 @@
20240409.13054.v4f1ad842 20240410.13059.vaa7f9dde