Skip to content

Commit c977bd0

Browse files
Version bump to Corda 4.9
1 parent 2f76b53 commit c977bd0

29 files changed

+747
-112
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
max_line_length = 140

build.gradle

Lines changed: 4 additions & 4 deletions
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.8'
8+
corda_release_version = '4.9'
99

1010
corda_gradle_plugin_group = 'net.corda.plugins'
1111
corda_gradle_plugin_version = '5.0.4'
@@ -14,10 +14,10 @@ buildscript {
1414
junit_version = '5.3.1'
1515

1616
onixlabs_group = 'io.onixlabs'
17-
onixlabs_corda_core_release_version = '4.0.0-rc3'
18-
onixlabs_corda_idfx_release_version = '4.0.0-rc5'
17+
onixlabs_corda_core_release_version = '4.0.1'
18+
onixlabs_corda_idfx_release_version = '4.0.1'
1919

20-
cordapp_platform_version = 10
20+
cordapp_platform_version = 11
2121
cordapp_contract_name = 'ONIXLabs Corda BNMS Contract'
2222
cordapp_workflow_name = 'ONIXLabs Corda BNMS Workflow'
2323
cordapp_vendor_name = 'ONIXLabs'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class ConfigurationBuilder(private val settings: MutableSet<Setting<*>>) {
196196
*
197197
* @return Returns a configuration containing the settings built by this configuration builder.
198198
*/
199-
fun toConfiguration(): Configuration {
199+
internal fun toConfiguration(): Configuration {
200200
return Configuration(settings)
201201
}
202202
}

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,7 @@ data class Membership(
9292
* @return Returns a persistent state entity.
9393
*/
9494
override fun generateMappedObject(schema: MappedSchema): PersistentState = when (schema) {
95-
is MembershipSchemaV1 -> MembershipEntity(
96-
linearId = linearId.id,
97-
externalId = linearId.externalId,
98-
holder = holder,
99-
networkValue = network.value,
100-
normalizedNetworkValue = network.normalizedValue,
101-
networkOperator = network.operator,
102-
networkHash = network.hash.toString(),
103-
isNetworkOperator = isNetworkOperator,
104-
hash = hash.toString()
105-
)
95+
is MembershipSchemaV1 -> MembershipEntity(this)
10696
else -> throw IllegalArgumentException("Unrecognised schema: $schema.")
10797
}
10898

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

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ class MembershipAttestation internal constructor(
6868
previousStateRef
6969
), NetworkState {
7070

71+
/**
72+
* Represents a membership attestation; a proof that a particular [Membership] state has been witnessed.
73+
*
74+
* @param attestor The party who is attesting to the witnessed [Membership] state.
75+
* @param membership The [Membership] state that is being witnessed and attested.
76+
* @param status The status of the attestation.
77+
* @param metadata Additional information about the attestation.
78+
* @param linearId The unique identifier of the attestation.
79+
* @param previousStateRef The state reference of the previous state in the chain.
80+
*
81+
* The primary constructor of the [MembershipAttestation] class is deliberately private
82+
* to enforce static attestation pointers via the secondary constructor.
83+
*/
7184
constructor(
7285
attestor: AbstractParty,
7386
membership: StateAndRef<Membership>,
@@ -79,7 +92,7 @@ class MembershipAttestation internal constructor(
7992
membership.state.data.network,
8093
attestor,
8194
setOf(membership.state.data.holder),
82-
membership.toStaticAttestationPointer(identifier = membership.state.data.linearId.toString()),
95+
membership.toStaticAttestationPointer(),
8396
status,
8497
metadata,
8598
linearId,
@@ -126,22 +139,7 @@ class MembershipAttestation internal constructor(
126139
* @return Returns a persistent state entity.
127140
*/
128141
override fun generateMappedObject(schema: MappedSchema): PersistentState = when (schema) {
129-
is MembershipAttestationSchemaV1 -> MembershipAttestationEntity(
130-
linearId = linearId.id,
131-
externalId = linearId.externalId,
132-
attestor = attestor,
133-
holder = holder,
134-
networkValue = network.value,
135-
normalizedNetworkValue = network.normalizedValue,
136-
networkOperator = network.operator,
137-
networkHash = network.hash.toString(),
138-
pointer = pointer.statePointer.toString(),
139-
pointerStateType = pointer.stateType.canonicalName,
140-
pointerHash = pointer.hash.toString(),
141-
status = status,
142-
previousStateRef = previousStateRef?.toString(),
143-
hash = hash.toString()
144-
)
142+
is MembershipAttestationSchemaV1 -> MembershipAttestationEntity(this)
145143
else -> super.generateMappedObject(schema)
146144
}
147145

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,22 @@ object MembershipAttestationSchema {
7676

7777
@Column(name = "hash", nullable = false, unique = true)
7878
val hash: String = ""
79-
) : PersistentState()
79+
) : PersistentState() {
80+
constructor(attestation: MembershipAttestation) : this(
81+
linearId = attestation.linearId.id,
82+
externalId = attestation.linearId.externalId,
83+
attestor = attestation.attestor,
84+
holder = attestation.holder,
85+
networkValue = attestation.network.value,
86+
normalizedNetworkValue = attestation.network.normalizedValue,
87+
networkOperator = attestation.network.operator,
88+
networkHash = attestation.network.hash.toString(),
89+
pointer = attestation.pointer.statePointer.toString(),
90+
pointerStateType = attestation.pointer.stateType.canonicalName,
91+
pointerHash = attestation.pointer.hash.toString(),
92+
status = attestation.status,
93+
previousStateRef = attestation.previousStateRef?.toString(),
94+
hash = attestation.hash.toString()
95+
)
96+
}
8097
}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,17 @@ object MembershipSchema {
6161

6262
@Column(name = "hash", nullable = false, unique = true)
6363
val hash: String = ""
64-
) : PersistentState()
64+
) : PersistentState() {
65+
constructor(membership: Membership) : this(
66+
linearId = membership.linearId.id,
67+
externalId = membership.linearId.externalId,
68+
holder = membership.holder,
69+
networkValue = membership.network.value,
70+
normalizedNetworkValue = membership.network.normalizedValue,
71+
networkOperator = membership.network.operator,
72+
networkHash = membership.network.hash.toString(),
73+
isNetworkOperator = membership.isNetworkOperator,
74+
hash = membership.hash.toString()
75+
)
76+
}
6577
}

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,7 @@ data class Relationship(
9494
* @return Returns a persistent state entity.
9595
*/
9696
override fun generateMappedObject(schema: MappedSchema): PersistentState = when (schema) {
97-
is RelationshipSchemaV1 -> RelationshipEntity(
98-
linearId = linearId.id,
99-
externalId = linearId.externalId,
100-
networkValue = network.value,
101-
normalizedNetworkValue = network.normalizedValue,
102-
networkOperator = network.operator,
103-
networkHash = network.hash.toString(),
104-
hash = hash.toString()
105-
)
97+
is RelationshipSchemaV1 -> RelationshipEntity(this)
10698
else -> throw IllegalArgumentException("Unrecognised schema: $schema.")
10799
}
108100

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package io.onixlabs.corda.bnms.contract.relationship
1818

1919
import io.onixlabs.corda.bnms.contract.Network
2020
import io.onixlabs.corda.bnms.contract.NetworkState
21+
import io.onixlabs.corda.bnms.contract.membership.Membership
2122
import io.onixlabs.corda.bnms.contract.relationship.RelationshipAttestationSchema.RelationshipAttestationEntity
2223
import io.onixlabs.corda.bnms.contract.relationship.RelationshipAttestationSchema.RelationshipAttestationSchemaV1
2324
import io.onixlabs.corda.identityframework.contract.attestations.Attestation
@@ -32,6 +33,20 @@ import net.corda.core.identity.AbstractParty
3233
import net.corda.core.schemas.MappedSchema
3334
import net.corda.core.schemas.PersistentState
3435

36+
/**
37+
* Represents a relationship attestation; a proof that a particular [Relationship] state has been witnessed.
38+
*
39+
* @property network The business network that this relationship attestation belongs to.
40+
* @property attestor The party who is attesting to the witnessed [Relationship] state.
41+
* @property attestees The parties of this attestation, usually the participants of the attested [Relationship] state.
42+
* @property pointer The pointer to the attested [Relationship] state.
43+
* @property status The status of the attestation.
44+
* @property metadata Additional information about the attestation.
45+
* @property linearId The unique identifier of the attestation.
46+
* @property previousStateRef The state reference of the previous state in the chain.
47+
* @property hash The unique hash which represents this attestation.
48+
* @property participants The participants of this attestation; namely the attestor and attestees.
49+
*/
3550
@BelongsToContract(RelationshipAttestationContract::class)
3651
class RelationshipAttestation internal constructor(
3752
override val network: Network,
@@ -89,21 +104,7 @@ class RelationshipAttestation internal constructor(
89104
}
90105

91106
override fun generateMappedObject(schema: MappedSchema): PersistentState = when (schema) {
92-
is RelationshipAttestationSchemaV1 -> RelationshipAttestationEntity(
93-
linearId = linearId.id,
94-
externalId = linearId.externalId,
95-
attestor = attestor,
96-
networkValue = network.value,
97-
normalizedNetworkValue = network.normalizedValue,
98-
networkOperator = network.operator,
99-
networkHash = network.hash.toString(),
100-
pointer = pointer.statePointer.toString(),
101-
pointerStateType = pointer.stateType.canonicalName,
102-
pointerHash = pointer.hash.toString(),
103-
status = status,
104-
previousStateRef = previousStateRef?.toString(),
105-
hash = hash.toString()
106-
)
107+
is RelationshipAttestationSchemaV1 -> RelationshipAttestationEntity(this)
107108
else -> super.generateMappedObject(schema)
108109
}
109110

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,21 @@ object RelationshipAttestationSchema {
7373

7474
@Column(name = "hash", nullable = false, unique = true)
7575
val hash: String = ""
76-
) : PersistentState()
76+
) : PersistentState() {
77+
constructor(attestation: RelationshipAttestation) : this(
78+
linearId = attestation.linearId.id,
79+
externalId = attestation.linearId.externalId,
80+
attestor = attestation.attestor,
81+
networkValue = attestation.network.value,
82+
normalizedNetworkValue = attestation.network.normalizedValue,
83+
networkOperator = attestation.network.operator,
84+
networkHash = attestation.network.hash.toString(),
85+
pointer = attestation.pointer.statePointer.toString(),
86+
pointerStateType = attestation.pointer.stateType.canonicalName,
87+
pointerHash = attestation.pointer.hash.toString(),
88+
status = attestation.status,
89+
previousStateRef = attestation.previousStateRef?.toString(),
90+
hash = attestation.hash.toString()
91+
)
92+
}
7793
}

0 commit comments

Comments
 (0)