public class DummyContractV2 implements UpgradedContract<OldState,NewState>
Dummy contract state for testing of the upgrade process.
Modifier and Type | Class and Description |
---|---|
static class |
DummyContractV2.State |
Constructor and Description |
---|
DummyContractV2()
Dummy contract state for testing of the upgrade process.
|
Modifier and Type | Method and Description |
---|---|
kotlin.Pair<net.corda.core.transactions.WireTransaction,java.util.Set> |
generateUpgradeFromV1(net.corda.core.contracts.StateAndRef states)
Generate an upgrade transaction from
class DummyContract . |
java.lang.Class<net.corda.core.contracts.DummyContract> |
getLegacyContract() |
SecureHash |
getLegalContractReference()
Unparsed reference to the natural language contract that this code is supposed to express (usually a hash of
the contract's contents).
|
DummyContractV2.State |
upgrade(DummyContract.State state)
Upgrade contract's state object to a new state object.
|
void |
verify(TransactionForContract tx)
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.
|
getLegacyContract, upgrade
getLegalContractReference, verify
public DummyContractV2()
Dummy contract state for testing of the upgrade process.
public java.lang.Class<net.corda.core.contracts.DummyContract> getLegacyContract()
public DummyContractV2.State upgrade(DummyContract.State state)
Upgrade contract's state object to a new state object.
public void verify(TransactionForContract tx)
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.
public SecureHash getLegalContractReference()
Unparsed reference to the natural language contract that this code is supposed to express (usually a hash of the contract's contents).
public kotlin.Pair<net.corda.core.transactions.WireTransaction,java.util.Set> generateUpgradeFromV1(net.corda.core.contracts.StateAndRef states)
Generate an upgrade transaction from class DummyContract
.
Note: This is a convenience helper method used for testing only.
class DummyContract