Skip to content

Commit 7752a8d

Browse files
authored
Merge pull request corda#64 from corda/aslemmer-fix-simm-valuation-demo-kryo
Fix simm-valuation-demo's kryo
2 parents 1d1a067 + a7c0799 commit 7752a8d

File tree

1 file changed

+14
-0
lines changed
  • samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/services

1 file changed

+14
-0
lines changed

samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/services/SimmService.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package net.corda.vega.services
22

3+
import com.esotericsoftware.kryo.Kryo
34
import net.corda.core.contracts.StateRef
45
import net.corda.core.crypto.Party
56
import net.corda.core.node.CordaPluginRegistry
67
import net.corda.vega.api.PortfolioApi
8+
import net.corda.vega.contracts.IRSState
9+
import net.corda.vega.contracts.OGTrade
710
import net.corda.vega.contracts.SwapData
811
import net.corda.vega.flows.IRSTradeFlow
912
import net.corda.vega.flows.SimmFlow
1013
import net.corda.vega.flows.SimmRevaluation
14+
import java.math.BigDecimal
1115
import java.time.LocalDate
1216
import java.util.function.Function
1317

@@ -25,5 +29,15 @@ object SimmService {
2529
IRSTradeFlow.Requester::class.java.name to setOf(SwapData::class.java.name, Party::class.java.name))
2630
override val staticServeDirs: Map<String, String> = mapOf("simmvaluationdemo" to javaClass.classLoader.getResource("simmvaluationweb").toExternalForm())
2731
override val servicePlugins = listOf(Function(SimmFlow::Service), Function(IRSTradeFlow::Service))
32+
override fun registerRPCKryoTypes(kryo: Kryo): Boolean {
33+
kryo.apply {
34+
register(SwapData::class.java)
35+
register(LocalDate::class.java)
36+
register(BigDecimal::class.java)
37+
register(IRSState::class.java)
38+
register(OGTrade::class.java)
39+
}
40+
return true
41+
}
2842
}
2943
}

0 commit comments

Comments
 (0)