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

net.corda.core.transactions

## Class ContractUpgradeWireTransaction

- net.corda.core.transactions.BaseTransaction
- - net.corda.core.transactions.CoreTransaction
  - - net.corda.core.transactions.ContractUpgradeWireTransaction

- All Implemented Interfaces:
    NamedByHash

      public class ContractUpgradeWireTransaction
      extends CoreTransaction

  A special transaction for upgrading the contract of a state.

- - ### Field Detail

    - #### Companion

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

  - ### Constructor Detail

    - #### ContractUpgradeWireTransaction

          public ContractUpgradeWireTransaction(@NotNull
                                                java.util.List<? extends net.corda.core.utilities.OpaqueBytes> serializedComponents,
                                                @NotNull
                                                PrivacySalt privacySalt,
                                                @NotNull
                                                DigestService digestService)

      A special transaction for upgrading the contract of a state.

      Parameters:
        `serializedComponents` - Contains all of the transaction components in serialized form.This is used for calculating the transaction id in a deterministic fashion, since re-serializing propertiesmay result in a different byte sequence depending on the serialization context.
        `privacySalt` - Required for hiding components in `class ContractUpgradeFilteredTransaction`.

    - #### ContractUpgradeWireTransaction

          public ContractUpgradeWireTransaction(@NotNull
                                                java.util.List<? extends net.corda.core.utilities.OpaqueBytes> serializedComponents,
                                                @NotNull
                                                PrivacySalt privacySalt)

  - ### Method Detail

    - #### getInputs

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

      The inputs of this transaction, containing state references only.

    - #### 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't double spend anything.

    - #### getLegacyContractAttachmentId

          @NotNull
          public SecureHash getLegacyContractAttachmentId()

    - #### getUpgradedContractClassName

          @NotNull
          public java.lang.String getUpgradedContractClassName()

    - #### getUpgradedContractAttachmentId

          @NotNull
          public SecureHash getUpgradedContractAttachmentId()

    - #### getNetworkParametersHash

          @Nullable
          public SecureHash getNetworkParametersHash()

      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.

    - #### copy

          @NotNull
          public ContractUpgradeWireTransaction copy(@NotNull
                                                              java.util.List<? extends net.corda.core.utilities.OpaqueBytes> serializedComponents,
                                                              @NotNull
                                                              PrivacySalt privacySalt)

      Old version of `ContractUpgradeWireTransaction.copy` for sake of ABI compatibility.

      See Also:
        `ContractUpgradeWireTransaction.copy`

    - #### getOutputs

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

      This transaction does not contain any output states, outputs can be obtained by resolving a `class ContractUpgradeLedgerTransaction` – outputs will be calculated on demand by applying the contract upgrade operation to inputs.

      See Also:
        `class ContractUpgradeLedgerTransaction`

    - #### getReferences

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

      ContractUpgradeWireTransactions should not contain reference input states.

    - #### getId

          @NotNull
          public SecureHash getId()

    - #### resolve

          @NotNull
          public ContractUpgradeLedgerTransaction resolve(@NotNull
                                                                   ServicesForResolution services,
                                                                   @NotNull
                                                                   java.util.List<net.corda.core.crypto.TransactionSignature> sigs)

      Resolves input states and contract attachments, and builds a ContractUpgradeLedgerTransaction.

    - #### buildFilteredTransaction

          @NotNull
          public ContractUpgradeFilteredTransaction buildFilteredTransaction()

      Constructs a filtered transaction: the inputs, the notary party and network parameters hash are always visible, while the rest are hidden.

    - #### getSerializedComponents

          @NotNull
          public java.util.List<net.corda.core.utilities.OpaqueBytes> getSerializedComponents()

      Contains all of the transaction components in serialized form.

      This is used for calculating the transaction id in a deterministic fashion, since re-serializing propertiesmay result in a different byte sequence depending on the serialization context.

    - #### getPrivacySalt

          @NotNull
          public PrivacySalt getPrivacySalt()

      Required for hiding components in

      `class ContractUpgradeFilteredTransaction`.

      See Also:
        `class ContractUpgradeFilteredTransaction`

    - #### getDigestService

          @NotNull
          public DigestService getDigestService()

    - #### component1

          @NotNull
          public java.util.List<net.corda.core.utilities.OpaqueBytes> component1()

      Contains all of the transaction components in serialized form.

      This is used for calculating the transaction id in a deterministic fashion, since re-serializing propertiesmay result in a different byte sequence depending on the serialization context.

    - #### component2

          @NotNull
          public PrivacySalt component2()

      Required for hiding components in

      `class ContractUpgradeFilteredTransaction`.

      See Also:
        `class ContractUpgradeFilteredTransaction`

    - #### component3

          @NotNull
          public DigestService component3()

    - #### copy

          @NotNull
          public ContractUpgradeWireTransaction copy(@NotNull
                                                              java.util.List<? extends net.corda.core.utilities.OpaqueBytes> serializedComponents,
                                                              @NotNull
                                                              PrivacySalt privacySalt,
                                                              @NotNull
                                                              DigestService digestService)

      A special transaction for upgrading the contract of a state.

    - #### toString

          @NotNull
          public java.lang.String toString()

      A special transaction for upgrading the contract of a state.

    - #### hashCode

          public int hashCode()

      A special transaction for upgrading the contract of a state.

    - #### equals

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

      A special transaction for upgrading the contract of a state.