mirror of
https://github.com/corda/corda.git
synced 2025-04-06 19:07:08 +00:00
Remove useless call to waitUntilNetworkReady within driver started nodes (#1998)
Remove usages of waitUntilNetworkReady in conjunction with driver
This commit is contained in:
parent
22453204ed
commit
9be37c2b88
@ -11,8 +11,8 @@ import net.corda.finance.DOLLARS
|
||||
import net.corda.finance.contracts.asset.Cash
|
||||
import net.corda.finance.flows.CashIssueFlow
|
||||
import net.corda.finance.flows.CashPaymentFlow
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.node.services.Permissions.Companion.invokeRpc
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.nodeapi.User
|
||||
import net.corda.testing.*
|
||||
import net.corda.testing.driver.driver
|
||||
@ -28,14 +28,12 @@ class IntegrationTestingTutorial {
|
||||
val aliceUser = User("aliceUser", "testPassword1", permissions = setOf(
|
||||
startFlow<CashIssueFlow>(),
|
||||
startFlow<CashPaymentFlow>(),
|
||||
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
|
||||
invokeRpc("vaultTrackBy"),
|
||||
invokeRpc(CordaRPCOps::notaryIdentities),
|
||||
invokeRpc(CordaRPCOps::networkMapFeed)
|
||||
))
|
||||
val bobUser = User("bobUser", "testPassword2", permissions = setOf(
|
||||
startFlow<CashPaymentFlow>(),
|
||||
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
|
||||
invokeRpc("vaultTrackBy"),
|
||||
invokeRpc(CordaRPCOps::networkMapFeed)
|
||||
))
|
||||
@ -44,6 +42,7 @@ class IntegrationTestingTutorial {
|
||||
startNode(providedName = ALICE.name, rpcUsers = listOf(aliceUser)),
|
||||
startNode(providedName = BOB.name, rpcUsers = listOf(bobUser))
|
||||
).transpose().getOrThrow()
|
||||
|
||||
// END 1
|
||||
|
||||
// START 2
|
||||
@ -52,9 +51,6 @@ class IntegrationTestingTutorial {
|
||||
|
||||
val bobClient = bob.rpcClientToNode()
|
||||
val bobProxy = bobClient.start("bobUser", "testPassword2").proxy
|
||||
|
||||
aliceProxy.waitUntilNetworkReady().getOrThrow()
|
||||
bobProxy.waitUntilNetworkReady().getOrThrow()
|
||||
// END 2
|
||||
|
||||
// START 3
|
||||
|
@ -8,14 +8,13 @@ import net.corda.core.serialization.CordaSerializable
|
||||
import net.corda.core.serialization.SerializationWhitelist
|
||||
import net.corda.core.transactions.SignedTransaction
|
||||
import net.corda.core.utilities.OpaqueBytes
|
||||
import net.corda.core.utilities.getOrThrow
|
||||
import net.corda.finance.USD
|
||||
import net.corda.finance.contracts.asset.Cash
|
||||
import net.corda.finance.flows.CashExitFlow
|
||||
import net.corda.finance.flows.CashIssueFlow
|
||||
import net.corda.finance.flows.CashPaymentFlow
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.node.services.Permissions.Companion.invokeRpc
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.nodeapi.User
|
||||
import net.corda.testing.ALICE
|
||||
import net.corda.testing.DUMMY_NOTARY
|
||||
@ -56,7 +55,6 @@ fun main(args: Array<String>) {
|
||||
// START 2
|
||||
val client = node.rpcClientToNode()
|
||||
val proxy = client.start("user", "password").proxy
|
||||
proxy.waitUntilNetworkReady().getOrThrow()
|
||||
|
||||
thread {
|
||||
generateTransactions(proxy)
|
||||
|
@ -68,7 +68,6 @@ class AttachmentLoadingTests {
|
||||
startNode(providedName = bankAName, rpcUsers = listOf(adminUser)),
|
||||
startNode(providedName = bankBName, rpcUsers = listOf(adminUser))
|
||||
).transpose().getOrThrow() // Wait for all nodes to start up.
|
||||
nodes.forEach { it.rpc.waitUntilNetworkReady().getOrThrow() }
|
||||
return nodes
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ import net.corda.core.utilities.getOrThrow
|
||||
import net.corda.finance.DOLLARS
|
||||
import net.corda.finance.contracts.asset.Cash
|
||||
import net.corda.finance.flows.CashIssueAndPaymentFlow
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.node.services.Permissions.Companion.invokeRpc
|
||||
import net.corda.node.services.Permissions.Companion.startFlow
|
||||
import net.corda.nodeapi.User
|
||||
import net.corda.testing.*
|
||||
import net.corda.testing.driver.driver
|
||||
@ -20,7 +20,6 @@ class BankOfCordaRPCClientTest {
|
||||
fun `issuer flow via RPC`() {
|
||||
val commonPermissions = setOf(
|
||||
invokeRpc("vaultTrackByCriteria"),
|
||||
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
|
||||
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name),
|
||||
invokeRpc(CordaRPCOps::notaryIdentities)
|
||||
)
|
||||
@ -40,8 +39,6 @@ class BankOfCordaRPCClientTest {
|
||||
// Big Corporation RPC Client
|
||||
val bigCorpClient = nodeBigCorporation.rpcClientToNode()
|
||||
val bigCorpProxy = bigCorpClient.start("bigCorpCFO", "password2").proxy
|
||||
bocProxy.waitUntilNetworkReady().getOrThrow()
|
||||
bigCorpProxy.waitUntilNetworkReady().getOrThrow()
|
||||
|
||||
// Register for Bank of Corda Vault updates
|
||||
val criteria = QueryCriteria.VaultQueryCriteria(status = Vault.StateStatus.ALL)
|
||||
|
@ -960,7 +960,7 @@ class DriverDSL(
|
||||
if (process.isAlive) null else process
|
||||
}
|
||||
establishRpc(configuration, processDeathFuture).flatMap { rpc ->
|
||||
// Call waitUntilNetworkReady in background in case RPC is failing over:
|
||||
// Check for all nodes to have all other nodes in background in case RPC is failing over:
|
||||
val forked = executorService.fork {
|
||||
allNodesConnected(rpc)
|
||||
}
|
||||
|
@ -127,10 +127,6 @@ class ExplorerSimulation(val options: OptionSet) {
|
||||
bobNode.nodeInfo.legalIdentities.first() to bobRPC,
|
||||
issuerNodeGBP.nodeInfo.legalIdentities.first() to issuerRPCGBP,
|
||||
issuerNodeUSD.nodeInfo.legalIdentities.first() to issuerRPCUSD))
|
||||
|
||||
listOf(aliceRPC, bobRPC, issuerRPCGBP, issuerRPCUSD).map {
|
||||
it.waitUntilNetworkReady().getOrThrow()
|
||||
}
|
||||
}
|
||||
|
||||
private fun startSimulation(eventGenerator: EventGenerator, maxIterations: Int) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user