mirror of
https://github.com/corda/corda.git
synced 2025-06-19 15:43:52 +00:00
Replace code only used in 1 test with existing general mechanism. (#600)
This commit is contained in:
@ -7,6 +7,8 @@ open class StorageServiceImpl(override val attachments: AttachmentStorage,
|
||||
override val validatedTransactions: TransactionStorage,
|
||||
override val stateMachineRecordedTransactionMapping: StateMachineRecordedTransactionMappingStorage)
|
||||
: SingletonSerializeAsToken(), TxWritableStorageService {
|
||||
override val attachmentsClassLoaderEnabled = false
|
||||
|
||||
lateinit override var uploaders: List<FileUploader>
|
||||
|
||||
fun initUploaders(uploadersList: List<FileUploader>) {
|
||||
|
@ -374,16 +374,18 @@ class StateMachineManager(val serviceHub: ServiceHubInternal,
|
||||
private fun serializeFiber(fiber: FlowStateMachineImpl<*>): SerializedBytes<FlowStateMachineImpl<*>> {
|
||||
return quasarKryo().run { kryo ->
|
||||
// add the map of tokens -> tokenizedServices to the kyro context
|
||||
SerializeAsTokenSerializer.setContext(kryo, serializationContext)
|
||||
fiber.serialize(kryo)
|
||||
kryo.withSerializationContext(serializationContext) {
|
||||
fiber.serialize(kryo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun deserializeFiber(checkpoint: Checkpoint): FlowStateMachineImpl<*> {
|
||||
return quasarKryo().run { kryo ->
|
||||
// put the map of token -> tokenized into the kryo context
|
||||
SerializeAsTokenSerializer.setContext(kryo, serializationContext)
|
||||
checkpoint.serializedFiber.deserialize(kryo).apply { fromCheckpoint = true }
|
||||
kryo.withSerializationContext(serializationContext) {
|
||||
checkpoint.serializedFiber.deserialize(kryo)
|
||||
}.apply { fromCheckpoint = true }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user