fix: Add tokenId and isApproved to TokenNFtTransfer.equals()
@@ -157,20 +157,15 @@ public class TokenNftTransfer implements Comparable<TokenNftTransfer> {
@Override
public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof TokenNftTransfer)) {
- return false;
- }
-
- TokenNftTransfer otherTransfer = (TokenNftTransfer) o;
- return sender.equals(otherTransfer.sender) && receiver.equals(otherTransfer.receiver) && serial == otherTransfer.serial;
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ TokenNftTransfer that = (TokenNftTransfer) o;
+ return serial == that.serial && isApproved == that.isApproved && tokenId.equals(that.tokenId) && sender.equals(that.sender) && receiver.equals(that.receiver);
}
@Override
public int hashCode() {
- return Objects.hash(sender.hashCode(), receiver.hashCode(), serial);
+ return Objects.hash(tokenId, sender, receiver, serial, isApproved);
}
+
}
