corda / net.corda.core.contracts / DummyContractV2

DummyContractV2

class DummyContractV2 : UpgradedContract<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: Class<DummyContract>
legalContractReference val legalContractReference: SecureHash

Unparsed reference to the natural language contract that this code is supposed to express (usually a hash of the contract's contents).

Functions

generateUpgradeFromV1 fun generateUpgradeFromV1(vararg states: StateAndRef<State>): Pair<WireTransaction, Set<CompositeKey>>

Generate an upgrade transaction from DummyContract.

upgrade fun upgrade(state: State): State

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

verify fun verify(tx: TransactionForContract): 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.