Skip to content

Commit 81b7f8b

Browse files
Publishing version 2.0.0-rc1
1 parent 99aad31 commit 81b7f8b

File tree

56 files changed

+1132
-808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1132
-808
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55

66
corda_artifactory_url = 'https://software.r3.com/artifactory'
77
corda_group = 'net.corda'
8-
corda_release_version = '4.6'
8+
corda_release_version = '4.8'
99

1010
corda_gradle_plugin_group = 'net.corda.plugins'
1111
corda_gradle_plugin_version = '5.0.4'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=onixlabs-corda-bnms
22
group=io.onixlabs
3-
version=2.0.0
3+
version=2.0.0-rc1
44
onixlabs.development.jarsign.keystore=../lib/onixlabs.development.pkcs12
55
onixlabs.development.jarsign.password=5891f47942424d2acbe108691fdb5ba258712fca7e4762be4327241ebf3dbfa3

onixlabs-corda-bnms-contract/src/main/kotlin/io/onixlabs/corda/bnms/contract/Extensions.Iterable.kt

Lines changed: 0 additions & 29 deletions
This file was deleted.

onixlabs-corda-bnms-contract/src/main/kotlin/io/onixlabs/corda/bnms/contract/Extensions.Setting.kt

Lines changed: 0 additions & 106 deletions
This file was deleted.

onixlabs-corda-bnms-contract/src/main/kotlin/io/onixlabs/corda/bnms/contract/SettingTypeInfo.kt

Lines changed: 0 additions & 66 deletions
This file was deleted.

onixlabs-corda-bnms-contract/src/main/kotlin/io/onixlabs/corda/bnms/contract/membership/Extensions.kt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,56 +19,128 @@ package io.onixlabs.corda.bnms.contract.membership
1919
import io.onixlabs.corda.identityframework.contract.attestations.AttestationStatus
2020
import io.onixlabs.corda.identityframework.contract.toStaticAttestationPointer
2121
import net.corda.core.contracts.StateAndRef
22+
import net.corda.core.contracts.StateRef
2223
import net.corda.core.contracts.UniqueIdentifier
2324
import net.corda.core.identity.AbstractParty
2425

26+
/**
27+
* Gets the next [Membership] output, appending the previous [Membership] state's [StateRef].
28+
*
29+
* @return Returns the next [Membership] output, appending the previous [Membership] state's [StateRef].
30+
*/
2531
fun StateAndRef<Membership>.getNextOutput(): Membership {
2632
return state.data.copy(previousStateRef = ref)
2733
}
2834

35+
/**
36+
* Creates a [MembershipAttestation] for the specified [Membership].
37+
*
38+
* @param attestor The attestor who is attesting to the [Membership].
39+
* @param status The status of the attestation.
40+
* @param metadata Any extra metadata that should be applied to the attestation.
41+
* @param linearId The linear ID of the attestation.
42+
* @return Returns a [MembershipAttestation] for the specified [Membership].
43+
*/
2944
fun StateAndRef<Membership>.attest(
3045
attestor: AbstractParty,
3146
status: AttestationStatus,
3247
metadata: Map<String, String> = emptyMap(),
3348
linearId: UniqueIdentifier = UniqueIdentifier()
3449
) = MembershipAttestation(attestor, this, status, metadata, linearId)
3550

51+
/**
52+
* Creates an accepted [MembershipAttestation] for the specified [Membership].
53+
*
54+
* @param attestor The attestor who is attesting to the [Membership].
55+
* @param metadata Any extra metadata that should be applied to the attestation.
56+
* @param linearId The linear ID of the attestation.
57+
* @return Returns an accepted [MembershipAttestation] for the specified [Membership].
58+
*/
3659
fun StateAndRef<Membership>.accept(
3760
attestor: AbstractParty,
3861
metadata: Map<String, String> = emptyMap(),
3962
linearId: UniqueIdentifier = UniqueIdentifier()
4063
) = attest(attestor, AttestationStatus.ACCEPTED, metadata, linearId)
4164

