Merge remote-tracking branch 'open/master' into os-merge-6d4bdb8

# Conflicts:
#	docs/source/changelog.rst
#	node-api/build.gradle
#	node/src/integration-test/kotlin/net/corda/node/flows/AsymmetricCorDappsTests.kt
#	node/src/integration-test/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt
#	node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt
#	node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt
This commit is contained in:
Shams Asari
2018-10-15 12:34:29 +01:00
62 changed files with 858 additions and 946 deletions

View File

@ -28,12 +28,12 @@ import java.security.GeneralSecurityException;
import java.security.PublicKey;
import java.time.Duration;
import java.time.Instant;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Collections.*;
import static net.corda.core.contracts.ContractsDSL.requireThat;
import static net.corda.core.crypto.Crypto.generateKeyPair;
@ -529,7 +529,7 @@ public class FlowCookbook {
// other required signers using ``CollectSignaturesFlow``.
// The responder flow will need to call ``SignTransactionFlow``.
// DOCSTART 15
SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(twiceSignedTx, Collections.emptySet(), SIGS_GATHERING.childProgressTracker()));
SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(twiceSignedTx, emptySet(), SIGS_GATHERING.childProgressTracker()));
// DOCEND 15
/*------------------------
@ -558,7 +558,7 @@ public class FlowCookbook {
// ``Arrays.asList(counterpartyPubKey)`` instead of
// ``Collections.singletonList(counterpartyPubKey)``.
// DOCSTART 54
onceSignedTx.verifySignaturesExcept(Collections.singletonList(counterpartyPubKey));
onceSignedTx.verifySignaturesExcept(singletonList(counterpartyPubKey));
// DOCEND 54
// We can also choose to only check the signatures that are
@ -584,7 +584,7 @@ public class FlowCookbook {
// We can also choose to send it to additional parties who aren't one
// of the state's participants.
// DOCSTART 10
Set<Party> additionalParties = Collections.singleton(regulator);
Set<Party> additionalParties = singleton(regulator);
SignedTransaction notarisedTx2 = subFlow(new FinalityFlow(fullySignedTx, additionalParties, FINALISATION.childProgressTracker()));
// DOCEND 10

View File

@ -15,7 +15,7 @@ import net.corda.core.utilities.ProgressTracker;
import static com.template.TemplateContract.TEMPLATE_CONTRACT_ID;
// Replace TemplateFlow's definition with:
// Replace Initiator's definition with:
@InitiatingFlow
@StartableByRPC
public class IOUFlow extends FlowLogic<Void> {
@ -44,7 +44,7 @@ public class IOUFlow extends FlowLogic<Void> {
@Override
public Void call() throws FlowException {
// We retrieve the notary identity from the network map.
final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
// We create the transaction components.
IOUState outputState = new IOUState(iouValue, getOurIdentity(), otherParty);
@ -52,12 +52,12 @@ public class IOUFlow extends FlowLogic<Void> {
Command cmd = new Command<>(cmdType, getOurIdentity().getOwningKey());
// We create a transaction builder and add the components.
final TransactionBuilder txBuilder = new TransactionBuilder(notary)
TransactionBuilder txBuilder = new TransactionBuilder(notary)
.addOutputState(outputState, TEMPLATE_CONTRACT_ID)
.addCommand(cmd);
// Signing the transaction.
final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);
SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);
// Finalising the transaction.
subFlow(new FinalityFlow(signedTx));
@ -65,4 +65,4 @@ public class IOUFlow extends FlowLogic<Void> {
return null;
}
}
// DOCEND 01
// DOCEND 01

View File

@ -43,11 +43,11 @@ public class IOUFlow extends FlowLogic<Void> {
@Override
public Void call() throws FlowException {
// We retrieve the notary identity from the network map.
final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
// DOCSTART 02
// We create a transaction builder.
final TransactionBuilder txBuilder = new TransactionBuilder();
TransactionBuilder txBuilder = new TransactionBuilder();
txBuilder.setNotary(notary);
// We create the transaction components.
@ -63,7 +63,7 @@ public class IOUFlow extends FlowLogic<Void> {
txBuilder.verify(getServiceHub());
// Signing the transaction.
final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);
SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);
// Creating a session with the other party.
FlowSession otherPartySession = initiateFlow(otherParty);

View File

@ -18,7 +18,7 @@ import net.corda.core.utilities.ProgressTracker
import com.template.TemplateContract.TEMPLATE_CONTRACT_ID
// Replace TemplateFlow's definition with:
// Replace Initiator's definition with:
@InitiatingFlow
@StartableByRPC
class IOUFlow(val iouValue: Int,

View File

@ -14,7 +14,6 @@ import net.corda.core.flows.StartableByRPC
import net.corda.core.identity.Party
import net.corda.core.transactions.TransactionBuilder
import net.corda.core.utilities.ProgressTracker
// DOCEND 01
@InitiatingFlow