Movatterモバイル変換


[0]ホーム

URL:


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

Commitcafcdff

Browse files
authored
Merge pull request#19 from GoodforGod/dev
[1.2.1]
2 parents22c9679 +aae1546 commitcafcdff

File tree

16 files changed

+59
-15
lines changed

16 files changed

+59
-15
lines changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Library supports all available EtherScan *API* calls for all available *Ethereum
1515
**Gradle**
1616
```groovy
1717
dependencies {
18-
compile "com.github.goodforgod:java-etherscan-api:1.2.0"
18+
compile "com.github.goodforgod:java-etherscan-api:1.2.1"
1919
}
2020
```
2121

@@ -24,7 +24,7 @@ dependencies {
2424
<dependency>
2525
<groupId>com.github.goodforgod</groupId>
2626
<artifactId>java-etherscan-api</artifactId>
27-
<version>1.2.0</version>
27+
<version>1.2.1</version>
2828
</dependency>
2929
```
3030

‎build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
implementation"org.jetbrains:annotations:22.0.0"
3939
implementation"com.google.code.gson:gson:2.8.9"
4040

41-
testImplementation"junit:junit:4.13.1"
41+
testImplementation"junit:junit:4.13.2"
4242
}
4343

4444
test {

‎gradle.properties‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
groupId=com.github.goodforgod
22
artifactId=java-etherscan-api
3-
artifactVersion=1.2.0
4-
buildNumber=1
3+
artifactVersion=1.2.1
54

65

76
##### GRADLE #####
87
org.gradle.daemon=true
98
org.gradle.parallel=true
109
org.gradle.configureondemand=true
1110
org.gradle.caching=true
12-
org.gradle.jvmargs=-Dfile.encoding=UTF-8
11+
org.gradle.jvmargs=-Dfile.encoding=UTF-8

‎src/main/java/io/api/etherscan/core/IProxyApi.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importio.api.etherscan.model.proxy.BlockProxy;
55
importio.api.etherscan.model.proxy.ReceiptProxy;
66
importio.api.etherscan.model.proxy.TxProxy;
7+
importorg.jetbrains.annotations.ApiStatus.Experimental;
78
importorg.jetbrains.annotations.NotNull;
89

910
importjava.math.BigInteger;
@@ -139,6 +140,7 @@ public interface IProxyApi {
139140
* @return optional the value at this storage position
140141
* @throws ApiException parent exception class
141142
*/
143+
@Experimental
142144
@NotNull
143145
Optional<String>storageAt(Stringaddress,longposition)throwsApiException;
144146

‎src/main/java/io/api/etherscan/core/impl/BasicProvider.java‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
packageio.api.etherscan.core.impl;
22

3-
importcom.google.gson.Gson;
3+
importcom.google.gson.*;
44
importio.api.etherscan.error.ApiException;
55
importio.api.etherscan.error.EtherScanException;
66
importio.api.etherscan.error.ParseException;
@@ -10,6 +10,8 @@
1010
importio.api.etherscan.model.utility.StringResponseTO;
1111
importio.api.etherscan.util.BasicUtils;
1212

13+
importjava.time.LocalDate;
14+
importjava.time.LocalDateTime;
1315
importjava.util.Map;
1416

1517
/**
@@ -40,7 +42,12 @@ abstract class BasicProvider {
4042
this.module ="&module=" +module;
4143
this.baseUrl =baseUrl;
4244
this.executor =executor;
43-
this.gson =newGson();
45+
this.gson =newGsonBuilder()
46+
.registerTypeAdapter(LocalDateTime.class, (JsonSerializer<LocalDateTime>) (src,t,c) ->newJsonPrimitive(""))
47+
.registerTypeAdapter(LocalDate.class, (JsonSerializer<LocalDate>) (src,t,context) ->newJsonPrimitive(""))
48+
.registerTypeAdapter(LocalDateTime.class, (JsonDeserializer<LocalDateTime>) (json,t,c) ->null)
49+
.registerTypeAdapter(LocalDate.class, (JsonDeserializer<LocalDate>) (json,t,c) ->null)
50+
.create();
4451
}
4552

4653
<T>Tconvert(finalStringjson,finalClass<T>tClass) {

‎src/main/java/io/api/etherscan/model/BaseTx.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageio.api.etherscan.model;
22

3+
importcom.google.gson.annotations.Expose;
34
importio.api.etherscan.util.BasicUtils;
45

56
importjava.math.BigInteger;
@@ -17,6 +18,7 @@ abstract class BaseTx {
1718

1819
privatelongblockNumber;
1920
privateStringtimeStamp;
21+
@Expose(serialize =false,deserialize =false)
2022
privateLocalDateTime_timeStamp;
2123
privateStringhash;
2224
privateStringfrom;

‎src/main/java/io/api/etherscan/model/Block.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageio.api.etherscan.model;
22

3+
importcom.google.gson.annotations.Expose;
34
importio.api.etherscan.util.BasicUtils;
45

56
importjava.math.BigInteger;
@@ -17,6 +18,7 @@ public class Block {
1718
privatelongblockNumber;
1819
privateBigIntegerblockReward;
1920
privateStringtimeStamp;
21+
@Expose(serialize =false,deserialize =false)
2022
privateLocalDateTime_timeStamp;
2123

2224
// <editor-fold desc="Getter">

‎src/main/java/io/api/etherscan/model/Log.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageio.api.etherscan.model;
22

3+
importcom.google.gson.annotations.Expose;
34
importio.api.etherscan.util.BasicUtils;
45

56
importjava.math.BigInteger;
@@ -17,20 +18,26 @@
1718
publicclassLog {
1819

1920
privateStringblockNumber;
21+
@Expose(serialize =false,deserialize =false)
2022
privateLong_blockNumber;
2123
privateStringaddress;
2224
privateStringtransactionHash;
2325
privateStringtransactionIndex;
26+
@Expose(serialize =false,deserialize =false)
2427
privateLong_transactionIndex;
2528
privateStringtimeStamp;
29+
@Expose(serialize =false,deserialize =false)
2630
privateLocalDateTime_timeStamp;
2731
privateStringdata;
2832
privateStringgasPrice;
33+
@Expose(serialize =false,deserialize =false)
2934
privateBigInteger_gasPrice;
3035
privateStringgasUsed;
36+
@Expose(serialize =false,deserialize =false)
3137
privateBigInteger_gasUsed;
3238
privateList<String>topics;
3339
privateStringlogIndex;
40+
@Expose(serialize =false,deserialize =false)
3441
privateLong_logIndex;
3542

3643
// <editor-fold desc="Getters">

‎src/main/java/io/api/etherscan/model/Price.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
packageio.api.etherscan.model;
22

3+
importcom.google.gson.annotations.Expose;
4+
35
importjava.time.LocalDateTime;
46
importjava.time.ZoneOffset;
57

@@ -15,7 +17,9 @@ public class Price {
1517
privatedoubleethbtc;
1618
privateStringethusd_timestamp;
1719
privateStringethbtc_timestamp;
20+
@Expose(serialize =false,deserialize =false)
1821
privateLocalDateTime_ethusd_timestamp;
22+
@Expose(serialize =false,deserialize =false)
1923
privateLocalDateTime_ethbtc_timestamp;
2024

2125
publicdoubleinUsd() {

‎src/main/java/io/api/etherscan/model/TxInternal.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
publicclassTxInternalextendsBaseTx {
1212

1313
privateStringtype;
14-
privatelongtraceId;
14+
privateStringtraceId;
1515
privateintisError;
1616
privateStringerrCode;
1717

@@ -21,6 +21,10 @@ public String getType() {
2121
}
2222

2323
publiclonggetTraceId() {
24+
return (traceId ==null) ?0 :Long.parseLong(traceId);
25+
}
26+
27+
publicStringgetTraceIdAsString() {
2428
returntraceId;
2529
}
2630

@@ -44,15 +48,15 @@ public boolean equals(Object o) {
4448

4549
TxInternalthat = (TxInternal)o;
4650

47-
if (traceId !=that.traceId)
51+
if (!Objects.equals(traceId,that.traceId))
4852
returnfalse;
4953
returnObjects.equals(errCode,that.errCode);
5054
}
5155

5256
@Override
5357
publicinthashCode() {
5458
intresult =super.hashCode();
55-
result =31 *result + (int) (traceId^ (traceId >>>32));
59+
result =31 *result + (traceId!=null ?traceId.hashCode() :0);
5660
result =31 *result + (errCode !=null ?errCode.hashCode() :0);
5761
returnresult;
5862
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp