Fix merge conflict in KVUtils test adapter (#6748)

NodeId from the Transaction object got deprecated.

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2020-07-15 21:30:01 +02:00 committed by GitHub
parent 471863570a
commit 91302d0f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ package com.daml.ledger.participant.state.kvutils.test
import com.daml.lf.data._
import com.daml.lf.language.Ast
import com.daml.lf.transaction.{Transaction => Tx, Node}
import com.daml.lf.transaction.{Transaction => Tx, Node, NodeId}
import com.daml.lf.transaction.test.{TransactionBuilder => TxBuilder}
import com.daml.lf.value.Value
import com.daml.lf.value.Value.ContractId
@ -15,14 +15,14 @@ import scala.collection.mutable
private[test] final class Adapter(packages: Map[Ref.PackageId, Ast.Package]) {
def adapt(tx: Tx.Transaction): Tx.SubmittedTransaction =
tx.foldWithPathState(new TxBuilder, Option.empty[Tx.NodeId])(
tx.foldWithPathState(new TxBuilder, Option.empty[NodeId])(
(builder, parent, _, node) =>
(builder, Some(parent.fold(builder.add(adapt(node)))(builder.add(adapt(node), _))))
)
.buildSubmitted()
// drop value version and children
private[this] def adapt(node: Tx.Node): Node.GenNode[Tx.NodeId, ContractId, Value[ContractId]] =
private[this] def adapt(node: Tx.Node): Node.GenNode[NodeId, ContractId, Value[ContractId]] =
node match {
case create: Node.NodeCreate.WithTxValue[ContractId] =>
create.copy(
@ -30,7 +30,7 @@ private[test] final class Adapter(packages: Map[Ref.PackageId, Ast.Package]) {
optLocation = None,
key = create.key.map(adapt)
)
case exe: Node.NodeExercises.WithTxValue[Tx.NodeId, ContractId] =>
case exe: Node.NodeExercises.WithTxValue[NodeId, ContractId] =>
exe.copy(
templateId = adapt(exe.templateId),
optLocation = None,