diff --git a/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/persistence/PersistentNetworkMapStorageTest.kt b/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/persistence/PersistentNetworkMapStorageTest.kt index cbc79e1902..425996bedd 100644 --- a/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/persistence/PersistentNetworkMapStorageTest.kt +++ b/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/persistence/PersistentNetworkMapStorageTest.kt @@ -1,7 +1,6 @@ package com.r3.corda.networkmanage.common.persistence import com.r3.corda.networkmanage.TestBase -import net.corda.core.identity.CordaX500Name import net.corda.core.internal.signWithCert import net.corda.nodeapi.internal.createDevNetworkMapCa import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair @@ -55,7 +54,7 @@ class PersistentNetworkMapStorageTest : TestBase() { val parametersSignature = networkParameters.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate).sig // Create network parameters val networkParametersHash = networkMapStorage.saveNetworkParameters(networkParameters, parametersSignature) - val networkMap = NetworkMap(listOf(nodeInfoHash), networkParametersHash) + val networkMap = NetworkMap(listOf(nodeInfoHash), networkParametersHash, null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) // when @@ -96,7 +95,7 @@ class PersistentNetworkMapStorageTest : TestBase() { // Create empty network map // Sign network map making it current network map - val networkMap = NetworkMap(emptyList(), networkParametersHash) + val networkMap = NetworkMap(emptyList(), networkParametersHash, null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) networkMapStorage.saveNetworkMap(signedNetworkMap) @@ -125,7 +124,7 @@ class PersistentNetworkMapStorageTest : TestBase() { // Create network parameters val testParameters = testNetworkParameters(emptyList()) val networkParametersHash = networkMapStorage.saveNetworkParameters(testParameters, testParameters.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate).sig) - val networkMap = NetworkMap(listOf(nodeInfoHashA), networkParametersHash) + val networkMap = NetworkMap(listOf(nodeInfoHashA), networkParametersHash, null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) // Sign network map diff --git a/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/signer/NetworkMapSignerTest.kt b/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/signer/NetworkMapSignerTest.kt index 25d9f7e7f5..a3ab4603a4 100644 --- a/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/signer/NetworkMapSignerTest.kt +++ b/network-management/src/test/kotlin/com/r3/corda/networkmanage/common/signer/NetworkMapSignerTest.kt @@ -47,7 +47,7 @@ class NetworkMapSignerTest : TestBase() { val signedNodeInfoHashes = listOf(SecureHash.randomSHA256(), SecureHash.randomSHA256()) val currentParameters = testNetworkParameters(emptyList(), minimumPlatformVersion = 1) val latestNetworkParameters = testNetworkParameters(emptyList(), minimumPlatformVersion = 2) - val networkMap = NetworkMap(signedNodeInfoHashes, currentParameters.serialize().hash) + val networkMap = NetworkMap(signedNodeInfoHashes, currentParameters.serialize().hash, null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) whenever(networkMapStorage.getCurrentNetworkMap()).thenReturn(signedNetworkMap) whenever(networkMapStorage.getNodeInfoHashes(any())).thenReturn(signedNodeInfoHashes) @@ -83,7 +83,7 @@ class NetworkMapSignerTest : TestBase() { // given val networkParameters = testNetworkParameters(emptyList()) val networkMapParametersHash = networkParameters.serialize().bytes.sha256() - val networkMap = NetworkMap(emptyList(), networkMapParametersHash) + val networkMap = NetworkMap(emptyList(), networkMapParametersHash, null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) whenever(networkMapStorage.getCurrentNetworkMap()).thenReturn(signedNetworkMap) whenever(networkMapStorage.getNodeInfoHashes(any())).thenReturn(emptyList()) diff --git a/network-management/src/test/kotlin/com/r3/corda/networkmanage/doorman/webservice/NetworkMapWebServiceTest.kt b/network-management/src/test/kotlin/com/r3/corda/networkmanage/doorman/webservice/NetworkMapWebServiceTest.kt index 65d7a322d5..dea911587c 100644 --- a/network-management/src/test/kotlin/com/r3/corda/networkmanage/doorman/webservice/NetworkMapWebServiceTest.kt +++ b/network-management/src/test/kotlin/com/r3/corda/networkmanage/doorman/webservice/NetworkMapWebServiceTest.kt @@ -104,7 +104,7 @@ class NetworkMapWebServiceTest { @Test fun `get network map`() { - val networkMap = NetworkMap(listOf(randomSHA256(), randomSHA256()), randomSHA256()) + val networkMap = NetworkMap(listOf(randomSHA256(), randomSHA256()), randomSHA256(), null) val signedNetworkMap = networkMap.signWithCert(networkMapCa.keyPair.private, networkMapCa.certificate) val networkMapStorage: NetworkMapStorage = mock { diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/SetsSerializationTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/SetsSerializationTest.kt index 48ba75540e..edd1eabf58 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/SetsSerializationTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/SetsSerializationTest.kt @@ -32,7 +32,7 @@ class SetsSerializationTest { } @Test - fun `check set can be serialized as part of SessionData`() { + fun `check set can be serialized as part of DataSessionMessage`() { run { val sessionData = DataSessionMessage(setOf(1).serialize()) assertEqualAfterRoundTripSerialization(sessionData) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/MySQLNotaryServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/MySQLNotaryServiceTests.kt index f36c398d8d..d7a394d461 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/MySQLNotaryServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/MySQLNotaryServiceTests.kt @@ -10,6 +10,7 @@ import net.corda.core.flows.NotaryException import net.corda.core.flows.NotaryFlow import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party +import net.corda.core.node.NotaryInfo import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.getOrThrow import net.corda.node.internal.StartedNode @@ -17,7 +18,6 @@ import net.corda.node.services.config.MySQLConfiguration import net.corda.node.services.config.NotaryConfig import net.corda.nodeapi.internal.DevIdentityGenerator import net.corda.nodeapi.internal.network.NetworkParametersCopier -import net.corda.nodeapi.internal.network.NotaryInfo import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract import net.corda.testing.core.chooseIdentity @@ -83,7 +83,7 @@ class MySQLNotaryServiceTests : IntegrationTest() { val firstSpend = node.services.startFlow(NotaryFlow.Client(firstSpendTx)) mockNet.runNetwork() - firstSpend.resultFuture.getOrThrow() + firstSpend.getOrThrow() val secondSpendBuilder = TransactionBuilder(notaryParty).withItems(inputState).run { val dummyState = DummyContract.SingleOwnerState(0, node.info.chooseIdentity()) @@ -96,7 +96,7 @@ class MySQLNotaryServiceTests : IntegrationTest() { mockNet.runNetwork() - val ex = assertFailsWith(NotaryException::class) { secondSpend.resultFuture.getOrThrow() } + val ex = assertFailsWith(NotaryException::class) { secondSpend.getOrThrow() } val error = ex.error as NotaryError.Conflict assertEquals(error.txId, secondSpendTx.id) } @@ -112,11 +112,11 @@ class MySQLNotaryServiceTests : IntegrationTest() { val notarise = node.services.startFlow(NotaryFlow.Client(spendTx)) mockNet.runNetwork() - val signature = notarise.resultFuture.get().single() + val signature = notarise.get().single() val notariseRetry = node.services.startFlow(NotaryFlow.Client(spendTx)) mockNet.runNetwork() - val signatureRetry = notariseRetry.resultFuture.get().single() + val signatureRetry = notariseRetry.get().single() fun checkSignature(signature: TransactionSignature) { signature.verify(spendTx.id) diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt index 6484a32bba..5319966b3e 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt @@ -38,8 +38,8 @@ import net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStra import net.corda.testing.node.MockNetwork import net.corda.testing.node.MockNetwork.MockNode import net.corda.testing.node.MockNodeParameters -import net.corda.testing.node.pumpReceive import net.corda.testing.node.internal.startFlow +import net.corda.testing.node.pumpReceive import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashSelectionH2Test.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashSelectionH2Test.kt index a28e82e637..6e8a3c5ecb 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashSelectionH2Test.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashSelectionH2Test.kt @@ -33,10 +33,10 @@ class CashSelectionH2Test { // spend operation below. // Issuing Integer.MAX_VALUE will not cause an exception since PersistentCashState.pennies is a long nCopies(2, Integer.MAX_VALUE).map { issueAmount -> - node.services.startFlow(CashIssueFlow(issueAmount.POUNDS, OpaqueBytes.of(1), mockNet.defaultNotaryIdentity)).resultFuture + node.services.startFlow(CashIssueFlow(issueAmount.POUNDS, OpaqueBytes.of(1), mockNet.defaultNotaryIdentity)) }.transpose().getOrThrow() // The spend must be more than the size of a single cash state to force the accumulator onto the second state. - node.services.startFlow(CashPaymentFlow((Integer.MAX_VALUE + 1L).POUNDS, node.info.legalIdentities[0])).resultFuture.getOrThrow() + node.services.startFlow(CashPaymentFlow((Integer.MAX_VALUE + 1L).POUNDS, node.info.legalIdentities[0])).getOrThrow() } @Test @@ -52,8 +52,8 @@ class CashSelectionH2Test { val flow2 = bankA.services.startFlow(CashPaymentFlow(amount = 100.DOLLARS, anonymous = false, recipient = notary)) val flow3 = bankA.services.startFlow(CashPaymentFlow(amount = 100.DOLLARS, anonymous = false, recipient = notary)) - assertThatThrownBy { flow1.resultFuture.getOrThrow() }.isInstanceOf(CashException::class.java) - assertThatThrownBy { flow2.resultFuture.getOrThrow() }.isInstanceOf(CashException::class.java) - assertThatThrownBy { flow3.resultFuture.getOrThrow() }.isInstanceOf(CashException::class.java) + assertThatThrownBy { flow1.getOrThrow() }.isInstanceOf(CashException::class.java) + assertThatThrownBy { flow2.getOrThrow() }.isInstanceOf(CashException::class.java) + assertThatThrownBy { flow3.getOrThrow() }.isInstanceOf(CashException::class.java) } } \ No newline at end of file diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashExitFlowTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashExitFlowTests.kt index 177d2ba983..5cdbcf7cda 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashExitFlowTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashExitFlowTests.kt @@ -33,7 +33,7 @@ class CashExitFlowTests { bankOfCordaNode = mockNet.createPartyNode(BOC_NAME) bankOfCorda = bankOfCordaNode.info.identityFromX500Name(BOC_NAME) notary = mockNet.defaultNotaryIdentity - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, notary)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, notary)) mockNet.runNetwork() future.getOrThrow() } @@ -46,7 +46,7 @@ class CashExitFlowTests { @Test fun `exit some cash`() { val exitAmount = 500.DOLLARS - val future = bankOfCordaNode.services.startFlow(CashExitFlow(exitAmount, ref)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashExitFlow(exitAmount, ref)) mockNet.runNetwork() val exitTx = future.getOrThrow().stx.tx val expected = (initialBalance - exitAmount).`issued by`(bankOfCorda.ref(ref)) @@ -59,7 +59,7 @@ class CashExitFlowTests { @Test fun `exit zero cash`() { val expected = 0.DOLLARS - val future = bankOfCordaNode.services.startFlow(CashExitFlow(expected, ref)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashExitFlow(expected, ref)) mockNet.runNetwork() assertFailsWith { future.getOrThrow() diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentFlowTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentFlowTests.kt index 06a6a1fc99..7f5d0a8b82 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentFlowTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentFlowTests.kt @@ -56,7 +56,7 @@ class CashIssueAndPaymentFlowTests { val (_, vaultUpdatesBoc) = bankOfCordaNode.services.vaultService.trackBy(criteria) val (_, vaultUpdatesBankClient) = aliceNode.services.vaultService.trackBy(criteria) - val future = bankOfCordaNode.services.startFlow(CashIssueAndPaymentFlow(expectedPayment, OpaqueBytes.of(1), payTo, false, notary)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueAndPaymentFlow(expectedPayment, OpaqueBytes.of(1), payTo, false, notary)) mockNet.runNetwork() future.getOrThrow() diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentNoSelectionFlowTest.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentNoSelectionFlowTest.kt index fd316b6373..bc27641c96 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentNoSelectionFlowTest.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueAndPaymentNoSelectionFlowTest.kt @@ -67,7 +67,7 @@ class CashIssueAndPayNoSelectionTests(private val anonymous: Boolean) { = aliceNode.services.vaultService.trackBy(criteria) val future = bankOfCordaNode.services.startFlow(CashIssueAndPaymentNoSelection( - expectedPayment, OpaqueBytes.of(1), payTo, anonymous, notary)).resultFuture + expectedPayment, OpaqueBytes.of(1), payTo, anonymous, notary)) mockNet.runNetwork() future.getOrThrow() diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueFlowTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueFlowTests.kt index 870e316755..d2aa44aefe 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueFlowTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashIssueFlowTests.kt @@ -43,7 +43,7 @@ class CashIssueFlowTests { fun `issue some cash`() { val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)) mockNet.runNetwork() val issueTx = future.getOrThrow().stx val output = issueTx.tx.outputsOfType().single() @@ -54,7 +54,7 @@ class CashIssueFlowTests { fun `issue zero cash`() { val expected = 0.DOLLARS val ref = OpaqueBytes.of(0x01) - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)) mockNet.runNetwork() assertFailsWith { future.getOrThrow() diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashPaymentFlowTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashPaymentFlowTests.kt index 3df1acd160..98769c3cd9 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashPaymentFlowTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/CashPaymentFlowTests.kt @@ -38,7 +38,7 @@ class CashPaymentFlowTests { aliceNode = mockNet.createPartyNode(ALICE_NAME) bankOfCorda = bankOfCordaNode.info.chooseIdentity() mockNet.runNetwork() - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, mockNet.defaultNotaryIdentity)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, mockNet.defaultNotaryIdentity)) future.getOrThrow() } @@ -60,7 +60,7 @@ class CashPaymentFlowTests { val (_, vaultUpdatesBankClient) = aliceNode.services.vaultService.trackBy(criteria) val future = bankOfCordaNode.services.startFlow(CashPaymentFlow(expectedPayment, - payTo)).resultFuture + payTo)) mockNet.runNetwork() future.getOrThrow() @@ -92,7 +92,7 @@ class CashPaymentFlowTests { val payTo = aliceNode.info.chooseIdentity() val expected = 4000.DOLLARS val future = bankOfCordaNode.services.startFlow(CashPaymentFlow(expected, - payTo)).resultFuture + payTo)) mockNet.runNetwork() assertFailsWith { future.getOrThrow() @@ -104,7 +104,7 @@ class CashPaymentFlowTests { val payTo = aliceNode.info.chooseIdentity() val expected = 0.DOLLARS val future = bankOfCordaNode.services.startFlow(CashPaymentFlow(expected, - payTo)).resultFuture + payTo)) mockNet.runNetwork() assertFailsWith { future.getOrThrow() diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt index a805adb30a..5b95f154e1 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt @@ -550,7 +550,7 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { val buyerFlows: Observable> = buyerNode.registerInitiatedFlow(BuyerAcceptor::class.java) val firstBuyerFiber = buyerFlows.toFuture().map { it.stateMachine } val seller = SellerInitiator(buyer, notary, assetToSell, 1000.DOLLARS, anonymous) - val sellerResult = sellerNode.services.startFlow(seller).resultFuture + val sellerResult = sellerNode.services.startFlow(seller) return RunResult(firstBuyerFiber, sellerResult, seller.stateMachine.id) } diff --git a/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/EnclaveletSerializationScheme.kt b/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/EnclaveletSerializationScheme.kt index 9dd51e1ca3..38c75114b3 100644 --- a/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/EnclaveletSerializationScheme.kt +++ b/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/EnclaveletSerializationScheme.kt @@ -4,14 +4,15 @@ package com.r3.enclaves.txverify import net.corda.core.serialization.SerializationContext import net.corda.core.serialization.internal.SerializationEnvironmentImpl import net.corda.core.serialization.internal.nodeSerializationEnv -import net.corda.core.utilities.ByteSequence import net.corda.core.utilities.toHexString -import net.corda.nodeapi.internal.serialization.* +import net.corda.nodeapi.internal.serialization.CordaSerializationMagic +import net.corda.nodeapi.internal.serialization.KRYO_P2P_CONTEXT +import net.corda.nodeapi.internal.serialization.SerializationFactoryImpl import net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme -import net.corda.nodeapi.internal.serialization.amqp.AmqpHeaderV1_0 import net.corda.nodeapi.internal.serialization.amqp.SerializerFactory +import net.corda.nodeapi.internal.serialization.amqp.amqpMagic import net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme -import net.corda.nodeapi.internal.serialization.kryo.KryoHeaderV0_1 +import net.corda.nodeapi.internal.serialization.kryo.kryoMagic @Suppress("UNUSED") private class EnclaveletSerializationScheme { @@ -40,8 +41,8 @@ private class EnclaveletSerializationScheme { } private object KryoVerifierSerializationScheme : AbstractKryoSerializationScheme() { - override fun canDeserializeVersion(byteSequence: ByteSequence, target: SerializationContext.UseCase): Boolean { - return byteSequence == KryoHeaderV0_1 && target == SerializationContext.UseCase.P2P + override fun canDeserializeVersion(magic: CordaSerializationMagic, target: SerializationContext.UseCase): Boolean { + return magic == kryoMagic && target == SerializationContext.UseCase.P2P } override fun rpcClientKryoPool(context: SerializationContext) = throw UnsupportedOperationException() @@ -49,8 +50,8 @@ private object KryoVerifierSerializationScheme : AbstractKryoSerializationScheme } private object AMQPVerifierSerializationScheme : AbstractAMQPSerializationScheme(emptyList()) { - override fun canDeserializeVersion(byteSequence: ByteSequence, target: SerializationContext.UseCase): Boolean { - return (byteSequence == AmqpHeaderV1_0 && (target == SerializationContext.UseCase.P2P)) + override fun canDeserializeVersion(magic: CordaSerializationMagic, target: SerializationContext.UseCase): Boolean { + return magic == amqpMagic && target == SerializationContext.UseCase.P2P } override fun rpcClientSerializerFactory(context: SerializationContext): SerializerFactory = throw UnsupportedOperationException() diff --git a/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/MockContractAttachment.kt b/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/MockContractAttachment.kt index 79264cf647..8e994b7ab1 100644 --- a/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/MockContractAttachment.kt +++ b/verify-enclave/src/main/kotlin/com/r3/enclaves/txverify/MockContractAttachment.kt @@ -10,4 +10,5 @@ import java.io.ByteArrayInputStream @CordaSerializable class MockContractAttachment(override val id: SecureHash = SecureHash.zeroHash, val contract: ContractClassName, override val signers: List = ArrayList()) : Attachment { override fun open() = ByteArrayInputStream(id.bytes) + override val size = id.size } \ No newline at end of file