Skip to content

Commit

Permalink
a bit more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
remyhaemmerle-da committed Nov 9, 2021
1 parent c788676 commit 5bd4db3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.daml.lf.transaction.{
NodeId,
SubmittedTransaction,
VersionedTransaction,
Transaction => GenTx,
Transaction => Tx,
TransactionVersion => TxVersions,
}
Expand Down Expand Up @@ -1196,7 +1195,7 @@ class EngineTest
}
}

def txFetchActors(tx: GenTx): Set[Party] =
def txFetchActors(tx: Tx): Set[Party] =
tx.fold(Set[Party]()) { case (actors, (_, n)) =>
actors union actFetchActors(n)
}
Expand Down Expand Up @@ -1369,9 +1368,7 @@ class EngineTest
lookerUpCid -> lookerUpInst,
)

def firstLookupNode(
tx: GenTx
): Option[(NodeId, Node.LookupByKey)] =
def firstLookupNode(tx: Tx): Option[(NodeId, Node.LookupByKey)] =
tx.nodes.collectFirst { case (nid, nl @ Node.LookupByKey(_, _, _, _)) =>
nid -> nl
}
Expand Down Expand Up @@ -2213,7 +2210,7 @@ object EngineTest {
dependsOnTime: Boolean = false,
nodeSeeds: BackStack[(NodeId, crypto.Hash)] = BackStack.empty,
) {
def commit(tr: GenTx, meta: Tx.Metadata) = {
def commit(tr: Tx, meta: Tx.Metadata) = {
val (newContracts, newKeys) = tr.fold((contracts, keys)) {
case ((contracts, keys), (_, exe: Node.Exercise)) =>
(contracts - exe.targetCoid, keys)
Expand Down Expand Up @@ -2306,10 +2303,7 @@ object EngineTest {
finalState.map(state =>
(
TxVersions.asVersionedTransaction(
GenTx(
state.nodes,
state.roots.toImmArray,
)
Tx(state.nodes, state.roots.toImmArray)
),
Tx.Metadata(
submissionSeed = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.daml.lf.data.{BackStack, ImmArray, Ref, Time}
import com.daml.lf.ledger.{Authorize, FailedAuthorization}
import com.daml.lf.transaction.{
ContractKeyUniquenessMode,
Transaction,
GlobalKey,
Node,
NodeId,
Expand Down Expand Up @@ -325,7 +324,7 @@ private[speedy] case class PartialTransaction(

nodes.keySet diff allChildNodeIds
}
val tx = Transaction(nodes, rootNodes.to(ImmArray))
val tx = Tx(nodes, rootNodes.to(ImmArray))

tx.foreach { (nid, node) =>
val rootPrefix = if (rootNodes.contains(nid)) "root " else ""
Expand Down Expand Up @@ -370,7 +369,7 @@ private[speedy] case class PartialTransaction(
context.info match {
case _: RootContextInfo if aborted.isEmpty =>
val roots = context.children.toImmArray
val tx0 = Transaction(nodes, roots)
val tx0 = Tx(nodes, roots)
val (tx, seeds) = NormalizeRollbacks.normalizeTx(tx0)
CompleteTransaction(
SubmittedTransaction(
Expand All @@ -389,7 +388,7 @@ private[speedy] case class PartialTransaction(
val ptx = unwind()

transaction.IncompleteTransaction(
Transaction(
Tx(
ptx.nodes,
ptx.context.children.toImmArray.toSeq.sortBy(_.index).toImmArray,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ object TransactionSpec {

import TransactionBuilder.Implicits._

type Transaction = Transaction
def mkTransaction(
nodes: HashMap[NodeId, Node],
roots: ImmArray[NodeId],
Expand Down

0 comments on commit 5bd4db3

Please sign in to comment.