core / TransactionForVerification

# TransactionForVerification

`data class TransactionForVerification`

A transaction in fully resolved and sig-checked form, ready for passing as input to a verification function.

### Types

InOutGroup

`data class InOutGroup<T : ContractState, K : Any>`

A set of related inputs and outputs that are connected by some common attributes. An InOutGroup is calculated using groupStates and is useful for handling cases where a transaction may contain similar but unrelated state evolutions, for example, a transaction that moves cash in two different currencies. The numbers must add up on both sides of the transaction, but the values must be summed independently per currency. Grouping can be used to simplify this logic.

### Constructors

<init> | `TransactionForVerification(inStates: List<ContractState>, outStates: List<ContractState>, attachments: List<Attachment>, commands: List<AuthenticatedObject<CommandData>>, origHash: SecureHash)` A transaction in fully resolved and sig-checked form, ready for passing as input to a verification function.

### Properties

attachments | `val attachments: List<Attachment>`
commands | `val commands: List<AuthenticatedObject<CommandData>>`
inStates | `val inStates: List<ContractState>`
origHash | `val origHash: SecureHash`
outStates | `val outStates: List<ContractState>`

### Functions

equals | `fun equals(other: Any?): Boolean`
getTimestampBy | `fun getTimestampBy(timestampingAuthority: Party): TimestampCommand?` Simply calls commands.getTimestampBy as a shortcut to make code completion more intuitive.

groupStates

`fun <T : ContractState, K : Any> groupStates(ofType: Class<T>, selector: (T) -> K): List<InOutGroup<T, K>>`

Given a type and a function that returns a grouping key, associates inputs and outputs together so that they can be processed as one. The grouping key is any arbitrary object that can act as a map key (so must implement equals and hashCode).

`fun <T : ContractState, K : Any> groupStates(selector: (T) -> K): List<InOutGroup<T, K>>`

See the documentation for the reflection-based version of groupStates

groupStatesInternal | `fun <T : ContractState, K : Any> groupStatesInternal(inGroups: Map<K, List<T>>, outGroups: Map<K, List<T>>): List<InOutGroup<T, K>>`
hashCode | `fun hashCode(): Int`
verify | `fun verify(): Unit` Runs the contracts for this transaction.