Skip to content

Commit eddb6d0

Browse files
1.0.0-rc4
1 parent f2daa13 commit eddb6d0

File tree

24 files changed

+226
-202
lines changed

24 files changed

+226
-202
lines changed

onixlabs-corda-identity-framework-integration/src/main/kotlin/io/onixlabs/corda/identityframework/integration/AttestationCommandService.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import io.onixlabs.corda.core.integration.RPCService
2020
import io.onixlabs.corda.identityframework.contract.*
2121
import io.onixlabs.corda.identityframework.workflow.AmendAttestationFlow
2222
import io.onixlabs.corda.identityframework.workflow.IssueAttestationFlow
23+
import io.onixlabs.corda.identityframework.workflow.PublishAttestationFlow
2324
import io.onixlabs.corda.identityframework.workflow.RevokeAttestationFlow
24-
import io.onixlabs.corda.identityframework.workflow.SendAttestationFlow
2525
import net.corda.core.contracts.ContractState
2626
import net.corda.core.contracts.StateAndRef
2727
import net.corda.core.contracts.UniqueIdentifier
@@ -138,18 +138,18 @@ class AttestationCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
138138
}
139139

140140
/**
141-
* Sends an attestation.
141+
* Publishes an attestation.
142142
*
143143
* @param T The underlying [ContractState] type.
144-
* @param attestation The attestation to be sent.
144+
* @param attestation The attestation to be published.
145145
* @param observers Observers of the attestation.
146146
*/
147-
fun <T : ContractState> sendAttestation(
147+
fun <T : ContractState> publishAttestation(
148148
attestation: StateAndRef<Attestation<T>>,
149149
observers: Set<Party>
150150
): FlowProgressHandle<SignedTransaction> {
151151
return rpc.startTrackedFlow(
152-
SendAttestationFlow::Initiator,
152+
PublishAttestationFlow::Initiator,
153153
attestation,
154154
observers
155155
)

onixlabs-corda-identity-framework-integration/src/main/kotlin/io/onixlabs/corda/identityframework/integration/ClaimCommandService.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import io.onixlabs.corda.identityframework.contract.CordaClaim
2121
import io.onixlabs.corda.identityframework.contract.amend
2222
import io.onixlabs.corda.identityframework.workflow.AmendClaimFlow
2323
import io.onixlabs.corda.identityframework.workflow.IssueClaimFlow
24+
import io.onixlabs.corda.identityframework.workflow.PublishClaimFlow
2425
import io.onixlabs.corda.identityframework.workflow.RevokeClaimFlow
25-
import io.onixlabs.corda.identityframework.workflow.SendClaimFlow
2626
import net.corda.core.contracts.StateAndRef
2727
import net.corda.core.contracts.UniqueIdentifier
2828
import net.corda.core.identity.AbstractParty
@@ -108,18 +108,18 @@ class ClaimCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
108108
}
109109

110110
/**
111-
* Sends a claim.
111+
* Publishes a claim.
112112
*
113113
* @param T The underlying claim value type.
114-
* @param claim The claim to be consumed.
114+
* @param claim The claim to be published.
115115
* @param observers Additional observers of the transaction.
116116
*/
117-
fun <T : Any> sendClaim(
117+
fun <T : Any> publishClaim(
118118
claim: StateAndRef<CordaClaim<T>>,
119119
observers: Set<Party>
120120
): FlowProgressHandle<SignedTransaction> {
121121
return rpc.startTrackedFlow(
122-
SendClaimFlow::Initiator,
122+
PublishClaimFlow::Initiator,
123123
claim,
124124
observers
125125
)

onixlabs-corda-identity-framework-integration/src/test/kotlin/io/onixlabs/corda/identityframework/integration/AttestationIntegrationTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ class AttestationIntegrationTests : IntegrationTest() {
6767
stateStatus = Vault.StateStatus.UNCONSUMED
6868
) ?: fail("Failed to find amended attestation.")
6969

70-
// Send the amended attestation
71-
nodeA.attestations.commandService.sendAttestation(
70+
// Publish the amended attestation
71+
nodeA.attestations.commandService.publishAttestation(
7272
attestation = amendedAttestation,
7373
observers = setOf(partyB)
7474
).returnValue.getOrThrow()
7575

76-
// Find the sent attestation
76+
// Find the published attestation
7777
listOf(nodeA, nodeB, nodeC).forEach {
7878
it.attestations.queryService.findAttestation<Attestation<CordaClaim<String>>>(
7979
pointerStateRef = issuedClaim.ref,
8080
stateStatus = Vault.StateStatus.UNCONSUMED
81-
) ?: fail("Failed to find send attestation.")
81+
) ?: fail("Failed to find published attestation.")
8282
}
8383

8484
// Revoke the attestation

onixlabs-corda-identity-framework-integration/src/test/kotlin/io/onixlabs/corda/identityframework/integration/ClaimIntegrationTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ class ClaimIntegrationTests : IntegrationTest() {
5353
stateStatus = Vault.StateStatus.UNCONSUMED
5454
) ?: fail("Failed to find amended claim.")
5555

56-
// Send the amended claim
57-
nodeA.claims.commandService.sendClaim(
56+
// Publish the amended claim
57+
nodeA.claims.commandService.publishClaim(
5858
claim = amendedClaim,
5959
observers = setOf(partyB, partyC)
6060
).returnValue.getOrThrow()
6161

62-
// Find the sent claim
62+
// Find the published claim
6363
listOf(nodeA, nodeB, nodeC).forEach {
6464
it.claims.queryService.findClaim<CordaClaim<String>>(
6565
linearId = ID,

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/AmendAttestationFlow.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,4 @@ class AmendAttestationFlow(
101101
)
102102
}
103103
}
104-
105-
/**
106-
* Represents the handler of the [Initiator] flow.
107-
*
108-
* @property session The counter-party session who is initiating the flow.
109-
*/
110-
@InitiatedBy(Initiator::class)
111-
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
112-
113-
private companion object {
114-
object OBSERVING : ProgressTracker.Step("Observing amended attestation.") {
115-
override fun childProgressTracker(): ProgressTracker = AmendAttestationFlowHandler.tracker()
116-
}
117-
}
118-
119-
override val progressTracker = ProgressTracker(OBSERVING)
120-
121-
@Suspendable
122-
override fun call(): SignedTransaction {
123-
currentStep(OBSERVING)
124-
return subFlow(AmendAttestationFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
125-
}
126-
}
127104
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/AmendAttestationFlowHandler.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package io.onixlabs.corda.identityframework.workflow
1818

1919
import co.paralleluniverse.fibers.Suspendable
2020
import io.onixlabs.corda.core.workflow.currentStep
21+
import io.onixlabs.corda.identityframework.workflow.AmendAttestationFlow.Initiator
2122
import net.corda.core.crypto.SecureHash
2223
import net.corda.core.flows.FlowLogic
2324
import net.corda.core.flows.FlowSession
25+
import net.corda.core.flows.InitiatedBy
2426
import net.corda.core.flows.ReceiveFinalityFlow
2527
import net.corda.core.node.StatesToRecord
2628
import net.corda.core.transactions.SignedTransaction
@@ -51,4 +53,27 @@ class AmendAttestationFlowHandler(
5153
currentStep(RECORDING)
5254
return subFlow(ReceiveFinalityFlow(session, expectedTransactionId, statesToRecord))
5355
}
56+
57+
/**
58+
* Represents the initiated flow handler for amending attestations.
59+
*
60+
* @property session The counter-party session who is initiating the flow.
61+
*/
62+
@InitiatedBy(Initiator::class)
63+
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
64+
65+
private companion object {
66+
object OBSERVING : ProgressTracker.Step("Observing amended attestation.") {
67+
override fun childProgressTracker(): ProgressTracker = tracker()
68+
}
69+
}
70+
71+
override val progressTracker = ProgressTracker(OBSERVING)
72+
73+
@Suspendable
74+
override fun call(): SignedTransaction {
75+
currentStep(OBSERVING)
76+
return subFlow(AmendAttestationFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
77+
}
78+
}
5479
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/AmendClaimFlow.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,27 +93,4 @@ class AmendClaimFlow(
9393
return subFlow(AmendClaimFlow(oldClaim, newClaim, sessions, AMENDING.childProgressTracker()))
9494
}
9595
}
96-
97-
/**
98-
* Represents the handler of the [Initiator] flow.
99-
*
100-
* @property session The counter-party session who is initiating the flow.
101-
*/
102-
@InitiatedBy(Initiator::class)
103-
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
104-
105-
private companion object {
106-
object OBSERVING : ProgressTracker.Step("Observing amended claim.") {
107-
override fun childProgressTracker(): ProgressTracker = AmendClaimFlowHandler.tracker()
108-
}
109-
}
110-
111-
override val progressTracker = ProgressTracker(OBSERVING)
112-
113-
@Suspendable
114-
override fun call(): SignedTransaction {
115-
currentStep(OBSERVING)
116-
return subFlow(AmendClaimFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
117-
}
118-
}
11996
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/AmendClaimFlowHandler.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package io.onixlabs.corda.identityframework.workflow
1818

1919
import co.paralleluniverse.fibers.Suspendable
2020
import io.onixlabs.corda.core.workflow.currentStep
21+
import io.onixlabs.corda.identityframework.workflow.AmendClaimFlow.Initiator
2122
import net.corda.core.crypto.SecureHash
2223
import net.corda.core.flows.FlowLogic
2324
import net.corda.core.flows.FlowSession
25+
import net.corda.core.flows.InitiatedBy
2426
import net.corda.core.flows.ReceiveFinalityFlow
2527
import net.corda.core.node.StatesToRecord
2628
import net.corda.core.transactions.SignedTransaction
@@ -51,4 +53,27 @@ class AmendClaimFlowHandler(
5153
currentStep(RECORDING)
5254
return subFlow(ReceiveFinalityFlow(session, expectedTransactionId, statesToRecord))
5355
}
56+
57+
/**
58+
* Represents the initiated flow handler for amending claims.
59+
*
60+
* @property session The counter-party session who is initiating the flow.
61+
*/
62+
@InitiatedBy(Initiator::class)
63+
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
64+
65+
private companion object {
66+
object OBSERVING : ProgressTracker.Step("Observing amended claim.") {
67+
override fun childProgressTracker(): ProgressTracker = tracker()
68+
}
69+
}
70+
71+
override val progressTracker = ProgressTracker(OBSERVING)
72+
73+
@Suspendable
74+
override fun call(): SignedTransaction {
75+
currentStep(OBSERVING)
76+
return subFlow(AmendClaimFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
77+
}
78+
}
5479
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/IssueAttestationFlow.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,4 @@ class IssueAttestationFlow(
101101
)
102102
}
103103
}
104-
105-
/**
106-
* Represents the handler of the [Initiator] flow.
107-
*
108-
* @property session The counter-party session who is initiating the flow.
109-
*/
110-
@InitiatedBy(Initiator::class)
111-
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
112-
113-
private companion object {
114-
object OBSERVING : ProgressTracker.Step("Observing issued attestation.") {
115-
override fun childProgressTracker(): ProgressTracker = IssueAttestationFlowHandler.tracker()
116-
}
117-
}
118-
119-
override val progressTracker = ProgressTracker(OBSERVING)
120-
121-
@Suspendable
122-
override fun call(): SignedTransaction {
123-
currentStep(OBSERVING)
124-
return subFlow(IssueAttestationFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
125-
}
126-
}
127104
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/IssueAttestationFlowHandler.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package io.onixlabs.corda.identityframework.workflow
1818

1919
import co.paralleluniverse.fibers.Suspendable
2020
import io.onixlabs.corda.core.workflow.currentStep
21+
import io.onixlabs.corda.identityframework.workflow.IssueAttestationFlow.Initiator
2122
import net.corda.core.crypto.SecureHash
2223
import net.corda.core.flows.FlowLogic
2324
import net.corda.core.flows.FlowSession
25+
import net.corda.core.flows.InitiatedBy
2426
import net.corda.core.flows.ReceiveFinalityFlow
2527
import net.corda.core.node.StatesToRecord
2628
import net.corda.core.transactions.SignedTransaction
@@ -51,4 +53,27 @@ class IssueAttestationFlowHandler(
5153
currentStep(RECORDING)
5254
return subFlow(ReceiveFinalityFlow(session, expectedTransactionId, statesToRecord))
5355
}
56+
57+
/**
58+
* Represents the initiated flow handler for issuing attestations.
59+
*
60+
* @property session The counter-party session who is initiating the flow.
61+
*/
62+
@InitiatedBy(Initiator::class)
63+
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
64+
65+
private companion object {
66+
object OBSERVING : ProgressTracker.Step("Observing issued attestation.") {
67+
override fun childProgressTracker(): ProgressTracker = tracker()
68+
}
69+
}
70+
71+
override val progressTracker = ProgressTracker(OBSERVING)
72+
73+
@Suspendable
74+
override fun call(): SignedTransaction {
75+
currentStep(OBSERVING)
76+
return subFlow(IssueAttestationFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
77+
}
78+
}
5479
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/IssueClaimFlow.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,4 @@ class IssueClaimFlow(
100100
)
101101
}
102102
}
103-
104-
/**
105-
* Represents the handler of the [Initiator] flow.
106-
*
107-
* @property session The counter-party session who is initiating the flow.
108-
*/
109-
@InitiatedBy(Initiator::class)
110-
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
111-
112-
private companion object {
113-
object OBSERVING : ProgressTracker.Step("Observing issued claim.") {
114-
override fun childProgressTracker(): ProgressTracker = IssueClaimFlowHandler.tracker()
115-
}
116-
}
117-
118-
override val progressTracker = ProgressTracker(OBSERVING)
119-
120-
@Suspendable
121-
override fun call(): SignedTransaction {
122-
currentStep(OBSERVING)
123-
return subFlow(IssueClaimFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
124-
}
125-
}
126103
}

