final case class Transaction(nodes: Map[NodeId, Node], roots: ImmArray[NodeId]) extends HasTxNodes with CidContainer[Transaction] with Product with Serializable
General transaction type
Abstracts over NodeId type and ContractId type ContractId restricts the occurrence of contractIds
- nodes
The nodes of this transaction.
- roots
References to the root nodes of the transaction. Users of this class may assume that all instances are well-formed, i.e.,
isWellFormed.isEmpty
. For performance reasons, users are not required to callisWellFormed
. Therefore, it is forbidden to create ill-formed instances, i.e., instances with!isWellFormed.isEmpty
.
- Alphabetic
- By Inheritance
- Transaction
- Serializable
- Product
- Equals
- CidContainer
- HasTxNodes
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Transaction(nodes: Map[NodeId, Node], roots: ImmArray[NodeId])
- nodes
The nodes of this transaction.
- roots
References to the root nodes of the transaction. Users of this class may assume that all instances are well-formed, i.e.,
isWellFormed.isEmpty
. For performance reasons, users are not required to callisWellFormed
. Therefore, it is forbidden to create ill-formed instances, i.e., instances with!isWellFormed.isEmpty
.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def cids: Set[ContractId]
- Definition Classes
- CidContainer
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def collectCids(acc: Set[ContractId]): Set[ContractId]
- Definition Classes
- CidContainer
- def compareForest(other: Transaction)(compare: (Node, Node) => Boolean): Boolean
Compares two Transactions up to renaming of Nids.
Compares two Transactions up to renaming of Nids. with the specified comparision of nodes Nid is irrelevant to the content of the transaction.
- final def consumedContracts[Cid2 >: ContractId]: Set[Cid2]
Returns the IDs of all the consumed contracts.
Returns the IDs of all the consumed contracts. This includes transient contracts but it does not include contracts consumed in rollback nodes.
- Definition Classes
- HasTxNodes
- def contractKeyInputs: Either[KeyInputError, Map[GlobalKey, KeyInput]]
Return the expected contract key inputs (i.e.
Return the expected contract key inputs (i.e. the state before the transaction) for this transaction or an error if the transaction contains a duplicate key error or has an inconsistent mapping for a key. For KeyCreate and NegativeKeyLookup (both corresponding to the key not being active) the first required input in execution order wins. So if a create comes first the input will be set to KeyCreate, if a negative lookup by key comes first the input will be set to NegativeKeyLookup.
Because we do not preserve byKey flags across transaction serialization this method will consider all operations with keys for conflicts rather than just by-key operations.
- Definition Classes
- HasTxNodes
- Annotations
- @throws("If a contract key contains a contract id")
- final def contractKeys: Set[GlobalKey]
Return all the contract keys referenced by this transaction.
Return all the contract keys referenced by this transaction. This includes the keys created, exercised, fetched, or looked up, even those that refer transient contracts or that appear under a rollback node.
- Definition Classes
- HasTxNodes
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equalForest(other: Transaction): Boolean
Compares two Transactions up to renaming of Nids.
Compares two Transactions up to renaming of Nids. You most likely want to use this rather than ==, since the Nid is irrelevant to the content of the transaction.
- final def fold[A](z: A)(f: (A, (NodeId, Node)) => A): A
Traverses the transaction tree in pre-order traversal (i.e.
Traverses the transaction tree in pre-order traversal (i.e. exercise nodes are traversed before their children)
Takes constant stack space. Crashes if the transaction is not well formed (see
isWellFormed
)- Definition Classes
- HasTxNodes
- final def foldInExecutionOrder[A](z: A)(exerciseBegin: (A, NodeId, Exercise) => (A, ChildrenRecursion), rollbackBegin: (A, NodeId, Rollback) => (A, ChildrenRecursion), leaf: (A, NodeId, LeafOnlyAction) => A, exerciseEnd: (A, NodeId, Exercise) => A, rollbackEnd: (A, NodeId, Rollback) => A): A
- Definition Classes
- HasTxNodes
- def foldValues[Z](z: Z)(f: (Z, Value) => Z): Z
Visit every
Val
. - final def foldWithPathState[A, B](globalState0: A, pathState0: B)(op: (A, B, NodeId, Node) => (A, B)): A
A fold over the transaction that maintains global and path-specific state.
A fold over the transaction that maintains global and path-specific state. Takes constant stack space. Returns the global state.
Used to for example compute the roots of per-party projections from the transaction.
- Definition Classes
- HasTxNodes
- final def foreach(f: (NodeId, Node) => Unit): Unit
This function traverses the transaction tree in pre-order traversal (i.e.
This function traverses the transaction tree in pre-order traversal (i.e. exercise node are traversed before their children).
Takes constant stack space. Crashes if the transaction is not well formed (see
isWellFormed
)- Definition Classes
- HasTxNodes
- def foreachCid(f: (ContractId) => Unit): Unit
- Definition Classes
- CidContainer
- final def foreachInExecutionOrder(exerciseBegin: (NodeId, Exercise) => ChildrenRecursion, rollbackBegin: (NodeId, Rollback) => ChildrenRecursion, leaf: (NodeId, LeafOnlyAction) => Unit, exerciseEnd: (NodeId, Exercise) => Unit, rollbackEnd: (NodeId, Rollback) => Unit): Unit
- Definition Classes
- HasTxNodes
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def guessSubmitter: Either[String, Party]
- Definition Classes
- HasTxNodes
- final def inactiveContracts[Cid2 >: ContractId]: Set[Cid2]
Local and global contracts that are inactive at the end of the transaction.
Local and global contracts that are inactive at the end of the transaction. This includes both contracts that have been arachived and local contracts whose create has been rolled back.
- Definition Classes
- HasTxNodes
- lazy val informees: Set[Party]
The union of the informees of a all the action nodes.
The union of the informees of a all the action nodes.
- Definition Classes
- HasTxNodes
- final def inputContracts[Cid2 >: ContractId]: Set[Cid2]
Returns the IDs of all input contracts that are used by this transaction.
Returns the IDs of all input contracts that are used by this transaction.
- Definition Classes
- HasTxNodes
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isWellFormed: Set[NotWellFormedError]
This function checks the following properties:
This function checks the following properties:
* No dangling references -- all node ids mentioned in the forest are in the nodes map; * No orphaned references -- all keys of the node map are mentioned in the forest; * No aliasing -- every node id in the node map is mentioned exactly once, in the roots list or as a child of another node.
- final def localContracts[Cid2 >: ContractId]: Map[Cid2, (NodeId, Create)]
- Definition Classes
- HasTxNodes
- def mapCid(f: (ContractId) => ContractId): Transaction
- Definition Classes
- Transaction → CidContainer
- def mapNodeId(f: (NodeId) => NodeId): Transaction
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val nodes: Map[NodeId, Node]
- Definition Classes
- Transaction → HasTxNodes
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def reachableNodeIds: Set[NodeId]
- Definition Classes
- HasTxNodes
- def rootNodes: ImmArray[Action]
- Definition Classes
- HasTxNodes
- Annotations
- @throws(scala.this.throws.<init>$default$1[IllegalArgumentException])
- val roots: ImmArray[NodeId]
- Definition Classes
- Transaction → HasTxNodes
- def self: Transaction.this.type
- Attributes
- protected
- Definition Classes
- Transaction → CidContainer
- def serializable(f: (Value) => ImmArray[String]): ImmArray[String]
checks that all the values contained are serializable
- final def suffixCid(f: (Hash) => Bytes): Either[String, Transaction]
- Definition Classes
- CidContainer
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def traverseCid[L](f: (ContractId) => Either[L, ContractId]): Either[L, Transaction]
- Definition Classes
- CidContainer
- final def updatedContractKeys: Map[GlobalKey, Option[ContractId]]
The contract keys created or updated as part of the transaction.
The contract keys created or updated as part of the transaction. This includes updates to transient contracts (by mapping them to None) but it does not include any updates under rollback nodes.
- Definition Classes
- HasTxNodes
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- final def assertNoCid(message: (ContractId) => String): Transaction
- Definition Classes
- CidContainer
- Annotations
- @deprecated
- Deprecated
(Since version 1.18.0) use foreachCid or cids method instead
- final def ensureNoCid: Either[ContractId, Transaction]
- Definition Classes
- CidContainer
- Annotations
- @deprecated
- Deprecated
(Since version 1.18.0) use cids method instead
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated