CORDA-2005: FinalityFlow has been made into an inlined flow to resolve issue with FinalityHandler (#4050)

FinalityHandler is insecure in that it is open to receive any transaction from any party.

Any CorDapp targeting platform version 4 or above is required use the new c'tors which take in FlowSession objects to the counterpart flow. This flow must subcall ReceiveFinalityFlow to receive and record the finalised transaction.

Old CorDapps (with target platform version < 4) will continue to work as previously. However if there are no old CorDapps loaded then the node will disable FinalityHandler.
This commit is contained in:
Shams Asari
2018-11-14 14:16:22 +00:00
committed by GitHub
parent 8e6d4b4b38
commit e8b6f5f2f2
76 changed files with 1251 additions and 469 deletions

View File

@ -1,4 +1,4 @@
package net.corda.docs;
package net.corda.docs.java.tutorial.test;
import net.corda.client.rpc.CordaRPCClient;
import net.corda.core.concurrent.CordaFuture;
@ -18,7 +18,9 @@ import net.corda.testing.node.User;
import org.junit.Test;
import rx.Observable;
import java.util.*;
import java.util.Currency;
import java.util.HashSet;
import java.util.List;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
@ -38,7 +40,7 @@ public class JavaIntegrationTestingTutorial {
// START 1
driver(new DriverParameters()
.withStartNodesInProcess(true)
.withExtraCordappPackagesToScan(Arrays.asList("net.corda.finance.contracts.asset", "net.corda.finance.schemas")), dsl -> {
.withExtraCordappPackagesToScan(singletonList("net.corda.finance")), dsl -> {
User aliceUser = new User("aliceUser", "testPassword1", new HashSet<>(asList(
startFlow(CashIssueAndPaymentFlow.class),

View File

@ -1,4 +1,4 @@
package net.corda.docs.java;
package net.corda.docs.java.tutorial.test;
import kotlin.Unit;
import net.corda.client.rpc.CordaRPCClient;

View File

@ -1,4 +1,4 @@
package net.corda.docs
package net.corda.docs.kotlin.tutorial.test
import net.corda.client.rpc.CordaRPCClient
import net.corda.core.contracts.Amount
@ -29,10 +29,7 @@ class KotlinIntegrationTestingTutorial {
@Test
fun `alice bob cash exchange example`() {
// START 1
driver(DriverParameters(
startNodesInProcess = true,
extraCordappPackagesToScan = listOf("net.corda.finance.contracts.asset", "net.corda.finance.schemas")
)) {
driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.finance"))) {
val aliceUser = User("aliceUser", "testPassword1", permissions = setOf(
startFlow<CashIssueAndPaymentFlow>(),
invokeRpc("vaultTrackBy")

View File

@ -1,4 +1,4 @@
package net.corda.docs
package net.corda.docs.kotlin.tutorial.test
import net.corda.client.rpc.CordaRPCClient
import net.corda.core.messaging.startFlow