onixlabs-corda-identity-framework-workflow/src/main/kotlin/io/onixlabs/corda/identityframework/workflow/IssueClaimFlowHandler.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package io.onixlabs.corda.identityframework.workflow
1818

1919
import co.paralleluniverse.fibers.Suspendable
2020
import io.onixlabs.corda.core.workflow.currentStep
21+
import io.onixlabs.corda.identityframework.workflow.IssueClaimFlow.Initiator
2122
import net.corda.core.crypto.SecureHash
2223
import net.corda.core.flows.FlowLogic
2324
import net.corda.core.flows.FlowSession
25+
import net.corda.core.flows.InitiatedBy
2426
import net.corda.core.flows.ReceiveFinalityFlow
2527
import net.corda.core.node.StatesToRecord
2628
import net.corda.core.transactions.SignedTransaction
@@ -51,4 +53,27 @@ class IssueClaimFlowHandler(
5153
currentStep(RECORDING)
5254
return subFlow(ReceiveFinalityFlow(session, expectedTransactionId, statesToRecord))
5355
}
56+
57+
/**
58+
* Represents the initiated flow handler for issuing claims.
59+
*
60+
* @property session The counter-party session who is initiating the flow.
61+
*/
62+
@InitiatedBy(Initiator::class)
63+
private class Handler(private val session: FlowSession) : FlowLogic<SignedTransaction>() {
64+
65+
private companion object {
66+
object OBSERVING : ProgressTracker.Step("Observing issued claim.") {
67+
override fun childProgressTracker(): ProgressTracker = IssueClaimFlowHandler.tracker()
68+
}
69+
}
70+
71+
override val progressTracker = ProgressTracker(OBSERVING)
72+
73+
@Suspendable
74+
override fun call(): SignedTransaction {
75+
currentStep(OBSERVING)
76+
return subFlow(IssueClaimFlowHandler(session, progressTracker = OBSERVING.childProgressTracker()))
77+
}
78+
}
5479
}

0 commit comments

Comments
 (0)