remove the minInterfaces feature flag in TransactionVersion (#18446)

This commit is contained in:
Paul Brauner 2024-02-12 11:05:47 +01:00 committed by GitHub
parent f42a6d526e
commit d0639566a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 16 deletions

View File

@ -29,8 +29,6 @@ import scalaz.scalacheck.ScalaCheckBinding._
object ValueGenerators {
import TransactionVersion.minInterfaces
// generate decimal values
def numGen(scale: Numeric.Scale): Gen[Numeric] = {
val num = for {
@ -377,7 +375,7 @@ object ValueGenerators {
targetCoid <- coidGen
pkgName <- pkgNameGen(version)
templateId <- idGen
interfaceId <- if (version < minInterfaces) Gen.const(None) else Gen.option(idGen)
interfaceId <- Gen.option(idGen)
choiceId <- nameGen
consume <- Gen.oneOf(true, false)
actingParties <- genNonEmptyParties

View File

@ -301,11 +301,9 @@ object TransactionCoder {
if (nodeVersion >= TransactionVersion.minByKey) {
discard(builder.setByKey(ne.byKey))
}
if (nodeVersion >= TransactionVersion.minInterfaces) {
ne.interfaceId.foreach(iface =>
builder.setInterfaceId(ValueCoder.encodeIdentifier(iface))
)
}
ne.interfaceId.foreach(iface =>
builder.setInterfaceId(ValueCoder.encodeIdentifier(iface))
)
for {
encodedPkgName <- encodePackageName(ne.packageName, nodeVersion)
_ = builder.setPackageName(encodedPkgName)
@ -552,7 +550,7 @@ object TransactionCoder {
protoExe.getByKey
else false
interfaceId <-
if (nodeVersion >= TransactionVersion.minInterfaces && protoExe.hasInterfaceId) {
if (protoExe.hasInterfaceId) {
ValueCoder.decodeIdentifier(protoExe.getInterfaceId).map(Some(_))
} else {
Right(None)

View File

@ -48,10 +48,8 @@ object TransactionVersion {
val minVersion: TransactionVersion = All.min
def maxVersion: TransactionVersion = VDev
// TODO(https://github.com/digital-asset/daml/issues/18240) remove these 3 feature flags and kill
// the transitively dead code. Make sure canton doesn't mention them anymore.
// TODO(https://github.com/digital-asset/daml/issues/18240) move this feature flag to VDev.
private[lf] val minByKey = V14
private[lf] val minInterfaces = V15
private[lf] val minUpgrade = V31
private[lf] val minSharedKeys = V31

View File

@ -1115,10 +1115,7 @@ class TransactionCoderSpec
case _ => exe
}
node.copy(
interfaceId =
if (exe.version >= TransactionVersion.minInterfaces)
exe.interfaceId
else None,
interfaceId = exe.interfaceId,
chosenValue = normalize(exe.chosenValue, exe.version),
exerciseResult = exe.exerciseResult.map(normalize(_, exe.version)),
choiceObservers = exe.choiceObservers,