Skip to content

Commit

Permalink
wip: version client feature -- TODO: static time, command dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaanm-da committed Jan 17, 2022
1 parent 4514873 commit 7e7d38c
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@

package com.daml.ledger.client.services.version.withoutledgerid

import com.daml.ledger.api.domain.Feature.CommandDeduplication
import com.daml.ledger.api.domain.{Feature, LedgerId}
import com.daml.ledger.api.v1.experimental_features.ExperimentalFeatures
import com.daml.ledger.api.v1.version_service.{
CommandDeduplicationFeatures,
FeaturesDescriptor,
GetLedgerApiVersionRequest,
}
import com.daml.ledger.api.v1.version_service.{FeaturesDescriptor, GetLedgerApiVersionRequest}
import com.daml.ledger.api.v1.version_service.VersionServiceGrpc.VersionServiceStub
import com.daml.ledger.client.LedgerClient
import scalaz.syntax.tag._
Expand Down Expand Up @@ -46,22 +41,15 @@ private[daml] final class VersionClient(service: VersionServiceStub) {
private[daml] object VersionClient {
def fromProto(featuresDescriptor: FeaturesDescriptor): Seq[Feature] =
featuresDescriptor match {
case FeaturesDescriptor(userManagement, experimentalFeatures, commandDeduplication) =>
case FeaturesDescriptor(userManagement, experimentalFeatures) =>
(userManagement.toSeq map (_ => Feature.UserManagement)) ++
(experimentalFeatures.toSeq flatMap fromProto) ++
(commandDeduplication.toSeq flatMap fromProto)
(experimentalFeatures.toSeq flatMap fromProto)
}

def fromProto(experimentalFeatures: ExperimentalFeatures): Seq[Feature] =
experimentalFeatures match {
case ExperimentalFeatures(selfServiceErrorCodes) =>
case ExperimentalFeatures(selfServiceErrorCodes, _, _) => // TODO: static time, command dedup
selfServiceErrorCodes.toSeq map (_ => Feature.SelfServiceErrorCodes)
}

def fromProto(commandDeduplication: CommandDeduplicationFeatures): Seq[Feature] = {
commandDeduplication match {
case _ => Seq(CommandDeduplication()) // TODO
}
}

}

0 comments on commit 7e7d38c

Please sign in to comment.