diff --git a/gradle.properties b/gradle.properties index dcdb8dd..905e0a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ name=onixlabs-corda-core group=io.onixlabs -version=4.0.0-rc1 +version=4.0.0-rc2 onixlabs.development.jarsign.keystore=../lib/onixlabs.development.pkcs12 onixlabs.development.jarsign.password=5891f47942424d2acbe108691fdb5ba258712fca7e4762be4327241ebf3dbfa3 diff --git a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.AbstractParty.kt b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.AbstractParty.kt index 315703a..34e3c24 100644 --- a/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.AbstractParty.kt +++ b/onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/Extensions.AbstractParty.kt @@ -20,6 +20,20 @@ import net.corda.core.crypto.SecureHash import net.corda.core.identity.AbstractParty import java.security.PublicKey +/** + * Guarantees strict equality between the current [AbstractParty] and the other [AbstractParty]. + * + * @param other The other [AbstractParty] to compare with the current [AbstractParty]. + * @return Returns true if the current [AbstractParty] and the other [AbstractParty] are strictly equal; otherwise, false. + */ +fun AbstractParty.strictEquals(other: AbstractParty): Boolean { + val equalByReference = this === other + val equalByThisOther = equals(other) + val equalByOtherThis = other == this + + return equalByReference || (equalByThisOther && equalByOtherThis) +} + /** * Gets the owning keys from an [Iterable] of [AbstractParty]. *