mirror of
https://github.com/corda/corda.git
synced 2024-12-22 22:32:26 +00:00
Extract jackson dependency from finance-workflows (#5163)
Extract jackson dependency from finance-workflows and move it to IRS Demo where it is actually needed
This commit is contained in:
parent
d6ac4e2393
commit
f273d894ef
docs/source
finance
contracts/src/test/kotlin/net/corda/finance/contracts
workflows
samples
irs-demo
cordapp
contracts-irs/src/test/kotlin/net/corda/irs/contract
workflows-irs
src/integration-test/kotlin/net/corda/irs
web/src/main/kotlin/net/corda/irs/web
simm-valuation-demo/src/main/kotlin/net/corda/vega/webplugin
@ -4,6 +4,14 @@ Changelog
|
||||
Here's a summary of what's changed in each Corda release. For guidance on how to upgrade code from the previous
|
||||
release, see :doc:`app-upgrade-notes`.
|
||||
|
||||
.. _changelog_v5.0:
|
||||
|
||||
Version 5.0
|
||||
-----------
|
||||
|
||||
* Removed ``finance-workflows`` dependency on jackson library. The functions that used jackson (e.g. ``FinanceJSONSupport``) have been moved
|
||||
into IRS Demo.
|
||||
|
||||
.. _changelog_v4.2:
|
||||
|
||||
Version 4.2
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.corda.finance.contracts
|
||||
|
||||
import loadTestCalendar
|
||||
import net.corda.finance.workflows.utils.loadTestCalendar
|
||||
import org.junit.Test
|
||||
import java.time.LocalDate
|
||||
import kotlin.test.assertEquals
|
||||
|
@ -37,9 +37,6 @@ dependencies {
|
||||
|
||||
cordapp project(':finance:contracts')
|
||||
|
||||
// For JSON
|
||||
compile "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
|
||||
|
||||
testCompile project(':test-utils')
|
||||
testCompile project(path: ':core', configuration: 'testArtifacts')
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
package net.corda.finance.workflows.utils
|
||||
|
||||
import net.corda.core.flows.FlowException
|
||||
import net.corda.core.serialization.CordaSerializable
|
||||
import net.corda.finance.contracts.BusinessCalendar
|
||||
@ -5,7 +7,7 @@ import net.corda.finance.contracts.BusinessCalendar
|
||||
val TEST_CALENDAR_NAMES = listOf("London", "NewYork")
|
||||
|
||||
fun loadTestCalendar(name: String): BusinessCalendar {
|
||||
val stream = UnknownCalendar::class.java.getResourceAsStream("net/corda/finance/workflows/utils/${name}HolidayCalendar.txt") ?: throw UnknownCalendar(name)
|
||||
val stream = UnknownCalendar::class.java.getResourceAsStream("/net/corda/finance/workflows/utils/${name}HolidayCalendar.txt") ?: throw UnknownCalendar(name)
|
||||
return stream.use {
|
||||
BusinessCalendar(stream.reader().readText().split(",").map { BusinessCalendar.parseDateFromString(it) }.toSortedSet())
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package net.corda.irs.contract
|
||||
import com.nhaarman.mockito_kotlin.doReturn
|
||||
import com.nhaarman.mockito_kotlin.mock
|
||||
import com.nhaarman.mockito_kotlin.whenever
|
||||
import loadTestCalendar
|
||||
import net.corda.core.contracts.Amount
|
||||
import net.corda.core.contracts.UniqueIdentifier
|
||||
import net.corda.core.crypto.generateKeyPair
|
||||
@ -15,6 +14,7 @@ import net.corda.core.utilities.seconds
|
||||
import net.corda.finance.DOLLARS
|
||||
import net.corda.finance.EUR
|
||||
import net.corda.finance.contracts.*
|
||||
import net.corda.finance.workflows.utils.loadTestCalendar
|
||||
import net.corda.node.services.api.IdentityServiceInternal
|
||||
import net.corda.testing.common.internal.addNotary
|
||||
import net.corda.testing.common.internal.testNetworkParameters
|
||||
|
@ -14,6 +14,8 @@ dependencies {
|
||||
|
||||
// Corda integration dependencies
|
||||
cordaCompile project(':core')
|
||||
|
||||
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version")
|
||||
|
||||
// only included to control the `DemoClock` as part of the demo application
|
||||
// normally `:node` should not be depended on in any CorDapps
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.corda.irs.api
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import loadTestCalendar
|
||||
import net.corda.core.contracts.Command
|
||||
import net.corda.core.crypto.TransactionSignature
|
||||
import net.corda.core.flows.*
|
||||
@ -16,6 +15,7 @@ import net.corda.finance.contracts.BusinessCalendar
|
||||
import net.corda.finance.contracts.Fix
|
||||
import net.corda.finance.contracts.FixOf
|
||||
import net.corda.finance.contracts.Tenor
|
||||
import net.corda.finance.workflows.utils.loadTestCalendar
|
||||
import net.corda.irs.flows.RatesFixFlow
|
||||
import net.corda.irs.math.CubicSplineInterpolator
|
||||
import net.corda.irs.math.Interpolator
|
||||
|
@ -1,17 +1,17 @@
|
||||
@file:JvmName("FinanceJSONSupport")
|
||||
|
||||
package net.corda.finance.workflows.plugin
|
||||
package net.corda.irs.flows.plugin
|
||||
|
||||
import TEST_CALENDAR_NAMES
|
||||
import com.fasterxml.jackson.core.JsonGenerator
|
||||
import com.fasterxml.jackson.core.JsonParseException
|
||||
import com.fasterxml.jackson.core.JsonParser
|
||||
import com.fasterxml.jackson.databind.*
|
||||
import com.fasterxml.jackson.databind.deser.std.StringArrayDeserializer
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule
|
||||
import loadTestCalendar
|
||||
import net.corda.finance.contracts.BusinessCalendar
|
||||
import net.corda.finance.contracts.Expression
|
||||
import net.corda.finance.workflows.utils.TEST_CALENDAR_NAMES
|
||||
import net.corda.finance.workflows.utils.loadTestCalendar
|
||||
import java.time.LocalDate
|
||||
import java.util.*
|
||||
|
@ -19,7 +19,7 @@ import net.corda.core.utilities.NetworkHostAndPort
|
||||
import net.corda.core.utilities.contextLogger
|
||||
import net.corda.core.utilities.getOrThrow
|
||||
import net.corda.core.utilities.seconds
|
||||
import net.corda.finance.workflows.plugin.registerFinanceJSONMappers
|
||||
import net.corda.irs.flows.plugin.registerFinanceJSONMappers
|
||||
import net.corda.irs.contract.InterestRateSwap
|
||||
import net.corda.irs.web.IrsDemoWebApplication
|
||||
import net.corda.test.spring.springDriver
|
||||
|
@ -6,7 +6,7 @@ import net.corda.client.rpc.CordaRPCClient
|
||||
import net.corda.client.rpc.RPCException
|
||||
import net.corda.core.messaging.CordaRPCOps
|
||||
import net.corda.core.utilities.NetworkHostAndPort
|
||||
import net.corda.finance.workflows.plugin.registerFinanceJSONMappers
|
||||
import net.corda.irs.flows.plugin.registerFinanceJSONMappers
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
|
@ -1,8 +1,6 @@
|
||||
package net.corda.vega.webplugin
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import net.corda.core.serialization.SerializationWhitelist
|
||||
import net.corda.finance.workflows.plugin.registerFinanceJSONMappers
|
||||
import net.corda.vega.api.PortfolioApi
|
||||
import net.corda.webserver.services.WebServerPluginRegistry
|
||||
import java.util.function.Function
|
||||
@ -16,5 +14,4 @@ import java.util.function.Function
|
||||
class SimmPlugin : WebServerPluginRegistry {
|
||||
override val webApis = listOf(Function(::PortfolioApi))
|
||||
override val staticServeDirs: Map<String, String> = emptyMap()
|
||||
override fun customizeJSONSerialization(om: ObjectMapper): Unit = registerFinanceJSONMappers(om)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user