mirror of
https://github.com/corda/corda.git
synced 2025-06-19 07:38:22 +00:00
CORDA-435 - AMQP enablement fixes
AMQP has different serialization rules than Kryo surrounding the way we introspect objects to work out how to construct them
This commit is contained in:
@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicBoolean
|
|||||||
import kotlin.reflect.jvm.jvmName
|
import kotlin.reflect.jvm.jvmName
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
private class NodePair(private val mockNet: MockNetwork) {
|
class NodePair(private val mockNet: MockNetwork) {
|
||||||
private class ServerLogic(private val session: FlowSession, private val running: AtomicBoolean) : FlowLogic<Unit>() {
|
private class ServerLogic(private val session: FlowSession, private val running: AtomicBoolean) : FlowLogic<Unit>() {
|
||||||
@Suspendable
|
@Suspendable
|
||||||
override fun call() {
|
override fun call() {
|
||||||
@ -103,8 +103,8 @@ class VaultSoftLockManagerTest {
|
|||||||
mockNet.stopNodes()
|
mockNet.stopNodes()
|
||||||
}
|
}
|
||||||
|
|
||||||
private object CommandDataImpl : CommandData
|
object CommandDataImpl : CommandData
|
||||||
private class ClientLogic(nodePair: NodePair, private val state: ContractState) : NodePair.AbstractClientLogic<List<ContractState>>(nodePair) {
|
class ClientLogic(nodePair: NodePair, val state: ContractState) : NodePair.AbstractClientLogic<List<ContractState>>(nodePair) {
|
||||||
override fun callImpl() = run {
|
override fun callImpl() = run {
|
||||||
subFlow(FinalityFlow(serviceHub.signInitialTransaction(TransactionBuilder(notary = ourIdentity).apply {
|
subFlow(FinalityFlow(serviceHub.signInitialTransaction(TransactionBuilder(notary = ourIdentity).apply {
|
||||||
addOutputState(state, ContractImpl::class.jvmName)
|
addOutputState(state, ContractImpl::class.jvmName)
|
||||||
@ -116,12 +116,15 @@ class VaultSoftLockManagerTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private abstract class SingleParticipantState(nodePair: NodePair) : ContractState {
|
private abstract class ParticipantState(override val participants: List<AbstractParty>) : ContractState
|
||||||
override val participants = listOf(nodePair.client.info.chooseIdentity())
|
|
||||||
|
private class PlainOldState(participants: List<AbstractParty>) : ParticipantState(participants) {
|
||||||
|
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.chooseIdentity()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PlainOldState(nodePair: NodePair) : SingleParticipantState(nodePair)
|
private class FungibleAssetImpl(participants: List<AbstractParty>) : ParticipantState(participants), FungibleAsset<Unit> {
|
||||||
private class FungibleAssetImpl(nodePair: NodePair) : SingleParticipantState(nodePair), FungibleAsset<Unit> {
|
constructor(nodePair: NodePair) : this(listOf(nodePair.client.info.chooseIdentity()))
|
||||||
|
|
||||||
override val owner get() = participants[0]
|
override val owner get() = participants[0]
|
||||||
override fun withNewOwner(newOwner: AbstractParty) = throw UnsupportedOperationException()
|
override fun withNewOwner(newOwner: AbstractParty) = throw UnsupportedOperationException()
|
||||||
override val amount get() = Amount(1, Issued(PartyAndReference(owner, OpaqueBytes.of(1)), Unit))
|
override val amount get() = Amount(1, Issued(PartyAndReference(owner, OpaqueBytes.of(1)), Unit))
|
||||||
|
Reference in New Issue
Block a user