object LfTransactionUtil
Helper functions to work with com.digitalasset.daml.lf.transaction.GenTransaction
.
Using these helper functions is useful to provide a buffer from upstream changes.
- Alphabetic
- By Inheritance
- LfTransactionUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- val actingParties: (LfActionNode) => Set[LfPartyId]
Yields the the acting parties of the node, if applicable
Yields the the acting parties of the node, if applicable
- Exceptions thrown
java.lang.IllegalArgumentException
if a Fetch node does not contain the acting parties.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assertNoContractIdInKey(key: Value): Value
- Exceptions thrown
java.lang.IllegalArgumentException
ifkey
contains a contact ID.
- def checkNoContractIdInKey(key: LfVersioned[LfValue]): Either[LfContractId, LfVersioned[LfValue]]
- def checkNoContractIdInKey(key: Value): Either[LfContractId, Value]
Check that the
com.daml.lf.value.Value
key does not contain a contract ID.Check that the
com.daml.lf.value.Value
key does not contain a contract ID. If the key does contain a contract ID then it will be returned in a Left. Valid contract keys cannot contain contract IDs. - val children: (LfNode) => Seq[LfNodeId]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def consumedContractId(node: LfActionNode): Option[LfContractId]
- def consumedContractIds(transactions: Iterable[LfVersionedTransaction]): Set[LfContractId]
Given internally consistent transactions, compute their consumed contract ids.
- def createdContractIdWithMetadata(node: LfNode): Option[WithContractMetadata[LfContractId]]
Get the IDs and metadata of all the created contracts of a single com.digitalasset.canton.protocol.package.LfNode.
- def duplicatedContractKeys(tx: LfVersionedTransaction): Set[LfGlobalKey]
Checks that the transaction is consistent w.r.t.
Checks that the transaction is consistent w.r.t. contract keys, taking into account all nodes instead of only-by key nodes as done by Daml engine when run in mode com.daml.lf.transaction.ContractKeyUniquenessMode.On.
For example, if a transaction fetches a contract by contract id and creates another contract that has the same contract key as the fetched contract, Daml engine will not complain about duplicate contract keys because the fetch does not have the com.daml.lf.transaction.Node.Action.byKey field set.
- Exceptions thrown
java.lang.IllegalArgumentException
if transaction's keys contain contract Ids.- See also
com.daml.lf.speedy.PartialTransaction.keys for Daml engine's tracking of unique keys
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def foldExecutionOrderM[F[_], A](tx: LfTransaction, initial: A)(exerciseBegin: (LfNodeId, LfNodeExercises, A) => F[A])(leaf: (LfNodeId, LfLeafOnlyActionNode, A) => F[A])(exerciseEnd: (LfNodeId, LfNodeExercises, A) => F[A])(rollbackBegin: (LfNodeId, LfNodeRollback, A) => F[A])(rollbackEnd: (LfNodeId, LfNodeRollback, A) => F[A])(implicit F: Monad[F]): F[A]
Monadic visit to all nodes of the transaction in execution order.
Monadic visit to all nodes of the transaction in execution order. Exercise nodes are visited twice: when execution reaches them and when execution leaves their body. Crashes on malformed transactions (see
com.daml.lf.transaction.GenTransaction.isWellFormed
)- Annotations
- @nowarn()
- def fromGlobalKeyWithMaintainers(global: LfGlobalKeyWithMaintainers): LfKeyWithMaintainers
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def globalKeyWithMaintainers(templateId: LfTemplateId, keyWithMaintainers: LfKeyWithMaintainers): Either[LfContractId, LfGlobalKeyWithMaintainers]
Check that
keyWithMaintainers
has a key that doesn't contain a contract ID (so can be used as a contact key).Check that
keyWithMaintainers
has a key that doesn't contain a contract ID (so can be used as a contact key). If so, convertkeyWithMaintainers
to a com.digitalasset.canton.protocol.package.LfGlobalKeyWithMaintainers. - def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def informees(transaction: LfVersionedTransaction): Set[LfPartyId]
Compute the informees of a transaction based on the ledger model definition.
Compute the informees of a transaction based on the ledger model definition.
Refer to https://docs.daml.com/concepts/ledger-model/ledger-privacy.html#projections
- def informees(node: LfActionNode): Set[LfPartyId]
Compute the informees of a node based on the ledger model definition.
Compute the informees of a node based on the ledger model definition.
Refer to https://docs.daml.com/concepts/ledger-model/ledger-privacy.html#projections
- Exceptions thrown
java.lang.IllegalStateException
if a Fetch node does not contain the acting parties.
- def inputContractIdsWithMetadata(tx: LfVersionedTransaction): Set[WithContractMetadata[LfContractId]]
Get the IDs and metadata of all input contracts of a com.digitalasset.canton.protocol.package.LfVersionedTransaction.
Get the IDs and metadata of all input contracts of a com.digitalasset.canton.protocol.package.LfVersionedTransaction. Input contracts are those that are used, but are not transient.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keyWithMaintainers(node: LfActionNode): Option[LfKeyWithMaintainers]
- def lightWeight(node: LfActionNode): LfActionNode
Yields the light-weight version (i.e.
Yields the light-weight version (i.e. without exercise children and result) of this node.
- Exceptions thrown
java.lang.UnsupportedOperationException
ifnode
is a rollback.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nodeHasSeed(node: LfNode): Boolean
Whether or not a node has a random seed
- def nodeTemplate(node: LfActionNode): Identifier
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- implicit val orderTransactionVersion: Order[TransactionVersion]
- def referencedContractIds(value: Value): Set[LfContractId]
All contract IDs referenced with a Daml
com.daml.lf.value.Value
- val signatoriesOrMaintainers: (LfActionNode) => Set[LfPartyId]
Yields the signatories of the node's contract, or key maintainers for nodes without signatories.
- def stateKnownTo(node: LfActionNode): Set[LfPartyId]
- def suffixContractInst(unicumOfDiscriminator: (LfHash) => Option[Unicum])(contractInst: LfContractInst): Either[String, LfContractInst]
- def suffixNode(unicumOfDiscriminator: (LfHash) => Option[Unicum])(node: LfActionNode): Either[String, LfActionNode]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryGlobalKeyWithMaintainers(templateId: LfTemplateId, keyWithMaintainers: LfKeyWithMaintainers, version: LfTransactionVersion): LfVersioned[LfGlobalKeyWithMaintainers]
Convert
keyWithMaintainers
to a versioned com.digitalasset.canton.protocol.package.LfGlobalKeyWithMaintainers, throwing an java.lang.IllegalArgumentException ifkeyWithMaintainers
has a key that contains a contract ID. - def usedContractIdWithMetadata(node: LfActionNode): Option[WithContractMetadata[LfContractId]]
Get the IDs and metadata of contracts used within a single com.digitalasset.canton.protocol.package.LfActionNode
- def usedContractIdsWithMetadata(tx: LfVersionedTransaction): Set[WithContractMetadata[LfContractId]]
Get the IDs and metadata of all the used contracts of a com.digitalasset.canton.protocol.package.LfVersionedTransaction
- 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])