public class FilteredLeaves implements TraversableTransaction
Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every
field from class WireTransaction
can be used in class PartialMerkleTree
calculation.
class WireTransaction
,
class PartialMerkleTree
TraversableTransaction.DefaultImpls
Constructor and Description |
---|
FilteredLeaves(java.util.List<net.corda.core.contracts.StateRef> inputs,
java.util.List<? extends net.corda.core.crypto.SecureHash> attachments,
java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs,
java.util.List<net.corda.core.contracts.Command> commands,
Party notary,
java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign,
TransactionType type,
Timestamp timestamp)
Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every
field from
class WireTransaction can be used in class PartialMerkleTree calculation. |
Modifier and Type | Method and Description |
---|---|
boolean |
checkWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> checkingFun)
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.
|
java.util.List<net.corda.core.crypto.SecureHash> |
getAttachments() |
java.util.List<net.corda.core.crypto.SecureHash> |
getAvailableComponentHashes()
Calculate the hashes of the sub-components of the transaction, that are used to build its Merkle tree.
The root of the tree is the transaction identifier. The tree structure is helpful for privacy, please
see the user-guide section "Transaction tear-offs" to learn more about this topic.
|
java.util.List<java.lang.Object> |
getAvailableComponents()
Returns a flattened list of all the components that are present in the transaction, in the following order:
|
java.util.List<net.corda.core.contracts.Command> |
getCommands() |
java.util.List<net.corda.core.contracts.StateRef> |
getInputs() |
java.util.List<net.corda.core.crypto.CompositeKey> |
getMustSign() |
Party |
getNotary() |
java.util.List<net.corda.core.contracts.TransactionState> |
getOutputs() |
Timestamp |
getTimestamp() |
TransactionType |
getType() |
getAttachments, getAvailableComponentHashes, getAvailableComponents, getCommands, getInputs, getMustSign, getNotary, getOutputs, getTimestamp, getType
public FilteredLeaves(java.util.List<net.corda.core.contracts.StateRef> inputs, java.util.List<? extends net.corda.core.crypto.SecureHash> attachments, java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs, java.util.List<net.corda.core.contracts.Command> commands, Party notary, java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign, TransactionType type, Timestamp timestamp)
Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every
field from class WireTransaction
can be used in class PartialMerkleTree
calculation.
class WireTransaction
,
class PartialMerkleTree
public boolean checkWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> checkingFun)
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.
checkingFun
- function that performs type checking on the structure fields and provides verification logic accordingly.public java.util.List<net.corda.core.contracts.StateRef> getInputs()
public java.util.List<net.corda.core.crypto.SecureHash> getAttachments()
public java.util.List<net.corda.core.contracts.TransactionState> getOutputs()
public java.util.List<net.corda.core.contracts.Command> getCommands()
public Party getNotary()
public java.util.List<net.corda.core.crypto.CompositeKey> getMustSign()
public TransactionType getType()
public Timestamp getTimestamp()
public java.util.List<java.lang.Object> getAvailableComponents()
Returns a flattened list of all the components that are present in the transaction, in the following order:
Each input that is present
Each attachment that is present
Each output that is present
Each command that is present
The notary class Party
, if present
Each required signer (mustSign) that is present
The type of the transaction, if present
The timestamp of the transaction, if present
class Party
public java.util.List<net.corda.core.crypto.SecureHash> getAvailableComponentHashes()
Calculate the hashes of the sub-components of the transaction, that are used to build its Merkle tree. The root of the tree is the transaction identifier. The tree structure is helpful for privacy, please see the user-guide section "Transaction tear-offs" to learn more about this topic.