Skip to content

Commit 86e4412

Browse files
Added a fix to CordaClaim to prevent the hash implementation from changing in derived claim types. Also fixed some typos in the CordaClaim kdoc. This requires a major version bump as it's a breaking change.
1 parent 6930e8a commit 86e4412

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ buildscript {
4444
}
4545

4646
group 'io.onixlabs'
47-
version '2.1.0'
47+
version '3.0.0-rc1'
4848

4949
subprojects {
5050
repositories {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=onixlabs-corda-identity-framework
22
group=io.onixlabs
3-
version=2.1.0
3+
version=3.0.0-rc1
44

55
kotlin.incremental=false
66
kotlin.code.style=official

onixlabs-corda-identity-framework-contract/src/main/kotlin/io/onixlabs/corda/identityframework/contract/CordaClaim.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ open class CordaClaim<T : Any>(
7373
val isSelfIssued: Boolean
7474
get() = issuer == holder
7575

76-
override val hash: SecureHash
76+
final override val hash: SecureHash
7777
get() = SecureHash.sha256("$issuer$holder$property$value$previousStateRef")
7878

7979
override val participants: List<AbstractParty>
@@ -130,6 +130,7 @@ open class CordaClaim<T : Any>(
130130
*/
131131
override fun equals(other: Any?): Boolean {
132132
return this === other || (other is CordaClaim<*>
133+
&& other.javaClass == javaClass
133134
&& other.issuer == issuer
134135
&& other.holder == holder
135136
&& other.property == property
@@ -148,7 +149,7 @@ open class CordaClaim<T : Any>(
148149
}
149150

150151
/**
151-
* Ensures that the immutable properties of this claim have not changed.
152+
* Ensures that the properties considered immutable across state transitions do not change.
152153
*
153154
* @param other The Corda claim to compare with the current Corda claim.
154155
* @return Returns true if the immutable properties have not changed; otherwise, false.
@@ -163,9 +164,9 @@ open class CordaClaim<T : Any>(
163164
}
164165

165166
/**
166-
* Ensures immutable property checks in derived classes.
167+
* Ensures that the properties considered immutable across state transitions do not change.
167168
*
168-
* @param other The attestation to compare with the current Corda claim.
169+
* @param other The Corda claim to compare with the current Corda claim.
169170
* @return Returns true if the immutable properties have not changed; otherwise, false.
170171
*/
171172
protected open fun immutableEquals(other: CordaClaim<*>): Boolean = true

0 commit comments

Comments
 (0)