65+
/**
66+
* Creates a rejected [MembershipAttestation] for the specified [Membership].
67+
*
68+
* @param attestor The attestor who is attesting to the [Membership].
69+
* @param metadata Any extra metadata that should be applied to the attestation.
70+
* @param linearId The linear ID of the attestation.
71+
* @return Returns a rejected [MembershipAttestation] for the specified [Membership].
72+
*/
4273
fun StateAndRef<Membership>.reject(
4374
attestor: AbstractParty,
4475
metadata: Map<String, String> = emptyMap(),
4576
linearId: UniqueIdentifier = UniqueIdentifier()
4677
) = attest(attestor, AttestationStatus.REJECTED, metadata, linearId)
4778

79+
/**
80+
* Amends a [MembershipAttestation] pointing to the existing [Membership] state.
81+
*
82+
* @param status The amended status of the [MembershipAttestation].
83+
* @param metadata Any extra metadata that should be applied to the attestation.
84+
* @return Returns an amended [MembershipAttestation] pointing to the existing [Membership] state.
85+
*/
4886
fun StateAndRef<MembershipAttestation>.amend(
4987
status: AttestationStatus,
5088
metadata: Map<String, String> = this.state.data.metadata
5189
) = this.state.data.amend(ref, status, state.data.pointer, metadata)
5290

91+
/**
92+
* Amends a [MembershipAttestation] pointing to an evolved [Membership] state.
93+
*
94+
* @param status The amended status of the [MembershipAttestation].
95+
* @param membership The evolved [Membership] state that the amended [MembershipAttestation] will point to.
96+
* @param metadata Any extra metadata that should be applied to the attestation.
97+
* @return Returns an amended [MembershipAttestation] pointing to an evolved [Membership] state.
98+
*/
5399
fun StateAndRef<MembershipAttestation>.amend(
54100
membership: StateAndRef<Membership>,
55101
status: AttestationStatus,
56102
metadata: Map<String, String> = this.state.data.metadata
57103
) = this.state.data.amend(ref, status, membership.toStaticAttestationPointer(), metadata)
58104

105+
/**
106+
* Amends and accepts a [MembershipAttestation] pointing to the existing [Membership] state.
107+
*
108+
* @param metadata Any extra metadata that should be applied to the attestation.
109+
* @return Returns an amended and accepted [MembershipAttestation] pointing to the existing [Membership] state.
110+
*/
59111
fun StateAndRef<MembershipAttestation>.accept(
60112
metadata: Map<String, String> = this.state.data.metadata
61113
) = amend(AttestationStatus.ACCEPTED, metadata)
62114

115+
/**
116+
* Amends and accepts a [MembershipAttestation] pointing to an evolved [Membership] state.
117+
*
118+
* @param membership The evolved [Membership] state that the amended [MembershipAttestation] will point to.
119+
* @param metadata Any extra metadata that should be applied to the attestation.
120+
* @return Returns an amended and accepted [MembershipAttestation] pointing to an evolved [Membership] state.
121+
*/
63122
fun StateAndRef<MembershipAttestation>.accept(
64123
membership: StateAndRef<Membership>,
65124
metadata: Map<String, String> = this.state.data.metadata
66125
) = amend(membership, AttestationStatus.ACCEPTED, metadata)
67126

127+
/**
128+
* Amends and rejects a [MembershipAttestation] pointing to the existing [Membership] state.
129+
*
130+
* @param metadata Any extra metadata that should be applied to the attestation.
131+
* @return Returns an amended and rejected [MembershipAttestation] pointing to the existing [Membership] state.
132+
*/
68133
fun StateAndRef<MembershipAttestation>.reject(
69134
metadata: Map<String, String> = this.state.data.metadata
70135
) = amend(AttestationStatus.REJECTED, metadata)
71136

137+
/**
138+
* Amends and rejects a [MembershipAttestation] pointing to an evolved [Membership] state.
139+
*
140+
* @param membership The evolved [Membership] state that the amended [MembershipAttestation] will point to.
141+
* @param metadata Any extra metadata that should be applied to the attestation.
142+
* @return Returns an amended and rejected [MembershipAttestation] pointing to an evolved [Membership] state.
143+
*/
72144
fun StateAndRef<MembershipAttestation>.reject(
73145
membership: StateAndRef<Membership>,
74146
metadata: Map<String, String> = this.state.data.metadata

0 commit comments

Comments
 (0)