mirror of
https://github.com/corda/corda.git
synced 2025-05-02 16:53:22 +00:00
BUILD: Fix some warnings about @BelongsToContract in tests. (#4902)
This commit is contained in:
parent
dc179d4ea1
commit
3333464c39
@ -1,9 +1,7 @@
|
|||||||
package net.corda.core.internal
|
package net.corda.core.internal
|
||||||
|
|
||||||
import net.corda.client.mock.Generator
|
import net.corda.client.mock.Generator
|
||||||
import net.corda.core.contracts.ContractState
|
import net.corda.core.contracts.*
|
||||||
import net.corda.core.contracts.StateRef
|
|
||||||
import net.corda.core.contracts.TransactionState
|
|
||||||
import net.corda.core.crypto.SecureHash
|
import net.corda.core.crypto.SecureHash
|
||||||
import net.corda.core.crypto.SignatureMetadata
|
import net.corda.core.crypto.SignatureMetadata
|
||||||
import net.corda.core.crypto.TransactionSignature
|
import net.corda.core.crypto.TransactionSignature
|
||||||
@ -30,11 +28,12 @@ class TopologicalSortTest {
|
|||||||
override val references: List<StateRef> = emptyList()
|
override val references: List<StateRef> = emptyList()
|
||||||
) : CoreTransaction() {
|
) : CoreTransaction() {
|
||||||
override val outputs: List<TransactionState<ContractState>> = (1..numberOfOutputs).map {
|
override val outputs: List<TransactionState<ContractState>> = (1..numberOfOutputs).map {
|
||||||
TransactionState(DummyState(), "", notary)
|
TransactionState(DummyState(), Contract::class.java.name, notary)
|
||||||
}
|
}
|
||||||
override val networkParametersHash: SecureHash? = testNetworkParameters().serialize().hash
|
override val networkParametersHash: SecureHash? = testNetworkParameters().serialize().hash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BelongsToContract(Contract::class)
|
||||||
class DummyState : ContractState {
|
class DummyState : ContractState {
|
||||||
override val participants: List<AbstractParty> = emptyList()
|
override val participants: List<AbstractParty> = emptyList()
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import kotlin.test.assertFailsWith
|
|||||||
|
|
||||||
class VaultUpdateTests {
|
class VaultUpdateTests {
|
||||||
private companion object {
|
private companion object {
|
||||||
const val DUMMY_PROGRAM_ID = "net.corda.core.node.VaultUpdateTests.DummyContract"
|
const val DUMMY_PROGRAM_ID = "net.corda.core.node.VaultUpdateTests\$DummyContract"
|
||||||
val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party
|
val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party
|
||||||
val emptyUpdate = Vault.Update(emptySet(), emptySet(), type = Vault.UpdateType.GENERAL, references = emptySet())
|
val emptyUpdate = Vault.Update(emptySet(), emptySet(), type = Vault.UpdateType.GENERAL, references = emptySet())
|
||||||
}
|
}
|
||||||
@ -25,6 +25,7 @@ class VaultUpdateTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
private class DummyState : ContractState {
|
private class DummyState : ContractState {
|
||||||
override val participants: List<AbstractParty> = emptyList()
|
override val participants: List<AbstractParty> = emptyList()
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ class ScheduledResponderFlow(private val otherSide: FlowSession) : FlowLogic<Uni
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
data class ScheduledState(val creationTime: Instant,
|
data class ScheduledState(val creationTime: Instant,
|
||||||
val source: Party,
|
val source: Party,
|
||||||
val destination: Party,
|
val destination: Party,
|
||||||
@ -63,6 +64,7 @@ data class ScheduledState(val creationTime: Instant,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
data class SpentState(val identity: String,
|
data class SpentState(val identity: String,
|
||||||
val source: Party,
|
val source: Party,
|
||||||
val destination: Party,
|
val destination: Party,
|
||||||
|
@ -40,6 +40,7 @@ class ScheduledFlowTests {
|
|||||||
private lateinit var alice: Party
|
private lateinit var alice: Party
|
||||||
private lateinit var bob: Party
|
private lateinit var bob: Party
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
data class ScheduledState(val creationTime: Instant,
|
data class ScheduledState(val creationTime: Instant,
|
||||||
val source: Party,
|
val source: Party,
|
||||||
val destination: Party,
|
val destination: Party,
|
||||||
|
@ -29,6 +29,7 @@ class ResolveStatePointersTest {
|
|||||||
private val cordapps = listOf("net.corda.testing.contracts")
|
private val cordapps = listOf("net.corda.testing.contracts")
|
||||||
private lateinit var services: MockServices
|
private lateinit var services: MockServices
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
private data class Bar(
|
private data class Bar(
|
||||||
override val participants: List<AbstractParty> = listOf(),
|
override val participants: List<AbstractParty> = listOf(),
|
||||||
val bar: Int = 0,
|
val bar: Int = 0,
|
||||||
@ -36,6 +37,7 @@ class ResolveStatePointersTest {
|
|||||||
override val linearId: UniqueIdentifier = UniqueIdentifier()
|
override val linearId: UniqueIdentifier = UniqueIdentifier()
|
||||||
) : LinearState
|
) : LinearState
|
||||||
|
|
||||||
|
@BelongsToContract(DummyContract::class)
|
||||||
private data class Foo<T : LinearState>(val baz: LinearPointer<T>, override val participants: List<AbstractParty>) : ContractState
|
private data class Foo<T : LinearState>(val baz: LinearPointer<T>, override val participants: List<AbstractParty>) : ContractState
|
||||||
|
|
||||||
private val barOne = Bar(listOf(myself.party), 1)
|
private val barOne = Bar(listOf(myself.party), 1)
|
||||||
|
@ -117,10 +117,12 @@ class VaultSoftLockManagerTest {
|
|||||||
|
|
||||||
private abstract class ParticipantState(override val participants: List<AbstractParty>) : ContractState
|
private abstract class ParticipantState(override val participants: List<AbstractParty>) : ContractState
|
||||||
|
|
||||||
|
@BelongsToContract(ContractImpl::class)
|
||||||
private class PlainOldState(participants: List<AbstractParty>) : ParticipantState(participants) {
|
private class PlainOldState(participants: List<AbstractParty>) : ParticipantState(participants) {
|
||||||
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.singleIdentity()))
|
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.singleIdentity()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BelongsToContract(ContractImpl::class)
|
||||||
private class FungibleAssetImpl(participants: List<AbstractParty>) : ParticipantState(participants), FungibleAsset<Unit> {
|
private class FungibleAssetImpl(participants: List<AbstractParty>) : ParticipantState(participants), FungibleAsset<Unit> {
|
||||||
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.singleIdentity()))
|
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.singleIdentity()))
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import javax.persistence.Table
|
|||||||
@CordaSerializable
|
@CordaSerializable
|
||||||
data class MessageData(val value: String)
|
data class MessageData(val value: String)
|
||||||
|
|
||||||
|
@BelongsToContract(MessageChainContract::class)
|
||||||
data class MessageChainState(val message: MessageData, val by: Party, override val linearId: UniqueIdentifier = UniqueIdentifier(), val extraParty: Party? = null) : LinearState, QueryableState {
|
data class MessageChainState(val message: MessageData, val by: Party, override val linearId: UniqueIdentifier = UniqueIdentifier(), val extraParty: Party? = null) : LinearState, QueryableState {
|
||||||
override val participants: List<AbstractParty> = if (extraParty == null) listOf(by) else listOf(by, extraParty)
|
override val participants: List<AbstractParty> = if (extraParty == null) listOf(by) else listOf(by, extraParty)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user