From 44a5fe4f50776775a2c8da617258ae5017481000 Mon Sep 17 00:00:00 2001 From: Anton Kurako Date: Sat, 13 Apr 2019 13:25:27 +0300 Subject: [PATCH] 1.0.2 Release --- README.md | 6 ++++-- src/main/java/io/api/etherscan/model/BaseTx.java | 6 +++++- src/main/java/io/api/etherscan/model/TxInternal.java | 6 +----- .../java/io/api/etherscan/account/AccountTxTokenTest.java | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a65cedd..f62f766 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,14 @@ Library supports all available EtherScan *API* calls for all available *Ethereum com.github.goodforgod java-etherscan-api - 1.0.1 + 1.0.2 ``` **Gradle** ```groovy dependencies { - compile 'com.github.goodforgod:java-etherscan-api:1.0.1' + compile 'com.github.goodforgod:java-etherscan-api:1.0.2' } ``` @@ -165,6 +165,8 @@ Token API methods migrated to [Account](#account-api) & [Stats](#stats-api) resp ## Version History +**1.0.2** - Minor http client improvements. + **1.0.1** - Gorli & TOBALABA networks support. **1.0.0** - Initial project with all API functionality, for all available networks, with tests coverage for all cases. diff --git a/src/main/java/io/api/etherscan/model/BaseTx.java b/src/main/java/io/api/etherscan/model/BaseTx.java index a757ad2..af2286f 100644 --- a/src/main/java/io/api/etherscan/model/BaseTx.java +++ b/src/main/java/io/api/etherscan/model/BaseTx.java @@ -73,13 +73,15 @@ public BigInteger getGasUsed() { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (!(o instanceof BaseTx)) return false; BaseTx baseTx = (BaseTx) o; if (blockNumber != baseTx.blockNumber) return false; if (timeStamp != null ? !timeStamp.equals(baseTx.timeStamp) : baseTx.timeStamp != null) return false; if (hash != null ? !hash.equals(baseTx.hash) : baseTx.hash != null) return false; + if (from != null ? !from.equals(baseTx.from) : baseTx.from != null) return false; + if (to != null ? !to.equals(baseTx.to) : baseTx.to != null) return false; return value != null ? value.equals(baseTx.value) : baseTx.value == null; } @@ -88,6 +90,8 @@ public int hashCode() { int result = (int) (blockNumber ^ (blockNumber >>> 32)); result = 31 * result + (timeStamp != null ? timeStamp.hashCode() : 0); result = 31 * result + (hash != null ? hash.hashCode() : 0); + result = 31 * result + (from != null ? from.hashCode() : 0); + result = 31 * result + (to != null ? to.hashCode() : 0); result = 31 * result + (value != null ? value.hashCode() : 0); return result; } diff --git a/src/main/java/io/api/etherscan/model/TxInternal.java b/src/main/java/io/api/etherscan/model/TxInternal.java index 693bb40..1d9d8a8 100644 --- a/src/main/java/io/api/etherscan/model/TxInternal.java +++ b/src/main/java/io/api/etherscan/model/TxInternal.java @@ -34,23 +34,19 @@ public String getErrCode() { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (!(o instanceof TxInternal)) return false; if (!super.equals(o)) return false; TxInternal that = (TxInternal) o; if (traceId != that.traceId) return false; - if (isError != that.isError) return false; - if (type != null ? !type.equals(that.type) : that.type != null) return false; return errCode != null ? errCode.equals(that.errCode) : that.errCode == null; } @Override public int hashCode() { int result = super.hashCode(); - result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (int) (traceId ^ (traceId >>> 32)); - result = 31 * result + isError; result = 31 * result + (errCode != null ? errCode.hashCode() : 0); return result; } diff --git a/src/test/java/io/api/etherscan/account/AccountTxTokenTest.java b/src/test/java/io/api/etherscan/account/AccountTxTokenTest.java index 48c08ef..7bdf2d6 100644 --- a/src/test/java/io/api/etherscan/account/AccountTxTokenTest.java +++ b/src/test/java/io/api/etherscan/account/AccountTxTokenTest.java @@ -20,14 +20,14 @@ public class AccountTxTokenTest extends Assert { @Test public void correct() { - List txs = api.account().txsToken("0x05fBf1E3f105df6a4553f3C7f2ed93070A4BAB46"); + List txs = api.account().txsToken("0xE376F69ED2218076682e2b3B7b9099eC50aD68c4"); assertNotNull(txs); - assertEquals(106, txs.size()); + assertEquals(3, txs.size()); assertTxs(txs); assertNotEquals(0, txs.get(0).getGasPrice()); assertNotEquals(-1, txs.get(0).getNonce()); - assertNotNull(txs.get(0).toString()); + assertNotNull(txs.get(0).toString()); assertNotEquals(txs.get(0).toString(), txs.get(1).toString()); assertNotEquals(txs.get(0), txs.get(1));