FilteredTransaction

Class representing merkleized filtered transaction.

Parameters

id

Merkle tree root hash.

filteredComponentGroups

list of transaction components groups remained after filters are applied to WireTransaction.

groupHashes

the roots of the transaction component groups.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.

Link copied to clipboard

Returns a list of all the component groups that are present in the transaction, excluding the privacySalt, in the following order (which is the same with the order in ComponentGroupEnum:

Link copied to clipboard

Ordered list of (CommandData, PublicKey) pairs that instruct the contracts what to do.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val id: SecureHash
Link copied to clipboard
open override val inputs: List<StateRef>

Pointers to the input states on the ledger, identified by (tx identity hash, output index).

Link copied to clipboard

Returns the attachments compatible with 4.11 and earlier. This may be empty, which means this transaction cannot be verified by a 4.11 node. On 4.12 and later these attachments are ignored.

Link copied to clipboard
open override val networkParametersHash: SecureHash?

Hash of the network parameters that were in force when the transaction was notarised. Null means, that the transaction was created on older version of Corda (before 4), resolution will default to initial parameters.

Link copied to clipboard
open override val notary: Party?

If present, the notary for this transaction. If absent then the transaction is not notarised at all. This is intended for issuance/genesis transactions that don't consume any other states and thus can't double spend anything.

Link copied to clipboard

Ordered list of states defined by this transaction, along with the associated notaries.

Link copied to clipboard

Helper property to return a list of ContractState objects, rather than the often less convenient TransactionState

Link copied to clipboard
open override val references: List<StateRef>

Pointers to reference states, identified by (tx identity hash, output index).

Link copied to clipboard

Functions

Link copied to clipboard

Function that checks if all of the components in a particular group are visible. This functionality is required on non-Validating Notaries to check that all inputs are visible. It might also be applied in Oracles or any other entity requiring Command visibility, but because this method cannot distinguish between related and unrelated to the signer Commands, one should use the checkCommandVisibility method, which is specifically designed for Command visibility purposes. The logic behind this algorithm is that we check that the root of the provided group partialMerkleTree matches with the root of a fullMerkleTree if computed using all visible components. Note that this method is usually called after or before verify, to also ensure that the provided partial Merkle tree corresponds to the correct leaf in the top Merkle tree.

Link copied to clipboard

Function that checks if all of the commands that should be signed by the input public key are visible. This functionality is required from Oracles to check that all of the commands they should sign are visible. This algorithm uses the ComponentGroupEnum.SIGNERS_GROUP to count how many commands should be signed by the input PublicKey and it then matches it with the size of received commands. Note that this method does not throw if there are no commands for this key to sign in the original WireTransaction.

Link copied to clipboard
fun checkWithFun(checkingFun: (Any) -> Boolean): Boolean

Function that checks the whole filtered structure. Force type checking on a structure that we obtained, so we don't sign more than expected. Example: Oracle is implemented to check only for commands, if it gets an attachment and doesn't expect it - it can sign over a transaction with the attachment that wasn't verified. Of course it depends on how you implement it, but else -> false should solve a problem with possible later extensions to WireTransaction.

Link copied to clipboard
inline fun <T : ContractState> filterOutputs(crossinline predicate: (T) -> Boolean): List<T>

fun <T : ContractState> filterOutputs(clazz: Class<T>, predicate: Predicate<T>): List<T>

Helper to simplify filtering outputs according to a Predicate.

Link copied to clipboard
inline fun <T : ContractState> filterOutRefs(crossinline predicate: (T) -> Boolean): List<StateAndRef<T>>

fun <T : ContractState> filterOutRefs(clazz: Class<T>, predicate: Predicate<T>): List<StateAndRef<T>>

Helper to simplify filtering output StateAndRef items according to a Predicate.

Link copied to clipboard
inline fun <T : ContractState> findOutput(crossinline predicate: (T) -> Boolean): T

fun <T : ContractState> findOutput(clazz: Class<T>, predicate: Predicate<T>): T

Helper to simplify finding a single output matching a Predicate.

Link copied to clipboard
inline fun <T : ContractState> findOutRef(crossinline predicate: (T) -> Boolean): StateAndRef<T>

fun <T : ContractState> findOutRef(clazz: Class<T>, predicate: Predicate<T>): StateAndRef<T>

Helper to simplify finding a single output StateAndRef matching a Predicate.

Link copied to clipboard

Helper to simplify getting an indexed output.

Link copied to clipboard
inline fun <T : ContractState> outputsOfType(): List<T>

Helper to simplify getting all output states of a particular class, interface, or base class.

Link copied to clipboard

Returns a StateAndRef for the given output index.

Returns a StateAndRef for the requested output state, or throws IllegalArgumentException if not found.

Link copied to clipboard

Helper to simplify getting all output StateAndRef items of a particular state class, interface, or base class.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun verify()

Runs verification of partial Merkle branch against id. Note that empty filtered transactions (with no component groups) are accepted as well, e.g. for Timestamp Authorities to blindly sign or any other similar case in the future that requires a blind signature over a transaction's id.