Skip to content

Commit 03f2538

Browse files
committed
Coverage improvements
1 parent 87776ca commit 03f2538

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

src/main/java/io/api/etherscan/model/TxToken.java

-34
Original file line numberDiff line numberDiff line change
@@ -56,40 +56,6 @@ public long getConfirmations() {
5656
}
5757
//</editor-fold>
5858

59-
@Override
60-
public boolean equals(Object o) {
61-
if (this == o) return true;
62-
if (o == null || getClass() != o.getClass()) return false;
63-
if (!super.equals(o)) return false;
64-
65-
TxToken txToken = (TxToken) o;
66-
67-
if (nonce != txToken.nonce) return false;
68-
if (transactionIndex != txToken.transactionIndex) return false;
69-
if (gasPrice != txToken.gasPrice) return false;
70-
if (cumulativeGasUsed != txToken.cumulativeGasUsed) return false;
71-
if (confirmations != txToken.confirmations) return false;
72-
if (blockHash != null ? !blockHash.equals(txToken.blockHash) : txToken.blockHash != null) return false;
73-
if (tokenName != null ? !tokenName.equals(txToken.tokenName) : txToken.tokenName != null) return false;
74-
if (tokenSymbol != null ? !tokenSymbol.equals(txToken.tokenSymbol) : txToken.tokenSymbol != null) return false;
75-
return tokenDecimal != null ? tokenDecimal.equals(txToken.tokenDecimal) : txToken.tokenDecimal == null;
76-
}
77-
78-
@Override
79-
public int hashCode() {
80-
int result = super.hashCode();
81-
result = 31 * result + (int) (nonce ^ (nonce >>> 32));
82-
result = 31 * result + (blockHash != null ? blockHash.hashCode() : 0);
83-
result = 31 * result + (tokenName != null ? tokenName.hashCode() : 0);
84-
result = 31 * result + (tokenSymbol != null ? tokenSymbol.hashCode() : 0);
85-
result = 31 * result + (tokenDecimal != null ? tokenDecimal.hashCode() : 0);
86-
result = 31 * result + transactionIndex;
87-
result = 31 * result + (int) (gasPrice ^ (gasPrice >>> 32));
88-
result = 31 * result + (int) (cumulativeGasUsed ^ (cumulativeGasUsed >>> 32));
89-
result = 31 * result + (int) (confirmations ^ (confirmations >>> 32));
90-
return result;
91-
}
92-
9359
@Override
9460
public String toString() {
9561
return "TxToken{" +

src/test/java/io/api/etherscan/account/AccountTxTokenTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public void correct() {
2828
assertNotEquals(-1, txs.get(0).getNonce());
2929
assertNotNull(txs.get(0).toString());
3030

31+
assertNotEquals(txs.get(0).toString(), txs.get(1).toString());
32+
3133
assertNotEquals(txs.get(0), txs.get(1));
3234
assertNotEquals(txs.get(0).hashCode(), txs.get(1).hashCode());
3335

0 commit comments

Comments
 (0)