Merge commit '39434dcbecdd2cd656e40622530e84d02443b8e2' into chrisr3-os-merge

This commit is contained in:
Chris Rankin
2018-10-08 10:42:55 +01:00
48 changed files with 273 additions and 306 deletions

View File

@ -66,11 +66,11 @@ public class IOUFlow extends FlowLogic<Void> {
final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);
// Creating a session with the other party.
FlowSession otherpartySession = initiateFlow(otherParty);
FlowSession otherPartySession = initiateFlow(otherParty);
// Obtaining the counterparty's signature.
SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(
signedTx, ImmutableList.of(otherpartySession), CollectSignaturesFlow.tracker()));
signedTx, ImmutableList.of(otherPartySession), CollectSignaturesFlow.tracker()));
// Finalising the transaction.
subFlow(new FinalityFlow(fullySignedTx));
@ -78,4 +78,4 @@ public class IOUFlow extends FlowLogic<Void> {
return null;
// DOCEND 02
}
}
}

View File

@ -1,3 +1,5 @@
@file:Suppress("MemberVisibilityCanBePrivate")
package net.corda.docs.kotlin.tutorial.helloworld
import net.corda.core.contracts.ContractState
@ -12,4 +14,4 @@ class IOUState(val value: Int,
val borrower: Party) : ContractState {
override val participants get() = listOf(lender, borrower)
}
// DOCEND 01
// DOCEND 01

View File

@ -1,3 +1,5 @@
@file:Suppress("MemberVisibilityCanBePrivate")
package net.corda.docs.kotlin.tutorial.twoparty
// DOCSTART 01
@ -48,13 +50,13 @@ class IOUFlow(val iouValue: Int,
val signedTx = serviceHub.signInitialTransaction(txBuilder)
// Creating a session with the other party.
val otherpartySession = initiateFlow(otherParty)
val otherPartySession = initiateFlow(otherParty)
// Obtaining the counterparty's signature.
val fullySignedTx = subFlow(CollectSignaturesFlow(signedTx, listOf(otherpartySession), CollectSignaturesFlow.tracker()))
val fullySignedTx = subFlow(CollectSignaturesFlow(signedTx, listOf(otherPartySession), CollectSignaturesFlow.tracker()))
// Finalising the transaction.
subFlow(FinalityFlow(fullySignedTx))
// DOCEND 02
}
}
}

View File

@ -1,3 +1,5 @@
@file:Suppress("unused")
package net.corda.docs.kotlin.tutorial.twoparty
import co.paralleluniverse.fibers.Suspendable
@ -30,4 +32,4 @@ class IOUFlowResponder(val otherPartySession: FlowSession) : FlowLogic<Unit>() {
subFlow(signTransactionFlow)
}
}
// DOCEND 01
// DOCEND 01

View File

@ -1,4 +1,4 @@
package net.corda.docs
package net.corda.docs.kotlin
import net.corda.core.contracts.Amount
import net.corda.core.contracts.ContractState
@ -8,7 +8,6 @@ import net.corda.core.node.services.vault.*
import net.corda.core.utilities.OpaqueBytes
import net.corda.core.utilities.getOrThrow
import net.corda.docs.java.tutorial.helloworld.IOUFlow
import net.corda.docs.kotlin.TopupIssuerFlow
import net.corda.finance.*
import net.corda.finance.contracts.getCashBalances
import net.corda.finance.flows.CashIssueFlow

View File

@ -1,18 +1,12 @@
package net.corda.docs
package net.corda.docs.kotlin
import net.corda.core.identity.Party
import net.corda.core.toFuture
import net.corda.core.utilities.OpaqueBytes
import net.corda.core.utilities.getOrThrow
import net.corda.docs.kotlin.ForeignExchangeFlow
import net.corda.docs.kotlin.ForeignExchangeRemoteFlow
import net.corda.finance.DOLLARS
import net.corda.finance.GBP
import net.corda.finance.POUNDS
import net.corda.finance.USD
import net.corda.finance.*
import net.corda.finance.contracts.getCashBalances
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.issuedBy
import net.corda.testing.core.singleIdentity
import net.corda.testing.node.MockNetwork
import net.corda.testing.node.StartedMockNode

View File

@ -1,4 +1,4 @@
package net.corda.docs
package net.corda.docs.kotlin
import net.corda.core.contracts.LinearState
import net.corda.core.contracts.StateAndRef
@ -9,10 +9,6 @@ import net.corda.core.node.services.queryBy
import net.corda.core.node.services.vault.QueryCriteria
import net.corda.core.toFuture
import net.corda.core.utilities.getOrThrow
import net.corda.docs.kotlin.SubmitCompletionFlow
import net.corda.docs.kotlin.SubmitTradeApprovalFlow
import net.corda.docs.kotlin.TradeApprovalContract
import net.corda.docs.kotlin.WorkflowState
import net.corda.testing.core.ALICE_NAME
import net.corda.testing.core.BOB_NAME
import net.corda.testing.node.MockNetwork