mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
remove the minInterfaces feature flag in TransactionVersion (#18446)
This commit is contained in:
parent
f42a6d526e
commit
d0639566a2
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user