Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c69eb9

Browse files
[3.0.0-SNAPSHOT]
Updated CI with key Added more toString/equalsHashcode contracts
1 parent 7790bb7 commit 5c69eb9

20 files changed

+472
-118
lines changed

β€Ž.github/workflows/master.ymlβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ jobs:
2828

2929
- name: Test
3030
run: './gradlew test jacocoTestReport'
31+
env:
32+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
3133

3234
- name: SonarQube
33-
if: matrix.java == '17'
35+
if: matrix.java == '11'
3436
run: './gradlew sonar --info'
3537
env:
3638
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

β€Ž.github/workflows/publish-release.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222

2323
- name: Test
2424
run: './gradlew test jacocoTestReport'
25+
env:
26+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}
2527

2628
- name: SonarQube
2729
run: './gradlew sonar --info'

β€Ž.github/workflows/publish-snapshot.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232

3333
- name: Test
3434
run: './gradlew test jacocoTestReport'
35+
env:
36+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}
3537

3638
- name: Publish Snapshot
3739
run: './gradlew publish'

β€Ž.github/workflows/pull-request.ymlβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ jobs:
3030

3131
- name: Test
3232
run: './gradlew test jacocoTestReport'
33+
env:
34+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
3335

3436
- name: SonarQube
35-
if: matrix.java == '17'
37+
if: matrix.java == '11'
3638
run: './gradlew sonar --info'
3739
env:
3840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Java EtherScan API
22

