diff --git a/core/src/test/kotlin/net/corda/core/utilities/KotlinUtilsTest.kt b/core/src/test/kotlin/net/corda/core/utilities/KotlinUtilsTest.kt index 89c4ee9092..e7fbf6a5d0 100644 --- a/core/src/test/kotlin/net/corda/core/utilities/KotlinUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/utilities/KotlinUtilsTest.kt @@ -52,7 +52,7 @@ class KotlinUtilsTest { expectedEx.expect(KryoException::class.java) expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization") val original = NonCapturingTransientProperty() - original.serialize(context = KRYO_CHECKPOINT_CONTEXT).deserialize() + original.serialize(context = KRYO_CHECKPOINT_CONTEXT.withEncoding(null)).deserialize() } @Test @@ -79,7 +79,7 @@ class KotlinUtilsTest { expectedEx.expect(KryoException::class.java) expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization") val original = CapturingTransientProperty("Hello") - original.serialize(context = KRYO_CHECKPOINT_CONTEXT).deserialize() + original.serialize(context = KRYO_CHECKPOINT_CONTEXT.withEncoding(null)).deserialize() } private class NullTransientProperty { diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SharedContexts.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SharedContexts.kt index 25977e4c1e..854866a506 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SharedContexts.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SharedContexts.kt @@ -6,6 +6,7 @@ import net.corda.core.serialization.EncodingWhitelist import net.corda.core.serialization.SerializationContext import net.corda.core.serialization.SerializationDefaults import net.corda.core.serialization.SerializationEncoding +import net.corda.nodeapi.internal.serialization.CordaSerializationEncoding.SNAPPY import net.corda.nodeapi.internal.serialization.amqp.amqpMagic import net.corda.nodeapi.internal.serialization.kryo.kryoMagic @@ -30,7 +31,7 @@ val KRYO_CHECKPOINT_CONTEXT = SerializationContextImpl(kryoMagic, emptyMap(), true, SerializationContext.UseCase.Checkpoint, - null, + SNAPPY, AlwaysAcceptEncodingWhitelist) val AMQP_P2P_CONTEXT = SerializationContextImpl(amqpMagic, SerializationDefaults.javaClass.classLoader, diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt index fa1281bce5..08b012c2e8 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt @@ -18,6 +18,7 @@ import net.corda.node.utilities.WeightBasedAppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.nodeapi.internal.persistence.bufferUntilDatabaseCommit import net.corda.nodeapi.internal.persistence.wrapWithDatabaseTransaction +import net.corda.nodeapi.internal.serialization.CordaSerializationEncoding.SNAPPY import org.apache.commons.lang.ArrayUtils.EMPTY_BYTE_ARRAY import rx.Observable import rx.subjects.PublishSubject @@ -57,7 +58,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S DBTransaction().apply { txId = key.toString() transaction = value.toSignedTx(). - serialize(context = SerializationDefaults.STORAGE_CONTEXT).bytes + serialize(context = SerializationDefaults.STORAGE_CONTEXT.withEncoding(SNAPPY)).bytes } }, persistentEntityClass = DBTransaction::class.java,