From 85e7135eeba5171b4a42ff3d0f454da61a012a25 Mon Sep 17 00:00:00 2001 From: Matthew Layton Date: Fri, 19 Feb 2021 16:51:28 +0000 Subject: [PATCH 01/22] Updated changelog --- CHANGELOG.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89bcba4..fc2e68f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,33 @@ This document serves as the change log for the ONIXLabs Corda Core API. +## Version 1.2.0 + +### Contract + +#### ContractID (interface) + +Defines the contract ID for a Corda contract. Rather than referencing the contract by a string or by its canonical name, implementing `ContractID` on a companion object adds the contract ID to the class for you automatically. + +#### SignedCommandData (interface) + +Defines a Corda contract command that maintains verifiable signature data. This can be used within a contract to check that a particular contract participant signed over the command - usually the transaction initiator. + +#### VerifiedCommandData (interface) + +Defines a Corda contract command that that localises its verification. Rather than commands simply being marker objects to determine which verification to execute, this leans towards the single responsibility principle, whereby each command is responsible for its verification. + +#### SignatureData (class) + +Represents a composite of both signed and unsigned data, which can be verified with a public key. + +### Workflow + +#### Extensions + +- Moved to new extension naming convention for maintainability. +- Added extensions to filter a set of sessions to include or exclude certain counter-parties, or state participants. + ## Version 1.1.0 ### Contract @@ -13,10 +40,6 @@ This document serves as the change log for the ONIXLabs Corda Core API. - Moved to new extension file naming convention for maintainability. - Added extensions to obtain single inputs, reference inputs and outputs from a `LedgerTransaction`. - Added extension to cast `Iterable>` to `List>`. -- Added `ContractID` interface which automatically binds a contract ID to a contract class. -- Added `SignedCommandData` interface which defines a contract command that must include a signature. -- Added `VerifiedCommandData` interface which verifies a ledger transaction. -- Added `SignatureData` class, which represents a digital signature, and it's unsigned counterpart. ### Workflow From ee7a061305a738999ae6de31aab369b54e1014eb Mon Sep 17 00:00:00 2001 From: Matthew Layton Date: Sat, 13 Mar 2021 10:09:04 +0000 Subject: [PATCH 02/22] Updated changelog format. Added missing license header to selected files. --- CHANGELOG.md | 1042 +++++++++++++++-- .../corda/core/contract/ContractID.kt | 16 + .../contract/Extensions.LedgerTransaction.kt | 16 + .../corda/core/contract/SignatureData.kt | 16 + .../corda/core/contract/SignedCommandData.kt | 16 + .../core/contract/VerifiedCommandData.kt | 16 + .../workflow/Extensions.FlowLogic.Notaries.kt | 16 + .../workflow/Extensions.FlowLogic.Sessions.kt | 16 + .../core/workflow/Extensions.FlowSession.kt | 16 + 9 files changed, 1093 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc2e68f..00bf4f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,162 +4,1050 @@ This document serves as the change log for the ONIXLabs Corda Core API. +## Version 2.0.0 + +TODO - add version 2 features. + + + ## Version 1.2.0 -### Contract +### ContractID *Interface* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Defines an interface which automatically binds a contract ID to a contract class. + +```kotlin +interface ContractID +``` + +#### Remarks + +Rather than referencing the contract by a string or by its canonical name, implementing `ContractID` on a companion object adds the contract ID to the class for you automatically. + +--- + +### SignatureData *Class* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Represents an array of unsigned bytes, and its signed equivalent. + +```kotlin +@CordaSerializable +data class SignatureData( + private val content: ByteArray, + private val signature: DigitalSignature +) +``` + +--- + +### SignedCommandData *Interface* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description -#### ContractID (interface) +Defines a contract command that must include a signature. -Defines the contract ID for a Corda contract. Rather than referencing the contract by a string or by its canonical name, implementing `ContractID` on a companion object adds the contract ID to the class for you automatically. +```kotlin +interface SignedCommandData : CommandData +``` -#### SignedCommandData (interface) +#### Remarks -Defines a Corda contract command that maintains verifiable signature data. This can be used within a contract to check that a particular contract participant signed over the command - usually the transaction initiator. +This can be used within a contract to check that a particular contract participant signed over the command; usually the transaction initiator. -#### VerifiedCommandData (interface) +--- -Defines a Corda contract command that that localises its verification. Rather than commands simply being marker objects to determine which verification to execute, this leans towards the single responsibility principle, whereby each command is responsible for its verification. +### VerifiedCommandData *Interface* -#### SignatureData (class) +**Module:** onixlabs-corda-core-contract -Represents a composite of both signed and unsigned data, which can be verified with a public key. +**Package:** io.onixlabs.corda.core.contract -### Workflow +#### Description -#### Extensions +Defines a contract command that can verify a ledger transaction. -- Moved to new extension naming convention for maintainability. -- Added extensions to filter a set of sessions to include or exclude certain counter-parties, or state participants. +```kotlin +interface VerifiedCommandData : CommandData +``` + +#### Remarks + +Rather than commands simply being marker objects to determine which verification to execute, this leans towards the single responsibility principle, whereby each command is responsible for its verification. + +--- ## Version 1.1.0 -### Contract +> 🔵 **INFORMATION** +> +> In addition to the new APIs in this release, all extension files have been renamed to use a better naming convention for maintainability. + +### singleInputRefOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single input ref from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleInputRefOfType(contractStateClass: Class): StateAndRef + +inline fun LedgerTransaction.singleInputRefOfType(): StateAndRef +``` + +--- + +### singleInputOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single input from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleInputOfType(contractStateClass: Class): T + +inline fun LedgerTransaction.singleInputOfType(): T +``` + +--- + +### singleReferenceInputRefOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single reference input ref from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleReferenceInputRefOfType(contractStateClass: Class): StateAndRef + +inline fun LedgerTransaction.singleReferenceInputRefOfType(): StateAndRef +``` + +--- + +### singleReferenceInputOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single reference input from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleReferenceInputOfType(contractStateClass: Class): T + +inline fun LedgerTransaction.singleReferenceInputOfType(): T +``` + +--- + +### singleOutputRefOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single output ref from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleOutputRefOfType(contractStateClass: Class): StateAndRef + +inline fun LedgerTransaction.singleOutputRefOfType(): StateAndRef +``` + +--- + +### singleOutputOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single output from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleOutputOfType(contractStateClass: Class): T + +inline fun LedgerTransaction.singleOutputOfType(): T +``` + +--- + +### singleOutputOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single output from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleOutputOfType(contractStateClass: Class): T + +inline fun LedgerTransaction.singleOutputOfType(): T +``` + +--- + +### singleCommandOfType *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Obtains a single command from a ledger transaction. + +```kotlin +fun LedgerTransaction.singleCommandOfType(commandClass: Class): Command + +inline fun LedgerTransaction.singleCommandOfType(): Command +``` -#### Extensions +--- -- Moved to new extension file naming convention for maintainability. -- Added extensions to obtain single inputs, reference inputs and outputs from a `LedgerTransaction`. -- Added extension to cast `Iterable>` to `List>`. +### sessionsFor *Extension Function* -### Workflow +**Module:** onixlabs-corda-core-workflow -#### Extensions +**Package:** io.onixlabs.corda.core.workflow -- Moved to new extension naming convention for maintainability. -- Added extensions to filter a set of sessions to include or exclude certain counter-parties, or state participants. +#### Description + +Obtains a collection of sessions for the specified parties, or state participants. + +```kotlin +fun Iterable.sessionsFor(parties: Iterable): Set + +fun Iterable.sessionsFor(vararg parties: AbstractParty): Set + +fun Iterable.sessionsFor(vararg states: ContractState): Set +``` + +--- + +### sessionFor *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Obtains a session for the specified party. + +```kotlin +fun Iterable.sessionFor(party: AbstractParty): FlowSession +``` + +--- + +### sessionsExcluding *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Obtains a collection of sessions excluding those for the specified parties, or state participants. + +```kotlin +fun Iterable.sessionsExcluding(parties: Iterable): Set + +fun Iterable.sessionsExcluding(vararg parties: AbstractParty): Set + +fun Iterable.sessionsExcluding(vararg states: ContractState): Set +``` + +--- + +### cast *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Casts an iterable of `StateAndRef` of an unknown `ContractState` to a list of `StateAndRef` of type `T`. + +```kotlin +inline fun Iterable>.cast(): List> where T : ContractState +``` + +--- ## Version 1.0.0 -### Contract +### ChainState *Interface* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Defines a Corda chain state. + +```kotlin +interface ChainState +``` + +#### Remarks + +A chain state is similar to a `LinearState` in that it represents a set of state transitions. Chain states adopt a concept similar to a blockchain, where each new state transition references the previous one by its `StateRef`, or `null` if it's the first state in the chain. + +--- + +### Hashable *Interface* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Defines an object that can produce a unique hash. + +```kotlin +interface Hashable +``` + +#### Remarks + +When used in conjunction with the `ChainState` interface, this can be useful for modelling states that always produce a unique hash for every state transition. + +--- -#### ChainState (interface) +### Resolvable *Interface* -Defines a Corda chain state. +**Module:** onixlabs-corda-core-contract -> A chain state is similar to a `LinearState`, in that it represents a set of state transitions. Chain states adopt a concept similar to blockchain, where each new state transition references the previous one by it's `StateRef`, or null if it's the first state in the chain. +**Package:** io.onixlabs.corda.core.contract -#### Hashable (interface) +#### Description -Defines an object that can produce a unique hash. +Defines an object which resolves a `ContractState`. -> This is useful if you require some level of state uniqueness. +```kotlin +interface Resolvable where T : ContractState +``` -#### Resolvable (interface) +#### Remarks -Defines an object which resolves a `ContractState`. +This is the fundamental principle on which state pointers are implemented in Corda; their ability to maintain and resolve a reference back to another known state in the vault. The implementation here is flexible and open, allowing developers to model resolvable as a design pattern, rather than as a strict implementation detail. -> This is the fundamental principle on which state pointers are implemented in Corda; their ability to maintain and resolve a reference back to another known state in the vault. The implementation here is flexible and open, allowing developers to model resolvable as a design pattern, rather than as a strict implementation detail. +--- -#### TransactionResolution (enum) +### TransactionResolution *Enum Class* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description Defines how to resolve states from a transaction, and is used by the `Resolvable` interface. -#### Extensions +```kotlin +enum class TransactionResolution +``` + +#### Entries + +| Name | Description | +| ------------- | ------------------------------------------------------------ | +| **INPUT** | Defines that a resolvable should resolve from a transaction input state. | +| **OUTPUT** | Defines that a resolvable should resolve from a transaction output state. | +| **REFERENCE** | Defines that a resolvable should resolve from a transaction reference input state. | + +--- + +### owningKeys *Extension Property* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Gets the owning keys from an `Iterable` of `AbstractParty`. + +```kotlin +val Iterable.owningKeys: Set +``` + +--- + +### participantHash *Extension Property* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Gets a hash from an `Iterable` of `AbstractParty`. + +```kotlin +val Iterable.participantHash: SecureHash +``` + +#### Remarks + +This extension property can be used to determine whether the participants of a state are unique, regardless of the ordering of those participants. + +--- -- Added extension to obtain a set of owning keys from a collection of `AbstractParty`. -- Added extension to obtain a participant hash to determine state uniqueness by participation. -- Added extensions to determine whether a chain state instance is pointing to a specified `StateRef`. -- Added extension to cast an unknown `StateAndRef<*>` to a typed `StateAndRef`. +### isPointingTo *Extension Function* -### Workflow +**Module:** onixlabs-corda-core-contract -#### FindStateFlow (abstract class) +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Determines whether the current state is pointing to the specified `StateRef`, or `StateAndRef`. + +```kotlin +fun T.isPointingTo(stateRef: StateRef): Boolean where T : ChainState +fun T.isPointingTo(stateAndRef: StateAndRef): Boolean where T : ChainState +``` + +--- + +### cast *Extension Function* + +**Module:** onixlabs-corda-core-contract + +**Package:** io.onixlabs.corda.core.contract + +#### Description + +Casts a `StateAndRef` of an unknown `ContractState` to a `StateAndRef` of type `T`. + +```kotlin +inline fun StateAndRef<*>.cast(): StateAndRef where T : ContractState +``` + +--- + +### FindStateFlow *Abstract Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description Represents the base class for implementing a query that finds a single state. -#### FindStatesFlow (abstract class) +```kotlin +abstract class FindStateFlow : FlowLogic?>() where T : ContractState +``` + +#### Remarks + +This design pattern enables developers to be more consistent in their approach to performing vault queries, regardless of whether they're being performed from within the node (using `ServiceHub`) or from an RPC client (using `CordaRPCOps`). + +--- + +### FindStatesFlow *Abstract Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description Represents the base class for implementing a query that finds multiple states. -> This design pattern enables developers to be more consistent in their approach to performing vault queries, regardless of whether they're being performed from within the node (using `ServiceHub`) or from an RPC client (using `CordaRPCOps`). +```kotlin +abstract class FindStatesFlow : FlowLogic>>() where T : ContractState +``` -#### Message (open class) +#### Remarks -Represents an open, transient message. +This design pattern enables developers to be more consistent in their approach to performing vault queries, regardless of whether they're being performed from within the node (using `ServiceHub`) or from an RPC client (using `CordaRPCOps`). -#### MessageAcknowledgement (open class) +--- -Represents an open acknowledgement to a message. +### Message *Open Class* -#### SendMessageFlow (class) +**Module:** onixlabs-corda-core-workflow -Sends a message to other nodes on the Corda network. +**Package:** io.onixlabs.corda.core.workflow -#### ReceiveMessageFlow (class) +#### Description -Receives a message from another node on the Corda network. +Represents a transient message. -#### SendMessageAcknowledgementFlow (class) +```kotlin +open class Message(val data: T, val id: UUID = UUID.randomUUID()) where T : Any +``` -Sends a message acknowledgement to other nodes on the Corda network. +--- -#### ReceiveMessageAcknowledgementFlow (class) +### MessageAcknowledgement *Open Class* -Receives a message acknowledgement from another node on the Corda network. +**Module:** onixlabs-corda-core-workflow -#### TransactionNote (class) +**Package:** io.onixlabs.corda.core.workflow -Represents a wrapper around a transaction note and the transaction that the note belongs to. +#### Description -#### SendTransactionNoteFlow (class) +Represents an acknowledgement to a transient message. -Sends a transaction note to other nodes on the Corda network for persistence. +```kotlin +open class MessageAcknowledgement(val id: UUID) +``` -#### ReceiveTransactionNoteFlow (class) +--- -Receives a transaction note from another node on the Corda network, and optionally persists it. +### SendMessageFlow *Class* -> All messaging APIs are part of the ONIXLabs Corda Code messaging protocol, which allows Corda nodes to send and receive transient messages and messages acknowledgements, which are not bound to the ledger. +**Module:** onixlabs-corda-core-workflow -#### Extensions +**Package:** io.onixlabs.corda.core.workflow -- Added extensions to obtain the first notary from the network map cache. -- Added extensions to obtain a random notary from the network map cache. -- Added extensions to obtain the preferred notary from the CorDapp config file. -- Added extensions to set, and optionally log progress tracker steps. -- Added extensions to initiate flow sessions for a collection of parties and/or state participants. -- Added extensions to check that sufficient flow sessions have been passed for the specified states. -- Added extensions to find transactions by transaction ID or `StateRef`. -- Added constants for default sorting and default, or maximum size page specification. -- Added extensions to build complex query expressions. +#### Description -### Integration +Represents a sub-flow that sends a message to the specified counter-parties. -#### RPCService (abstract class) +```kotlin +class SendMessageFlow( + private val message: T, + private val sessions: Set, + private val requestAcknowledgement: Boolean = false, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic>() where T : Message<*> +``` -Represents the base class for implementing services that utilize `CordaRPCOps`. +#### Remarks -#### MessageService (class) +Use the built-in `SendMessageFlow.Initiator` class in order to use this class as an initiating flow. + +```kotlin +@StartableByRPC +@StartableByService +@InitiatingFlow +class Initiator( + private val message: T, + private val counterparties: Collection +) : FlowLogic>() where T : Message<*> +``` + +--- + +### ReceiveMessageFlow *Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a sub-flow that receives a message from the specified counter-parties. + +```kotlin +class ReceiveMessageFlow( + private val session: FlowSession, + private val requestAcknowledgement: Boolean = false, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic>() where T : Message<*> +``` + +#### Remarks + +Use the built-in `ReceiveMessageFlow.Receiver` class in order to register it as an initiated-by flow, and listen for message results. + +```kotlin +@InitiatedBy(SendMessageFlow.Initiator::class) +class Receiver(private val session: FlowSession) : FlowLogic>() where T : Message<*> +``` + +--- + +### SendMessageAcknowledgementFlow *Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a sub-flow that sends a message acknowledgement to the specified counter-party. + +```kotlin +class SendMessageAcknowledgementFlow( + private val acknowledgement: T, + private val session: FlowSession, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic() where T : MessageAcknowledgement +``` + +#### Remarks + +Use the built-in `SendMessageAcknowledgementFlow.Initiator` class in order to use this class as an initiating flow. + +```kotlin +@StartableByRPC +@StartableByService +@InitiatingFlow +class Initiator( + private val acknowledgement: T, + private val counterparty: Party +) : FlowLogic() where T : MessageAcknowledgement +``` + +--- + +### ReceiveMessageAcknowledgementFlow *Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a sub-flow that receives a message acknowledgement from the specified counter-party. + +```kotlin +class ReceiveMessageAcknowledgementFlow( + private val session: FlowSession, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic>() +``` + +#### Remarks + +Use the built-in `ReceiveMessageAcknowledgementFlow.Receiver` class in order to register it as an initiated-by flow, and listen for message acknowledgement results. + +```kotlin +@InitiatedBy(SendMessageAcknowledgementFlow.Initiator::class) +class Receiver(private val session: FlowSession) : FlowLogic>() where T : MessageAcknowledgement +``` + +--- + +### TransactionNote *Data Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a transaction note. + +```kotlin +data class TransactionNote(val transactionId: SecureHash, val text: String) +``` + +--- + +### SendTransactionNoteFlow *Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a sub-flow that sends a transaction note to the specified counter-parties. + +```kotlin +class SendTransactionNoteFlow( + private val transactionNote: TransactionNote, + private val sessions: Collection, + private val addNoteToTransaction: Boolean = true, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic() +``` + +#### Remarks + +Use the built-in `SendTransactionNoteFlow.Initiator` class in order to use this class as an initiating flow. + +```kotlin +@StartableByRPC +@StartableByService +@InitiatingFlow +class Initiator( + private val transactionNote: TransactionNote, + private val counterparties: Iterable, + private val addNoteToTransaction: Boolean = true +) : FlowLogic() +``` + +--- + +### ReceiveTransactionNoteFlow *Class* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Represents a sub-flow that receives a transaction note from the specified counter-party. + +```kotlin +class ReceiveTransactionNoteFlow( + private val session: FlowSession, + private val persist: Boolean = true, + private val expectedTransactionId: SecureHash? = null, + override val progressTracker: ProgressTracker = tracker() +) : FlowLogic>() +``` + +#### Remarks + +Use the built-in `ReceiveTransactionNoteFlow.Receiver` class in order to register it as an initiated-by flow, and listen for transaction note results. + +```kotlin +@InitiatedBy(SendTransactionNoteFlow.Initiator::class) +class Receiver(private val session: FlowSession) : FlowLogic>() +``` + +--- + +### firstNotary *Extension Property* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Gets the first available notary. + +```kotlin +val FlowLogic<*>.firstNotary: Party +``` + +#### Remarks + +This extension property will throw a `NoSuchElementException` if there are no available notaries. + +--- + +### randomNotary *Extension Property* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Gets a randomly available notary. + +```kotlin +val FlowLogic<*>.randomNotary: Party +``` + +#### Remarks + +This extension property will throw a `NoSuchElementException` if there are no available notaries. + +--- + +### getPreferredNotary *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Gets the preferred notary from the CorDapp config, or alternatively a default notary in the event that a preferred notary has not been specified in the CorDapp config. + +```kotlin +@Suspendable +fun FlowLogic<*>.getPreferredNotary( + serviceHub: ServiceHub = this.serviceHub, + defaultSelector: (ServiceHub) -> Party = { firstNotary } +): Party +``` + +#### Remarks + +This extension property will throw an `IllegalArgumentException` if the preferred notary cannot be found in the network map cache. + +--- + +### currentStep *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Sets the current progress tracker step. + +```kotlin +@Suspendable +fun FlowLogic<*>.currentStep(step: Step, log: Boolean = true, additionalLogInfo: String? = null) +``` + +--- + +### initiateFlows *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Initiates flow sessions for the specified parties and/or states, except for identities that belong to the local node, since flow sessions are not required locally. + +```kotlin +@Suspendable +fun FlowLogic<*>.initiateFlows(vararg parties: AbstractParty): Set + +@Suspendable +fun FlowLogic<*>.initiateFlows(vararg states: ContractState): Set + +@Suspendable +fun FlowLogic<*>.initiateFlows(parties: Iterable, vararg states: ContractState): Set +``` + +--- + +### checkSufficientSessions *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Checks that sufficient flow sessions have been provided for the specified states, of from the input and output states of a transaction builder. + +```kotlin +@Suspendable +fun FlowLogic<*>.checkSufficientSessions(sessions: Iterable, states: Iterable) + +@Suspendable +fun FlowLogic<*>.checkSufficientSessions(sessions: Iterable, vararg states: ContractState) + +@Suspendable +fun FlowLogic<*>.checkSufficientSessions(sessions: Iterable, transaction: TransactionBuilder) +``` + +#### Remarks + +Assuming that the specified states will be used as input or output states in a transaction, this function will extract a set of all state participants, excluding identities owned by the initiating node, and then check that a flow session exists for each participant. + +--- + +### findTransaction *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Finds a recorded transaction in the vault for the specified transaction hash. + +```kotlin +@Suspendable +fun FlowLogic<*>.findTransaction(transactionHash: SecureHash): SignedTransaction + +@Suspendable +fun FlowLogic<*>.findTransaction(stateRef: StateRef): SignedTransaction + +@Suspendable +fun FlowLogic<*>.findTransaction(stateAndRef: StateAndRef<*>): SignedTransaction +``` + +--- + +### DEFAULT_SORTING *Extension Property* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +The default sorting order. + +```kotlin +val DEFAULT_SORTING: Sort +``` + +--- + +### DEFAULT_PAGE_SPECIFICATION *Extension Property* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +The default page specification. + +```kotlin +val DEFAULT_PAGE_SPECIFICATION: PageSpecification +``` + +--- + +### MAXIMUM_PAGE_SPECIFICATION *Extension Property* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +The maximum page specification. + +```kotlin +val MAXIMUM_PAGE_SPECIFICATION: PageSpecification +``` + +--- + +### andWithExpressions *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Builds a custom query criteria. This combines all non-null query expressions using logical AND. + +```kotlin +fun QueryCriteria.VaultQueryCriteria.andWithExpressions( + vararg expressions: CriteriaExpression? +): QueryCriteria +``` + +--- + +### orWithExpressions *Extension Function* + +**Module:** onixlabs-corda-core-workflow + +**Package:** io.onixlabs.corda.core.workflow + +#### Description + +Builds a custom query criteria. This combines all non-null query expressions using logical OR. + +```kotlin +fun QueryCriteria.VaultQueryCriteria.andWithExpressions( + vararg expressions: CriteriaExpression? +): QueryCriteria +``` + +--- + +### RPCService *Abstract Class* + +**Module:** onixlabs-corda-core-integration + +**Package:** io.onixlabs.corda.core.integration + +#### Description + +Represents the base class for implementing integration services over RPC. + +```kotlin +abstract class RPCService(val rpc: CordaRPCOps) +``` + +--- + +### MessageService *Class* + +**Module:** onixlabs-corda-core-integration + +**Package:** io.onixlabs.corda.core.integration + +#### Description Represents an RPC service for sending and subscribing to transient messages. -#### MessageAcknowledgementService (class) +```kotlin +class MessageService(rpc: CordaRPCOps) : RPCService(rpc) +``` + +--- + +### MessageAcknowledgementService *Class* + +**Module:** onixlabs-corda-core-integration + +**Package:** io.onixlabs.corda.core.integration + +#### Description Represents an RPC service for sending and subscribing to transience message acknowledgements. -#### TransactionNoteService (class) +```kotlin +class MessageAcknowledgementService(rpc: CordaRPCOps) : RPCService(rpc) +``` + +--- + +### TransactionNoteService *Class* + +**Module:** onixlabs-corda-core-integration + +**Package:** io.onixlabs.corda.core.integration + +#### Description Represents an RPC service for adding, sending and persisting transaction notes. +```kotlin +class TransactionNoteService(rpc: CordaRPCOps) : RPCService(rpc) +``` +--- diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/ContractID.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/ContractID.kt index 000ce97..11a8b69 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/ContractID.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/ContractID.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.contract import net.corda.core.contracts.ContractClassName diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.LedgerTransaction.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.LedgerTransaction.kt index f219b0f..c0db890 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.LedgerTransaction.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.LedgerTransaction.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.contract import net.corda.core.contracts.Command diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignatureData.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignatureData.kt index b725c84..243382c 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignatureData.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignatureData.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.contract import net.corda.core.crypto.Crypto diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignedCommandData.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignedCommandData.kt index 4ef52b4..44f7755 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignedCommandData.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/SignedCommandData.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.contract import net.corda.core.contracts.CommandData diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/VerifiedCommandData.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/VerifiedCommandData.kt index 05aef5d..5b1683a 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/VerifiedCommandData.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/VerifiedCommandData.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.contract import net.corda.core.contracts.CommandData diff --git a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Notaries.kt b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Notaries.kt index 63c9cb3..8fe2bca 100644 --- a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Notaries.kt +++ b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Notaries.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.workflow import co.paralleluniverse.fibers.Suspendable diff --git a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Sessions.kt b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Sessions.kt index 91406c1..cd44612 100644 --- a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Sessions.kt +++ b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowLogic.Sessions.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.workflow import co.paralleluniverse.fibers.Suspendable diff --git a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowSession.kt b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowSession.kt index b5e3441..5892bec 100644 --- a/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowSession.kt +++ b/onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/Extensions.FlowSession.kt @@ -1,3 +1,19 @@ +/** + * Copyright 2020 Matthew Layton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.onixlabs.corda.core.workflow import net.corda.core.contracts.ContractState From a4beb66b55fc0d244dddc8da0d485d1170240855 Mon Sep 17 00:00:00 2001 From: Matthew Layton Date: Sun, 14 Mar 2021 12:04:12 +0000 Subject: [PATCH 03/22] Majority of version 2.0.0 features implemented. --- .../runConfigurations/Run_Contract_Tests.xml | 4 +- .../runConfigurations/Run_Workflow_Tests.xml | 4 +- CHANGELOG.md | 44 ++ HEADER | 2 +- build.gradle | 6 +- gradle.properties | 4 + lib/onixlabs.development.jks | Bin 0 -> 2229 bytes lib/onixlabs.development.pkcs12 | Bin 0 -> 2599 bytes .../onixlabs/corda/core/Extensions.Class.kt | 43 ++ .../io/onixlabs/corda/core/Extensions.Type.kt | 39 ++ .../io/onixlabs/corda/core/TypeReference.kt | 70 +++ .../core/contract/AbstractPluralResolvable.kt | 76 +++ .../contract/AbstractSingularResolvable.kt | 77 +++ .../corda/core/contract/ChainState.kt | 2 +- .../corda/core/contract/ContractID.kt | 2 +- .../corda/core/contract/DummyContract.kt | 49 +- .../core/contract/Extensions.AbstractParty.kt | 2 +- .../core/contract/Extensions.ChainState.kt | 2 +- .../contract/Extensions.LedgerTransaction.kt | 38 +- .../contract/Extensions.SingularResolvable.kt | 63 +++ .../core/contract/Extensions.StateAndRef.kt | 2 +- .../onixlabs/corda/core/contract/Hashable.kt | 2 +- .../corda/core/contract/PluralResolvable.kt | 64 +++ .../corda/core/contract/SignatureData.kt | 26 +- .../corda/core/contract/SignedCommandData.kt | 2 +- .../{Resolvable.kt => SingularResolvable.kt} | 8 +- .../core/contract/TransactionResolution.kt | 2 +- .../core/contract/VerifiedCommandData.kt | 2 +- .../corda/core/contract/ContractTest.kt | 30 -- .../contract/DummyContractCommandTests.kt | 22 - .../corda/core/contract/DummyContractTests.kt | 20 - .../onixlabs/corda/core/contract/MockData.kt | 10 - .../MessageAcknowledgementService.kt | 2 +- .../corda/core/integration/MessageService.kt | 2 +- .../corda/core/integration/RPCService.kt | 2 +- .../integration/TransactionNoteService.kt | 2 +- .../{workflow => query}/Extensions.Query.kt | 4 +- .../core/{workflow => query}/FindStateFlow.kt | 12 +- .../{workflow => query}/FindStatesFlow.kt | 12 +- .../core/query/QueryComparable.Extensions.kt | 120 +++++ .../corda/core/query/QueryComparable.kt | 462 ++++++++++++++++++ .../core/query/QueryEquatable.Extensions.kt | 41 ++ .../corda/core/query/QueryEquatable.kt | 151 ++++++ .../core/query/QueryString.Extensions.kt | 65 +++ .../onixlabs/corda/core/query/QueryString.kt | 245 ++++++++++ .../workflow/Extensions.FlowLogic.Notaries.kt | 2 +- .../workflow/Extensions.FlowLogic.Sessions.kt | 2 +- .../Extensions.FlowLogic.Transaction.kt | 2 +- .../core/workflow/Extensions.FlowSession.kt | 2 +- .../onixlabs/corda/core/workflow/Message.kt | 2 +- .../core/workflow/MessageAcknowledgement.kt | 2 +- .../ReceiveMessageAcknowledgementFlow.kt | 2 +- .../corda/core/workflow/ReceiveMessageFlow.kt | 2 +- .../workflow/ReceiveTransactionNoteFlow.kt | 2 +- .../SendMessageAcknowledgementFlow.kt | 2 +- .../corda/core/workflow/SendMessageFlow.kt | 2 +- .../core/workflow/SendTransactionNoteFlow.kt | 2 +- .../corda/core/workflow/TransactionNote.kt | 2 +- .../MessageWithAcknowledgementFlowTests.kt | 31 -- .../workflow/messaging/flows/ReceiveFlow.kt | 20 - .../core/workflow/messaging/flows/SendFlow.kt | 23 - onixlabs-corda-test-contract/build.gradle | 35 ++ .../onixlabs/corda/test/contract/Customer.kt | 86 ++++ .../corda/test/contract/CustomerContract.kt | 135 +++++ .../corda/test/contract/CustomerEntity.kt | 66 +++ .../corda/test/contract/Extensions.Query.kt | 32 ++ .../io/onixlabs/corda/test/contract/Reward.kt | 72 +++ .../corda/test/contract/RewardContract.kt | 121 +++++ .../corda/test/contract/RewardEntity.kt | 52 ++ .../customer-schema.changelog-master.xml | 6 + .../customer-schema.changelog-v1.xml | 38 ++ .../reward-schema.changelog-master.xml | 6 + .../migration/reward-schema.changelog-v1.xml | 31 ++ .../onixlabs/corda/test/TypeReferenceTests.kt | 139 ++++++ .../contract/AbstractPartyExtensionTests.kt | 22 +- .../test/contract/ChainStateExtensionTests.kt | 64 +++ .../corda/test/contract/ContractIDTests.kt | 49 ++ .../corda/test/contract/ContractTest.kt | 77 +++ .../CustomerContractAmendCommandTests.kt | 115 +++++ .../CustomerContractIssueCommandTests.kt | 102 ++++ .../CustomerContractRevokeCommandTests.kt | 70 +++ .../onixlabs/corda/test/contract/MockData.kt | 38 ++ .../RewardContractIssueCommandTests.kt | 143 ++++++ .../RewardContractSpendCommandTests.kt | 144 ++++++ .../corda/test/contract/SignatureDataTests.kt | 57 +++ onixlabs-corda-test-workflow/build.gradle | 37 ++ .../corda/test/workflow/AmendCustomerFlow.kt | 74 +++ .../test/workflow/AmendCustomerFlowHandler.kt | 42 ++ .../corda/test/workflow/FindCustomerFlow.kt | 56 +++ .../corda/test/workflow/FindCustomersFlow.kt | 58 +++ .../corda/test/workflow/FindRewardFlow.kt | 50 ++ .../corda/test/workflow/FindRewardsFlow.kt | 52 ++ .../workflow/GetCustomerRewardBalanceFlow.kt | 33 ++ .../corda/test/workflow/IssueCustomerFlow.kt | 69 +++ .../test/workflow/IssueCustomerFlowHandler.kt | 42 ++ .../corda/test/workflow/IssueRewardFlow.kt | 82 ++++ .../test/workflow/IssueRewardFlowHandler.kt | 49 ++ .../corda/test/workflow/RevokeCustomerFlow.kt | 70 +++ .../workflow/RevokeCustomerFlowHandler.kt | 42 ++ .../corda/test/workflow/SpendRewardFlow.kt | 84 ++++ .../test/workflow/SpendRewardFlowHandler.kt | 49 ++ .../onixlabs/corda/test}/workflow/FlowTest.kt | 36 +- .../onixlabs/corda/test}/workflow/Pipeline.kt | 6 +- .../customer/AmendCustomerFlowTests.kt | 83 ++++ .../FindCustomersFlowQueryComparableTests.kt | 137 ++++++ .../FindCustomersFlowQueryEquatableTests.kt | 134 +++++ .../FindCustomersFlowQueryStringTests.kt | 168 +++++++ .../customer/IssueCustomerFlowTests.kt | 77 +++ .../customer/RevokeCustomerFlowTests.kt | 64 +++ .../MessageAcknowledgementFlowTests.kt | 26 +- .../workflow/messaging/MessageFlowTests.kt | 26 +- .../SendAndReceiveAcknowledgementFlow.kt | 47 ++ .../FindRewardsFlowQueryComparableTests.kt | 130 +++++ .../FindRewardsFlowQueryEquatableTests.kt | 99 ++++ .../GetCustomerRewardBalanceFlowTests.kt | 45 ++ .../IssueRewardFlowSignatureDataTests.kt | 48 ++ .../workflow/reward/IssueRewardFlowTests.kt | 82 ++++ .../SpendRewardFlowSignatureDataTests.kt | 50 ++ .../workflow/reward/SpendRewardFlowTests.kt | 62 +++ settings.gradle | 2 + 120 files changed, 5573 insertions(+), 275 deletions(-) create mode 100644 lib/onixlabs.development.jks create mode 100644 lib/onixlabs.development.pkcs12 create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/Extensions.Class.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/Extensions.Type.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/TypeReference.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/AbstractPluralResolvable.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/AbstractSingularResolvable.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.SingularResolvable.kt create mode 100644 onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/PluralResolvable.kt rename onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/{Resolvable.kt => SingularResolvable.kt} (87%) delete mode 100644 onixlabs-corda-core-contract/src/test/kotlin/io/onixlabs/corda/core/contract/ContractTest.kt delete mode 100644 onixlabs-corda-core-contract/src/test/kotlin/io/onixlabs/corda/core/contract/DummyContractCommandTests.kt delete mode 100644 onixlabs-corda-core-contract/src/test/kotlin/io/onixlabs/corda/core/contract/DummyContractTests.kt delete mode 100644 onixlabs-corda-core-contract/src/test/kotlin/io/onixlabs/corda/core/contract/MockData.kt rename onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/{workflow => query}/Extensions.Query.kt (97%) rename onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/{workflow => query}/FindStateFlow.kt (84%) rename onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/{workflow => query}/FindStatesFlow.kt (85%) create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryComparable.Extensions.kt create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryComparable.kt create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryEquatable.Extensions.kt create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryEquatable.kt create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryString.Extensions.kt create mode 100644 onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/query/QueryString.kt delete mode 100644 onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core/workflow/messaging/MessageWithAcknowledgementFlowTests.kt delete mode 100644 onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core/workflow/messaging/flows/ReceiveFlow.kt delete mode 100644 onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core/workflow/messaging/flows/SendFlow.kt create mode 100644 onixlabs-corda-test-contract/build.gradle create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/Customer.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/CustomerContract.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/CustomerEntity.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/Extensions.Query.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/Reward.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/RewardContract.kt create mode 100644 onixlabs-corda-test-contract/src/main/kotlin/io/onixlabs/corda/test/contract/RewardEntity.kt create mode 100644 onixlabs-corda-test-contract/src/main/resources/migration/customer-schema.changelog-master.xml create mode 100644 onixlabs-corda-test-contract/src/main/resources/migration/customer-schema.changelog-v1.xml create mode 100644 onixlabs-corda-test-contract/src/main/resources/migration/reward-schema.changelog-master.xml create mode 100644 onixlabs-corda-test-contract/src/main/resources/migration/reward-schema.changelog-v1.xml create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/TypeReferenceTests.kt rename {onixlabs-corda-core-contract/src/test/kotlin/io/onixlabs/corda/core => onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test}/contract/AbstractPartyExtensionTests.kt (63%) create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/ChainStateExtensionTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/ContractIDTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/ContractTest.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/CustomerContractAmendCommandTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/CustomerContractIssueCommandTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/CustomerContractRevokeCommandTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/MockData.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/RewardContractIssueCommandTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/RewardContractSpendCommandTests.kt create mode 100644 onixlabs-corda-test-contract/src/test/kotlin/io/onixlabs/corda/test/contract/SignatureDataTests.kt create mode 100644 onixlabs-corda-test-workflow/build.gradle create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/AmendCustomerFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/AmendCustomerFlowHandler.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/FindCustomerFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/FindCustomersFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/FindRewardFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/FindRewardsFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/GetCustomerRewardBalanceFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/IssueCustomerFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/IssueCustomerFlowHandler.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/IssueRewardFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/IssueRewardFlowHandler.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/RevokeCustomerFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/RevokeCustomerFlowHandler.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/SpendRewardFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/main/kotlin/io/onixlabs/corda/test/workflow/SpendRewardFlowHandler.kt rename {onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core => onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test}/workflow/FlowTest.kt (62%) rename {onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core => onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test}/workflow/Pipeline.kt (94%) create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/AmendCustomerFlowTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/FindCustomersFlowQueryComparableTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/FindCustomersFlowQueryEquatableTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/FindCustomersFlowQueryStringTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/IssueCustomerFlowTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/customer/RevokeCustomerFlowTests.kt rename {onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core => onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test}/workflow/messaging/MessageAcknowledgementFlowTests.kt (56%) rename {onixlabs-corda-core-workflow/src/test/kotlin/io/onixlabs/corda/core => onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test}/workflow/messaging/MessageFlowTests.kt (58%) create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/messaging/flows/SendAndReceiveAcknowledgementFlow.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/FindRewardsFlowQueryComparableTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/FindRewardsFlowQueryEquatableTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/GetCustomerRewardBalanceFlowTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/IssueRewardFlowSignatureDataTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/IssueRewardFlowTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/SpendRewardFlowSignatureDataTests.kt create mode 100644 onixlabs-corda-test-workflow/src/test/kotlin/io/onixlabs/corda/test/workflow/reward/SpendRewardFlowTests.kt diff --git a/.idea/runConfigurations/Run_Contract_Tests.xml b/.idea/runConfigurations/Run_Contract_Tests.xml index 4ec7b4a..85ba4f8 100644 --- a/.idea/runConfigurations/Run_Contract_Tests.xml +++ b/.idea/runConfigurations/Run_Contract_Tests.xml @@ -1,7 +1,7 @@ - -