diff --git a/core/src/main/kotlin/net/corda/core/contracts/StatePointer.kt b/core/src/main/kotlin/net/corda/core/contracts/StatePointer.kt index 5f1cc39401..cc31b74121 100644 --- a/core/src/main/kotlin/net/corda/core/contracts/StatePointer.kt +++ b/core/src/main/kotlin/net/corda/core/contracts/StatePointer.kt @@ -65,6 +65,19 @@ class StaticPointer(override val pointer: StateRef, override override fun resolve(ltx: LedgerTransaction): StateAndRef { return ltx.referenceInputRefsOfType(type).single { pointer == it.ref } } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is StaticPointer<*>) return false + + if (pointer != other.pointer) return false + + return true + } + + override fun hashCode(): Int { + return pointer.hashCode() + } } /** @@ -118,4 +131,17 @@ class LinearPointer(override val pointer: UniqueIdentifier, ove override fun resolve(ltx: LedgerTransaction): StateAndRef { return ltx.referenceInputRefsOfType(type).single { pointer == it.state.data.linearId } } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is LinearPointer<*>) return false + + if (pointer != other.pointer) return false + + return true + } + + override fun hashCode(): Int { + return pointer.hashCode() + } } \ No newline at end of file