ContractUpgradeLedgerTransaction
Keywords: net.corda.core.transactions.ContractUpgradeLedgerTransaction class
Date: 2023-09-18

net.corda.core.transactions

## Class ContractUpgradeLedgerTransaction

- net.corda.core.transactions.BaseTransaction
- - FullTransaction
  - - net.corda.core.transactions.ContractUpgradeLedgerTransaction

- All Implemented Interfaces:
    NamedByHash, TransactionWithSignatures

      public class ContractUpgradeLedgerTransaction
      extends FullTransaction
      implements 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.

- - ### Field Detail

    - #### Companion

          public static net.corda.core.transactions.ContractUpgradeLedgerTransaction.Companion Companion

  - ### Constructor Detail

    - #### ContractUpgradeLedgerTransaction

          @Deprecated
          public ContractUpgradeLedgerTransaction(@NotNull
                                                              java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends net.corda.core.contracts.ContractState>> inputs,
                                                              @NotNull
                                                              Party notary,
                                                              @NotNull
                                                              Attachment legacyContractAttachment,
                                                              @NotNull
                                                              java.lang.String upgradedContractClassName,
                                                              @NotNull
                                                              Attachment upgradedContractAttachment,
                                                              @NotNull
                                                              SecureHash id,
                                                              @NotNull
                                                              PrivacySalt privacySalt,
                                                              @NotNull
                                                              java.util.List<net.corda.core.crypto.TransactionSignature> sigs,
                                                              @NotNull
                                                              NetworkParameters networkParameters)

      Deprecated.

  - ### Method Detail

    - #### getReferences

          @NotNull
          public java.util.List<net.corda.core.contracts.StateAndRef> getReferences()

      ContractUpgradeLedgerTransactions do not contain reference input states.

    - #### getUpgradedContractClassName

          @NotNull
          public java.lang.String getUpgradedContractClassName()

    - #### getOutputs

          @NotNull
          public java.util.List<net.corda.core.contracts.TransactionState> getOutputs()

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

    - #### getRequiredSigningKeys

          @NotNull
          public java.util.Set<java.security.PublicKey> getRequiredSigningKeys()

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

    - #### getKeyDescriptions

          @NotNull
          public java.util.List<java.lang.String> getKeyDescriptions(@NotNull
                                                                              java.util.Set<? extends java.security.PublicKey> keys)

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

      Note that the results should not be serialised, parsed or expected to remain stable between Corda versions.

    - #### component1

          @NotNull
          public java.util.List<net.corda.core.contracts.StateAndRef> component1()

    - #### component2

          @NotNull
          public Party component2()

    - #### component3

          @NotNull
          public Attachment component3()

    - #### component4

          @NotNull
          public java.lang.String component4()

    - #### component5

          @NotNull
          public Attachment component5()

    - #### component6

          @NotNull
          public SecureHash component6()

    - #### component7

          @NotNull
          public PrivacySalt component7()

    - #### component8

          @NotNull
          public java.util.List<net.corda.core.crypto.TransactionSignature> component8()

    - #### component9

          @NotNull
          public NetworkParameters component9()

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object other)

    - #### hashCode

          public int hashCode()

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### copy

          @Deprecated
           @NotNull
          public ContractUpgradeLedgerTransaction copy(@NotNull
                                                                             java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends net.corda.core.contracts.ContractState>> inputs,
                                                                             @NotNull
                                                                             Party notary,
                                                                             @NotNull
                                                                             Attachment legacyContractAttachment,
                                                                             @NotNull
                                                                             java.lang.String upgradedContractClassName,
                                                                             @NotNull
                                                                             Attachment upgradedContractAttachment,
                                                                             @NotNull
                                                                             SecureHash id,
                                                                             @NotNull
                                                                             PrivacySalt privacySalt,
                                                                             @NotNull
                                                                             java.util.List<net.corda.core.crypto.TransactionSignature> sigs,
                                                                             @NotNull
                                                                             NetworkParameters networkParameters)

      Deprecated.

    - #### getInputs

          @NotNull
          public java.util.List<net.corda.core.contracts.StateAndRef> getInputs()

      The inputs of this transaction.

      Note that in BaseTransaction subclasses the type of this list may change!

    - #### getNotary

          @NotNull
          public Party getNotary()

      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'tdouble spend anything.

    - #### getLegacyContractAttachment

          @NotNull
          public Attachment getLegacyContractAttachment()

    - #### getUpgradedContractAttachment

          @NotNull
          public Attachment getUpgradedContractAttachment()

    - #### getId

          @NotNull
          public SecureHash getId()

    - #### getPrivacySalt

          @NotNull
          public PrivacySalt getPrivacySalt()

    - #### getSigs

          @NotNull
          public java.util.List<net.corda.core.crypto.TransactionSignature> getSigs()

      List of signatures on this transaction.

      See Also:
        `checkSignaturesAreValid`, `verifyRequiredSignatures`

    - #### getNetworkParameters

          @NotNull
          public NetworkParameters getNetworkParameters()

      Network parameters that were in force when this transaction was created.

      Resolved from the hash of network parameters on the correspondingwire transaction.