diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java index bea562ee1f4..1f21dd2fd85 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java @@ -22,6 +22,7 @@ import org.hyperledger.besu.ethereum.rlp.RLPException; import org.hyperledger.besu.ethereum.rlp.RLPInput; +import java.util.Arrays; import java.util.concurrent.ExecutionException; import com.fasterxml.jackson.annotation.JsonCreator; @@ -291,4 +292,16 @@ public Hash addressHash() { return Hash.hash(this); } } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Address)) { + return false; + } + Address other = (Address) obj; + return Arrays.equals(this.toArrayUnsafe(), other.toArrayUnsafe()); + } }