Removed the ability to manually start notary nodes from the driver and MockNetwork. Instead by default a single notary is automatically started. This can be customised at creation time of the driver and MockNetwork. This more accurately models the concept of network parameters in a CZ.

Also added helper methods to retrieve this default notary.
This commit is contained in:
Shams Asari
2017-11-05 12:34:42 +00:00
parent 9be37c2b88
commit 3bb018a5ce
64 changed files with 637 additions and 643 deletions

View File

@ -3,7 +3,9 @@ package net.corda.vega
import com.opengamma.strata.product.common.BuySell
import net.corda.core.identity.CordaX500Name
import net.corda.core.utilities.getOrThrow
import net.corda.testing.*
import net.corda.testing.DUMMY_BANK_A
import net.corda.testing.DUMMY_BANK_B
import net.corda.testing.IntegrationTestCategory
import net.corda.testing.driver.driver
import net.corda.testing.http.HttpApi
import net.corda.vega.api.PortfolioApi
@ -27,7 +29,6 @@ class SimmValuationTest : IntegrationTestCategory {
@Test
fun `runs SIMM valuation demo`() {
driver(isDebug = true, extraCordappPackagesToScan = listOf("net.corda.vega.contracts")) {
startNotaryNode(DUMMY_NOTARY.name, validating = false).getOrThrow()
val nodeAFuture = startNode(providedName = nodeALegalName)
val nodeBFuture = startNode(providedName = nodeBLegalName)
val (nodeA, nodeB) = listOf(nodeAFuture, nodeBFuture).map { it.getOrThrow() }

View File

@ -4,7 +4,6 @@ import net.corda.core.utilities.getOrThrow
import net.corda.testing.DUMMY_BANK_A
import net.corda.testing.DUMMY_BANK_B
import net.corda.testing.DUMMY_BANK_C
import net.corda.testing.DUMMY_NOTARY
import net.corda.testing.driver.driver
/**
@ -13,17 +12,17 @@ import net.corda.testing.driver.driver
* via the web api.
*/
fun main(args: Array<String>) {
driver(dsl = {
val notaryFuture = startNotaryNode(DUMMY_NOTARY.name, validating = false)
val nodeAFuture = startNode(providedName = DUMMY_BANK_A.name)
val nodeBFuture = startNode(providedName = DUMMY_BANK_B.name)
val nodeCFuture = startNode(providedName = DUMMY_BANK_C.name)
val (nodeA, nodeB, nodeC) = listOf(nodeAFuture, nodeBFuture, nodeCFuture, notaryFuture).map { it.getOrThrow() }
driver(isDebug = true) {
val (nodeA, nodeB, nodeC) = listOf(
startNode(providedName = DUMMY_BANK_A.name),
startNode(providedName = DUMMY_BANK_B.name),
startNode(providedName = DUMMY_BANK_C.name)
).map { it.getOrThrow() }
startWebserver(nodeA)
startWebserver(nodeB)
startWebserver(nodeC)
waitForAllNodesToFinish()
}, isDebug = true)
}
}