Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* SPDX-FileCopyrightText: Copyright (c) 2018-2026 Zerocracy
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: Copyright (c) 2018-2026 Zerocracy
* SPDX-License-Identifier: MIT
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/zold/api/Copies.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public int compareTo(final Copy other) {
@Override
public boolean equals(final Object obj) {
return obj instanceof Copy
&& this.compareTo((Copy) obj) == 0;
&& this.wlt.equals(((Copy) obj).wlt);
}

@Override
Expand Down
17 changes: 17 additions & 0 deletions src/test/java/io/zold/api/CopiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ void groupsRemotesScoresIntoSingleCopy() {
);
}

@Test
void distinguishesCopiesWithDifferentWallets() {
final Remote remote = new Remote.Fake(
new RtScore(new IterableOf<>(new TextOf("a")))
);
MatcherAssert.assertThat(
"wallet identity defines copy equality",
new Copies.Copy(new Wallet.Fake(1L), remote).equals(
new Copies.Copy(
new Wallet.Fake(2L),
remote
)
),
new IsEqual<>(false)
);
}

private static Iterable<Copies.Copy> copies() {
return new Copies(
1L,
Expand Down
Loading