From fb6c4f6a3d0b740a5e6168e632ddb016683e1b3d Mon Sep 17 00:00:00 2001 From: Jose Coll Date: Tue, 19 Dec 2023 11:14:35 +0000 Subject: [PATCH] ENT-11003 [CRAFT][Sample CorDapp] simm-demo fails to create a trade (#7604) * Reference tiny contract-states jar (do this also gets deployed to node cordapps) * Update artifact publishing. * Add explicit compileKotlin pendency to sub-project shrink task. --- samples/simm-valuation-demo/build.gradle | 4 +++- samples/simm-valuation-demo/contracts-states/build.gradle | 2 +- .../src/main/kotlin/net/corda/vega/api/PortfolioApi.kt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/simm-valuation-demo/build.gradle b/samples/simm-valuation-demo/build.gradle index e570d01a55..42099153ff 100644 --- a/samples/simm-valuation-demo/build.gradle +++ b/samples/simm-valuation-demo/build.gradle @@ -20,6 +20,8 @@ sourceSets { } } +compileKotlin.dependsOn(":samples:simm-valuation-demo:contracts-states:shrink") + configurations { integrationTestImplementation.extendsFrom testImplementation integrationTestRuntimeOnly.extendsFrom testRuntimeOnly @@ -35,7 +37,7 @@ dependencies { // The SIMM demo CorDapp depends upon Cash CorDapp features cordapp project(':finance:contracts') cordapp project(':finance:workflows') - cordapp project(':samples:simm-valuation-demo:contracts-states') + cordapp project(path: ':samples:simm-valuation-demo:contracts-states', configuration: 'shrinkArtifacts') cordapp project(':samples:simm-valuation-demo:flows') cordaBootstrapper "org.slf4j:slf4j-simple:$slf4j_version" diff --git a/samples/simm-valuation-demo/contracts-states/build.gradle b/samples/simm-valuation-demo/contracts-states/build.gradle index f4daf59e12..777a908910 100644 --- a/samples/simm-valuation-demo/contracts-states/build.gradle +++ b/samples/simm-valuation-demo/contracts-states/build.gradle @@ -122,5 +122,5 @@ jar.finalizedBy shrink shrink.finalizedBy sign artifacts { -// shrinkArtifacts file: sign.outputJars.singleFile, name: project.name, type: 'jar', extension: 'jar', classifier: 'tiny', builtBy: sign + shrinkArtifacts shrinkJar } diff --git a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/api/PortfolioApi.kt b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/api/PortfolioApi.kt index a8ffecff93..fee3363a0a 100644 --- a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/api/PortfolioApi.kt +++ b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/api/PortfolioApi.kt @@ -135,7 +135,7 @@ class PortfolioApi(val rpc: CordaRPCOps) { it.toView(ownParty, latestPortfolioStateData?.portfolio?.toStateAndRef(rpc)?.toPortfolio(), PVs?.get(it.id.second) ?: MultiCurrencyAmount.empty(), - IMs?.get(it.id.second) ?: InitialMarginTriple.zero() + IMs?.get(it.id.second) ?: InitialMarginTriple(0.0, 0.0, 0.0) ) }).build() }