corda / net.corda.core.transactions / ContractUpgradeLedgerTransaction

ContractUpgradeLedgerTransaction

class ContractUpgradeLedgerTransaction : FullTransaction, TransactionWithSignatures

A contract upgrade transaction with fully resolved inputs and signatures. Contract upgrade transactions are separate to regular transactions because their validation logic is specialised; the original contract by definition cannot be aware of the upgraded contract (it was written after the original contract was developed), so its validation logic cannot succeed. Instead alternative verification logic is used which verifies that the outputs correspond to the inputs after upgrading.

In contrast with a regular transaction, signatures are checked against the signers specified by input states' participants fields, so full resolution is needed for signature verification.

Constructors

<init>

ContractUpgradeLedgerTransaction(inputs: List<StateAndRef<ContractState>>, notary: Party, legacyContractAttachment: Attachment, upgradedContractClassName: ContractClassName, upgradedContractAttachment: Attachment, id: SecureHash, privacySalt: PrivacySalt, sigs: List<TransactionSignature>, networkParameters: NetworkParameters)

Properties

id

val id: SecureHash

inputs

val inputs: List<StateAndRef<ContractState>>

The inputs of this transaction. Note that in BaseTransaction subclasses the type of this list may change!

legacyContractAttachment

val legacyContractAttachment: Attachment

networkParameters

val networkParameters: NetworkParameters

Network parameters that were in force when this transaction was created. Resolved from the hash of network parameters on the corresponding wire transaction.

notary

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.

outputs

val outputs: List<TransactionState<ContractState>>

Outputs are computed by running the contract upgrade logic on input states. This is done eagerly so that the transaction is verified during construction.

privacySalt

val privacySalt: PrivacySalt

references

val references: List<StateAndRef<ContractState>>

ContractUpgradeLedgerTransactions do not contain reference input states.

requiredSigningKeys

val requiredSigningKeys: Set<PublicKey>

The required signers are the set of all input states' participants.

sigs

val sigs: List<TransactionSignature>

List of signatures on this transaction.

upgradedContractAttachment

val upgradedContractAttachment: Attachment

upgradedContractClassName

val upgradedContractClassName: ContractClassName

Functions

component1

operator fun component1(): List<StateAndRef<ContractState>>

component2

operator fun component2(): Party

component3

operator fun component3(): Attachment

component4

operator fun component4(): ContractClassName

component5

operator fun component5(): Attachment

component6

operator fun component6(): SecureHash

component7

operator fun component7(): PrivacySalt

component8

operator fun component8(): List<TransactionSignature>

component9

operator fun component9(): NetworkParameters

copy

fun copy(inputs: List<StateAndRef<ContractState>> = this.inputs, notary: Party = this.notary, legacyContractAttachment: Attachment = this.legacyContractAttachment, upgradedContractClassName: ContractClassName = this.upgradedContract::class.java.name, upgradedContractAttachment: Attachment = this.upgradedContractAttachment, id: SecureHash = this.id, privacySalt: PrivacySalt = this.privacySalt, sigs: List<TransactionSignature> = this.sigs, networkParameters: NetworkParameters = this.networkParameters): ContractUpgradeLedgerTransaction

equals

fun equals(other: Any?): Boolean

getKeyDescriptions

fun getKeyDescriptions(keys: Set<PublicKey>): List<String>

Get a human readable description of where signatures are required from, and are missing, to assist in debugging the underlying cause.

hashCode

fun hashCode(): Int

toString

fun toString(): String

Inherited Functions

checkBaseInvariants

open fun checkBaseInvariants(): Unit

checkNotaryWhitelisted

fun checkNotaryWhitelisted(): Unit

Make sure the assigned notary is part of the network parameter whitelist.

checkSignaturesAreValid

open fun checkSignaturesAreValid(): Unit

Mathematically validates the signatures that are present on this transaction. This does not imply that the signatures are by the right keys, or that there are sufficient signatures, just that they aren't corrupt. If you use this function directly you'll need to do the other checks yourself. Probably you want verifyRequiredSignatures instead.

getMissingSigners

open fun getMissingSigners(): Set<PublicKey>

Return the PublicKeys for which we still need signatures.

verifyRequiredSignatures

open fun verifyRequiredSignatures(): <ERROR CLASS>

Verifies the signatures on this transaction and throws if any are missing. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

verifySignaturesExcept

open fun verifySignaturesExcept(vararg allowedToBeMissing: PublicKey): Unit
open fun verifySignaturesExcept(allowedToBeMissing: Collection<PublicKey>): Unit

Verifies the signatures on this transaction and throws if any are missing which aren't passed as parameters. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.