diff --git a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/DummyIssueAndMove.kt b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/DummyIssueAndMove.kt index 5d4820f0b5..c4c5bde481 100644 --- a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/DummyIssueAndMove.kt +++ b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/DummyIssueAndMove.kt @@ -14,12 +14,15 @@ import net.corda.core.transactions.TransactionBuilder @StartableByRPC class DummyIssueAndMove(private val notary: Party, private val counterpartyNode: Party, private val discriminator: Int) : FlowLogic() { - val DO_NOTHING_PROGRAM_ID = "net.corda.notarydemo.flows.DummyIssueAndMove.DoNothingContract" - object DoNothingContract : Contract { + companion object { + private val DO_NOTHING_PROGRAM_ID = "net.corda.notarydemo.flows.DummyIssueAndMove\$DoNothingContract" + } + + class DoNothingContract : Contract { override fun verify(tx: LedgerTransaction) {} } - data class DummyCommand(val dummy: Int = 0): CommandData + data class DummyCommand(val dummy: Int = 0) : CommandData data class State(override val participants: List, private val discriminator: Int) : ContractState @@ -29,7 +32,7 @@ class DummyIssueAndMove(private val notary: Party, private val counterpartyNode: val state = State(listOf(ourIdentity), discriminator) val issueTx = serviceHub.signInitialTransaction(TransactionBuilder(notary).apply { addOutputState(state, DO_NOTHING_PROGRAM_ID) - addCommand(DummyCommand(),listOf(ourIdentity.owningKey)) + addCommand(DummyCommand(), listOf(ourIdentity.owningKey)) }) serviceHub.recordTransactions(issueTx) // Move ownership of the asset to the counterparty @@ -37,7 +40,7 @@ class DummyIssueAndMove(private val notary: Party, private val counterpartyNode: return serviceHub.signInitialTransaction(TransactionBuilder(notary).apply { addInputState(issueTx.tx.outRef(0)) addOutputState(state.copy(participants = listOf(counterpartyNode)), DO_NOTHING_PROGRAM_ID) - addCommand(DummyCommand(),listOf(ourIdentity.owningKey)) + addCommand(DummyCommand(), listOf(ourIdentity.owningKey)) }) } }