Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03b70d3

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

18 files changed

+468
-114
lines changed

‎.github/workflows/master.yml

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

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

3234
- name: SonarQube
3335
if: matrix.java == '17'

‎.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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030

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

3436
- name: SonarQube
3537
if: matrix.java == '17'

‎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
}

‎src/main/java/io/goodforgod/api/etherscan/model/proxy/utility/BaseProxyTO.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.goodforgod.api.etherscan.model.proxy.utility;
22

3+
import java.util.Objects;
4+
35
/**
46
* @author GoodforGod
57
* @since 31.10.2018
@@ -21,4 +23,28 @@ public String getJsonrpc() {
2123
public ErrorProxyTO getError() {
2224
return error;
2325
}
26+
27+
@Override
28+
public boolean equals(Object o) {
29+
if (this == o)
30+
return true;
31+
if (o == null || getClass() != o.getClass())
32+
return false;
33+
BaseProxyTO that = (BaseProxyTO) o;
34+
return Objects.equals(id, that.id) && Objects.equals(jsonrpc, that.jsonrpc) && Objects.equals(error, that.error);
35+
}
36+
37+
@Override
38+
public int hashCode() {
39+
return Objects.hash(id, jsonrpc, error);
40+
}
41+
42+
@Override
43+
public String toString() {
44+
return "BaseProxyTO{" +
45+
"id=" + id +
46+
", jsonrpc=" + jsonrpc +
47+
", error=" + error +
48+
'}';
49+
}
2450
}

0 commit comments

Comments
 (0)