diff --git a/core/src/main/kotlin/net/corda/flows/AbstractStateReplacementFlow.kt b/core/src/main/kotlin/net/corda/core/flows/AbstractStateReplacementFlow.kt similarity index 96% rename from core/src/main/kotlin/net/corda/flows/AbstractStateReplacementFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/AbstractStateReplacementFlow.kt index a035bd256f..b34ab2a65b 100644 --- a/core/src/main/kotlin/net/corda/flows/AbstractStateReplacementFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/AbstractStateReplacementFlow.kt @@ -1,4 +1,4 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.ContractState @@ -6,10 +6,6 @@ import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateRef import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.isFulfilledBy -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic -import net.corda.core.identity.AbstractParty -import net.corda.core.identity.AnonymousParty import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable import net.corda.core.transactions.SignedTransaction @@ -56,7 +52,7 @@ abstract class AbstractStateReplacementFlow { abstract class Instigator( val originalState: StateAndRef, val modification: M, - override val progressTracker: ProgressTracker = tracker()) : FlowLogic>() { + override val progressTracker: ProgressTracker = Instigator.tracker()) : FlowLogic>() { companion object { object SIGNING : ProgressTracker.Step("Requesting signatures from other parties") object NOTARY : ProgressTracker.Step("Requesting notary signature") @@ -133,7 +129,7 @@ abstract class AbstractStateReplacementFlow { // Type parameter should ideally be Unit but that prevents Java code from subclassing it (https://youtrack.jetbrains.com/issue/KT-15964). // We use Void? instead of Unit? as that's what you'd use in Java. abstract class Acceptor(val otherSide: Party, - override val progressTracker: ProgressTracker = tracker()) : FlowLogic() { + override val progressTracker: ProgressTracker = Acceptor.tracker()) : FlowLogic() { companion object { object VERIFYING : ProgressTracker.Step("Verifying state replacement proposal") object APPROVING : ProgressTracker.Step("State replacement approved") diff --git a/core/src/main/kotlin/net/corda/flows/BroadcastTransactionFlow.kt b/core/src/main/kotlin/net/corda/core/flows/BroadcastTransactionFlow.kt similarity index 93% rename from core/src/main/kotlin/net/corda/flows/BroadcastTransactionFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/BroadcastTransactionFlow.kt index 93ed85fc08..9227741230 100644 --- a/core/src/main/kotlin/net/corda/flows/BroadcastTransactionFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/BroadcastTransactionFlow.kt @@ -1,8 +1,6 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable import net.corda.core.transactions.SignedTransaction diff --git a/core/src/main/kotlin/net/corda/flows/CollectSignaturesFlow.kt b/core/src/main/kotlin/net/corda/core/flows/CollectSignaturesFlow.kt similarity index 98% rename from core/src/main/kotlin/net/corda/flows/CollectSignaturesFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/CollectSignaturesFlow.kt index 5bd80d9f98..1e49baed1c 100644 --- a/core/src/main/kotlin/net/corda/flows/CollectSignaturesFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/CollectSignaturesFlow.kt @@ -1,11 +1,9 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.isFulfilledBy import net.corda.core.crypto.toBase58String -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic import net.corda.core.identity.Party import net.corda.core.node.ServiceHub import net.corda.core.transactions.SignedTransaction @@ -62,7 +60,7 @@ import java.security.PublicKey // TODO: AbstractStateReplacementFlow needs updating to use this flow. // TODO: Update this flow to handle randomly generated keys when that works is complete. class CollectSignaturesFlow(val partiallySignedTx: SignedTransaction, - override val progressTracker: ProgressTracker = tracker()): FlowLogic() { + override val progressTracker: ProgressTracker = CollectSignaturesFlow.tracker()): FlowLogic() { companion object { object COLLECTING : ProgressTracker.Step("Collecting signatures from counter-parties.") @@ -175,7 +173,7 @@ class CollectSignaturesFlow(val partiallySignedTx: SignedTransaction, * @param otherParty The counter-party which is providing you a transaction to sign. */ abstract class SignTransactionFlow(val otherParty: Party, - override val progressTracker: ProgressTracker = tracker()) : FlowLogic() { + override val progressTracker: ProgressTracker = SignTransactionFlow.tracker()) : FlowLogic() { companion object { object RECEIVING : ProgressTracker.Step("Receiving transaction proposal for signing.") diff --git a/core/src/main/kotlin/net/corda/flows/ContractUpgradeFlow.kt b/core/src/main/kotlin/net/corda/core/flows/ContractUpgradeFlow.kt similarity index 94% rename from core/src/main/kotlin/net/corda/flows/ContractUpgradeFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/ContractUpgradeFlow.kt index ce785ed6f2..bc1ced6793 100644 --- a/core/src/main/kotlin/net/corda/flows/ContractUpgradeFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/ContractUpgradeFlow.kt @@ -1,10 +1,6 @@ -package net.corda.flows +package net.corda.core.flows import net.corda.core.contracts.* -import net.corda.core.flows.InitiatingFlow -import net.corda.core.flows.StartableByRPC -import net.corda.core.identity.AbstractParty -import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.TransactionBuilder import java.security.PublicKey diff --git a/core/src/main/kotlin/net/corda/flows/FetchAttachmentsFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FetchAttachmentsFlow.kt similarity index 95% rename from core/src/main/kotlin/net/corda/flows/FetchAttachmentsFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/FetchAttachmentsFlow.kt index 805e25da14..1eaeff6e56 100644 --- a/core/src/main/kotlin/net/corda/flows/FetchAttachmentsFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FetchAttachmentsFlow.kt @@ -1,10 +1,9 @@ -package net.corda.flows +package net.corda.core.flows import net.corda.core.contracts.AbstractAttachment import net.corda.core.contracts.Attachment import net.corda.core.crypto.SecureHash import net.corda.core.crypto.sha256 -import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.Party import net.corda.core.serialization.SerializationToken import net.corda.core.serialization.SerializeAsToken diff --git a/core/src/main/kotlin/net/corda/flows/FetchDataFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FetchDataFlow.kt similarity index 94% rename from core/src/main/kotlin/net/corda/flows/FetchDataFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/FetchDataFlow.kt index efbe720210..28c5fdceb1 100644 --- a/core/src/main/kotlin/net/corda/flows/FetchDataFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FetchDataFlow.kt @@ -1,16 +1,14 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.NamedByHash import net.corda.core.crypto.SecureHash -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic +import net.corda.core.flows.FetchDataFlow.DownloadedVsRequestedDataMismatch +import net.corda.core.flows.FetchDataFlow.HashNotFound import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable import net.corda.core.utilities.UntrustworthyData import net.corda.core.utilities.unwrap -import net.corda.flows.FetchDataFlow.DownloadedVsRequestedDataMismatch -import net.corda.flows.FetchDataFlow.HashNotFound import java.util.* /** diff --git a/core/src/main/kotlin/net/corda/flows/FetchTransactionsFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FetchTransactionsFlow.kt similarity index 93% rename from core/src/main/kotlin/net/corda/flows/FetchTransactionsFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/FetchTransactionsFlow.kt index 0f99aad169..e39e16aa7c 100644 --- a/core/src/main/kotlin/net/corda/flows/FetchTransactionsFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FetchTransactionsFlow.kt @@ -1,7 +1,6 @@ -package net.corda.flows +package net.corda.core.flows import net.corda.core.crypto.SecureHash -import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.Party import net.corda.core.transactions.SignedTransaction diff --git a/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt similarity index 99% rename from core/src/main/kotlin/net/corda/flows/FinalityFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt index cb76ab342f..650ba3e25d 100644 --- a/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt @@ -1,11 +1,10 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.ContractState import net.corda.core.contracts.StateRef import net.corda.core.contracts.TransactionState import net.corda.core.crypto.isFulfilledBy -import net.corda.core.flows.FlowLogic import net.corda.core.identity.Party import net.corda.core.node.ServiceHub import net.corda.core.transactions.LedgerTransaction diff --git a/core/src/main/kotlin/net/corda/flows/NotaryChangeFlow.kt b/core/src/main/kotlin/net/corda/core/flows/NotaryChangeFlow.kt similarity index 96% rename from core/src/main/kotlin/net/corda/flows/NotaryChangeFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/NotaryChangeFlow.kt index ee5453d167..f0edfa69d2 100644 --- a/core/src/main/kotlin/net/corda/flows/NotaryChangeFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/NotaryChangeFlow.kt @@ -1,7 +1,6 @@ -package net.corda.flows +package net.corda.core.flows import net.corda.core.contracts.* -import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party import net.corda.core.transactions.TransactionBuilder @@ -20,7 +19,7 @@ import net.corda.core.utilities.ProgressTracker class NotaryChangeFlow( originalState: StateAndRef, newNotary: Party, - progressTracker: ProgressTracker = tracker()) + progressTracker: ProgressTracker = AbstractStateReplacementFlow.Instigator.tracker()) : AbstractStateReplacementFlow.Instigator(originalState, newNotary, progressTracker) { override fun assembleTx(): AbstractStateReplacementFlow.UpgradeTx { diff --git a/core/src/main/kotlin/net/corda/flows/NotaryFlow.kt b/core/src/main/kotlin/net/corda/core/flows/NotaryFlow.kt similarity index 96% rename from core/src/main/kotlin/net/corda/flows/NotaryFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/NotaryFlow.kt index 579f9c8125..a13c3ad650 100644 --- a/core/src/main/kotlin/net/corda/flows/NotaryFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/NotaryFlow.kt @@ -1,4 +1,4 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.StateRef @@ -7,9 +7,6 @@ import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SignedData import net.corda.core.crypto.keys -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.Party import net.corda.core.node.services.* import net.corda.core.serialization.CordaSerializable @@ -32,7 +29,7 @@ object NotaryFlow { @InitiatingFlow open class Client(private val stx: SignedTransaction, override val progressTracker: ProgressTracker) : FlowLogic>() { - constructor(stx: SignedTransaction) : this(stx, Client.tracker()) + constructor(stx: SignedTransaction) : this(stx, tracker()) companion object { object REQUESTING : ProgressTracker.Step("Requesting signature by Notary service") diff --git a/core/src/main/kotlin/net/corda/flows/ResolveTransactionsFlow.kt b/core/src/main/kotlin/net/corda/core/flows/ResolveTransactionsFlow.kt similarity index 99% rename from core/src/main/kotlin/net/corda/flows/ResolveTransactionsFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/ResolveTransactionsFlow.kt index 92f3b9ebd0..c1b2045476 100644 --- a/core/src/main/kotlin/net/corda/flows/ResolveTransactionsFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/ResolveTransactionsFlow.kt @@ -1,9 +1,8 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.core.checkedAdd import net.corda.core.crypto.SecureHash -import net.corda.core.flows.FlowLogic import net.corda.core.getOrThrow import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable diff --git a/core/src/main/kotlin/net/corda/flows/TransactionKeyFlow.kt b/core/src/main/kotlin/net/corda/core/flows/TransactionKeyFlow.kt similarity index 93% rename from core/src/main/kotlin/net/corda/flows/TransactionKeyFlow.kt rename to core/src/main/kotlin/net/corda/core/flows/TransactionKeyFlow.kt index 1989ef5d82..b1567f0557 100644 --- a/core/src/main/kotlin/net/corda/flows/TransactionKeyFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/TransactionKeyFlow.kt @@ -1,12 +1,10 @@ -package net.corda.flows +package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.InitiatingFlow -import net.corda.core.flows.StartableByRPC import net.corda.core.identity.Party import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.unwrap +import net.corda.flows.AnonymisedIdentity /** * Very basic flow which exchanges transaction key and certificate paths between two parties in a transaction. diff --git a/core/src/main/kotlin/net/corda/core/node/services/NotaryService.kt b/core/src/main/kotlin/net/corda/core/node/services/NotaryService.kt index aa3def742c..81ac8ff8e8 100644 --- a/core/src/main/kotlin/net/corda/core/node/services/NotaryService.kt +++ b/core/src/main/kotlin/net/corda/core/node/services/NotaryService.kt @@ -6,13 +6,13 @@ import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SignedData import net.corda.core.flows.FlowLogic +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException import net.corda.core.identity.Party import net.corda.core.node.ServiceHub import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.serialization.serialize import net.corda.core.utilities.loggerFor -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException import org.slf4j.Logger abstract class NotaryService : SingletonSerializeAsToken() { diff --git a/core/src/test/kotlin/net/corda/core/flows/CollectSignaturesFlowTests.kt b/core/src/test/kotlin/net/corda/core/flows/CollectSignaturesFlowTests.kt index 8bccd7666c..f62050a35a 100644 --- a/core/src/test/kotlin/net/corda/core/flows/CollectSignaturesFlowTests.kt +++ b/core/src/test/kotlin/net/corda/core/flows/CollectSignaturesFlowTests.kt @@ -4,15 +4,12 @@ import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.Command import net.corda.core.contracts.TransactionType import net.corda.core.contracts.requireThat -import net.corda.testing.contracts.DummyContract import net.corda.core.getOrThrow import net.corda.core.identity.Party import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.CollectSignaturesFlow -import net.corda.flows.FinalityFlow -import net.corda.flows.SignTransactionFlow import net.corda.testing.MINI_CORP_KEY +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.MockNetwork import net.corda.testing.node.MockServices import org.junit.After diff --git a/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt b/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt index 1ee8601e34..169ca03947 100644 --- a/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt +++ b/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt @@ -3,8 +3,6 @@ package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import net.corda.contracts.asset.Cash import net.corda.core.contracts.* -import net.corda.testing.contracts.DummyContract -import net.corda.testing.contracts.DummyContractV2 import net.corda.core.crypto.SecureHash import net.corda.core.getOrThrow import net.corda.core.identity.AbstractParty @@ -12,17 +10,17 @@ import net.corda.core.identity.Party import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.startFlow import net.corda.core.node.services.unconsumedStates -import net.corda.core.utilities.OpaqueBytes import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.Emoji +import net.corda.core.utilities.OpaqueBytes import net.corda.flows.CashIssueFlow -import net.corda.flows.ContractUpgradeFlow -import net.corda.flows.FinalityFlow import net.corda.node.internal.CordaRPCOpsImpl import net.corda.node.services.startFlowPermission import net.corda.node.utilities.transaction import net.corda.nodeapi.User import net.corda.testing.RPCDriverExposedDSLInterface +import net.corda.testing.contracts.DummyContract +import net.corda.testing.contracts.DummyContractV2 import net.corda.testing.node.MockNetwork import net.corda.testing.rpcDriver import net.corda.testing.rpcTestUser diff --git a/core/src/test/kotlin/net/corda/core/flows/ResolveTransactionsFlowTest.kt b/core/src/test/kotlin/net/corda/core/flows/ResolveTransactionsFlowTest.kt index 341f9b0d5d..f0489562ec 100644 --- a/core/src/test/kotlin/net/corda/core/flows/ResolveTransactionsFlowTest.kt +++ b/core/src/test/kotlin/net/corda/core/flows/ResolveTransactionsFlowTest.kt @@ -7,7 +7,6 @@ import net.corda.core.identity.Party import net.corda.core.utilities.opaque import net.corda.core.transactions.SignedTransaction import net.corda.testing.DUMMY_NOTARY_KEY -import net.corda.flows.ResolveTransactionsFlow import net.corda.node.utilities.transaction import net.corda.testing.MEGA_CORP import net.corda.testing.MEGA_CORP_KEY diff --git a/core/src/test/kotlin/net/corda/flows/TransactionKeyFlowTests.kt b/core/src/test/kotlin/net/corda/core/flows/TransactionKeyFlowTests.kt similarity index 97% rename from core/src/test/kotlin/net/corda/flows/TransactionKeyFlowTests.kt rename to core/src/test/kotlin/net/corda/core/flows/TransactionKeyFlowTests.kt index 486e24b3e8..4bd6152651 100644 --- a/core/src/test/kotlin/net/corda/flows/TransactionKeyFlowTests.kt +++ b/core/src/test/kotlin/net/corda/core/flows/TransactionKeyFlowTests.kt @@ -1,8 +1,9 @@ -package net.corda.flows +package net.corda.core.flows import net.corda.core.getOrThrow import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party +import net.corda.flows.AnonymisedIdentity import net.corda.testing.ALICE import net.corda.testing.BOB import net.corda.testing.DUMMY_NOTARY diff --git a/core/src/test/kotlin/net/corda/core/serialization/AttachmentSerializationTest.kt b/core/src/test/kotlin/net/corda/core/serialization/AttachmentSerializationTest.kt index f1259a4f73..964a81a4b4 100644 --- a/core/src/test/kotlin/net/corda/core/serialization/AttachmentSerializationTest.kt +++ b/core/src/test/kotlin/net/corda/core/serialization/AttachmentSerializationTest.kt @@ -11,7 +11,7 @@ import net.corda.core.messaging.RPCOps import net.corda.core.messaging.SingleMessageRecipient import net.corda.core.node.services.ServiceInfo import net.corda.core.utilities.unwrap -import net.corda.flows.FetchAttachmentsFlow +import net.corda.core.flows.FetchAttachmentsFlow import net.corda.node.internal.InitiatedFlowFactory import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.network.NetworkMapService diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 7e4eb64739..97270867b4 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -31,6 +31,9 @@ UNRELEASED * Added additional common Sort attributes (see ``Sort.CommandStateAttribute``) for use in Vault Query criteria to include STATE_REF, STATE_REF_TXN_ID, STATE_REF_INDEX +* Moved the core flows previously found in ``net.corda.flows`` into ``net.corda.core.flows``. This is so that all packages + in the ``core`` module begin with ``net.corda.core``. + Milestone 13 ------------ diff --git a/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java b/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java index cf188f4e2c..fec84eb069 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java @@ -7,8 +7,6 @@ import net.corda.contracts.asset.Cash; import net.corda.core.contracts.*; import net.corda.core.contracts.TransactionType.General; import net.corda.core.contracts.TransactionType.NotaryChange; -import net.corda.testing.contracts.DummyContract; -import net.corda.testing.contracts.DummyState; import net.corda.core.crypto.DigitalSignature; import net.corda.core.crypto.SecureHash; import net.corda.core.flows.*; @@ -24,10 +22,8 @@ import net.corda.core.transactions.WireTransaction; import net.corda.core.utilities.ProgressTracker; import net.corda.core.utilities.ProgressTracker.Step; import net.corda.core.utilities.UntrustworthyData; -import net.corda.flows.CollectSignaturesFlow; -import net.corda.flows.FinalityFlow; -import net.corda.flows.ResolveTransactionsFlow; -import net.corda.flows.SignTransactionFlow; +import net.corda.testing.contracts.DummyContract; +import net.corda.testing.contracts.DummyState; import org.bouncycastle.asn1.x500.X500Name; import java.security.PublicKey; diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomNotaryTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomNotaryTutorial.kt index f5ec3116a4..eacbfe96ff 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomNotaryTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomNotaryTutorial.kt @@ -1,8 +1,8 @@ -package net.corda.notarydemo +package net.corda.docs import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.TransactionVerificationException -import net.corda.core.flows.FlowLogic +import net.corda.core.flows.* import net.corda.core.identity.Party import net.corda.core.node.PluginServiceHub import net.corda.core.node.services.CordaService @@ -12,7 +12,6 @@ import net.corda.core.transactions.LedgerTransaction import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.WireTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.* import net.corda.node.services.transactions.PersistentUniquenessProvider import net.corda.node.services.transactions.ValidatingNotaryService import java.security.SignatureException diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt index 6414d50f9b..a5a0150b22 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt @@ -5,8 +5,6 @@ import net.corda.contracts.asset.Cash import net.corda.core.contracts.* import net.corda.core.contracts.TransactionType.General import net.corda.core.contracts.TransactionType.NotaryChange -import net.corda.testing.contracts.DummyContract -import net.corda.testing.contracts.DummyState import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash import net.corda.core.flows.* @@ -19,15 +17,13 @@ import net.corda.core.transactions.LedgerTransaction import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.TransactionBuilder import net.corda.core.transactions.WireTransaction -import net.corda.testing.DUMMY_PUBKEY_1 import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.ProgressTracker.Step import net.corda.core.utilities.UntrustworthyData import net.corda.core.utilities.unwrap -import net.corda.flows.CollectSignaturesFlow -import net.corda.flows.FinalityFlow -import net.corda.flows.ResolveTransactionsFlow -import net.corda.flows.SignTransactionFlow +import net.corda.testing.DUMMY_PUBKEY_1 +import net.corda.testing.contracts.DummyContract +import net.corda.testing.contracts.DummyState import org.bouncycastle.asn1.x500.X500Name import java.security.PublicKey import java.time.Duration diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt index ce6ea008c6..b684d9e2eb 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt @@ -8,20 +8,15 @@ import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.TransactionType import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.InitiatedBy -import net.corda.core.flows.InitiatingFlow +import net.corda.core.flows.* import net.corda.core.identity.Party import net.corda.core.node.ServiceHub import net.corda.core.node.services.Vault import net.corda.core.node.services.queryBy -import net.corda.core.node.services.unconsumedStates import net.corda.core.node.services.vault.QueryCriteria import net.corda.core.serialization.CordaSerializable import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.FinalityFlow -import net.corda.flows.ResolveTransactionsFlow import java.util.* @CordaSerializable diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt index 7e66e01fd7..ffff6d14cb 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt @@ -5,6 +5,7 @@ import net.corda.core.contracts.* import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash import net.corda.core.crypto.containsAny +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowLogic import net.corda.core.flows.InitiatedBy import net.corda.core.flows.InitiatingFlow @@ -15,7 +16,6 @@ import net.corda.core.node.services.linearHeadsOfType import net.corda.core.serialization.CordaSerializable import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.FinalityFlow import java.security.PublicKey import java.time.Duration diff --git a/docs/source/hello-world-flow.rst b/docs/source/hello-world-flow.rst index 3416be215d..b23a61b30d 100644 --- a/docs/source/hello-world-flow.rst +++ b/docs/source/hello-world-flow.rst @@ -50,7 +50,7 @@ the following: import net.corda.core.identity.Party import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.ProgressTracker - import net.corda.flows.FinalityFlow + import net.corda.core.flows.FinalityFlow @InitiatingFlow @StartableByRPC diff --git a/finance/src/main/kotlin/net/corda/flows/AbstractCashFlow.kt b/finance/src/main/kotlin/net/corda/flows/AbstractCashFlow.kt index 52bef42f21..fd809ab7e5 100644 --- a/finance/src/main/kotlin/net/corda/flows/AbstractCashFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/AbstractCashFlow.kt @@ -1,8 +1,10 @@ package net.corda.flows import co.paralleluniverse.fibers.Suspendable +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowException import net.corda.core.flows.FlowLogic +import net.corda.core.flows.NotaryException import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable @@ -12,7 +14,7 @@ import net.corda.core.utilities.ProgressTracker /** * Initiates a flow that produces an Issue/Move or Exit Cash transaction. */ -abstract class AbstractCashFlow(override val progressTracker: ProgressTracker) : FlowLogic() { +abstract class AbstractCashFlow(override val progressTracker: ProgressTracker) : FlowLogic() { companion object { object GENERATING_ID : ProgressTracker.Step("Generating anonymous identities") object GENERATING_TX : ProgressTracker.Step("Generating transaction") diff --git a/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt b/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt index ec9659f1d5..0bcaa5fed8 100644 --- a/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt @@ -5,10 +5,12 @@ import net.corda.contracts.asset.Cash import net.corda.core.contracts.Amount import net.corda.core.contracts.TransactionType import net.corda.core.contracts.issuedBy +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.StartableByRPC +import net.corda.core.flows.TransactionKeyFlow import net.corda.core.identity.Party -import net.corda.core.utilities.OpaqueBytes import net.corda.core.transactions.TransactionBuilder +import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.ProgressTracker import java.util.* @@ -45,7 +47,7 @@ class CashIssueFlow(val amount: Amount, } else { emptyMap() } - val anonymousRecipient = txIdentities.get(recipient)?.identity ?: recipient + val anonymousRecipient = txIdentities[recipient]?.identity ?: recipient progressTracker.currentStep = GENERATING_TX val builder: TransactionBuilder = TransactionType.General.Builder(notary = notary) val issuer = serviceHub.myInfo.legalIdentity.ref(issueRef) diff --git a/finance/src/main/kotlin/net/corda/flows/CashPaymentFlow.kt b/finance/src/main/kotlin/net/corda/flows/CashPaymentFlow.kt index 0567e2c77e..f7bc488b5c 100644 --- a/finance/src/main/kotlin/net/corda/flows/CashPaymentFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/CashPaymentFlow.kt @@ -5,6 +5,7 @@ import net.corda.core.contracts.Amount import net.corda.core.contracts.InsufficientBalanceException import net.corda.core.contracts.TransactionType import net.corda.core.flows.StartableByRPC +import net.corda.core.flows.TransactionKeyFlow import net.corda.core.identity.Party import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.ProgressTracker diff --git a/finance/src/main/kotlin/net/corda/flows/TwoPartyDealFlow.kt b/finance/src/main/kotlin/net/corda/flows/TwoPartyDealFlow.kt index 8509e55c9b..c421a58b57 100644 --- a/finance/src/main/kotlin/net/corda/flows/TwoPartyDealFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/TwoPartyDealFlow.kt @@ -4,7 +4,10 @@ import co.paralleluniverse.fibers.Suspendable import net.corda.contracts.DealState import net.corda.core.contracts.requireThat import net.corda.core.crypto.SecureHash +import net.corda.core.flows.CollectSignaturesFlow +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowLogic +import net.corda.core.flows.SignTransactionFlow import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party import net.corda.core.node.NodeInfo @@ -20,14 +23,10 @@ import java.security.PublicKey /** * Classes for manipulating a two party deal or agreement. - * - * TODO: The subclasses should probably be broken out into individual flows rather than making this an ever expanding collection of subclasses. - * - * TODO: Also, the term Deal is used here where we might prefer Agreement. - * - * TODO: Make this flow more generic. - * */ +// TODO: The subclasses should probably be broken out into individual flows rather than making this an ever expanding collection of subclasses. +// TODO: Also, the term Deal is used here where we might prefer Agreement. +// TODO: Make this flow more generic. object TwoPartyDealFlow { // This object is serialised to the network and is the first flow message the seller sends to the buyer. @CordaSerializable diff --git a/finance/src/main/kotlin/net/corda/flows/TwoPartyTradeFlow.kt b/finance/src/main/kotlin/net/corda/flows/TwoPartyTradeFlow.kt index d384e1255e..7a529f7237 100644 --- a/finance/src/main/kotlin/net/corda/flows/TwoPartyTradeFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/TwoPartyTradeFlow.kt @@ -3,8 +3,7 @@ package net.corda.flows import co.paralleluniverse.fibers.Suspendable import net.corda.contracts.asset.sumCashBy import net.corda.core.contracts.* -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic +import net.corda.core.flows.* import net.corda.core.identity.AbstractParty import net.corda.core.identity.AnonymousParty import net.corda.core.identity.Party diff --git a/finance/src/test/java/net/corda/flows/AbstractStateReplacementFlowTest.java b/finance/src/test/java/net/corda/flows/AbstractStateReplacementFlowTest.java index 9c8d3086e3..4c11636d78 100644 --- a/finance/src/test/java/net/corda/flows/AbstractStateReplacementFlowTest.java +++ b/finance/src/test/java/net/corda/flows/AbstractStateReplacementFlowTest.java @@ -1,6 +1,6 @@ package net.corda.flows; -import net.corda.core.identity.Party; +import net.corda.core.flows.AbstractStateReplacementFlow; import net.corda.core.identity.Party; import net.corda.core.utilities.*; import org.jetbrains.annotations.*; diff --git a/finance/src/test/kotlin/net/corda/flows/BroadcastTransactionFlowTest.kt b/finance/src/test/kotlin/net/corda/flows/BroadcastTransactionFlowTest.kt index 49dc19751a..cc0ba55107 100644 --- a/finance/src/test/kotlin/net/corda/flows/BroadcastTransactionFlowTest.kt +++ b/finance/src/test/kotlin/net/corda/flows/BroadcastTransactionFlowTest.kt @@ -7,9 +7,9 @@ import com.pholser.junit.quickcheck.generator.Generator import com.pholser.junit.quickcheck.random.SourceOfRandomness import com.pholser.junit.quickcheck.runner.JUnitQuickcheck import net.corda.contracts.testing.SignedTransactionGenerator +import net.corda.core.flows.BroadcastTransactionFlow.NotifyTxRequest import net.corda.core.serialization.deserialize import net.corda.core.serialization.serialize -import net.corda.flows.BroadcastTransactionFlow.NotifyTxRequest import org.junit.runner.RunWith import kotlin.test.assertEquals diff --git a/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt index 7e7060cbc6..6d9e28218d 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt @@ -4,18 +4,17 @@ import com.nhaarman.mockito_kotlin.whenever import net.corda.core.contracts.ContractState import net.corda.core.contracts.StateRef import net.corda.core.contracts.TransactionType -import net.corda.testing.contracts.DummyContract -import net.corda.core.crypto.composite.CompositeKey import net.corda.core.crypto.SecureHash +import net.corda.core.crypto.composite.CompositeKey import net.corda.core.div +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException +import net.corda.core.flows.NotaryFlow import net.corda.core.getOrThrow import net.corda.core.identity.Party import net.corda.core.node.services.ServiceInfo import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.Try -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException -import net.corda.flows.NotaryFlow import net.corda.node.internal.AbstractNode import net.corda.node.services.network.NetworkMapService import net.corda.node.services.transactions.BFTNonValidatingNotaryService @@ -23,6 +22,7 @@ import net.corda.node.services.transactions.minClusterSize import net.corda.node.services.transactions.minCorrectReplicas import net.corda.node.utilities.ServiceIdentityGenerator import net.corda.node.utilities.transaction +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.MockNetwork import org.bouncycastle.asn1.x500.X500Name import org.junit.After diff --git a/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt index 566c4674e1..b8d54616b5 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt @@ -4,16 +4,16 @@ import com.google.common.util.concurrent.Futures import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateRef import net.corda.core.contracts.TransactionType -import net.corda.testing.contracts.DummyContract +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException +import net.corda.core.flows.NotaryFlow import net.corda.core.getOrThrow import net.corda.core.identity.Party import net.corda.core.map -import net.corda.testing.DUMMY_BANK_A -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException -import net.corda.flows.NotaryFlow import net.corda.node.internal.AbstractNode import net.corda.node.utilities.transaction +import net.corda.testing.DUMMY_BANK_A +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.NodeBasedTest import org.bouncycastle.asn1.x500.X500Name import org.junit.Test diff --git a/node/src/main/kotlin/net/corda/node/services/CoreFlowHandlers.kt b/node/src/main/kotlin/net/corda/node/services/CoreFlowHandlers.kt index 3359d55e58..7853a3a04b 100644 --- a/node/src/main/kotlin/net/corda/node/services/CoreFlowHandlers.kt +++ b/node/src/main/kotlin/net/corda/node/services/CoreFlowHandlers.kt @@ -6,8 +6,7 @@ import net.corda.core.contracts.TransactionType import net.corda.core.contracts.UpgradedContract import net.corda.core.contracts.requireThat import net.corda.core.crypto.SecureHash -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic +import net.corda.core.flows.* import net.corda.core.identity.Party import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.ProgressTracker diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/BFTNonValidatingNotaryService.kt b/node/src/main/kotlin/net/corda/node/services/transactions/BFTNonValidatingNotaryService.kt index a64cfaaa9d..0336132f50 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/BFTNonValidatingNotaryService.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/BFTNonValidatingNotaryService.kt @@ -4,6 +4,7 @@ import co.paralleluniverse.fibers.Suspendable import com.google.common.util.concurrent.SettableFuture import net.corda.core.crypto.DigitalSignature import net.corda.core.flows.FlowLogic +import net.corda.core.flows.NotaryException import net.corda.core.getOrThrow import net.corda.core.identity.Party import net.corda.core.node.services.NotaryService @@ -14,7 +15,6 @@ import net.corda.core.transactions.FilteredTransaction import net.corda.core.utilities.debug import net.corda.core.utilities.loggerFor import net.corda.core.utilities.unwrap -import net.corda.flows.NotaryException import net.corda.node.services.api.ServiceHubInternal import kotlin.concurrent.thread diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/BFTSMaRt.kt b/node/src/main/kotlin/net/corda/node/services/transactions/BFTSMaRt.kt index f910c0ef1e..e7f4bca217 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/BFTSMaRt.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/BFTSMaRt.kt @@ -18,6 +18,8 @@ import net.corda.core.crypto.DigitalSignature import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SignedData import net.corda.core.crypto.sign +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException import net.corda.core.identity.Party import net.corda.core.node.services.TimeWindowChecker import net.corda.core.node.services.UniquenessProvider @@ -30,8 +32,6 @@ import net.corda.core.transactions.FilteredTransaction import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.debug import net.corda.core.utilities.loggerFor -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException import net.corda.node.services.api.ServiceHubInternal import net.corda.node.services.transactions.BFTSMaRt.Client import net.corda.node.services.transactions.BFTSMaRt.Replica diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/NonValidatingNotaryFlow.kt b/node/src/main/kotlin/net/corda/node/services/transactions/NonValidatingNotaryFlow.kt index 354ef7799d..7538bb9bbd 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/NonValidatingNotaryFlow.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/NonValidatingNotaryFlow.kt @@ -1,12 +1,12 @@ package net.corda.node.services.transactions import co.paralleluniverse.fibers.Suspendable +import net.corda.core.flows.NotaryFlow +import net.corda.core.flows.TransactionParts import net.corda.core.identity.Party import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.transactions.FilteredTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.NotaryFlow -import net.corda.flows.TransactionParts class NonValidatingNotaryFlow(otherSide: Party, service: TrustedAuthorityNotaryService) : NotaryFlow.Service(otherSide, service) { /** diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/RaftNonValidatingNotaryService.kt b/node/src/main/kotlin/net/corda/node/services/transactions/RaftNonValidatingNotaryService.kt index 05bcabe172..9c5d0b237e 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/RaftNonValidatingNotaryService.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/RaftNonValidatingNotaryService.kt @@ -1,9 +1,9 @@ package net.corda.node.services.transactions +import net.corda.core.flows.NotaryFlow import net.corda.core.identity.Party -import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.node.services.TimeWindowChecker -import net.corda.flows.NotaryFlow +import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.node.services.api.ServiceHubInternal /** A non-validating notary service operated by a group of mutually trusting parties, uses the Raft algorithm to achieve consensus. */ diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/RaftValidatingNotaryService.kt b/node/src/main/kotlin/net/corda/node/services/transactions/RaftValidatingNotaryService.kt index deba64d1a3..498173e689 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/RaftValidatingNotaryService.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/RaftValidatingNotaryService.kt @@ -1,9 +1,9 @@ package net.corda.node.services.transactions +import net.corda.core.flows.NotaryFlow import net.corda.core.identity.Party -import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.node.services.TimeWindowChecker -import net.corda.flows.NotaryFlow +import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.node.services.api.ServiceHubInternal /** A validating notary service operated by a group of mutually trusting parties, uses the Raft algorithm to achieve consensus. */ diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/SimpleNotaryService.kt b/node/src/main/kotlin/net/corda/node/services/transactions/SimpleNotaryService.kt index c23d19532b..629ff1a5fd 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/SimpleNotaryService.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/SimpleNotaryService.kt @@ -1,10 +1,10 @@ package net.corda.node.services.transactions +import net.corda.core.flows.NotaryFlow import net.corda.core.identity.Party -import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.node.services.ServiceType import net.corda.core.node.services.TimeWindowChecker -import net.corda.flows.NotaryFlow +import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.node.services.api.ServiceHubInternal /** A simple Notary service that does not perform transaction validation */ diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryFlow.kt b/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryFlow.kt index dca4e5f5ad..afe9a81d99 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryFlow.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryFlow.kt @@ -2,12 +2,12 @@ package net.corda.node.services.transactions import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.TransactionVerificationException +import net.corda.core.flows.* import net.corda.core.identity.Party import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.WireTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.* import java.security.SignatureException /** diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryService.kt b/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryService.kt index c996a8979d..e85c15d2db 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryService.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/ValidatingNotaryService.kt @@ -1,10 +1,10 @@ package net.corda.node.services.transactions +import net.corda.core.flows.NotaryFlow import net.corda.core.identity.Party -import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.core.node.services.ServiceType import net.corda.core.node.services.TimeWindowChecker -import net.corda.flows.NotaryFlow +import net.corda.core.node.services.TrustedAuthorityNotaryService import net.corda.node.services.api.ServiceHubInternal /** A Notary service that validates the transaction chain of the submitted transaction before committing it */ diff --git a/node/src/test/kotlin/net/corda/node/messaging/AttachmentTests.kt b/node/src/test/kotlin/net/corda/node/messaging/AttachmentTests.kt index a9fb24ce5b..8085de959e 100644 --- a/node/src/test/kotlin/net/corda/node/messaging/AttachmentTests.kt +++ b/node/src/test/kotlin/net/corda/node/messaging/AttachmentTests.kt @@ -6,8 +6,8 @@ import net.corda.core.crypto.sha256 import net.corda.core.getOrThrow import net.corda.core.messaging.SingleMessageRecipient import net.corda.core.node.services.ServiceInfo -import net.corda.flows.FetchAttachmentsFlow -import net.corda.flows.FetchDataFlow +import net.corda.core.flows.FetchAttachmentsFlow +import net.corda.core.flows.FetchDataFlow import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.database.RequeryConfiguration import net.corda.node.services.network.NetworkMapService diff --git a/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt b/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt index 8aef7f445e..dedb3bd5c3 100644 --- a/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt @@ -8,8 +8,8 @@ import net.corda.core.identity.Party import net.corda.core.node.services.ServiceInfo import net.corda.core.seconds import net.corda.core.transactions.WireTransaction -import net.corda.flows.NotaryChangeFlow -import net.corda.flows.StateReplacementException +import net.corda.core.flows.NotaryChangeFlow +import net.corda.core.flows.StateReplacementException import net.corda.node.internal.AbstractNode import net.corda.node.services.network.NetworkMapService import net.corda.node.services.transactions.SimpleNotaryService diff --git a/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt b/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt index 6fec905bae..23f32bee3d 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt @@ -2,22 +2,18 @@ package net.corda.node.services.events import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.* -import net.corda.testing.contracts.DummyContract import net.corda.core.crypto.containsAny -import net.corda.core.flows.FlowInitiator -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.FlowLogicRefFactory -import net.corda.core.flows.SchedulableFlow +import net.corda.core.flows.* import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party import net.corda.core.node.services.ServiceInfo import net.corda.core.node.services.linearHeadsOfType -import net.corda.testing.DUMMY_NOTARY -import net.corda.flows.FinalityFlow import net.corda.node.services.network.NetworkMapService import net.corda.node.services.statemachine.StateMachineManager import net.corda.node.services.transactions.ValidatingNotaryService import net.corda.node.utilities.transaction +import net.corda.testing.DUMMY_NOTARY +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.MockNetwork import org.junit.After import org.junit.Assert.assertTrue diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/DataVendingServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/DataVendingServiceTests.kt index f912949506..2730cd9a63 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/DataVendingServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/DataVendingServiceTests.kt @@ -6,13 +6,13 @@ import net.corda.core.contracts.Amount import net.corda.core.contracts.Issued import net.corda.core.contracts.TransactionType import net.corda.core.contracts.USD +import net.corda.core.flows.BroadcastTransactionFlow.NotifyTxRequest import net.corda.core.flows.FlowLogic import net.corda.core.flows.InitiatedBy import net.corda.core.flows.InitiatingFlow import net.corda.core.identity.Party import net.corda.core.node.services.unconsumedStates import net.corda.core.transactions.SignedTransaction -import net.corda.flows.BroadcastTransactionFlow.NotifyTxRequest import net.corda.node.services.NotifyTransactionHandler import net.corda.node.utilities.transaction import net.corda.testing.DUMMY_NOTARY diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt index f83de31b69..88c298a34a 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt @@ -4,49 +4,43 @@ import co.paralleluniverse.fibers.Fiber import co.paralleluniverse.fibers.Suspendable import com.google.common.util.concurrent.ListenableFuture import net.corda.contracts.asset.Cash -import net.corda.core.* import net.corda.core.contracts.ContractState import net.corda.core.contracts.DOLLARS import net.corda.core.contracts.StateAndRef -import net.corda.testing.contracts.DummyState import net.corda.core.crypto.SecureHash import net.corda.core.crypto.generateKeyPair import net.corda.core.crypto.random63BitValue -import net.corda.core.flows.FlowException -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.FlowSessionException -import net.corda.core.flows.InitiatingFlow +import net.corda.core.flatMap +import net.corda.core.flows.* +import net.corda.core.getOrThrow import net.corda.core.identity.Party +import net.corda.core.map import net.corda.core.messaging.MessageRecipients import net.corda.core.node.services.PartyInfo import net.corda.core.node.services.ServiceInfo import net.corda.core.node.services.queryBy import net.corda.core.node.services.unconsumedStates -import net.corda.core.utilities.OpaqueBytes import net.corda.core.serialization.deserialize +import net.corda.core.toFuture import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.TransactionBuilder -import net.corda.testing.LogHelper +import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.ProgressTracker.Change import net.corda.core.utilities.unwrap import net.corda.flows.CashIssueFlow import net.corda.flows.CashPaymentFlow -import net.corda.flows.FinalityFlow -import net.corda.flows.NotaryFlow import net.corda.node.internal.InitiatedFlowFactory import net.corda.node.services.persistence.checkpoints import net.corda.node.services.transactions.ValidatingNotaryService import net.corda.node.utilities.transaction -import net.corda.testing.expect -import net.corda.testing.expectEvents -import net.corda.testing.getTestX509Name +import net.corda.testing.* +import net.corda.testing.contracts.DummyState import net.corda.testing.node.InMemoryMessagingNetwork import net.corda.testing.node.InMemoryMessagingNetwork.MessageTransfer import net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy.RoundRobin import net.corda.testing.node.MockNetwork import net.corda.testing.node.MockNetwork.MockNode -import net.corda.testing.sequence import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt index c0da57821c..fbc80fd8db 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt @@ -4,18 +4,18 @@ import com.google.common.util.concurrent.ListenableFuture import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateRef import net.corda.core.contracts.TransactionType -import net.corda.testing.contracts.DummyContract import net.corda.core.crypto.DigitalSignature +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException +import net.corda.core.flows.NotaryFlow import net.corda.core.getOrThrow import net.corda.core.node.services.ServiceInfo import net.corda.core.seconds import net.corda.core.transactions.SignedTransaction -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException -import net.corda.flows.NotaryFlow import net.corda.node.internal.AbstractNode import net.corda.node.services.network.NetworkMapService import net.corda.testing.DUMMY_NOTARY +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.MockNetwork import org.assertj.core.api.Assertions.assertThat import org.junit.After diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt index 3072677dfd..f1ca383d4e 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt @@ -5,19 +5,19 @@ import net.corda.core.contracts.Command import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateRef import net.corda.core.contracts.TransactionType -import net.corda.testing.contracts.DummyContract import net.corda.core.crypto.DigitalSignature +import net.corda.core.flows.NotaryError +import net.corda.core.flows.NotaryException +import net.corda.core.flows.NotaryFlow import net.corda.core.getOrThrow import net.corda.core.node.services.ServiceInfo import net.corda.core.transactions.SignedTransaction -import net.corda.flows.NotaryError -import net.corda.flows.NotaryException -import net.corda.flows.NotaryFlow import net.corda.node.internal.AbstractNode import net.corda.node.services.issueInvalidState import net.corda.node.services.network.NetworkMapService import net.corda.testing.DUMMY_NOTARY import net.corda.testing.MEGA_CORP_KEY +import net.corda.testing.contracts.DummyContract import net.corda.testing.node.MockNetwork import org.assertj.core.api.Assertions.assertThat import org.junit.After diff --git a/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt b/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt index 22f54033f3..7484959cfd 100644 --- a/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt +++ b/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt @@ -8,6 +8,7 @@ import net.corda.core.contracts.ContractState import net.corda.core.contracts.TransactionForContract import net.corda.core.contracts.TransactionType import net.corda.core.crypto.SecureHash +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowLogic import net.corda.core.flows.StartableByRPC import net.corda.core.getOrThrow @@ -17,8 +18,9 @@ import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.startTrackedFlow import net.corda.core.sizedInputStreamAndHash import net.corda.core.transactions.SignedTransaction -import net.corda.core.utilities.* -import net.corda.flows.FinalityFlow +import net.corda.core.utilities.Emoji +import net.corda.core.utilities.NetworkHostAndPort +import net.corda.core.utilities.ProgressTracker import net.corda.testing.DUMMY_BANK_B import net.corda.testing.DUMMY_NOTARY import net.corda.testing.driver.poll diff --git a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/Notarise.kt b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/Notarise.kt index 855fd1dd27..c0de6f27a2 100644 --- a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/Notarise.kt +++ b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/Notarise.kt @@ -11,9 +11,9 @@ import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.startFlow import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.NetworkHostAndPort -import net.corda.testing.BOB import net.corda.notarydemo.flows.DummyIssueAndMove import net.corda.notarydemo.flows.RPCStartableNotaryFlowClient +import net.corda.testing.BOB import kotlin.streams.asSequence fun main(args: Array) { diff --git a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/RPCStartableNotaryFlowClient.kt b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/RPCStartableNotaryFlowClient.kt index a3d16c4984..95eb184c09 100644 --- a/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/RPCStartableNotaryFlowClient.kt +++ b/samples/notary-demo/src/main/kotlin/net/corda/notarydemo/flows/RPCStartableNotaryFlowClient.kt @@ -1,8 +1,8 @@ package net.corda.notarydemo.flows +import net.corda.core.flows.NotaryFlow import net.corda.core.flows.StartableByRPC import net.corda.core.transactions.SignedTransaction -import net.corda.flows.NotaryFlow @StartableByRPC class RPCStartableNotaryFlowClient(stx: SignedTransaction) : NotaryFlow.Client(stx) diff --git a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/SimmFlow.kt b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/SimmFlow.kt index 331f4b2b96..e3f031e880 100644 --- a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/SimmFlow.kt +++ b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/SimmFlow.kt @@ -19,8 +19,8 @@ import net.corda.core.identity.Party import net.corda.core.serialization.CordaSerializable import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.unwrap -import net.corda.flows.AbstractStateReplacementFlow.Proposal -import net.corda.flows.StateReplacementException +import net.corda.core.flows.AbstractStateReplacementFlow.Proposal +import net.corda.core.flows.StateReplacementException import net.corda.flows.TwoPartyDealFlow import net.corda.vega.analytics.* import net.corda.vega.contracts.* diff --git a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/StateRevisionFlow.kt b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/StateRevisionFlow.kt index c9d56ae403..343282440c 100644 --- a/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/StateRevisionFlow.kt +++ b/samples/simm-valuation-demo/src/main/kotlin/net/corda/vega/flows/StateRevisionFlow.kt @@ -1,14 +1,11 @@ package net.corda.vega.flows import net.corda.core.contracts.StateAndRef -import net.corda.core.identity.AbstractParty import net.corda.core.identity.Party import net.corda.core.seconds -import net.corda.core.transactions.SignedTransaction -import net.corda.flows.AbstractStateReplacementFlow -import net.corda.flows.StateReplacementException +import net.corda.core.flows.AbstractStateReplacementFlow +import net.corda.core.flows.StateReplacementException import net.corda.vega.contracts.RevisionedState -import java.security.PublicKey /** * Flow that generates an update on a mutable deal state and commits the resulting transaction reaching consensus diff --git a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/flow/SellerFlow.kt b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/flow/SellerFlow.kt index 720f33ffe5..ca738a7bdb 100644 --- a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/flow/SellerFlow.kt +++ b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/flow/SellerFlow.kt @@ -5,8 +5,8 @@ import net.corda.contracts.CommercialPaper import net.corda.contracts.asset.DUMMY_CASH_ISSUER import net.corda.core.contracts.* import net.corda.core.crypto.SecureHash -import net.corda.core.crypto.generateKeyPair import net.corda.core.days +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowLogic import net.corda.core.flows.InitiatingFlow import net.corda.core.flows.StartableByRPC @@ -17,8 +17,6 @@ import net.corda.core.node.NodeInfo import net.corda.core.seconds import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.ProgressTracker -import net.corda.flows.FinalityFlow -import net.corda.flows.NotaryFlow import net.corda.flows.TwoPartyTradeFlow import net.corda.testing.BOC import java.time.Instant diff --git a/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt b/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt index b14b55937f..f71c8dfedb 100644 --- a/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt +++ b/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt @@ -4,7 +4,7 @@ import net.corda.core.contracts.* import net.corda.core.crypto.SecureHash import net.corda.core.identity.AbstractParty import net.corda.core.transactions.WireTransaction -import net.corda.flows.ContractUpgradeFlow +import net.corda.core.flows.ContractUpgradeFlow // The dummy contract doesn't do anything useful. It exists for testing purposes. val DUMMY_V2_PROGRAM_ID = DummyContractV2() diff --git a/tools/loadtest/src/main/kotlin/net/corda/loadtest/tests/NotaryTest.kt b/tools/loadtest/src/main/kotlin/net/corda/loadtest/tests/NotaryTest.kt index f684b08bb4..21a17d16bb 100644 --- a/tools/loadtest/src/main/kotlin/net/corda/loadtest/tests/NotaryTest.kt +++ b/tools/loadtest/src/main/kotlin/net/corda/loadtest/tests/NotaryTest.kt @@ -6,11 +6,11 @@ import net.corda.client.mock.pickOne import net.corda.client.mock.replicate import net.corda.contracts.asset.DUMMY_CASH_ISSUER import net.corda.contracts.asset.DUMMY_CASH_ISSUER_KEY +import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowException import net.corda.core.messaging.startFlow import net.corda.core.thenMatch import net.corda.core.transactions.SignedTransaction -import net.corda.flows.FinalityFlow import net.corda.loadtest.LoadTest import net.corda.loadtest.NodeConnection import net.corda.testing.contracts.DummyContract