3-
[![Minimum required Java version](https://img.shields.io/badge/Java-1.8%2B-blue?logo=openjdk)](https://openjdk.org/projects/jdk8/)
3+
[![Minimum required Java version](https://img.shields.io/badge/Java-11%2B-blue?logo=openjdk)](https://openjdk.org/projects/jdk/11/)
44
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.goodforgod/java-etherscan-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.goodforgod/java-etherscan-api)
55
[![Java CI](https://github.com/GoodforGod/java-etherscan-api/workflows/CI%20Master/badge.svg)](https://github.com/GoodforGod/java-etherscan-api/actions?query=workflow%3ACI+Master)
66
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=coverage)](https://sonarcloud.io/dashboard?id=GoodforGod_java-etherscan-api)

β€Žbuild.gradleβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test {
3535
testLogging {
3636
events("passed", "skipped", "failed")
3737
exceptionFormat("full")
38-
showStandardStreams(true)
38+
showStandardStreams(false)
3939
}
4040

4141
reports {

β€Žsrc/main/java/io/goodforgod/api/etherscan/model/proxy/BlockProxy.javaβ€Ž

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -143,48 +143,6 @@ public List<TxProxy> getTransactions() {
143143
}
144144
// </editor-fold>
145145

146-
@Override
147-
public boolean equals(Object o) {
148-
if (this == o)
149-
return true;
150-
if (!(o instanceof BlockProxy))
151-
return false;
152-
BlockProxy that = (BlockProxy) o;
153-
return Objects.equals(number, that.number) && Objects.equals(hash, that.hash)
154-
&& Objects.equals(parentHash, that.parentHash) && Objects.equals(nonce, that.nonce);
155-
}
156-
157-
@Override
158-
public int hashCode() {
159-
return Objects.hash(number, hash, parentHash, nonce);
160-
}
161-
162-
@Override
163-
public String toString() {
164-
return "BlockProxy{" +
165-
"number=" + number +
166-
", hash=" + hash +
167-
", parentHash=" + parentHash +
168-
", stateRoot=" + stateRoot +
169-
", size=" + size +
170-
", difficulty=" + difficulty +
171-
", totalDifficulty=" + totalDifficulty +
172-
", timestamp=" + timestamp +
173-
", miner=" + miner +
174-
", nonce=" + nonce +
175-
", extraData=" + extraData +
176-
", logsBloom=" + logsBloom +
177-
", mixHash=" + mixHash +
178-
", gasUsed=" + gasUsed +
179-
", gasLimit=" + gasLimit +
180-
", sha3Uncles=" + sha3Uncles +
181-
", uncles=" + uncles +
182-
", receiptsRoot=" + receiptsRoot +
183-
", transactionsRoot=" + transactionsRoot +
184-
", transactions=" + transactions +
185-
'}';
186-
}
187-
188146
@Override
189147
public int compareTo(@NotNull BlockProxy o) {
190148
return Long.compare(getNumber(), o.getNumber());
@@ -353,4 +311,63 @@ public BlockProxy build() {
353311
return blockProxy;
354312
}
355313
}
314+
315+
@Override
316+
public boolean equals(Object o) {
317+
if (this == o)
318+
return true;
319+
if (o == null || getClass() != o.getClass())
320+
return false;
321+
BlockProxy that = (BlockProxy) o;
322+
return Objects.equals(number, that.number) && Objects.equals(_number, that._number) && Objects.equals(hash, that.hash)
323+
&& Objects.equals(parentHash, that.parentHash) && Objects.equals(stateRoot, that.stateRoot)
324+
&& Objects.equals(size, that.size) && Objects.equals(_size, that._size)
325+
&& Objects.equals(difficulty, that.difficulty) && Objects.equals(totalDifficulty, that.totalDifficulty)
326+
&& Objects.equals(timestamp, that.timestamp) && Objects.equals(_timestamp, that._timestamp)
327+
&& Objects.equals(miner, that.miner) && Objects.equals(nonce, that.nonce)
328+
&& Objects.equals(extraData, that.extraData) && Objects.equals(logsBloom, that.logsBloom)
329+
&& Objects.equals(mixHash, that.mixHash) && Objects.equals(gasUsed, that.gasUsed)
330+
&& Objects.equals(_gasUsed, that._gasUsed) && Objects.equals(gasLimit, that.gasLimit)
331+
&& Objects.equals(_gasLimit, that._gasLimit) && Objects.equals(sha3Uncles, that.sha3Uncles)
332+
&& Objects.equals(uncles, that.uncles) && Objects.equals(receiptsRoot, that.receiptsRoot)
333+
&& Objects.equals(transactionsRoot, that.transactionsRoot) && Objects.equals(transactions, that.transactions);
334+
}
335+
336+
@Override
337+
public int hashCode() {
338+
return Objects.hash(number, number, hash, parentHash, stateRoot, size, size, difficulty, totalDifficulty, timestamp,
339+
timestamp, miner, nonce, extraData, logsBloom, mixHash, gasUsed, gasUsed, gasLimit, gasLimit, sha3Uncles, uncles,
340+
receiptsRoot, transactionsRoot, transactions);
341+
}
342+
343+
@Override
344+
public String toString() {
345+
return "BlockProxy{" +
346+
"number=" + number +
347+
", number=" + _number +
348+
", hash=" + hash +
349+
", parentHash=" + parentHash +
350+
", stateRoot=" + stateRoot +
351+
", size=" + size +
352+
", size=" + _size +
353+
", difficulty=" + difficulty +
354+
", totalDifficulty=" + totalDifficulty +
355+
", timestamp=" + timestamp +
356+
", timestamp=" + _timestamp +
357+
", miner=" + miner +
358+
", nonce=" + nonce +
359+
", extraData=" + extraData +
360+
", logsBloom=" + logsBloom +
361+
", mixHash=" + mixHash +
362+
", gasUsed=" + gasUsed +
363+
", gasUsed=" + _gasUsed +
364+
", gasLimit=" + gasLimit +
365+
", gasLimit=" + _gasLimit +
366+
", sha3Uncles=" + sha3Uncles +
367+
", uncles=" + uncles +
368+
", receiptsRoot=" + receiptsRoot +
369+
", transactionsRoot=" + transactionsRoot +
370+
", transactions=" + transactions +
371+
'}';
372+
}
356373
}

β€Žsrc/main/java/io/goodforgod/api/etherscan/model/proxy/ReceiptProxy.javaβ€Ž

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,6 @@ public String getLogsBloom() {
9595
}
9696
// </editor-fold>
9797

98-
@Override
99-
public boolean equals(Object o) {
100-
if (this == o)
101-
return true;
102-
if (!(o instanceof ReceiptProxy))
103-
return false;
104-
ReceiptProxy that = (ReceiptProxy) o;
105-
return Objects.equals(blockNumber, that.blockNumber) && Objects.equals(blockHash, that.blockHash)
106-
&& Objects.equals(transactionHash, that.transactionHash)
107-
&& Objects.equals(transactionIndex, that.transactionIndex);
108-
}
109-
110-
@Override
111-
public int hashCode() {
112-
return Objects.hash(blockNumber, blockHash, transactionHash, transactionIndex);
113-
}
114-
115-
@Override
116-
public String toString() {
117-
return "ReceiptProxy{" +
118-
"root=" + root +
119-
", from=" + from +
120-
", to=" + to +
121-
", blockNumber=" + blockNumber +
122-
", blockHash=" + blockHash +
123-
", transactionHash=" + transactionHash +
124-
", transactionIndex=" + transactionIndex +
125-
", gasUsed=" + gasUsed +
126-
", cumulativeGasUsed=" + cumulativeGasUsed +
127-
", contractAddress=" + contractAddress +
128-
", logs=" + logs +
129-
", logsBloom=" + logsBloom +
130-
'}';
131-
}
132-
13398
public static ReceiptProxyBuilder builder() {
13499
return new ReceiptProxyBuilder();
135100
}
@@ -234,4 +199,50 @@ public ReceiptProxy build() {
234199
return receiptProxy;
235200
}
236201
}
202+
203+
@Override
204+
public boolean equals(Object o) {
205+
if (this == o)
206+
return true;
207+
if (o == null || getClass() != o.getClass())
208+
return false;
209+
ReceiptProxy that = (ReceiptProxy) o;
210+
return Objects.equals(root, that.root) && Objects.equals(from, that.from) && Objects.equals(to, that.to)
211+
&& Objects.equals(blockNumber, that.blockNumber) && Objects.equals(_blockNumber, that._blockNumber)
212+
&& Objects.equals(blockHash, that.blockHash) && Objects.equals(transactionHash, that.transactionHash)
213+
&& Objects.equals(transactionIndex, that.transactionIndex)
214+
&& Objects.equals(_transactionIndex, that._transactionIndex) && Objects.equals(gasUsed, that.gasUsed)
215+
&& Objects.equals(_gasUsed, that._gasUsed) && Objects.equals(cumulativeGasUsed, that.cumulativeGasUsed)
216+
&& Objects.equals(_cumulativeGasUsed, that._cumulativeGasUsed)
217+
&& Objects.equals(contractAddress, that.contractAddress) && Objects.equals(logs, that.logs)
218+
&& Objects.equals(logsBloom, that.logsBloom);
219+
}
220+
221+
@Override
222+
public int hashCode() {
223+
return Objects.hash(root, from, to, blockNumber, blockNumber, blockHash, transactionHash, transactionIndex,
224+
transactionIndex, gasUsed, gasUsed, cumulativeGasUsed, cumulativeGasUsed, contractAddress, logs, logsBloom);
225+
}
226+
227+
@Override
228+
public String toString() {
229+
return "ReceiptProxy{" +
230+
"root=" + root + '\'' +
231+
", from=" + from + '\'' +
232+
", to=" + to + '\'' +
233+
", blockNumber=" + blockNumber + '\'' +
234+
", blockNumber=" + _blockNumber +
235+
", blockHash=" + blockHash + '\'' +
236+
", transactionHash=" + transactionHash + '\'' +
237+
", transactionIndex=" + transactionIndex + '\'' +
238+
", transactionIndex=" + _transactionIndex +
239+
", gasUsed=" + gasUsed + '\'' +
240+
", gasUsed=" + _gasUsed +
241+
", cumulativeGasUsed=" + cumulativeGasUsed + '\'' +
242+
", cumulativeGasUsed=" + _cumulativeGasUsed +
243+
", contractAddress=" + contractAddress + '\'' +
244+
", logs=" + logs +
245+
", logsBloom=" + logsBloom + '\'' +
246+
'}';
247+
}
237248
}

β€Žsrc/main/java/io/goodforgod/api/etherscan/model/proxy/TxProxy.javaβ€Ž

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,43 +107,6 @@ public Long getBlockNumber() {
107107
}
108108
// </editor-fold>
109109

110-
@Override
111-
public boolean equals(Object o) {
112-
if (this == o)
113-
return true;
114-
if (!(o instanceof TxProxy))
115-
return false;
116-
TxProxy txProxy = (TxProxy) o;
117-
return Objects.equals(hash, txProxy.hash) && Objects.equals(transactionIndex, txProxy.transactionIndex)
118-
&& Objects.equals(nonce, txProxy.nonce) && Objects.equals(blockHash, txProxy.blockHash)
119-
&& Objects.equals(blockNumber, txProxy.blockNumber);
120-
}
121-
122-
@Override
123-
public int hashCode() {
124-
return Objects.hash(hash, transactionIndex, nonce, blockHash, blockNumber);
125-
}
126-
127-
@Override
128-
public String toString() {
129-
return "TxProxy{" +
130-
"to=" + to +
131-
", hash=" + hash +
132-
", transactionIndex=" + transactionIndex +
133-
", from=" + from +
134-
", v=" + v +
135-
", input=" + input +
136-
", s=" + s +
137-
", r=" + r +
138-
", nonce=" + nonce +
139-
", value=" + value +
140-
", gas=" + gas +
141-
", gasPrice=" + gasPrice +
142-
", blockHash=" + blockHash +
143-
", blockNumber=" + blockNumber +
144-
'}';
145-
}
146-
147110
@Override
148111
public int compareTo(@NotNull TxProxy o) {
149112
final int firstCompare = Long.compare(getBlockNumber(), o.getBlockNumber());
@@ -271,4 +234,53 @@ public TxProxy build() {
271234
return txProxy;
272235
}
273236
}
237+
238+
@Override
239+
public boolean equals(Object o) {
240+
if (this == o)
241+
return true;
242+
if (o == null || getClass() != o.getClass())
243+
return false;
244+
TxProxy txProxy = (TxProxy) o;
245+
return Objects.equals(to, txProxy.to) && Objects.equals(hash, txProxy.hash)
246+
&& Objects.equals(transactionIndex, txProxy.transactionIndex)
247+
&& Objects.equals(_transactionIndex, txProxy._transactionIndex) && Objects.equals(from, txProxy.from)
248+
&& Objects.equals(v, txProxy.v) && Objects.equals(input, txProxy.input) && Objects.equals(s, txProxy.s)
249+
&& Objects.equals(r, txProxy.r) && Objects.equals(nonce, txProxy.nonce) && Objects.equals(_nonce, txProxy._nonce)
250+
&& Objects.equals(value, txProxy.value) && Objects.equals(gas, txProxy.gas) && Objects.equals(_gas, txProxy._gas)
251+
&& Objects.equals(gasPrice, txProxy.gasPrice) && Objects.equals(_gasPrice, txProxy._gasPrice)
252+
&& Objects.equals(blockHash, txProxy.blockHash) && Objects.equals(blockNumber, txProxy.blockNumber)
253+
&& Objects.equals(_blockNumber, txProxy._blockNumber);
254+
}
255+
256+
@Override
257+
public int hashCode() {
258+
return Objects.hash(to, hash, transactionIndex, transactionIndex, from, v, input, s, r, nonce, nonce, value, gas, gas,
259+
gasPrice, gasPrice, blockHash, blockNumber, blockNumber);
260+
}
261+
262+
@Override
263+
public String toString() {
264+
return "TxProxy{" +
265+
"to=" + to + '\'' +
266+
", hash=" + hash + '\'' +
267+
", transactionIndex=" + transactionIndex + '\'' +
268+
", transactionIndex=" + _transactionIndex +
269+
", from=" + from + '\'' +
270+
", v=" + v + '\'' +
271+
", input=" + input + '\'' +
272+
", s=" + s + '\'' +
273+
", r=" + r + '\'' +
274+
", nonce=" + nonce + '\'' +
275+
", nonce=" + _nonce +
276+
", value=" + value + '\'' +
277+
", gas=" + gas + '\'' +
278+
", gas=" + _gas +
279+
", gasPrice=" + gasPrice + '\'' +
280+
", gasPrice=" + _gasPrice +
281+
", blockHash=" + blockHash + '\'' +
282+
", blockNumber=" + blockNumber + '\'' +
283+
", blockNumber=" + _blockNumber +
284+
'}';
285+
}
274286
}

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /