corda / net.corda.testing.contracts / DummyContractV2

DummyContractV2

class DummyContractV2 : UpgradedContractWithLegacyConstraint<State, State>

Dummy contract state for testing of the upgrade process.

Types

Commands

interface Commands : CommandData

State

data class State : ContractState

Constructors

<init>

DummyContractV2()

Dummy contract state for testing of the upgrade process.

Properties

legacyContract

val legacyContract: String

Name of the contract this is an upgraded version of, used as part of verification of upgrade transactions.

legacyContractConstraint

val legacyContractConstraint: AttachmentConstraint

A validator for the legacy (pre-upgrade) contract attachments on the transaction.

Functions

upgrade

fun upgrade(state: State): State

Upgrade contract's state object to a new state object.

verify

fun verify(tx: LedgerTransaction): Unit

Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense. Must throw an exception if there's a problem that should prevent state transition. Takes a single object rather than an argument so that additional data can be added without breaking binary compatibility with existing contract code.

Companion Object Properties

PROGRAM_ID

const val PROGRAM_ID: ContractClassName

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

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